Commit 88ffe55a authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] rtl28xxu: bind tua9001 using I2C binding

Change tua9001 driver from media binding to I2C client binding.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent b6c5fe70
...@@ -1100,10 +1100,6 @@ static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -1100,10 +1100,6 @@ static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap)
return ret; return ret;
} }
static struct tua9001_config rtl2832u_tua9001_config = {
.i2c_addr = 0x60,
};
static const struct fc0012_config rtl2832u_fc0012_config = { static const struct fc0012_config rtl2832u_fc0012_config = {
.i2c_address = 0x63, /* 0xc6 >> 1 */ .i2c_address = 0x63, /* 0xc6 >> 1 */
.xtal_freq = FC_XTAL_28_8_MHZ, .xtal_freq = FC_XTAL_28_8_MHZ,
...@@ -1203,7 +1199,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -1203,7 +1199,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
dev->i2c_client_tuner = client; dev->i2c_client_tuner = client;
} }
break; break;
case TUNER_RTL2832_TUA9001: case TUNER_RTL2832_TUA9001: {
struct tua9001_platform_data tua9001_pdata = {
.dvb_frontend = adap->fe[0],
};
struct i2c_board_info board_info = {};
/* enable GPIO1 and GPIO4 as output */ /* enable GPIO1 and GPIO4 as output */
ret = rtl28xxu_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x12); ret = rtl28xxu_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x12);
if (ret) if (ret)
...@@ -1213,10 +1214,20 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -1213,10 +1214,20 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
if (ret) if (ret)
goto err; goto err;
fe = dvb_attach(tua9001_attach, adap->fe[0], strlcpy(board_info.type, "tua9001", I2C_NAME_SIZE);
dev->demod_i2c_adapter, board_info.addr = 0x60;
&rtl2832u_tua9001_config); board_info.platform_data = &tua9001_pdata;
request_module("tua9001");
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; break;
}
case TUNER_RTL2832_R820T: case TUNER_RTL2832_R820T:
fe = dvb_attach(r820t_attach, adap->fe[0], fe = dvb_attach(r820t_attach, adap->fe[0],
dev->demod_i2c_adapter, dev->demod_i2c_adapter,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment