diff options
author | Antti Palosaari <crope@iki.fi> | 2014-09-04 17:04:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-21 19:48:30 -0300 |
commit | ca42129f867fbc427d709408b3ae35988cc08ed4 (patch) | |
tree | ed60d8d97185118da381806316e1a1508775d0d0 | |
parent | ef2fb46b6d7ed9df5906a3c76c9c4673355cd339 (diff) | |
download | op-kernel-dev-ca42129f867fbc427d709408b3ae35988cc08ed4.zip op-kernel-dev-ca42129f867fbc427d709408b3ae35988cc08ed4.tar.gz |
[media] dvb-usb-v2: add frontend_detach callback
Add frontend_detach callback in order to allow custom detach. It is
needed when demod driver is implemented I2C client or some other
kernel bus, but not proprietary dvb_attach / dvb_detach.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvb_usb.h | 2 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb.h b/drivers/media/usb/dvb-usb-v2/dvb_usb.h index 124b4ba..7e36ee0 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb.h +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb.h @@ -214,6 +214,7 @@ struct dvb_usb_adapter_properties { * @read_config: called to resolve device configuration * @read_mac_address: called to resolve adapter mac-address * @frontend_attach: called to attach the possible frontends + * @frontend_detach: called to detach the possible frontends * @tuner_attach: called to attach the possible tuners * @frontend_ctrl: called to power on/off active frontend * @streaming_ctrl: called to start/stop the usb streaming of adapter @@ -254,6 +255,7 @@ struct dvb_usb_device_properties { int (*read_config) (struct dvb_usb_device *d); int (*read_mac_address) (struct dvb_usb_adapter *, u8 []); int (*frontend_attach) (struct dvb_usb_adapter *); + int (*frontend_detach)(struct dvb_usb_adapter *); int (*tuner_attach) (struct dvb_usb_adapter *); int (*frontend_ctrl) (struct dvb_frontend *, int); int (*streaming_ctrl) (struct dvb_frontend *, int); diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index adca05f..02c43b5 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -664,9 +664,10 @@ err: static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap) { - int i; - dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__, - adap->id); + int ret, i; + struct dvb_usb_device *d = adap_to_d(adap); + + dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id); for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) { if (adap->fe[i]) { @@ -675,6 +676,15 @@ static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap) } } + if (d->props->frontend_detach) { + ret = d->props->frontend_detach(adap); + if (ret < 0) { + dev_dbg(&d->udev->dev, + "%s: frontend_detach() failed=%d\n", + __func__, ret); + } + } + return 0; } |