Commit ff27cda3 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] radio-keene: support suspend/resume

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 37481fca
...@@ -156,6 +156,23 @@ static void usb_keene_disconnect(struct usb_interface *intf) ...@@ -156,6 +156,23 @@ static void usb_keene_disconnect(struct usb_interface *intf)
v4l2_device_put(&radio->v4l2_dev); v4l2_device_put(&radio->v4l2_dev);
} }
static int usb_keene_suspend(struct usb_interface *intf, pm_message_t message)
{
struct keene_device *radio = to_keene_dev(usb_get_intfdata(intf));
return keene_cmd_main(radio, 0, false);
}
static int usb_keene_resume(struct usb_interface *intf)
{
struct keene_device *radio = to_keene_dev(usb_get_intfdata(intf));
mdelay(50);
keene_cmd_set(radio);
keene_cmd_main(radio, radio->curfreq, true);
return 0;
}
static int vidioc_querycap(struct file *file, void *priv, static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v) struct v4l2_capability *v)
{ {
...@@ -402,6 +419,9 @@ static struct usb_driver usb_keene_driver = { ...@@ -402,6 +419,9 @@ static struct usb_driver usb_keene_driver = {
.probe = usb_keene_probe, .probe = usb_keene_probe,
.disconnect = usb_keene_disconnect, .disconnect = usb_keene_disconnect,
.id_table = usb_keene_device_table, .id_table = usb_keene_device_table,
.suspend = usb_keene_suspend,
.resume = usb_keene_resume,
.reset_resume = usb_keene_resume,
}; };
static int __init keene_init(void) static int __init keene_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment