summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-04-14 19:55:51 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-18 15:45:55 -0300
commit35fc0e0fcb9479a15422240050ca39aa68796a41 (patch)
tree2bcbf971c9957c96c2fb915ec7a1400ff0a709d6 /drivers
parent6802fc0b8126d8e2e5e982a9772d757e61e47c72 (diff)
[media] rtl28xxu: bind fc2580 using I2C binding
Change fc2580 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')
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index bcd7e0f4e978..3ff4362585df 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1100,11 +1100,6 @@ err:
return ret;
}
-static const struct fc2580_config rtl2832u_fc2580_config = {
- .i2c_addr = 0x56,
- .clock = 16384000,
-};
-
static struct tua9001_config rtl2832u_tua9001_config = {
.i2c_addr = 0x60,
};
@@ -1187,10 +1182,26 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
subdev = i2c_get_clientdata(client);
}
break;
- case TUNER_RTL2832_FC2580:
- fe = dvb_attach(fc2580_attach, adap->fe[0],
- dev->demod_i2c_adapter,
- &rtl2832u_fc2580_config);
+ case TUNER_RTL2832_FC2580: {
+ struct fc2580_platform_data fc2580_pdata = {
+ .dvb_frontend = adap->fe[0],
+ };
+ struct i2c_board_info board_info = {};
+
+ strlcpy(board_info.type, "fc2580", I2C_NAME_SIZE);
+ board_info.addr = 0x56;
+ board_info.platform_data = &fc2580_pdata;
+ request_module("fc2580");
+ client = i2c_new_device(dev->demod_i2c_adapter,
+ &board_info);
+ if (client == NULL || client->dev.driver == NULL)
+ break;
+ if (!try_module_get(client->dev.driver->owner)) {
+ i2c_unregister_device(client);
+ break;
+ }
+ dev->i2c_client_tuner = client;
+ }
break;
case TUNER_RTL2832_TUA9001:
/* enable GPIO1 and GPIO4 as output */