diff options
author | Antti Palosaari <crope@iki.fi> | 2014-09-04 16:04:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-21 18:48:30 -0400 |
commit | ca42129f867fbc427d709408b3ae35988cc08ed4 (patch) | |
tree | ed60d8d97185118da381806316e1a1508775d0d0 /drivers | |
parent | ef2fb46b6d7ed9df5906a3c76c9c4673355cd339 (diff) |
[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>
Diffstat (limited to 'drivers')
-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 124b4baa7e97..7e36ee02f957 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 { | |||
214 | * @read_config: called to resolve device configuration | 214 | * @read_config: called to resolve device configuration |
215 | * @read_mac_address: called to resolve adapter mac-address | 215 | * @read_mac_address: called to resolve adapter mac-address |
216 | * @frontend_attach: called to attach the possible frontends | 216 | * @frontend_attach: called to attach the possible frontends |
217 | * @frontend_detach: called to detach the possible frontends | ||
217 | * @tuner_attach: called to attach the possible tuners | 218 | * @tuner_attach: called to attach the possible tuners |
218 | * @frontend_ctrl: called to power on/off active frontend | 219 | * @frontend_ctrl: called to power on/off active frontend |
219 | * @streaming_ctrl: called to start/stop the usb streaming of adapter | 220 | * @streaming_ctrl: called to start/stop the usb streaming of adapter |
@@ -254,6 +255,7 @@ struct dvb_usb_device_properties { | |||
254 | int (*read_config) (struct dvb_usb_device *d); | 255 | int (*read_config) (struct dvb_usb_device *d); |
255 | int (*read_mac_address) (struct dvb_usb_adapter *, u8 []); | 256 | int (*read_mac_address) (struct dvb_usb_adapter *, u8 []); |
256 | int (*frontend_attach) (struct dvb_usb_adapter *); | 257 | int (*frontend_attach) (struct dvb_usb_adapter *); |
258 | int (*frontend_detach)(struct dvb_usb_adapter *); | ||
257 | int (*tuner_attach) (struct dvb_usb_adapter *); | 259 | int (*tuner_attach) (struct dvb_usb_adapter *); |
258 | int (*frontend_ctrl) (struct dvb_frontend *, int); | 260 | int (*frontend_ctrl) (struct dvb_frontend *, int); |
259 | int (*streaming_ctrl) (struct dvb_frontend *, int); | 261 | 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 adca05f27fba..02c43b52c906 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: | |||
664 | 664 | ||
665 | static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap) | 665 | static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap) |
666 | { | 666 | { |
667 | int i; | 667 | int ret, i; |
668 | dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__, | 668 | struct dvb_usb_device *d = adap_to_d(adap); |
669 | adap->id); | 669 | |
670 | dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id); | ||
670 | 671 | ||
671 | for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) { | 672 | for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) { |
672 | if (adap->fe[i]) { | 673 | if (adap->fe[i]) { |
@@ -675,6 +676,15 @@ static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap) | |||
675 | } | 676 | } |
676 | } | 677 | } |
677 | 678 | ||
679 | if (d->props->frontend_detach) { | ||
680 | ret = d->props->frontend_detach(adap); | ||
681 | if (ret < 0) { | ||
682 | dev_dbg(&d->udev->dev, | ||
683 | "%s: frontend_detach() failed=%d\n", | ||
684 | __func__, ret); | ||
685 | } | ||
686 | } | ||
687 | |||
678 | return 0; | 688 | return 0; |
679 | } | 689 | } |
680 | 690 | ||