[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c4b13461c5c44c5a7ebaa3d215e1875@BY2PR0301MB0711.namprd03.prod.outlook.com>
Date: Fri, 1 Aug 2014 17:29:09 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Dexuan Cui <decui@...rosoft.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"driverdev-devel@...uxdriverproject.org"
<driverdev-devel@...uxdriverproject.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
"jasowang@...hat.com" <jasowang@...hat.com>
CC: Haiyang Zhang <haiyangz@...rosoft.com>
Subject: RE: [PATCH] Input: hyperv-keyboard: register as a wakeup source
> -----Original Message-----
> From: Dexuan Cui [mailto:decui@...rosoft.com]
> Sent: Friday, August 1, 2014 7:28 AM
> To: gregkh@...uxfoundation.org; dmitry.torokhov@...il.com; linux-
> input@...r.kernel.org; linux-kernel@...r.kernel.org; driverdev-
> devel@...uxdriverproject.org; olaf@...fle.de; apw@...onical.com;
> jasowang@...hat.com
> Cc: KY Srinivasan; Haiyang Zhang
> Subject: [PATCH] Input: hyperv-keyboard: register as a wakeup source
>
> With this patch, we can press a key to wake up the VM after the VM
> executes "echo freeze > /sys/power/state".
>
> This addresses part of https://bugzilla.redhat.com/show_bug.cgi?id=1086100
>
> Cc: K. Y. Srinivasan <kys@...rosoft.com>
Thanks Dexuan.
Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> Signed-off-by: Dexuan Cui <decui@...rosoft.com>
> ---
> drivers/input/serio/hyperv-keyboard.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/input/serio/hyperv-keyboard.c
> b/drivers/input/serio/hyperv-keyboard.c
> index 6132619..e74e5d6 100644
> --- a/drivers/input/serio/hyperv-keyboard.c
> +++ b/drivers/input/serio/hyperv-keyboard.c
> @@ -170,6 +170,15 @@ static void hv_kbd_on_receive(struct hv_device
> *hv_dev,
> serio_interrupt(kbd_dev->hv_serio, scan_code, 0);
> }
> spin_unlock_irqrestore(&kbd_dev->lock, flags);
> +
> + /*
> + * Only trigger a wakeup on key down, otherwise
> + * "echo freeze > /sys/power/state" can't really enter the
> + * state because the Enter-UP can trigger a wakeup at once.
> + */
> + if (!(info & IS_BREAK))
> + pm_wakeup_event(&hv_dev->device, 0);
> +
> break;
>
> default:
> @@ -376,6 +385,9 @@ static int hv_kbd_probe(struct hv_device *hv_dev,
> goto err_close_vmbus;
>
> serio_register_port(kbd_dev->hv_serio);
> +
> + device_init_wakeup(&hv_dev->device, true);
> +
> return 0;
>
> err_close_vmbus:
> @@ -390,6 +402,7 @@ static int hv_kbd_remove(struct hv_device *hv_dev)
> {
> struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev);
>
> + device_init_wakeup(&hv_dev->device, false);
> serio_unregister_port(kbd_dev->hv_serio);
> vmbus_close(hv_dev->channel);
> kfree(kbd_dev);
> --
> 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists