diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-16 10:55:55 -0300 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-08 15:23:20 +0900 |
commit | 70af01e95bc21a6dbe0fbe8a3efa13a2f37d837a (patch) | |
tree | 43e5203c4f96ea9439b8976ebf6ce78ec2fa0399 /drivers/media/usb/em28xx/em28xx-dvb.c | |
parent | b12c60bba2823caeac4e05557aefb6ed716a53c4 (diff) | |
download | linux-3.10-70af01e95bc21a6dbe0fbe8a3efa13a2f37d837a.tar.gz linux-3.10-70af01e95bc21a6dbe0fbe8a3efa13a2f37d837a.tar.bz2 linux-3.10-70af01e95bc21a6dbe0fbe8a3efa13a2f37d837a.zip |
upstream: [media] m88ts2022: convert to Kernel I2C driver model
Convert driver from proprietary DVB driver model to standard I2C
driver model.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/tuners/m88ts2022.c
Conflicts:
drivers/media/tuners/m88ts2022.c
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-dvb.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 97013372c70..be1749076f2 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -91,6 +91,7 @@ struct em28xx_dvb { struct semaphore pll_mutex; bool dont_attach_fe1; int lna_gpio; + struct i2c_client *i2c_client_tuner; }; @@ -826,11 +827,6 @@ static const struct m88ds3103_config pctv_461e_m88ds3103_config = { .agc = 0x99, }; -static const struct m88ts2022_config em28xx_m88ts2022_config = { - .i2c_addr = 0x60, - .clock = 27000000, -}; - /* ------------------------------------------------------------------ */ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) @@ -1383,6 +1379,11 @@ static int em28xx_dvb_init(struct em28xx *dev) { /* demod I2C adapter */ struct i2c_adapter *i2c_adapter; + struct i2c_board_info info; + struct m88ts2022_config m88ts2022_config = { + .clock = 27000000, + }; + memset(&info, 0, sizeof(struct i2c_board_info)); /* attach demod */ dvb->fe[0] = dvb_attach(m88ds3103_attach, @@ -1395,13 +1396,12 @@ static int em28xx_dvb_init(struct em28xx *dev) } /* attach tuner */ - if (!dvb_attach(m88ts2022_attach, dvb->fe[0], - i2c_adapter, - &em28xx_m88ts2022_config)) { - dvb_frontend_detach(dvb->fe[0]); - result = -ENODEV; - goto out_free; - } + m88ts2022_config.fe = dvb->fe[0]; + strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + info.addr = 0x60; + info.platform_data = &m88ts2022_config; + request_module("m88ts2022"); + dvb->i2c_client_tuner = i2c_new_device(i2c_adapter, &info); /* delegate signal strength measurement to tuner */ dvb->fe[0]->ops.read_signal_strength = @@ -1488,6 +1488,7 @@ static int em28xx_dvb_fini(struct em28xx *dev) prevent_sleep(&dvb->fe[1]->ops); } + i2c_release_client(dvb->i2c_client_tuner); em28xx_unregister_dvb(dvb); kfree(dvb); dev->dvb = NULL; |