summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-04-15 19:18:40 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-18 15:52:14 -0300
commitb6c5fe70a7902dc9749991ac57e6e47d4471ecce (patch)
tree0282f5d371279fff358caf6e56ca302d890a1397 /drivers/media/usb
parentfc851c66b275e4092bb79c888a80dcdd1920c0b8 (diff)
[media] af9035: bind tua9001 using I2C binding
Change tua9001 driver from media binding to I2C client binding. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 2ae1f2e8f2ab..be077f2fd3ab 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -1234,10 +1234,6 @@ static int af9035_frontend_detach(struct dvb_usb_adapter *adap)
return 0;
}
-static struct tua9001_config af9035_tua9001_config = {
- .i2c_addr = 0x60,
-};
-
static const struct fc0011_config af9035_fc0011_config = {
.i2c_address = 0x60,
};
@@ -1296,9 +1292,15 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
*/
switch (state->af9033_config[adap->id].tuner) {
- case AF9033_TUNER_TUA9001:
- /* AF9035 gpiot3 = TUA9001 RESETN
- AF9035 gpiot2 = TUA9001 RXEN */
+ case AF9033_TUNER_TUA9001: {
+ struct tua9001_platform_data tua9001_pdata = {
+ .dvb_frontend = adap->fe[0],
+ };
+
+ /*
+ * AF9035 gpiot3 = TUA9001 RESETN
+ * AF9035 gpiot2 = TUA9001 RXEN
+ */
/* configure gpiot2 and gpiot2 as output */
ret = af9035_wr_reg_mask(d, 0x00d8ec, 0x01, 0x01);
@@ -1318,9 +1320,14 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
goto err;
/* attach tuner */
- fe = dvb_attach(tua9001_attach, adap->fe[0],
- &d->i2c_adap, &af9035_tua9001_config);
+ ret = af9035_add_i2c_dev(d, "tua9001", 0x60, &tua9001_pdata,
+ &d->i2c_adap);
+ if (ret)
+ goto err;
+
+ fe = adap->fe[0];
break;
+ }
case AF9033_TUNER_FC0011:
fe = dvb_attach(fc0011_attach, adap->fe[0],
&d->i2c_adap, &af9035_fc0011_config);
@@ -1616,6 +1623,7 @@ static int af9035_tuner_detach(struct dvb_usb_adapter *adap)
dev_dbg(&d->udev->dev, "%s: adap->id=%d\n", __func__, adap->id);
switch (state->af9033_config[adap->id].tuner) {
+ case AF9033_TUNER_TUA9001:
case AF9033_TUNER_FC2580:
case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51: