* [PATCH 00/16] acpi4asus updates for 3.1
@ 2011-07-01 9:34 Corentin Chary
2011-07-01 9:34 ` [PATCH 01/16] asus-wmi: fix hwmon/pwm1 Corentin Chary
` (15 more replies)
0 siblings, 16 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Hi Matthew
Here are my updates for 3.1, most of them were ready for 3.0 but
I missed the merge window. Most of it is wmi stuff (all new notebooks
seems to use the wmi interface).
Thanks,
Corentin Chary (13):
asus-wmi: fix hwmon/pwm1
asus-wmi: second part of the version starts at 16 not 8
asus-wmi: add keyboard backlight support
asus-wmi: fix section mismatch
asus-wmi: set backlight type
asus-wmi: fix keyboard backlight detection
asus-wmi: add some device ids
asus-wmi: add thermal sensor
asus-wmi: check for temp1 presence
asus-wmi: return proper value in store_cpufv()
asus-wmi: add CWAP support and clarify the meaning of WAPF bits
asus-wmi: add gps rfkill support
asus-wmi: add uwb rfkill support
Seth Forshee (3):
asus-wmi: Add callback for hotkey filtering
eeepc-wmi: Add support for T101MT Home/Express Gate key
asus-wmi: Enable autorepeat for hotkey input device
drivers/platform/x86/asus-laptop.c | 9 +-
drivers/platform/x86/asus-nb-wmi.c | 27 ++++-
drivers/platform/x86/asus-wmi.c | 240 ++++++++++++++++++++++++++++++++----
drivers/platform/x86/asus-wmi.h | 7 +
drivers/platform/x86/eeepc-wmi.c | 27 ++++
5 files changed, 274 insertions(+), 36 deletions(-)
--
1.7.3.4
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 01/16] asus-wmi: fix hwmon/pwm1
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 02/16] asus-wmi: Add callback for hotkey filtering Corentin Chary
` (14 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, stable, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
The code was completly broken, and should never had been sent
to the kernel. That's what happens when you write code without
hardware to test it.
Cc: stable@kernel.org
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 00460cb..d1ddb4a 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -797,8 +797,8 @@ exit:
* Hwmon device
*/
static ssize_t asus_hwmon_pwm1(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+ struct device_attribute *attr,
+ char *buf)
{
struct asus_wmi *asus = dev_get_drvdata(dev);
u32 value;
@@ -809,7 +809,7 @@ static ssize_t asus_hwmon_pwm1(struct device *dev,
if (err < 0)
return err;
- value |= 0xFF;
+ value &= 0xFF;
if (value == 1) /* Low Speed */
value = 85;
@@ -869,7 +869,7 @@ static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
* - reverved bits are non-zero
* - sfun and presence bit are not set
*/
- if (value != ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000
+ if (value == ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000
|| (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT)))
ok = false;
}
@@ -904,6 +904,7 @@ static int asus_wmi_hwmon_init(struct asus_wmi *asus)
pr_err("Could not register asus hwmon device\n");
return PTR_ERR(hwmon);
}
+ dev_set_drvdata(hwmon, asus);
asus->hwmon_device = hwmon;
result = sysfs_create_group(&hwmon->kobj, &hwmon_attribute_group);
if (result)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 02/16] asus-wmi: Add callback for hotkey filtering
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
2011-07-01 9:34 ` [PATCH 01/16] asus-wmi: fix hwmon/pwm1 Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 03/16] eeepc-wmi: Add support for T101MT Home/Express Gate key Corentin Chary
` (13 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Seth Forshee, Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
From: Seth Forshee <seth.forshee@canonical.com>
This is required for the T101MT home key, which behaves differently
than other hotkeys.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 12 +++++++++++-
drivers/platform/x86/asus-wmi.h | 6 ++++++
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index d1ddb4a..a09271d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1060,6 +1060,8 @@ static void asus_wmi_notify(u32 value, void *context)
acpi_status status;
int code;
int orig_code;
+ unsigned int key_value = 1;
+ bool autorelease = 1;
status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
@@ -1075,6 +1077,13 @@ static void asus_wmi_notify(u32 value, void *context)
code = obj->integer.value;
orig_code = code;
+ if (asus->driver->key_filter) {
+ asus->driver->key_filter(asus->driver, &code, &key_value,
+ &autorelease);
+ if (code == ASUS_WMI_KEY_IGNORE)
+ goto exit;
+ }
+
if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
code = NOTIFY_BRNUP_MIN;
else if (code >= NOTIFY_BRNDOWN_MIN &&
@@ -1084,7 +1093,8 @@ static void asus_wmi_notify(u32 value, void *context)
if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
if (!acpi_video_backlight_support())
asus_wmi_backlight_notify(asus, orig_code);
- } else if (!sparse_keymap_report_event(asus->inputdev, code, 1, true))
+ } else if (!sparse_keymap_report_event(asus->inputdev, code,
+ key_value, autorelease))
pr_info("Unknown key %x pressed\n", code);
exit:
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index c044522..4da6103 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -29,6 +29,8 @@
#include <linux/platform_device.h>
+#define ASUS_WMI_KEY_IGNORE (-1)
+
struct module;
struct key_entry;
struct asus_wmi;
@@ -44,6 +46,10 @@ struct asus_wmi_driver {
const struct key_entry *keymap;
const char *input_name;
const char *input_phys;
+ /* Returns new code, value, and autorelease values in arguments.
+ * Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
+ void (*key_filter) (struct asus_wmi_driver *driver, int *code,
+ unsigned int *value, bool *autorelease);
int (*probe) (struct platform_device *device);
void (*quirks) (struct asus_wmi_driver *driver);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 03/16] eeepc-wmi: Add support for T101MT Home/Express Gate key
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
2011-07-01 9:34 ` [PATCH 01/16] asus-wmi: fix hwmon/pwm1 Corentin Chary
2011-07-01 9:34 ` [PATCH 02/16] asus-wmi: Add callback for hotkey filtering Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device Corentin Chary
` (12 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Seth Forshee, Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
From: Seth Forshee <seth.forshee@canonical.com>
This key is different than other hotkeys, having seperate scan
codes for press, release, and hold, so it requires some special
filtering. Press and release events are passed on, and hold events
are ignored since sparse-keymap does not support hardware
autorepeat.
Note that "Home" in the context of this button doesn't mean the
same thing as the usual Home key, and it really isn't clear at
all what is meant by "Home". The manufacurer's description of the
button indicates that it should launch some sort of touch screen
settings interface on short press and apply a desktop rotation on
long press.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/eeepc-wmi.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 4aa867a..f41a977 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -56,6 +56,11 @@ MODULE_PARM_DESC(hotplug_wireless,
"If your laptop needs that, please report to "
"acpi4asus-user@lists.sourceforge.net.");
+/* Values for T101MT "Home" key */
+#define HOME_PRESS 0xe4
+#define HOME_HOLD 0xea
+#define HOME_RELEASE 0xe5
+
static const struct key_entry eeepc_wmi_keymap[] = {
/* Sleep already handled via generic ACPI code */
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
@@ -71,6 +76,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_KEY, 0xcc, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0xe0, { KEY_PROG1 } }, /* Task Manager */
{ KE_KEY, 0xe1, { KEY_F14 } }, /* Change Resolution */
+ { KE_KEY, HOME_PRESS, { KEY_CONFIG } }, /* Home/Express gate key */
{ KE_KEY, 0xe8, { KEY_SCREENLOCK } },
{ KE_KEY, 0xe9, { KEY_BRIGHTNESS_ZERO } },
{ KE_KEY, 0xeb, { KEY_CAMERA_ZOOMOUT } },
@@ -81,6 +87,25 @@ static const struct key_entry eeepc_wmi_keymap[] = {
{ KE_END, 0},
};
+static void eeepc_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code,
+ unsigned int *value, bool *autorelease)
+{
+ switch (*code) {
+ case HOME_PRESS:
+ *value = 1;
+ *autorelease = 0;
+ break;
+ case HOME_HOLD:
+ *code = ASUS_WMI_KEY_IGNORE;
+ break;
+ case HOME_RELEASE:
+ *code = HOME_PRESS;
+ *value = 0;
+ *autorelease = 0;
+ break;
+ }
+}
+
static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
void *context, void **retval)
{
@@ -151,6 +176,7 @@ static struct asus_wmi_driver asus_wmi_driver = {
.keymap = eeepc_wmi_keymap,
.input_name = "Eee PC WMI hotkeys",
.input_phys = EEEPC_WMI_FILE "/input0",
+ .key_filter = eeepc_wmi_key_filter,
.probe = eeepc_wmi_probe,
.quirks = eeepc_wmi_quirks,
};
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (2 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 03/16] eeepc-wmi: Add support for T101MT Home/Express Gate key Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 14:15 ` Matthew Garrett
2011-07-01 9:34 ` [PATCH 05/16] asus-wmi: second part of the version starts at 16 not 8 Corentin Chary
` (11 subsequent siblings)
15 siblings, 1 reply; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Seth Forshee, Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
From: Seth Forshee <seth.forshee@canonical.com>
The T101MT Home/Express Gate key autorepeats in hardware, but
sparse-keymap does not support hardware autorepeat. Enable the
input core's software autorepeat to emulate the hardware behavior.
Normal hotkeys are autoreleased, so the behavior of these keys
will not be affected.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index a09271d..35eeb69 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -205,6 +205,7 @@ static int asus_wmi_input_init(struct asus_wmi *asus)
asus->inputdev->phys = asus->driver->input_phys;
asus->inputdev->id.bustype = BUS_HOST;
asus->inputdev->dev.parent = &asus->platform_device->dev;
+ __set_bit(EV_REP, asus->inputdev->evbit);
err = sparse_keymap_setup(asus->inputdev, asus->driver->keymap, NULL);
if (err)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/16] asus-wmi: second part of the version starts at 16 not 8
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (3 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 06/16] asus-wmi: add keyboard backlight support Corentin Chary
` (10 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Matthew Garrett, open list:ASUS NOTEBOOKS AN...,
open list
From: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
drivers/platform/x86/asus-wmi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 35eeb69..688fcf7 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1245,7 +1245,7 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
/* We don't know yet what to do with this version... */
if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_SPEC, 0, 0x9, &rv)) {
- pr_info("BIOS WMI version: %d.%d", rv >> 8, rv & 0xFF);
+ pr_info("BIOS WMI version: %d.%d", rv >> 16, rv & 0xFF);
asus->spec = rv;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/16] asus-wmi: add keyboard backlight support
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (4 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 05/16] asus-wmi: second part of the version starts at 16 not 8 Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 07/16] asus-wmi: fix section mismatch Corentin Chary
` (9 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Nate Weibley, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
From: Corentin Chary <corentincj@iksaif.net>
Based on a patch from Nate Weibley. <nweibley@gmail.com>.
Cc: Nate Weibley <nweibley@gmail.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
drivers/platform/x86/asus-wmi.c | 130 +++++++++++++++++++++++++++++++++-----
1 files changed, 113 insertions(+), 17 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 688fcf7..619e3e3 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -66,6 +66,8 @@ MODULE_LICENSE("GPL");
#define NOTIFY_BRNUP_MAX 0x1f
#define NOTIFY_BRNDOWN_MIN 0x20
#define NOTIFY_BRNDOWN_MAX 0x2e
+#define NOTIFY_KBD_BRTUP 0xc4
+#define NOTIFY_KBD_BRTDWN 0xc5
/* WMI Methods */
#define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */
@@ -174,8 +176,11 @@ struct asus_wmi {
struct led_classdev tpd_led;
int tpd_led_wk;
+ struct led_classdev kbd_led;
+ int kbd_led_wk;
struct workqueue_struct *led_workqueue;
struct work_struct tpd_led_work;
+ struct work_struct kbd_led_work;
struct asus_rfkill wlan;
struct asus_rfkill bluetooth;
@@ -360,30 +365,79 @@ static enum led_brightness tpd_led_get(struct led_classdev *led_cdev)
return read_tpd_led_state(asus);
}
-static int asus_wmi_led_init(struct asus_wmi *asus)
+static void kbd_led_update(struct work_struct *work)
{
- int rv;
+ int ctrl_param = 0;
+ struct asus_wmi *asus;
- if (read_tpd_led_state(asus) < 0)
- return 0;
+ asus = container_of(work, struct asus_wmi, kbd_led_work);
- asus->led_workqueue = create_singlethread_workqueue("led_workqueue");
- if (!asus->led_workqueue)
- return -ENOMEM;
- INIT_WORK(&asus->tpd_led_work, tpd_led_update);
+ /*
+ * bits 0-2: level
+ * bit 7: light on/off
+ */
+ if (asus->kbd_led_wk > 0)
+ ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
- asus->tpd_led.name = "asus::touchpad";
- asus->tpd_led.brightness_set = tpd_led_set;
- asus->tpd_led.brightness_get = tpd_led_get;
- asus->tpd_led.max_brightness = 1;
+ asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
+}
- rv = led_classdev_register(&asus->platform_device->dev, &asus->tpd_led);
- if (rv) {
- destroy_workqueue(asus->led_workqueue);
- return rv;
+static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
+{
+ int retval;
+
+ /*
+ * bits 0-2: level
+ * bit 7: light on/off
+ * bit 8-10: environment (0: dark, 1: normal, 2: light)
+ * bit 17: status unknown
+ */
+ retval = asus_wmi_get_devstate_bits(asus, ASUS_WMI_DEVID_KBD_BACKLIGHT,
+ 0xFFFF);
+
+ if (retval == 0x8000)
+ retval = -ENODEV;
+
+ if (retval >= 0) {
+ if (level)
+ *level = retval & 0x80 ? retval & 0x7F : 0;
+ if (env)
+ *env = (retval >> 8) & 0x7F;
+ retval = 0;
}
- return 0;
+ return retval;
+}
+
+static void kbd_led_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ struct asus_wmi *asus;
+
+ asus = container_of(led_cdev, struct asus_wmi, kbd_led);
+
+ if (value > asus->kbd_led.max_brightness)
+ value = asus->kbd_led.max_brightness;
+ else if (value < 0)
+ value = 0;
+
+ asus->kbd_led_wk = value;
+ queue_work(asus->led_workqueue, &asus->kbd_led_work);
+}
+
+static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
+{
+ struct asus_wmi *asus;
+ int retval, value;
+
+ asus = container_of(led_cdev, struct asus_wmi, kbd_led);
+
+ retval = kbd_led_read(asus, &value, NULL);
+
+ if (retval < 0)
+ return retval;
+
+ return value;
}
static void asus_wmi_led_exit(struct asus_wmi *asus)
@@ -394,6 +448,48 @@ static void asus_wmi_led_exit(struct asus_wmi *asus)
destroy_workqueue(asus->led_workqueue);
}
+static int asus_wmi_led_init(struct asus_wmi *asus)
+{
+ int rv = 0;
+
+ asus->led_workqueue = create_singlethread_workqueue("led_workqueue");
+ if (!asus->led_workqueue)
+ return -ENOMEM;
+
+ if (read_tpd_led_state(asus) >= 0) {
+ INIT_WORK(&asus->tpd_led_work, tpd_led_update);
+
+ asus->tpd_led.name = "asus::touchpad";
+ asus->tpd_led.brightness_set = tpd_led_set;
+ asus->tpd_led.brightness_get = tpd_led_get;
+ asus->tpd_led.max_brightness = 1;
+
+ rv = led_classdev_register(&asus->platform_device->dev,
+ &asus->tpd_led);
+ if (rv)
+ goto error;
+ }
+
+ if (kbd_led_read(asus, NULL, NULL) >= 0) {
+ INIT_WORK(&asus->kbd_led_work, kbd_led_update);
+
+ asus->kbd_led.name = "asus::kbd_backlight";
+ asus->kbd_led.brightness_set = kbd_led_set;
+ asus->kbd_led.brightness_get = kbd_led_get;
+ asus->kbd_led.max_brightness = 3;
+
+ rv = led_classdev_register(&asus->platform_device->dev,
+ &asus->kbd_led);
+ }
+
+error:
+ if (rv)
+ asus_wmi_led_exit(asus);
+
+ return rv;
+}
+
+
/*
* PCI hotplug (for wlan rfkill)
*/
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/16] asus-wmi: fix section mismatch
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (5 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 06/16] asus-wmi: add keyboard backlight support Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 08/16] asus-wmi: set backlight type Corentin Chary
` (8 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 619e3e3..fa6982a 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1711,7 +1711,7 @@ static int asus_wmi_probe(struct platform_device *pdev)
static bool used;
-int asus_wmi_register_driver(struct asus_wmi_driver *driver)
+int __init_or_module asus_wmi_register_driver(struct asus_wmi_driver *driver)
{
struct platform_driver *platform_driver;
struct platform_device *platform_device;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 08/16] asus-wmi: set backlight type
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (6 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 07/16] asus-wmi: fix section mismatch Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 09/16] asus-wmi: fix keyboard backlight detection Corentin Chary
` (7 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index fa6982a..2ab83d1 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1123,6 +1123,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
return power;
memset(&props, 0, sizeof(struct backlight_properties));
+ props.type = BACKLIGHT_PLATFORM;
props.max_brightness = max;
bd = backlight_device_register(asus->driver->name,
&asus->platform_device->dev, asus,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/16] asus-wmi: fix keyboard backlight detection
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (7 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 08/16] asus-wmi: set backlight type Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 10/16] asus-wmi: add some device ids Corentin Chary
` (6 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 2ab83d1..332103b 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -395,8 +395,9 @@ static int kbd_led_read(struct asus_wmi *asus, int *level, int *env)
retval = asus_wmi_get_devstate_bits(asus, ASUS_WMI_DEVID_KBD_BACKLIGHT,
0xFFFF);
+ /* Unknown status is considered as off */
if (retval == 0x8000)
- retval = -ENODEV;
+ retval = 0;
if (retval >= 0) {
if (level)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 10/16] asus-wmi: add some device ids
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (8 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 09/16] asus-wmi: fix keyboard backlight detection Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 11/16] asus-wmi: add thermal sensor Corentin Chary
` (5 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 332103b..a972d8e 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -95,6 +95,7 @@ MODULE_LICENSE("GPL");
/* Wireless */
#define ASUS_WMI_DEVID_HW_SWITCH 0x00010001
#define ASUS_WMI_DEVID_WIRELESS_LED 0x00010002
+#define ASUS_WMI_DEVID_CWAP 0x00010003
#define ASUS_WMI_DEVID_WLAN 0x00010011
#define ASUS_WMI_DEVID_BLUETOOTH 0x00010013
#define ASUS_WMI_DEVID_GPS 0x00010015
@@ -104,6 +105,12 @@ MODULE_LICENSE("GPL");
/* Leds */
/* 0x000200XX and 0x000400XX */
+#define ASUS_WMI_DEVID_LED1 0x00020011
+#define ASUS_WMI_DEVID_LED2 0x00020012
+#define ASUS_WMI_DEVID_LED3 0x00020013
+#define ASUS_WMI_DEVID_LED4 0x00020014
+#define ASUS_WMI_DEVID_LED5 0x00020015
+#define ASUS_WMI_DEVID_LED6 0x00020016
/* Backlight and Brightness */
#define ASUS_WMI_DEVID_BACKLIGHT 0x00050011
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 11/16] asus-wmi: add thermal sensor
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (9 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 10/16] asus-wmi: add some device ids Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 12/16] asus-wmi: check for temp1 presence Corentin Chary
` (4 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index a972d8e..cc947cc 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -44,6 +44,7 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/platform_device.h>
+#include <linux/thermal.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
@@ -930,7 +931,26 @@ static ssize_t asus_hwmon_pwm1(struct device *dev,
return sprintf(buf, "%d\n", value);
}
+static ssize_t asus_hwmon_temp1(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct asus_wmi *asus = dev_get_drvdata(dev);
+ u32 value;
+ int err;
+
+ err = asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_THERMAL_CTRL, &value);
+
+ if (err < 0)
+ return err;
+
+ value = KELVIN_TO_CELSIUS((value & 0xFFFF)) * 1000;
+
+ return sprintf(buf, "%d\n", value);
+}
+
static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO, asus_hwmon_pwm1, NULL, 0);
+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, asus_hwmon_temp1, NULL, 0);
static ssize_t
show_name(struct device *dev, struct device_attribute *attr, char *buf)
@@ -941,6 +961,7 @@ static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_pwm1.dev_attr.attr,
+ &sensor_dev_attr_temp1_input.dev_attr.attr,
&sensor_dev_attr_name.dev_attr.attr,
NULL
};
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 12/16] asus-wmi: check for temp1 presence
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (10 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 11/16] asus-wmi: add thermal sensor Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 13/16] asus-wmi: return proper value in store_cpufv() Corentin Chary
` (3 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index cc947cc..be9e89a 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -967,7 +967,7 @@ static struct attribute *hwmon_attributes[] = {
};
static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
- struct attribute *attr, int idx)
+ struct attribute *attr, int idx)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct platform_device *pdev = to_platform_device(dev->parent);
@@ -978,6 +978,8 @@ static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
if (attr == &sensor_dev_attr_pwm1.dev_attr.attr)
dev_id = ASUS_WMI_DEVID_FAN_CTRL;
+ else if (attr == &sensor_dev_attr_temp1_input.dev_attr.attr)
+ dev_id = ASUS_WMI_DEVID_THERMAL_CTRL;
if (dev_id != -1) {
int err = asus_wmi_get_devstate(asus, dev_id, &value);
@@ -998,6 +1000,10 @@ static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
if (value == ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000
|| (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT)))
ok = false;
+ } else if (dev_id == ASUS_WMI_DEVID_THERMAL_CTRL) {
+ /* If value is zero, something is clearly wrong */
+ if (value == 0)
+ ok = false;
}
return ok ? attr->mode : 0;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 13/16] asus-wmi: return proper value in store_cpufv()
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (11 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 12/16] asus-wmi: check for temp1 presence Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 14/16] asus-wmi: add CWAP support and clarify the meaning of WAPF bits Corentin Chary
` (2 subsequent siblings)
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, stable, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Cc: stable@kernel.org
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index be9e89a..b181f5d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1307,14 +1307,18 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER);
static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
- int value;
+ int value, rv;
if (!count || sscanf(buf, "%i", &value) != 1)
return -EINVAL;
if (value < 0 || value > 2)
return -EINVAL;
- return asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL);
+ rv = asus_wmi_evaluate_method(ASUS_WMI_METHODID_CFVS, value, 0, NULL);
+ if (rv < 0)
+ return rv;
+
+ return count;
}
static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 14/16] asus-wmi: add CWAP support and clarify the meaning of WAPF bits
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (12 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 13/16] asus-wmi: return proper value in store_cpufv() Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 15/16] asus-wmi: add gps rfkill support Corentin Chary
2011-07-01 9:34 ` [PATCH 16/16] asus-wmi: add uwb " Corentin Chary
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
ref: http://dev.iksaif.net/projects/3/wiki/Asus-laptop_WAPF
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-laptop.c | 9 ++++-----
drivers/platform/x86/asus-nb-wmi.c | 27 +++++++++++++++++++++++----
drivers/platform/x86/asus-wmi.c | 6 ++++++
drivers/platform/x86/asus-wmi.h | 1 +
drivers/platform/x86/eeepc-wmi.c | 1 +
5 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index d65df92..fa6d7ec 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -70,11 +70,10 @@ MODULE_LICENSE("GPL");
* WAPF defines the behavior of the Fn+Fx wlan key
* The significance of values is yet to be found, but
* most of the time:
- * 0x0 will do nothing
- * 0x1 will allow to control the device with Fn+Fx key.
- * 0x4 will send an ACPI event (0x88) while pressing the Fn+Fx key
- * 0x5 like 0x1 or 0x4
- * So, if something doesn't work as you want, just try other values =)
+ * Bit | Bluetooth | WLAN
+ * 0 | Hardware | Hardware
+ * 1 | Hardware | Software
+ * 4 | Software | Software
*/
static uint wapf = 1;
module_param(wapf, uint, 0444);
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index 0580d99..b0859d4 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -38,6 +38,24 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
+/*
+ * WAPF defines the behavior of the Fn+Fx wlan key
+ * The significance of values is yet to be found, but
+ * most of the time:
+ * Bit | Bluetooth | WLAN
+ * 0 | Hardware | Hardware
+ * 1 | Hardware | Software
+ * 4 | Software | Software
+ */
+static uint wapf;
+module_param(wapf, uint, 0444);
+MODULE_PARM_DESC(wapf, "WAPF value");
+
+static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
+{
+ driver->wapf = wapf;
+}
+
static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
@@ -53,16 +71,16 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x51, { KEY_WWW } },
{ KE_KEY, 0x55, { KEY_CALC } },
{ KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */
- { KE_KEY, 0x5D, { KEY_WLAN } },
- { KE_KEY, 0x5E, { KEY_WLAN } },
- { KE_KEY, 0x5F, { KEY_WLAN } },
+ { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
+ { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
+ { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
- { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+ { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x88, { KEY_RFKILL } },
{ KE_KEY, 0x8A, { KEY_PROG1 } },
@@ -81,6 +99,7 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
.keymap = asus_nb_wmi_keymap,
.input_name = "Asus WMI hotkeys",
.input_phys = ASUS_NB_WMI_FILE "/input0",
+ .quirks = asus_nb_wmi_quirks,
};
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index b181f5d..db4413a 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1413,6 +1413,12 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
return -ENODEV;
}
+ /* CWAP allow to define the behavior of the Fn+F2 key,
+ * this method doesn't seems to be present on Eee PCs */
+ if (asus->driver->wapf >= 0)
+ asus_wmi_set_devstate(ASUS_WMI_DEVID_CWAP,
+ asus->driver->wapf, NULL);
+
return asus_wmi_sysfs_init(asus->platform_device);
}
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 4da6103..8147c10 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -37,6 +37,7 @@ struct asus_wmi;
struct asus_wmi_driver {
bool hotplug_wireless;
+ int wapf;
const char *name;
struct module *owner;
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index f41a977..9f6e643 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -166,6 +166,7 @@ static void eeepc_dmi_check(struct asus_wmi_driver *driver)
static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
{
driver->hotplug_wireless = hotplug_wireless;
+ driver->wapf = -1;
eeepc_dmi_check(driver);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 15/16] asus-wmi: add gps rfkill support
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (13 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 14/16] asus-wmi: add CWAP support and clarify the meaning of WAPF bits Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 16/16] asus-wmi: add uwb " Corentin Chary
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index db4413a..83d4d26 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -194,6 +194,7 @@ struct asus_wmi {
struct asus_rfkill bluetooth;
struct asus_rfkill wimax;
struct asus_rfkill wwan3g;
+ struct asus_rfkill gps;
struct hotplug_slot *hotplug_slot;
struct mutex hotplug_lock;
@@ -835,6 +836,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
rfkill_destroy(asus->wwan3g.rfkill);
asus->wwan3g.rfkill = NULL;
}
+ if (asus->gps.rfkill) {
+ rfkill_unregister(asus->gps.rfkill);
+ rfkill_destroy(asus->gps.rfkill);
+ asus->gps.rfkill = NULL;
+ }
}
static int asus_wmi_rfkill_init(struct asus_wmi *asus)
@@ -869,6 +875,12 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus)
if (result && result != -ENODEV)
goto exit;
+ result = asus_new_rfkill(asus, &asus->gps, "asus-gps",
+ RFKILL_TYPE_GPS, ASUS_WMI_DEVID_GPS);
+
+ if (result && result != -ENODEV)
+ goto exit;
+
if (!asus->driver->hotplug_wireless)
goto exit;
@@ -1721,6 +1733,10 @@ static int asus_hotk_restore(struct device *device)
bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_WWAN3G);
rfkill_set_sw_state(asus->wwan3g.rfkill, bl);
}
+ if (asus->gps.rfkill) {
+ bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS);
+ rfkill_set_sw_state(asus->gps.rfkill, bl);
+ }
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 16/16] asus-wmi: add uwb rfkill support
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
` (14 preceding siblings ...)
2011-07-01 9:34 ` [PATCH 15/16] asus-wmi: add gps rfkill support Corentin Chary
@ 2011-07-01 9:34 ` Corentin Chary
15 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-01 9:34 UTC (permalink / raw)
To: platform-driver-x86
Cc: Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 83d4d26..1ea6b5b 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -195,6 +195,7 @@ struct asus_wmi {
struct asus_rfkill wimax;
struct asus_rfkill wwan3g;
struct asus_rfkill gps;
+ struct asus_rfkill uwb;
struct hotplug_slot *hotplug_slot;
struct mutex hotplug_lock;
@@ -841,6 +842,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
rfkill_destroy(asus->gps.rfkill);
asus->gps.rfkill = NULL;
}
+ if (asus->uwb.rfkill) {
+ rfkill_unregister(asus->uwb.rfkill);
+ rfkill_destroy(asus->uwb.rfkill);
+ asus->uwb.rfkill = NULL;
+ }
}
static int asus_wmi_rfkill_init(struct asus_wmi *asus)
@@ -881,6 +887,12 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus)
if (result && result != -ENODEV)
goto exit;
+ result = asus_new_rfkill(asus, &asus->uwb, "asus-uwb",
+ RFKILL_TYPE_UWB, ASUS_WMI_DEVID_UWB);
+
+ if (result && result != -ENODEV)
+ goto exit;
+
if (!asus->driver->hotplug_wireless)
goto exit;
@@ -1737,6 +1749,10 @@ static int asus_hotk_restore(struct device *device)
bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS);
rfkill_set_sw_state(asus->gps.rfkill, bl);
}
+ if (asus->uwb.rfkill) {
+ bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_UWB);
+ rfkill_set_sw_state(asus->uwb.rfkill, bl);
+ }
return 0;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device
2011-07-01 9:34 ` [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device Corentin Chary
@ 2011-07-01 14:15 ` Matthew Garrett
2011-07-04 7:49 ` Corentin Chary
0 siblings, 1 reply; 19+ messages in thread
From: Matthew Garrett @ 2011-07-01 14:15 UTC (permalink / raw)
To: Corentin Chary
Cc: platform-driver-x86, Seth Forshee, Corentin Chary,
open list:ASUS NOTEBOOKS AN..., open list
On Fri, Jul 01, 2011 at 11:34:29AM +0200, Corentin Chary wrote:
> asus->inputdev->id.bustype = BUS_HOST;
> asus->inputdev->dev.parent = &asus->platform_device->dev;
> + __set_bit(EV_REP, asus->inputdev->evbit);
set_bit()? I guess it doesn't make much difference in this case, it just
seems neater to use the non __ version.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device
2011-07-01 14:15 ` Matthew Garrett
@ 2011-07-04 7:49 ` Corentin Chary
0 siblings, 0 replies; 19+ messages in thread
From: Corentin Chary @ 2011-07-04 7:49 UTC (permalink / raw)
To: platform-driver-x86
Cc: Seth Forshee, Corentin Chary, Corentin Chary, Matthew Garrett,
open list:ASUS NOTEBOOKS AN..., open list
From: Seth Forshee <seth.forshee@canonical.com>
The T101MT Home/Express Gate key autorepeats in hardware, but
sparse-keymap does not support hardware autorepeat. Enable the
input core's software autorepeat to emulate the hardware behavior.
Normal hotkeys are autoreleased, so the behavior of these keys
will not be affected.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index a09271d..35eeb69 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -205,6 +205,7 @@ static int asus_wmi_input_init(struct asus_wmi *asus)
asus->inputdev->phys = asus->driver->input_phys;
asus->inputdev->id.bustype = BUS_HOST;
asus->inputdev->dev.parent = &asus->platform_device->dev;
+ set_bit(EV_REP, asus->inputdev->evbit);
err = sparse_keymap_setup(asus->inputdev, asus->driver->keymap, NULL);
if (err)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2011-07-04 7:50 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01 9:34 [PATCH 00/16] acpi4asus updates for 3.1 Corentin Chary
2011-07-01 9:34 ` [PATCH 01/16] asus-wmi: fix hwmon/pwm1 Corentin Chary
2011-07-01 9:34 ` [PATCH 02/16] asus-wmi: Add callback for hotkey filtering Corentin Chary
2011-07-01 9:34 ` [PATCH 03/16] eeepc-wmi: Add support for T101MT Home/Express Gate key Corentin Chary
2011-07-01 9:34 ` [PATCH 04/16] asus-wmi: Enable autorepeat for hotkey input device Corentin Chary
2011-07-01 14:15 ` Matthew Garrett
2011-07-04 7:49 ` Corentin Chary
2011-07-01 9:34 ` [PATCH 05/16] asus-wmi: second part of the version starts at 16 not 8 Corentin Chary
2011-07-01 9:34 ` [PATCH 06/16] asus-wmi: add keyboard backlight support Corentin Chary
2011-07-01 9:34 ` [PATCH 07/16] asus-wmi: fix section mismatch Corentin Chary
2011-07-01 9:34 ` [PATCH 08/16] asus-wmi: set backlight type Corentin Chary
2011-07-01 9:34 ` [PATCH 09/16] asus-wmi: fix keyboard backlight detection Corentin Chary
2011-07-01 9:34 ` [PATCH 10/16] asus-wmi: add some device ids Corentin Chary
2011-07-01 9:34 ` [PATCH 11/16] asus-wmi: add thermal sensor Corentin Chary
2011-07-01 9:34 ` [PATCH 12/16] asus-wmi: check for temp1 presence Corentin Chary
2011-07-01 9:34 ` [PATCH 13/16] asus-wmi: return proper value in store_cpufv() Corentin Chary
2011-07-01 9:34 ` [PATCH 14/16] asus-wmi: add CWAP support and clarify the meaning of WAPF bits Corentin Chary
2011-07-01 9:34 ` [PATCH 15/16] asus-wmi: add gps rfkill support Corentin Chary
2011-07-01 9:34 ` [PATCH 16/16] asus-wmi: add uwb " Corentin Chary
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox