diff options
| author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-05 08:25:34 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-06 08:25:07 -0400 |
| commit | 6da74b1da2caf8a659cde68a8faafb766e04037c (patch) | |
| tree | 2544dab4c52e5eea7f431485001da03052efb40e /drivers/media/dvb | |
| parent | 0ca477ea8dceb13eb2f91b13d8ff25a7b3113f7e (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.c | 25 |
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[] = { | |||
| 876 | 876 | ||
| 877 | MODULE_DEVICE_TABLE(usb, az6007_usb_table); | 877 | MODULE_DEVICE_TABLE(usb, az6007_usb_table); |
| 878 | 878 | ||
| 879 | static int az6007_suspend(struct usb_interface *intf, pm_message_t msg) | ||
| 880 | { | ||
| 881 | struct dvb_usb_device *d = usb_get_intfdata(intf); | ||
| 882 | |||
| 883 | az6007_ci_uninit(d); | ||
| 884 | return dvb_usbv2_suspend(intf, msg); | ||
| 885 | } | ||
| 886 | |||
| 887 | static int az6007_resume(struct usb_interface *intf) | ||
| 888 | { | ||
| 889 | struct dvb_usb_device *d = usb_get_intfdata(intf); | ||
| 890 | struct dvb_usb_adapter *adap = &d->adapter[0]; | ||
| 891 | |||
| 892 | az6007_ci_init(adap); | ||
| 893 | return dvb_usbv2_resume(intf); | ||
| 894 | } | ||
| 895 | |||
| 879 | /* usb specific object needed to register this driver with the usb subsystem */ | 896 | /* usb specific object needed to register this driver with the usb subsystem */ |
| 880 | static struct usb_driver az6007_usb_driver = { | 897 | static struct usb_driver az6007_usb_driver = { |
| 881 | .name = KBUILD_MODNAME, | 898 | .name = KBUILD_MODNAME, |
| 882 | .id_table = az6007_usb_table, | 899 | .id_table = az6007_usb_table, |
| 883 | .probe = dvb_usbv2_probe, | 900 | .probe = dvb_usbv2_probe, |
| 884 | .disconnect = az6007_usb_disconnect, | 901 | .disconnect = az6007_usb_disconnect, |
| 885 | .suspend = dvb_usbv2_suspend, | ||
| 886 | .resume = dvb_usbv2_resume, | ||
| 887 | .no_dynamic_id = 1, | 902 | .no_dynamic_id = 1, |
| 888 | .soft_unbind = 1, | 903 | .soft_unbind = 1, |
| 904 | /* | ||
| 905 | * FIXME: need to implement reset_resume, likely with | ||
| 906 | * dvb-usb-v2 core support | ||
| 907 | */ | ||
| 908 | .suspend = az6007_suspend, | ||
| 909 | .resume = az6007_resume, | ||
| 889 | }; | 910 | }; |
| 890 | 911 | ||
| 891 | module_usb_driver(az6007_usb_driver); | 912 | module_usb_driver(az6007_usb_driver); |
