Commit 8022f9af authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] em28xx: bind PCTV 460e using I2C client

Load PCTV 460e tda10071 demod and a8293 SEC using I2C client bindings.
Remove old unused tda10071 config struct. We are using I2C platform
data now.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 7098f582
...@@ -808,16 +808,6 @@ static struct tda18271_config em28xx_cxd2820r_tda18271_config = { ...@@ -808,16 +808,6 @@ static struct tda18271_config em28xx_cxd2820r_tda18271_config = {
.gate = TDA18271_GATE_DIGITAL, .gate = TDA18271_GATE_DIGITAL,
}; };
static const struct tda10071_config em28xx_tda10071_config = {
.demod_i2c_addr = 0x55, /* (0xaa >> 1) */
.tuner_i2c_addr = 0x14,
.i2c_wr_max = 64,
.ts_mode = TDA10071_TS_SERIAL,
.spec_inv = 0,
.xtal = 40444000, /* 40.444 MHz */
.pll_multiplier = 20,
};
static const struct a8293_config em28xx_a8293_config = { static const struct a8293_config em28xx_a8293_config = {
.i2c_addr = 0x08, /* (0x10 >> 1) */ .i2c_addr = 0x08, /* (0x10 >> 1) */
}; };
...@@ -1332,16 +1322,60 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1332,16 +1322,60 @@ static int em28xx_dvb_init(struct em28xx *dev)
&dev->i2c_adap[dev->def_i2c_bus], &dev->i2c_adap[dev->def_i2c_bus],
&c3tech_duo_tda18271_config); &c3tech_duo_tda18271_config);
break; break;
case EM28174_BOARD_PCTV_460E: case EM28174_BOARD_PCTV_460E: {
/* attach demod */ struct i2c_client *client;
dvb->fe[0] = dvb_attach(tda10071_attach, struct i2c_board_info board_info;
&em28xx_tda10071_config, &dev->i2c_adap[dev->def_i2c_bus]); struct tda10071_platform_data tda10071_pdata = {};
struct a8293_platform_data a8293_pdata = {};
/* attach demod + tuner combo */
tda10071_pdata.clk = 40444000, /* 40.444 MHz */
tda10071_pdata.i2c_wr_max = 64,
tda10071_pdata.ts_mode = TDA10071_TS_SERIAL,
tda10071_pdata.pll_multiplier = 20,
tda10071_pdata.tuner_i2c_addr = 0x14,
memset(&board_info, 0, sizeof(board_info));
strlcpy(board_info.type, "tda10071_cx24118", I2C_NAME_SIZE);
board_info.addr = 0x55;
board_info.platform_data = &tda10071_pdata;
request_module("tda10071");
client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &board_info);
if (client == NULL || client->dev.driver == NULL) {
result = -ENODEV;
goto out_free;
}
if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client);
result = -ENODEV;
goto out_free;
}
dvb->fe[0] = tda10071_pdata.get_dvb_frontend(client);
dvb->i2c_client_demod = client;
/* attach SEC */ /* attach SEC */
if (dvb->fe[0]) a8293_pdata.dvb_frontend = dvb->fe[0];
dvb_attach(a8293_attach, dvb->fe[0], &dev->i2c_adap[dev->def_i2c_bus], memset(&board_info, 0, sizeof(board_info));
&em28xx_a8293_config); strlcpy(board_info.type, "a8293", I2C_NAME_SIZE);
board_info.addr = 0x08;
board_info.platform_data = &a8293_pdata;
request_module("a8293");
client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &board_info);
if (client == NULL || client->dev.driver == NULL) {
module_put(dvb->i2c_client_demod->dev.driver->owner);
i2c_unregister_device(dvb->i2c_client_demod);
result = -ENODEV;
goto out_free;
}
if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client);
module_put(dvb->i2c_client_demod->dev.driver->owner);
i2c_unregister_device(dvb->i2c_client_demod);
result = -ENODEV;
goto out_free;
}
dvb->i2c_client_sec = client;
break; break;
}
case EM2874_BOARD_DELOCK_61959: case EM2874_BOARD_DELOCK_61959:
case EM2874_BOARD_MAXMEDIA_UB425_TC: case EM2874_BOARD_MAXMEDIA_UB425_TC:
/* attach demodulator */ /* attach demodulator */
......
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