summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cx231xx
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2014-07-22 22:12:14 +0200
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-27 22:02:22 +0200
commit6d3debafc8e718d5f3b2d87fe0387019b29b3bfa (patch)
tree7088ee9e4681b04ca58c1ed54a08a5ee3e43599d /drivers/media/usb/cx231xx
parent[media] cx23885: Add si2165 support for HVR-5500 (diff)
downloadlinux-6d3debafc8e718d5f3b2d87fe0387019b29b3bfa.tar.xz
linux-6d3debafc8e718d5f3b2d87fe0387019b29b3bfa.zip
[media] cx231xx: prepare for i2c_client attachment
This is needed to support PCTV QuatroStick 522e which uses a si2157. The si2157 driver is written using i2c_client attachment. Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Tested-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-dvb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 4504bc6a700b..5c69be707a30 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -67,6 +67,7 @@ struct cx231xx_dvb {
struct dmx_frontend fe_hw;
struct dmx_frontend fe_mem;
struct dvb_net net;
+ struct i2c_client *i2c_client_tuner;
};
static struct s5h1432_config dvico_s5h1432_config = {
@@ -549,11 +550,18 @@ fail_adapter:
static void unregister_dvb(struct cx231xx_dvb *dvb)
{
+ struct i2c_client *client;
dvb_net_release(&dvb->net);
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
dvb_dmxdev_release(&dvb->dmxdev);
dvb_dmx_release(&dvb->demux);
+ client = dvb->i2c_client_tuner;
+ /* remove I2C tuner */
+ if (client) {
+ module_put(client->dev.driver->owner);
+ i2c_unregister_device(client);
+ }
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
dvb_unregister_adapter(&dvb->adapter);