summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-04-20 17:08:01 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-06 07:24:55 -0300
commit49b7cb5da1867511f10ca9fb7be44c0b2c6a79ee (patch)
tree5bca58054abcb554dfb10064f76c66b339c4eaa3 /drivers
parenta4569507039ba5bebe8fdfb9e9b0358b38b17588 (diff)
[media] cx23885: Hauppauge WinTV-HVR5525 bind I2C SEC
Bind a8293 SEC using I2C 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/pci/cx23885/cx23885-dvb.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
index ef1ebcb0420b..9f377ad5e845 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -864,10 +864,6 @@ static const struct tda10071_platform_data hauppauge_tda10071_pdata = {
.tuner_i2c_addr = 0x54,
};
-static const struct a8293_config hauppauge_a8293_config = {
- .i2c_addr = 0x0b,
-};
-
static const struct si2165_config hauppauge_hvr4400_si2165_config = {
.i2c_addr = 0x64,
.chip_mode = SI2165_MODE_PLL_XTAL,
@@ -2167,6 +2163,7 @@ static int dvb_register(struct cx23885_tsport *port)
case CX23885_BOARD_HAUPPAUGE_HVR5525:
switch (port->nr) {
struct m88rs6000t_config m88rs6000t_config;
+ struct a8293_platform_data a8293_pdata = {};
/* port b - satellite */
case 1:
@@ -2178,10 +2175,20 @@ static int dvb_register(struct cx23885_tsport *port)
break;
/* attach SEC */
- if (!dvb_attach(a8293_attach, fe0->dvb.frontend,
- &dev->i2c_bus[0].i2c_adap,
- &hauppauge_a8293_config))
+ a8293_pdata.dvb_frontend = fe0->dvb.frontend;
+ memset(&info, 0, sizeof(info));
+ strlcpy(info.type, "a8293", I2C_NAME_SIZE);
+ info.addr = 0x0b;
+ info.platform_data = &a8293_pdata;
+ request_module("a8293");
+ client_sec = i2c_new_device(&dev->i2c_bus[0].i2c_adap, &info);
+ if (!client_sec || !client_sec->dev.driver)
goto frontend_detach;
+ if (!try_module_get(client_sec->dev.driver->owner)) {
+ i2c_unregister_device(client_sec);
+ goto frontend_detach;
+ }
+ port->i2c_client_sec = client_sec;
/* attach tuner */
memset(&m88rs6000t_config, 0, sizeof(m88rs6000t_config));