]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
[media] dvb-usb-v2: add tuner_detach callback
authorAntti Palosaari <crope@iki.fi>
Thu, 4 Sep 2014 21:31:40 +0000 (18:31 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 21 Sep 2014 22:49:18 +0000 (19:49 -0300)
Add tuner_detach callback in order to allow custom detach. It is
needed when tuner 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>
drivers/media/usb/dvb-usb-v2/dvb_usb.h
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c

index 7e36ee02f9577c576597736fc000011a44ffe78e..14e111e13e54c31eae02814b9602e1cf06564e4d 100644 (file)
@@ -257,6 +257,7 @@ struct dvb_usb_device_properties {
        int (*frontend_attach) (struct dvb_usb_adapter *);
        int (*frontend_detach)(struct dvb_usb_adapter *);
        int (*tuner_attach) (struct dvb_usb_adapter *);
+       int (*tuner_detach)(struct dvb_usb_adapter *);
        int (*frontend_ctrl) (struct dvb_frontend *, int);
        int (*streaming_ctrl) (struct dvb_frontend *, int);
        int (*init) (struct dvb_usb_device *);
index 02c43b52c90694db2942678716d5b7fd2ed17f77..1950f37df835187c0ac0e153231b316adcaea106 100644 (file)
@@ -676,6 +676,14 @@ static int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap)
                }
        }
 
+       if (d->props->tuner_detach) {
+               ret = d->props->tuner_detach(adap);
+               if (ret < 0) {
+                       dev_dbg(&d->udev->dev, "%s: tuner_detach() failed=%d\n",
+                                       __func__, ret);
+               }
+       }
+
        if (d->props->frontend_detach) {
                ret = d->props->frontend_detach(adap);
                if (ret < 0) {