* [PATCH v2 1/2] eeepc-wmi: add additional hotkeys
@ 2010-10-11 23:47 chris
2010-10-11 23:47 ` [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface chris
2010-10-21 6:40 ` [PATCH v2 1/2] eeepc-wmi: add additional hotkeys Corentin Chary
0 siblings, 2 replies; 7+ messages in thread
From: chris @ 2010-10-11 23:47 UTC (permalink / raw)
To: platform-driver-x86, acpi4asus-user, corentin.chary, yong.y.wang
Cc: Chris Bagwell
From: Chris Bagwell <chris@cnpbagwell.com>
Added 4 hotkeys using same keymap values as eeepc-latop.
These are mousepad toggle, resolution change, screen off,
and task manager. These were tested on 1005PE and are the
Fn-F3, F4, F7, and F9, respectively.
Also, added a new hot key for power toggles (Fn-Space on 1005PE)
and is meant to drive cpufv interface from userspace.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
---
drivers/platform/x86/eeepc-wmi.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 9dc50fb..21df266 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -69,6 +69,11 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_IGNORE, NOTIFY_BRNDOWN_MIN, { KEY_BRIGHTNESSDOWN } },
{ KE_IGNORE, NOTIFY_BRNUP_MIN, { KEY_BRIGHTNESSUP } },
{ KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } },
+ { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
+ { KE_KEY, 0xe1, { KEY_F14 } },
+ { KE_KEY, 0xe9, { KEY_DISPLAY_OFF } },
+ { KE_KEY, 0xe0, { KEY_PROG1 } },
+ { KE_KEY, 0x5c, { KEY_F15 } },
{ KE_END, 0},
};
--
1.7.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface
2010-10-11 23:47 [PATCH v2 1/2] eeepc-wmi: add additional hotkeys chris
@ 2010-10-11 23:47 ` chris
2010-10-21 6:45 ` Corentin Chary
2010-10-21 14:09 ` Matthew Garrett
2010-10-21 6:40 ` [PATCH v2 1/2] eeepc-wmi: add additional hotkeys Corentin Chary
1 sibling, 2 replies; 7+ messages in thread
From: chris @ 2010-10-11 23:47 UTC (permalink / raw)
To: platform-driver-x86, acpi4asus-user, corentin.chary, yong.y.wang
Cc: Chris Bagwell
From: Chris Bagwell <chris@cnpbagwell.com>
eeepc-laptop provides a sysfs interface to read and control what it
calls cpufv. When WMI is enabled, the ACPI interface changes slightly
and becames a write-only control with 3 valid values.
Expose cpufv again to allow for user space utils that can extended battery
life noticably and come a little closer to parity with eeepc-laptop.
Write-only is OK for most user space apps because read status was
mostly used to prevent unneeded mode changes. Since this same check
to ignore changes to same mode also exists in the DSDT then it was
wasted ACPI call.
acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
read support of cpufv for debugging things such as behaviour
during resume.
This patch was tested with EEE PC 1005PE by monitoring powertop output while
writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
an 1201NL and comparing it to 1005PE's DSDT.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
---
drivers/platform/x86/eeepc-wmi.c | 51 ++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 21df266..462ceab 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -57,6 +57,7 @@ MODULE_ALIAS("wmi:"EEEPC_WMI_MGMT_GUID);
#define EEEPC_WMI_METHODID_DEVS 0x53564544
#define EEEPC_WMI_METHODID_DSTS 0x53544344
+#define EEEPC_WMI_METHODID_CFVS 0x53564643
#define EEEPC_WMI_DEVID_BACKLIGHT 0x00050012
@@ -297,6 +298,49 @@ static void eeepc_wmi_notify(u32 value, void *context)
kfree(obj);
}
+static int store_cpufv(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int value;
+ struct acpi_buffer input = { (acpi_size)sizeof(value), &value };
+ acpi_status status;
+
+ if (!count || sscanf(buf, "%i", &value) != 1)
+ return -EINVAL;
+ if (value < 0 || value > 2)
+ return -EINVAL;
+
+ status = wmi_evaluate_method(EEEPC_WMI_MGMT_GUID,
+ 1, EEEPC_WMI_METHODID_CFVS, &input, NULL);
+
+ if (ACPI_FAILURE(status))
+ return -EIO;
+ else
+ return count;
+}
+
+static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
+
+static void eeepc_wmi_sysfs_exit(struct platform_device *device)
+{
+ device_remove_file(&device->dev, &dev_attr_cpufv);
+}
+
+static int eeepc_wmi_sysfs_init(struct platform_device *device)
+{
+ int retval = -ENOMEM;
+
+ retval = device_create_file(&device->dev, &dev_attr_cpufv);
+ if (retval)
+ goto error_sysfs;
+
+ return 0;
+
+error_sysfs:
+ eeepc_wmi_sysfs_exit(platform_device);
+ return retval;
+}
+
static int __devinit eeepc_wmi_platform_probe(struct platform_device *device)
{
struct eeepc_wmi *eeepc;
@@ -392,8 +436,14 @@ static int __init eeepc_wmi_init(void)
goto del_dev;
}
+ err = eeepc_wmi_sysfs_init(platform_device);
+ if (err)
+ goto del_sysfs;
+
return 0;
+del_sysfs:
+ eeepc_wmi_sysfs_exit(platform_device);
del_dev:
platform_device_del(platform_device);
put_dev:
@@ -408,6 +458,7 @@ static void __exit eeepc_wmi_exit(void)
{
struct eeepc_wmi *eeepc;
+ eeepc_wmi_sysfs_exit(platform_device);
eeepc = platform_get_drvdata(platform_device);
platform_driver_unregister(&platform_driver);
platform_device_unregister(platform_device);
--
1.7.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] eeepc-wmi: add additional hotkeys
2010-10-11 23:47 [PATCH v2 1/2] eeepc-wmi: add additional hotkeys chris
2010-10-11 23:47 ` [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface chris
@ 2010-10-21 6:40 ` Corentin Chary
1 sibling, 0 replies; 7+ messages in thread
From: Corentin Chary @ 2010-10-21 6:40 UTC (permalink / raw)
To: chris, Matthew Garrett; +Cc: platform-driver-x86, acpi4asus-user, yong.y.wang
On Tue, Oct 12, 2010 at 1:47 AM, <chris@cnpbagwell.com> wrote:
> From: Chris Bagwell <chris@cnpbagwell.com>
>
> Added 4 hotkeys using same keymap values as eeepc-latop.
> These are mousepad toggle, resolution change, screen off,
> and task manager. These were tested on 1005PE and are the
> Fn-F3, F4, F7, and F9, respectively.
>
> Also, added a new hot key for power toggles (Fn-Space on 1005PE)
> and is meant to drive cpufv interface from userspace.
>
> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
> ---
> drivers/platform/x86/eeepc-wmi.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> index 9dc50fb..21df266 100644
> --- a/drivers/platform/x86/eeepc-wmi.c
> +++ b/drivers/platform/x86/eeepc-wmi.c
> @@ -69,6 +69,11 @@ static const struct key_entry eeepc_wmi_keymap[] = {
> { KE_IGNORE, NOTIFY_BRNDOWN_MIN, { KEY_BRIGHTNESSDOWN } },
> { KE_IGNORE, NOTIFY_BRNUP_MIN, { KEY_BRIGHTNESSUP } },
> { KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } },
> + { KE_KEY, 0x6b, { KEY_F13 } }, /* Disable Touchpad */
> + { KE_KEY, 0xe1, { KEY_F14 } },
> + { KE_KEY, 0xe9, { KEY_DISPLAY_OFF } },
> + { KE_KEY, 0xe0, { KEY_PROG1 } },
> + { KE_KEY, 0x5c, { KEY_F15 } },
> { KE_END, 0},
> };
>
> --
> 1.7.3.1
>
>
Reviewed-by: Corentin Chary <corentincj@iksaif.net>
Matthew, could you add this patch for 2.6.37 ? Thanks.
--
Corentin Chary
http://xf.iksaif.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface
2010-10-11 23:47 ` [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface chris
@ 2010-10-21 6:45 ` Corentin Chary
2010-10-21 13:06 ` Chris Bagwell
2010-10-21 14:09 ` Matthew Garrett
1 sibling, 1 reply; 7+ messages in thread
From: Corentin Chary @ 2010-10-21 6:45 UTC (permalink / raw)
To: chris, Matthew Garrett; +Cc: platform-driver-x86, acpi4asus-user, yong.y.wang
On Tue, Oct 12, 2010 at 1:47 AM, <chris@cnpbagwell.com> wrote:
> From: Chris Bagwell <chris@cnpbagwell.com>
>
> eeepc-laptop provides a sysfs interface to read and control what it
> calls cpufv. When WMI is enabled, the ACPI interface changes slightly
> and becames a write-only control with 3 valid values.
>
> Expose cpufv again to allow for user space utils that can extended battery
> life noticably and come a little closer to parity with eeepc-laptop.
>
> Write-only is OK for most user space apps because read status was
> mostly used to prevent unneeded mode changes. Since this same check
> to ignore changes to same mode also exists in the DSDT then it was
> wasted ACPI call.
>
> acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
> read support of cpufv for debugging things such as behaviour
> during resume.
>
> This patch was tested with EEE PC 1005PE by monitoring powertop output while
> writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
> an 1201NL and comparing it to 1005PE's DSDT.
>
> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
> ---
> drivers/platform/x86/eeepc-wmi.c | 51 ++++++++++++++++++++++++++++++++++++++
> 1 files changed, 51 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
> index 21df266..462ceab 100644
> --- a/drivers/platform/x86/eeepc-wmi.c
> +++ b/drivers/platform/x86/eeepc-wmi.c
> @@ -57,6 +57,7 @@ MODULE_ALIAS("wmi:"EEEPC_WMI_MGMT_GUID);
>
> #define EEEPC_WMI_METHODID_DEVS 0x53564544
> #define EEEPC_WMI_METHODID_DSTS 0x53544344
> +#define EEEPC_WMI_METHODID_CFVS 0x53564643
>
> #define EEEPC_WMI_DEVID_BACKLIGHT 0x00050012
>
> @@ -297,6 +298,49 @@ static void eeepc_wmi_notify(u32 value, void *context)
> kfree(obj);
> }
>
> +static int store_cpufv(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + int value;
> + struct acpi_buffer input = { (acpi_size)sizeof(value), &value };
> + acpi_status status;
> +
> + if (!count || sscanf(buf, "%i", &value) != 1)
> + return -EINVAL;
> + if (value < 0 || value > 2)
> + return -EINVAL;
> +
> + status = wmi_evaluate_method(EEEPC_WMI_MGMT_GUID,
> + 1, EEEPC_WMI_METHODID_CFVS, &input, NULL);
> +
> + if (ACPI_FAILURE(status))
> + return -EIO;
> + else
> + return count;
> +}
> +
> +static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
> +
> +static void eeepc_wmi_sysfs_exit(struct platform_device *device)
> +{
> + device_remove_file(&device->dev, &dev_attr_cpufv);
> +}
> +
> +static int eeepc_wmi_sysfs_init(struct platform_device *device)
> +{
> + int retval = -ENOMEM;
> +
> + retval = device_create_file(&device->dev, &dev_attr_cpufv);
> + if (retval)
> + goto error_sysfs;
> +
> + return 0;
> +
> +error_sysfs:
> + eeepc_wmi_sysfs_exit(platform_device);
> + return retval;
> +}
> +
> static int __devinit eeepc_wmi_platform_probe(struct platform_device *device)
> {
> struct eeepc_wmi *eeepc;
> @@ -392,8 +436,14 @@ static int __init eeepc_wmi_init(void)
> goto del_dev;
> }
>
> + err = eeepc_wmi_sysfs_init(platform_device);
> + if (err)
> + goto del_sysfs;
> +
> return 0;
>
> +del_sysfs:
> + eeepc_wmi_sysfs_exit(platform_device);
> del_dev:
> platform_device_del(platform_device);
> put_dev:
> @@ -408,6 +458,7 @@ static void __exit eeepc_wmi_exit(void)
> {
> struct eeepc_wmi *eeepc;
>
> + eeepc_wmi_sysfs_exit(platform_device);
> eeepc = platform_get_drvdata(platform_device);
> platform_driver_unregister(&platform_driver);
> platform_device_unregister(platform_device);
> --
> 1.7.3.1
>
>
Seems ok.
Matthew, could you add that one for inclusion in 2.6.37 ?
Chris, could you document cpufv in
Documentation/ABI/testing/sysfs-platform-eeepc-wmi (see eeepc-laptop
example) ?
I don't think the lacking documentation should delay this patch because:
- most of platform-x86 are not documented at all
- the merge window is open, and we should'nt miss that.
Thanks,
--
Corentin Chary
http://xf.iksaif.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface
2010-10-21 6:45 ` Corentin Chary
@ 2010-10-21 13:06 ` Chris Bagwell
2010-10-21 13:31 ` Corentin Chary
0 siblings, 1 reply; 7+ messages in thread
From: Chris Bagwell @ 2010-10-21 13:06 UTC (permalink / raw)
To: Corentin Chary
Cc: Matthew Garrett, platform-driver-x86, acpi4asus-user, yong.y.wang
On Thu, Oct 21, 2010 at 1:45 AM, Corentin Chary
<corentin.chary@gmail.com> wrote:
> On Tue, Oct 12, 2010 at 1:47 AM, <chris@cnpbagwell.com> wrote:
>> From: Chris Bagwell <chris@cnpbagwell.com>
>>
>> eeepc-laptop provides a sysfs interface to read and control what it
>> calls cpufv. When WMI is enabled, the ACPI interface changes slightly
>> and becames a write-only control with 3 valid values.
>>
>> Expose cpufv again to allow for user space utils that can extended battery
>> life noticably and come a little closer to parity with eeepc-laptop.
>>
>> Write-only is OK for most user space apps because read status was
>> mostly used to prevent unneeded mode changes. Since this same check
>> to ignore changes to same mode also exists in the DSDT then it was
>> wasted ACPI call.
>>
>> acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
>> read support of cpufv for debugging things such as behaviour
>> during resume.
>>
>> This patch was tested with EEE PC 1005PE by monitoring powertop output while
>> writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
>> an 1201NL and comparing it to 1005PE's DSDT.
>>
>> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
>> ---
[ ... ]
>
> Seems ok.
> Matthew, could you add that one for inclusion in 2.6.37 ?
>
> Chris, could you document cpufv in
> Documentation/ABI/testing/sysfs-platform-eeepc-wmi (see eeepc-laptop
> example) ?
> I don't think the lacking documentation should delay this patch because:
> - most of platform-x86 are not documented at all
> - the merge window is open, and we should'nt miss that.
>
> Thanks,
>
Sure thing. Are you OK as the contact for this interface? I assume
the intent is not for author of patches.
Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface
2010-10-21 13:06 ` Chris Bagwell
@ 2010-10-21 13:31 ` Corentin Chary
0 siblings, 0 replies; 7+ messages in thread
From: Corentin Chary @ 2010-10-21 13:31 UTC (permalink / raw)
To: Chris Bagwell
Cc: Matthew Garrett, platform-driver-x86, acpi4asus-user, yong.y.wang
On Thu, Oct 21, 2010 at 3:06 PM, Chris Bagwell <chris@cnpbagwell.com> wrote:
> On Thu, Oct 21, 2010 at 1:45 AM, Corentin Chary
> <corentin.chary@gmail.com> wrote:
>> On Tue, Oct 12, 2010 at 1:47 AM, <chris@cnpbagwell.com> wrote:
>>> From: Chris Bagwell <chris@cnpbagwell.com>
>>>
>>> eeepc-laptop provides a sysfs interface to read and control what it
>>> calls cpufv. When WMI is enabled, the ACPI interface changes slightly
>>> and becames a write-only control with 3 valid values.
>>>
>>> Expose cpufv again to allow for user space utils that can extended battery
>>> life noticably and come a little closer to parity with eeepc-laptop.
>>>
>>> Write-only is OK for most user space apps because read status was
>>> mostly used to prevent unneeded mode changes. Since this same check
>>> to ignore changes to same mode also exists in the DSDT then it was
>>> wasted ACPI call.
>>>
>>> acpi_osi="!Windows 2009" can be used for get back eeepc-laptop's
>>> read support of cpufv for debugging things such as behaviour
>>> during resume.
>>>
>>> This patch was tested with EEE PC 1005PE by monitoring powertop output while
>>> writing values of "0", "1", and "2" and by reviewing the decompiled DSDT of
>>> an 1201NL and comparing it to 1005PE's DSDT.
>>>
>>> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
>>> ---
>
> [ ... ]
>
>>
>> Seems ok.
>> Matthew, could you add that one for inclusion in 2.6.37 ?
>>
>> Chris, could you document cpufv in
>> Documentation/ABI/testing/sysfs-platform-eeepc-wmi (see eeepc-laptop
>> example) ?
>> I don't think the lacking documentation should delay this patch because:
>> - most of platform-x86 are not documented at all
>> - the merge window is open, and we should'nt miss that.
>>
>> Thanks,
>>
>
> Sure thing. Are you OK as the contact for this interface? I assume
> the intent is not for author of patches.
I'm not the original author of the driver, and I'm not really the
"official" maintainer.
Yong will maintain this driver on the long term ?
If yes, please send a patch for MAINTAINER, and Chris will use your
name in the Doc file
If not, I shall declare myself maintainer for this driver, and Chris
will use mine as ABI contact
Thanks,
--
Corentin Chary
http://xf.iksaif.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface
2010-10-11 23:47 ` [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface chris
2010-10-21 6:45 ` Corentin Chary
@ 2010-10-21 14:09 ` Matthew Garrett
1 sibling, 0 replies; 7+ messages in thread
From: Matthew Garrett @ 2010-10-21 14:09 UTC (permalink / raw)
To: chris; +Cc: platform-driver-x86, acpi4asus-user, corentin.chary, yong.y.wang
Applied both of these, thanks!
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-10-21 14:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11 23:47 [PATCH v2 1/2] eeepc-wmi: add additional hotkeys chris
2010-10-11 23:47 ` [PATCH v2 2/2] eeepc-wmi: Add cpufv sysfs interface chris
2010-10-21 6:45 ` Corentin Chary
2010-10-21 13:06 ` Chris Bagwell
2010-10-21 13:31 ` Corentin Chary
2010-10-21 14:09 ` Matthew Garrett
2010-10-21 6:40 ` [PATCH v2 1/2] eeepc-wmi: add additional hotkeys Corentin Chary
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.