* [PATCH] HID: hyperv: register as a wakeup source
@ 2014-08-01 14:26 Dexuan Cui
2014-08-01 17:29 ` KY Srinivasan
2014-08-04 9:23 ` Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: Dexuan Cui @ 2014-08-01 14:26 UTC (permalink / raw)
To: gregkh, jkosina, linux-input, linux-kernel, driverdev-devel, olaf,
apw, jasowang
Cc: kys, haiyangz
With this patch, we can move the mouse 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@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
drivers/hid/hid-hyperv.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index f52dbcb..31fad64 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -308,6 +308,9 @@ static void mousevsc_on_receive(struct hv_device *device,
memcpy(input_dev->input_buf, input_report->buffer, len);
hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
input_dev->input_buf, len, 1);
+
+ pm_wakeup_event(&input_dev->device->device, 0);
+
break;
default:
pr_err("unsupported hid msg type - type %d len %d",
@@ -549,6 +552,8 @@ static int mousevsc_probe(struct hv_device *device,
goto probe_err2;
}
+ device_init_wakeup(&device->device, true);
+
input_dev->connected = true;
input_dev->init_complete = true;
@@ -571,6 +576,7 @@ static int mousevsc_remove(struct hv_device *dev)
{
struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
+ device_init_wakeup(&dev->device, false);
vmbus_close(dev->channel);
hid_hw_stop(input_dev->hid_device);
hid_destroy_device(input_dev->hid_device);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] HID: hyperv: register as a wakeup source
2014-08-01 14:26 [PATCH] HID: hyperv: register as a wakeup source Dexuan Cui
@ 2014-08-01 17:29 ` KY Srinivasan
2014-08-04 9:23 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: KY Srinivasan @ 2014-08-01 17:29 UTC (permalink / raw)
To: Dexuan Cui, gregkh@linuxfoundation.org, jkosina@suse.cz,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
apw@canonical.com, jasowang@redhat.com
Cc: Haiyang Zhang
> -----Original Message-----
> From: Dexuan Cui [mailto:decui@microsoft.com]
> Sent: Friday, August 1, 2014 7:27 AM
> To: gregkh@linuxfoundation.org; jkosina@suse.cz; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org; driverdev-
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com
> Cc: KY Srinivasan; Haiyang Zhang
> Subject: [PATCH] HID: hyperv: register as a wakeup source
>
> With this patch, we can move the mouse 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@microsoft.com>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
> drivers/hid/hid-hyperv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c index
> f52dbcb..31fad64 100644
> --- a/drivers/hid/hid-hyperv.c
> +++ b/drivers/hid/hid-hyperv.c
> @@ -308,6 +308,9 @@ static void mousevsc_on_receive(struct hv_device
> *device,
> memcpy(input_dev->input_buf, input_report->buffer, len);
> hid_input_report(input_dev->hid_device,
> HID_INPUT_REPORT,
> input_dev->input_buf, len, 1);
> +
> + pm_wakeup_event(&input_dev->device->device, 0);
> +
> break;
> default:
> pr_err("unsupported hid msg type - type %d len %d", @@ -
> 549,6 +552,8 @@ static int mousevsc_probe(struct hv_device *device,
> goto probe_err2;
> }
>
> + device_init_wakeup(&device->device, true);
> +
> input_dev->connected = true;
> input_dev->init_complete = true;
>
> @@ -571,6 +576,7 @@ static int mousevsc_remove(struct hv_device *dev) {
> struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
>
> + device_init_wakeup(&dev->device, false);
> vmbus_close(dev->channel);
> hid_hw_stop(input_dev->hid_device);
> hid_destroy_device(input_dev->hid_device);
> --
> 1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: hyperv: register as a wakeup source
2014-08-01 14:26 [PATCH] HID: hyperv: register as a wakeup source Dexuan Cui
2014-08-01 17:29 ` KY Srinivasan
@ 2014-08-04 9:23 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2014-08-04 9:23 UTC (permalink / raw)
To: Dexuan Cui
Cc: gregkh, linux-input, linux-kernel, driverdev-devel, olaf, apw,
jasowang, kys, haiyangz
On Fri, 1 Aug 2014, Dexuan Cui wrote:
> With this patch, we can move the mouse 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@microsoft.com>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
Applied, thanks.
> ---
> drivers/hid/hid-hyperv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> index f52dbcb..31fad64 100644
> --- a/drivers/hid/hid-hyperv.c
> +++ b/drivers/hid/hid-hyperv.c
> @@ -308,6 +308,9 @@ static void mousevsc_on_receive(struct hv_device *device,
> memcpy(input_dev->input_buf, input_report->buffer, len);
> hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
> input_dev->input_buf, len, 1);
> +
> + pm_wakeup_event(&input_dev->device->device, 0);
> +
> break;
> default:
> pr_err("unsupported hid msg type - type %d len %d",
> @@ -549,6 +552,8 @@ static int mousevsc_probe(struct hv_device *device,
> goto probe_err2;
> }
>
> + device_init_wakeup(&device->device, true);
> +
> input_dev->connected = true;
> input_dev->init_complete = true;
>
> @@ -571,6 +576,7 @@ static int mousevsc_remove(struct hv_device *dev)
> {
> struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
>
> + device_init_wakeup(&dev->device, false);
> vmbus_close(dev->channel);
> hid_hw_stop(input_dev->hid_device);
> hid_destroy_device(input_dev->hid_device);
> --
> 1.9.1
>
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-04 9:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01 14:26 [PATCH] HID: hyperv: register as a wakeup source Dexuan Cui
2014-08-01 17:29 ` KY Srinivasan
2014-08-04 9:23 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).