summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-08-05 09:25:34 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-06 09:25:07 -0300
commit6da74b1da2caf8a659cde68a8faafb766e04037c (patch)
tree2544dab4c52e5eea7f431485001da03052efb40e /drivers/media/dvb
parent0ca477ea8dceb13eb2f91b13d8ff25a7b3113f7e (diff)
[media] az6007: handle CI during suspend/resume
The dvb-usb-v2 core doesn't know anything about CI. So, the driver needs to handle it by hand. This patch stops CI just before stopping URB's/RC, and restarts it before URB/RC start. It should be noticed that suspend/resume is not yet working properly, as the PM model requires the implementation of reset_resume: dvb_usb_az6007 1-6:1.0: no reset_resume for driver dvb_usb_az6007? But this is not implemented there at dvb-usb-v2 yet. Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-usb-v2/az6007.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb-v2/az6007.c b/drivers/media/dvb/dvb-usb-v2/az6007.c
index 4a0ee6420297..420cb62fbc75 100644
--- a/drivers/media/dvb/dvb-usb-v2/az6007.c
+++ b/drivers/media/dvb/dvb-usb-v2/az6007.c
@@ -876,16 +876,37 @@ static struct usb_device_id az6007_usb_table[] = {
MODULE_DEVICE_TABLE(usb, az6007_usb_table);
+static int az6007_suspend(struct usb_interface *intf, pm_message_t msg)
+{
+ struct dvb_usb_device *d = usb_get_intfdata(intf);
+
+ az6007_ci_uninit(d);
+ return dvb_usbv2_suspend(intf, msg);
+}
+
+static int az6007_resume(struct usb_interface *intf)
+{
+ struct dvb_usb_device *d = usb_get_intfdata(intf);
+ struct dvb_usb_adapter *adap = &d->adapter[0];
+
+ az6007_ci_init(adap);
+ return dvb_usbv2_resume(intf);
+}
+
/* usb specific object needed to register this driver with the usb subsystem */
static struct usb_driver az6007_usb_driver = {
.name = KBUILD_MODNAME,
.id_table = az6007_usb_table,
.probe = dvb_usbv2_probe,
.disconnect = az6007_usb_disconnect,
- .suspend = dvb_usbv2_suspend,
- .resume = dvb_usbv2_resume,
.no_dynamic_id = 1,
.soft_unbind = 1,
+ /*
+ * FIXME: need to implement reset_resume, likely with
+ * dvb-usb-v2 core support
+ */
+ .suspend = az6007_suspend,
+ .resume = az6007_resume,
};
module_usb_driver(az6007_usb_driver);