linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* proposal on runtime power management in hid
@ 2008-10-30 16:03 Oliver Neukum
  2008-10-30 17:01 ` Alan Stern
  2008-10-30 23:17 ` Jiri Kosina
  0 siblings, 2 replies; 6+ messages in thread
From: Oliver Neukum @ 2008-10-30 16:03 UTC (permalink / raw)
  To: linux-input
  Cc: Jiri Kosina, Dmitry Torokhov, David Brownell, Alan Stern,
	Rafael J. Wysocki, Jiri Slaby, linux-pm

Hi,

I am looking at runtime power management for usb hid devices.
There's a problem with hidraw. As we have no idea, what goes
on between a device and users of hidraw, it seems to me that
such a device should not be subject to runtime power management
without the user's explicit agreement.
But that would be only a kludge. Therefore this is my first draft of
an API to cleanly allow this.

It is based on telling drivers what capabilties a device must provide
to the system, allowing the driver to use the most aggressive runtime
power management compatible with the requirement.
Comments?

	Regards
		Oliver

diff --git a/include/linux/hid.h b/include/linux/hid.h
index ea80380..9b886c5 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -602,6 +602,12 @@ struct hid_driver {
  * @parse: this method is called only once to parse the device data,
  *	   shouldn't allocate anything to not leak memory
  */
+
+#define HID_POWER_LEVEL_NONE		0
+#define HID_POWER_LEVEL_WAKEUP		1
+#define HID_POWER_LEVEL_OPERATING	2
+#define HID_POWER_LEVEL_ON		3
+
 struct hid_ll_driver {
 	int (*start)(struct hid_device *hdev);
 	void (*stop)(struct hid_device *hdev);
@@ -613,6 +619,7 @@ struct hid_ll_driver {
 			unsigned int code, int value);
 
 	int (*parse)(struct hid_device *hdev);
+	int (*pctrl)(struct hid_device *hdev, int level);
 };
 
 /* Applications from HID Usage Tables 4/8/99 Version 1.1 */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-01 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 16:03 proposal on runtime power management in hid Oliver Neukum
2008-10-30 17:01 ` Alan Stern
2008-10-30 23:17 ` Jiri Kosina
2008-10-31  9:26   ` Oliver Neukum
     [not found]     ` <d7e40be30810311553s579db3abiea69be2c2f30cf4e@mail.gmail.com>
2008-10-31 23:59       ` Oliver Neukum
2008-11-01 18:30     ` Pavel Machek

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).