aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2014-08-11 15:58:13 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-23 20:30:24 -0400
commitb0b12e63f999c91690f3f95bd585cf7812a251d9 (patch)
treeb1eae91fff918d865a00c08c4299afe8e541d2b4 /drivers/media
parent49310ed0ab8da344dece4a543bfcdd14490ccfa0 (diff)
[media] cx23885: add i2c client handling into dvb_unregister and state
Prepare cx23885 driver for handling I2C client that is needed for certain demodulators and tuners (for example Si2168 and Si2157). I2C client for tuner and demod stored in state and unregistering of the I2C devices added into dvb_unregister. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/cx23885/cx23885-dvb.c23
-rw-r--r--drivers/media/pci/cx23885/cx23885.h3
2 files changed, 19 insertions, 7 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
index 332e6facc095..3e72c95a1d59 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -1688,15 +1688,24 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
1688int cx23885_dvb_unregister(struct cx23885_tsport *port) 1688int cx23885_dvb_unregister(struct cx23885_tsport *port)
1689{ 1689{
1690 struct vb2_dvb_frontend *fe0; 1690 struct vb2_dvb_frontend *fe0;
1691 struct i2c_client *client;
1692
1693 /* remove I2C client for tuner */
1694 client = port->i2c_client_tuner;
1695 if (client) {
1696 module_put(client->dev.driver->owner);
1697 i2c_unregister_device(client);
1698 }
1699
1700 /* remove I2C client for demodulator */
1701 client = port->i2c_client_demod;
1702 if (client) {
1703 module_put(client->dev.driver->owner);
1704 i2c_unregister_device(client);
1705 }
1691 1706
1692 /* FIXME: in an error condition where the we have
1693 * an expected number of frontends (attach problem)
1694 * then this might not clean up correctly, if 1
1695 * is invalid.
1696 * This comment only applies to future boards IF they
1697 * implement MFE support.
1698 */
1699 fe0 = vb2_dvb_get_frontend(&port->frontends, 1); 1707 fe0 = vb2_dvb_get_frontend(&port->frontends, 1);
1708
1700 if (fe0 && fe0->dvb.frontend) 1709 if (fe0 && fe0->dvb.frontend)
1701 vb2_dvb_unregister_bus(&port->frontends); 1710 vb2_dvb_unregister_bus(&port->frontends);
1702 1711
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
index 39a89855d1d5..458d180cf96d 100644
--- a/drivers/media/pci/cx23885/cx23885.h
+++ b/drivers/media/pci/cx23885/cx23885.h
@@ -293,6 +293,9 @@ struct cx23885_tsport {
293 /* Workaround for a temp dvb_frontend that the tuner can attached to */ 293 /* Workaround for a temp dvb_frontend that the tuner can attached to */
294 struct dvb_frontend analog_fe; 294 struct dvb_frontend analog_fe;
295 295
296 struct i2c_client *i2c_client_demod;
297 struct i2c_client *i2c_client_tuner;
298
296 int (*set_frontend)(struct dvb_frontend *fe); 299 int (*set_frontend)(struct dvb_frontend *fe);
297}; 300};
298 301