24 #include <linux/slab.h>
25 #include <linux/module.h>
27 #define DRIVER_DESC "WL1273 FM Radio Core"
29 static const struct i2c_device_id wl1273_driver_id_table[] = {
43 dev_err(&client->
dev,
"%s: Read: %d fails.\n", __func__, reg);
47 *value = (
u16)b[0] << 8 | b[1];
55 u8 buf[] = { (param >> 8) & 0xff, param & 0xff };
60 dev_err(&client->
dev,
"%s: Cmd: %d fails.\n", __func__, cmd);
80 dev_err(&client->
dev,
"%s: write error.\n", __func__);
94 static int wl1273_fm_set_audio(
struct wl1273_core *core,
unsigned int new_mode)
162 if (core->
volume == volume)
173 static int wl1273_core_remove(
struct i2c_client *client)
175 struct wl1273_core *core = i2c_get_clientdata(client);
202 dev_err(&client->
dev,
"Cannot function without radio child.\n");
214 i2c_set_clientdata(client, core);
216 dev_dbg(&client->
dev,
"%s: Have V4L2.\n", __func__);
218 cell = &core->
cells[children];
219 cell->
name =
"wl1273_fm_radio";
224 core->
read = wl1273_fm_read_reg;
225 core->
write = wl1273_fm_write_cmd;
231 cell = &core->
cells[children];
233 dev_dbg(&client->
dev,
"%s: Have codec.\n", __func__);
234 cell->
name =
"wl1273-codec";
240 dev_dbg(&client->
dev,
"%s: number of children: %d.\n",
259 static struct i2c_driver wl1273_core_driver = {
263 .probe = wl1273_core_probe,
264 .id_table = wl1273_driver_id_table,
268 static int __init wl1273_core_init(
void)
272 r = i2c_add_driver(&wl1273_core_driver);
275 ": driver registration failed\n");
282 static void __exit wl1273_core_exit(
void)