summaryrefslogtreecommitdiff
path: root/drivers/media/radio/radio-keene.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-04-18 13:47:02 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-07 22:23:17 +0400
commitff27cda340450b4d5267a79109204e853f95cb4c (patch)
tree682eb626f450cda2a503b0e46305278b6c9d4602 /drivers/media/radio/radio-keene.c
parent37481fcacbae3de4972dae265dab7a58f2c9cf8b (diff)
downloadlinux-ff27cda340450b4d5267a79109204e853f95cb4c.tar.xz
[media] radio-keene: support suspend/resume
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-keene.c')
-rw-r--r--drivers/media/radio/radio-keene.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index 5f33047d0d43..62d32c4946f7 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -156,6 +156,23 @@ static void usb_keene_disconnect(struct usb_interface *intf)
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,
struct v4l2_capability *v)
{
@@ -402,6 +419,9 @@ static struct usb_driver usb_keene_driver = {
.probe = usb_keene_probe,
.disconnect = usb_keene_disconnect,
.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)