[media] cx23885: add support for DVB I2C SEC client
authorAntti Palosaari <crope@iki.fi>
Thu, 16 Apr 2015 16:59:46 +0000 (13:59 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 6 Jun 2015 10:23:20 +0000 (07:23 -0300)
Add support for I2C SEC (satellite equipment controller) client.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/pci/cx23885/cx23885.h

index 37fd013c385bcaa23dc128836edc20598130e1bb..ac062a50286cde82b23d91fdd6d1a646d7f56029 100644 (file)
@@ -1190,6 +1190,7 @@ static int dvb_register(struct cx23885_tsport *port)
        struct i2c_board_info info;
        struct i2c_adapter *adapter;
        struct i2c_client *client_demod = NULL, *client_tuner = NULL;
+       struct i2c_client *client_sec = NULL;
        const struct m88ds3103_config *p_m88ds3103_config = NULL;
        int (*p_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage) = NULL;
        int mfe_shared = 0; /* bus not shared by default */
@@ -2242,6 +2243,14 @@ static int dvb_register(struct cx23885_tsport *port)
        return 0;
 
 frontend_detach:
+       /* remove I2C client for SEC */
+       client_sec = port->i2c_client_sec;
+       if (client_sec) {
+               module_put(client_sec->dev.driver->owner);
+               i2c_unregister_device(client_sec);
+               port->i2c_client_sec = NULL;
+       }
+
        /* remove I2C client for tuner */
        client_tuner = port->i2c_client_tuner;
        if (client_tuner) {
@@ -2343,6 +2352,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
                i2c_unregister_device(client);
        }
 
+       /* remove I2C client for SEC */
+       client = port->i2c_client_sec;
+       if (client) {
+               module_put(client->dev.driver->owner);
+               i2c_unregister_device(client);
+       }
+
        /* remove I2C client for tuner */
        client = port->i2c_client_tuner;
        if (client) {
index aeda8d3990aef828777bd1dc15bd855822636648..81e25194986b9458ac7d4674e09b73b2d7f76407 100644 (file)
@@ -304,6 +304,7 @@ struct cx23885_tsport {
 
        struct i2c_client *i2c_client_demod;
        struct i2c_client *i2c_client_tuner;
+       struct i2c_client *i2c_client_sec;
        struct i2c_client *i2c_client_ci;
 
        int (*set_frontend)(struct dvb_frontend *fe);