* [PATCH 0/4] asus-laptop
@ 2007-05-06 12:45 Corentin CHARY
2007-05-06 12:46 ` [PATCH 1/4] asus-laptop notify ALL events Corentin CHARY
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Corentin CHARY @ 2007-05-06 12:45 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
Hi Len,
Some asus-laptop patchs for 2.6.22 =).
--
CHARY 'Iksaif' Corentin
http://xf.iksaif.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] asus-laptop notify ALL events
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
@ 2007-05-06 12:46 ` Corentin CHARY
2007-05-06 12:47 ` [PATCH 2/4] asus-laptop add GPS support Corentin CHARY
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Corentin CHARY @ 2007-05-06 12:46 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
From: Corentin Chary <corentincj@iksaif.net>
We need to handle all events, because some dsdt use events >= 0x80
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
asus-laptop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/misc/asus-laptop.c 2007-05-04 21:44:35.000000000 +0200
+++ b/drivers/misc/asus-laptop.c 2007-05-05 09:20:11.000000000 +0200
@@ -950,7 +950,7 @@
* We install the handler, it will receive the hotk in parameter, so, we
* could add other data to the hotk struct
*/
- status = acpi_install_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
+ status = acpi_install_notify_handler(hotk->handle, ACPI_ALL_NOTIFY,
asus_hotk_notify, hotk);
if (ACPI_FAILURE(status))
printk(ASUS_ERR "Error installing notify handler\n");
@@ -997,7 +997,7 @@
if (!device || !acpi_driver_data(device))
return -EINVAL;
- status = acpi_remove_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
+ status = acpi_remove_notify_handler(hotk->handle, ACPI_ALL_NOTIFY,
asus_hotk_notify);
if (ACPI_FAILURE(status))
printk(ASUS_ERR "Error removing notify handler\n");
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] asus-laptop add GPS support
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
2007-05-06 12:46 ` [PATCH 1/4] asus-laptop notify ALL events Corentin CHARY
@ 2007-05-06 12:47 ` Corentin CHARY
2007-05-06 12:47 ` [PATCH 3/4] asus-laptop fix light sens init Corentin CHARY
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Corentin CHARY @ 2007-05-06 12:47 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
From: Corentin Chary <corentincj@iksaif.net>
Just adds GPS support found in R2H thanks to Sam Lin. It will
make a "gps" file in /sys/devices/platform/asus-laptop/.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
asus-laptop.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
--- a/drivers/misc/asus-laptop.c 2007-05-05 09:21:19.000000000 +0200
+++ b/drivers/misc/asus-laptop.c 2007-05-05 09:27:46.000000000 +0200
@@ -30,7 +30,7 @@
* Eric Burghard - LED display support for W1N
* Josh Green - Light Sens support
* Thomas Tuttle - His first patch for led support was very helpfull
- *
+ * Sam Lin - GPS support
*/
#include <linux/autoconf.h>
@@ -83,6 +83,7 @@
#define PLED_ON 0x20 //Phone LED
#define GLED_ON 0x40 //Gaming LED
#define LCD_ON 0x80 //LCD backlight
+#define GPS_ON 0x100 //GPS
#define ASUS_LOG ASUS_HOTK_FILE ": "
#define ASUS_ERR KERN_ERR ASUS_LOG
@@ -162,6 +163,12 @@
ASUS_HANDLE(ls_switch, ASUS_HOTK_PREFIX "ALSC"); /* Z71A Z71V */
ASUS_HANDLE(ls_level, ASUS_HOTK_PREFIX "ALSL"); /* Z71A Z71V */
+/* GPS */
+/* R2H use different handle for GPS on/off */
+ASUS_HANDLE(gps_on, ASUS_HOTK_PREFIX "SDON"); /* R2H */
+ASUS_HANDLE(gps_off, ASUS_HOTK_PREFIX "SDOF"); /* R2H */
+ASUS_HANDLE(gps_status, ASUS_HOTK_PREFIX "GPST");
+
/*
* This is the main structure, we can use it to store anything interesting
* about the hotk device
@@ -278,12 +285,27 @@
return (hotk->status & mask) ? 1 : 0;
}
+static int read_gps_status(void) {
+ ulong status;
+ acpi_status rv = AE_OK;
+
+ rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status);
+ if (ACPI_FAILURE(rv))
+ printk(ASUS_WARNING "Error reading GPS status\n");
+ else
+ return status ? 1 : 0;
+
+ return (hotk->status & GPS_ON) ? 1 : 0;
+}
+
/* Generic LED functions */
static int read_status(int mask)
{
/* There is a special method for both wireless devices */
if (mask == BT_ON || mask == WL_ON)
return read_wireless_status(mask);
+ else if(mask == GPS_ON)
+ return read_gps_status();
return (hotk->status & mask) ? 1 : 0;
}
@@ -299,6 +321,10 @@
case GLED_ON:
out = (out & 0x1) + 1;
break;
+ case GPS_ON:
+ handle = (out) ? gps_on_handle : gps_off_handle;
+ out = 0x02;
+ break;
default:
out &= 0x1;
break;
@@ -667,6 +693,21 @@
return rv;
}
+/*
+ * GPS
+ */
+static ssize_t show_gps(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%d\n", read_status(GPS_ON));
+}
+
+static ssize_t store_gps(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ return store_status(buf, count, NULL, GPS_ON);
+}
+
static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
{
/* TODO Find a better way to handle events count. */
@@ -715,6 +756,7 @@
static ASUS_CREATE_DEVICE_ATTR(ledd);
static ASUS_CREATE_DEVICE_ATTR(ls_switch);
static ASUS_CREATE_DEVICE_ATTR(ls_level);
+static ASUS_CREATE_DEVICE_ATTR(gps);
static struct attribute *asuspf_attributes[] = {
&dev_attr_infos.attr,
@@ -724,6 +766,7 @@
&dev_attr_ledd.attr,
&dev_attr_ls_switch.attr,
&dev_attr_ls_level.attr,
+ &dev_attr_gps.attr,
NULL
};
@@ -763,6 +806,9 @@
ASUS_SET_DEVICE_ATTR(ls_level, 0644, show_lslvl, store_lslvl);
ASUS_SET_DEVICE_ATTR(ls_switch, 0644, show_lssw, store_lssw);
}
+
+ if(gps_status_handle && gps_on_handle && gps_off_handle)
+ ASUS_SET_DEVICE_ATTR(gps, 0644, show_gps, store_gps);
}
static int asus_handle_init(char *name, acpi_handle * handle,
@@ -893,6 +939,10 @@
if (ASUS_HANDLE_INIT(ls_switch))
ASUS_HANDLE_INIT(ls_level);
+ ASUS_HANDLE_INIT(gps_on);
+ ASUS_HANDLE_INIT(gps_off);
+ ASUS_HANDLE_INIT(gps_status);
+
kfree(model);
return AE_OK;
@@ -981,6 +1031,9 @@
if (ls_level_handle)
set_light_sens_level(hotk->light_level);
+ /* GPS is on by default */
+ write_status(NULL, 1, GPS_ON);
+
end:
if (result) {
kfree(hotk->name);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] asus-laptop fix light sens init
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
2007-05-06 12:46 ` [PATCH 1/4] asus-laptop notify ALL events Corentin CHARY
2007-05-06 12:47 ` [PATCH 2/4] asus-laptop add GPS support Corentin CHARY
@ 2007-05-06 12:47 ` Corentin CHARY
2007-05-06 12:48 ` [PATCH 4/4] asus-laptop version bump and lindent Corentin CHARY
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Corentin CHARY @ 2007-05-06 12:47 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
From: Corentin Chary <corentincj@iksaif.net>
Fix a stupid light sens detection bug.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
asus-laptop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/misc/asus-laptop.c 2007-05-05 09:31:05.000000000 +0200
+++ b/drivers/misc/asus-laptop.c 2007-05-05 09:32:55.000000000 +0200
@@ -936,7 +936,7 @@
/* There is a lot of models with "ALSL", but a few get
a real light sens, so we need to check it. */
- if (ASUS_HANDLE_INIT(ls_switch))
+ if (!ASUS_HANDLE_INIT(ls_switch))
ASUS_HANDLE_INIT(ls_level);
ASUS_HANDLE_INIT(gps_on);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] asus-laptop version bump and lindent
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
` (2 preceding siblings ...)
2007-05-06 12:47 ` [PATCH 3/4] asus-laptop fix light sens init Corentin CHARY
@ 2007-05-06 12:48 ` Corentin CHARY
2007-05-07 10:00 ` [PATCH 0/4] asus-laptop Thomas Renninger
2007-05-10 6:44 ` Len Brown
5 siblings, 0 replies; 7+ messages in thread
From: Corentin CHARY @ 2007-05-06 12:48 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi
From: Corentin Chary <corentincj@iksaif.net>
Version bump, lindent, etc ..
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
asus-laptop.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
--- a/drivers/misc/asus-laptop.c 2007-05-05 09:33:12.000000000 +0200
+++ b/drivers/misc/asus-laptop.c 2007-05-05 09:33:32.000000000 +0200
@@ -48,7 +48,7 @@
#include <acpi/acpi_bus.h>
#include <asm/uaccess.h>
-#define ASUS_LAPTOP_VERSION "0.41"
+#define ASUS_LAPTOP_VERSION "0.42"
#define ASUS_HOTK_NAME "Asus Laptop Support"
#define ASUS_HOTK_CLASS "hotkey"
@@ -83,7 +83,7 @@
#define PLED_ON 0x20 //Phone LED
#define GLED_ON 0x40 //Gaming LED
#define LCD_ON 0x80 //LCD backlight
-#define GPS_ON 0x100 //GPS
+#define GPS_ON 0x100 //GPS
#define ASUS_LOG ASUS_HOTK_FILE ": "
#define ASUS_ERR KERN_ERR ASUS_LOG
@@ -149,7 +149,7 @@
ASUS_HANDLE(display_get, "\\_SB.PCI0.P0P1.VGA.GETD", /* A6B, A6K A6R A7D F3JM L4R M6R A3G
M6A M6V VX-1 V6J V6V W3Z */
"\\_SB.PCI0.P0P2.VGA.GETD", /* A3E A4K, A4D A4L A6J A7J A8J Z71V M9V
- S5A M5A z33A W1Jc W2V */
+ S5A M5A z33A W1Jc W2V G1 */
"\\_SB.PCI0.P0P3.VGA.GETD", /* A6V A6Q */
"\\_SB.PCI0.P0PA.VGA.GETD", /* A6T, A6M */
"\\_SB.PCI0.PCI1.VGAC.NMAP", /* L3C */
@@ -165,8 +165,8 @@
/* GPS */
/* R2H use different handle for GPS on/off */
-ASUS_HANDLE(gps_on, ASUS_HOTK_PREFIX "SDON"); /* R2H */
-ASUS_HANDLE(gps_off, ASUS_HOTK_PREFIX "SDOF"); /* R2H */
+ASUS_HANDLE(gps_on, ASUS_HOTK_PREFIX "SDON"); /* R2H */
+ASUS_HANDLE(gps_off, ASUS_HOTK_PREFIX "SDOF"); /* R2H */
ASUS_HANDLE(gps_status, ASUS_HOTK_PREFIX "GPST");
/*
@@ -285,17 +285,18 @@
return (hotk->status & mask) ? 1 : 0;
}
-static int read_gps_status(void) {
- ulong status;
+static int read_gps_status(void)
+{
+ ulong status;
acpi_status rv = AE_OK;
rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status);
if (ACPI_FAILURE(rv))
- printk(ASUS_WARNING "Error reading GPS status\n");
+ printk(ASUS_WARNING "Error reading GPS status\n");
else
- return status ? 1 : 0;
+ return status ? 1 : 0;
- return (hotk->status & GPS_ON) ? 1 : 0;
+ return (hotk->status & GPS_ON) ? 1 : 0;
}
/* Generic LED functions */
@@ -304,8 +305,8 @@
/* There is a special method for both wireless devices */
if (mask == BT_ON || mask == WL_ON)
return read_wireless_status(mask);
- else if(mask == GPS_ON)
- return read_gps_status();
+ else if (mask == GPS_ON)
+ return read_gps_status();
return (hotk->status & mask) ? 1 : 0;
}
@@ -705,7 +706,7 @@
static ssize_t store_gps(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
- return store_status(buf, count, NULL, GPS_ON);
+ return store_status(buf, count, NULL, GPS_ON);
}
static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
@@ -807,7 +808,7 @@
ASUS_SET_DEVICE_ATTR(ls_switch, 0644, show_lssw, store_lssw);
}
- if(gps_status_handle && gps_on_handle && gps_off_handle)
+ if (gps_status_handle && gps_on_handle && gps_off_handle)
ASUS_SET_DEVICE_ATTR(gps, 0644, show_gps, store_gps);
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] asus-laptop
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
` (3 preceding siblings ...)
2007-05-06 12:48 ` [PATCH 4/4] asus-laptop version bump and lindent Corentin CHARY
@ 2007-05-07 10:00 ` Thomas Renninger
2007-05-10 6:44 ` Len Brown
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Renninger @ 2007-05-07 10:00 UTC (permalink / raw)
To: corentincj; +Cc: linux-acpi, Danny Kukawka
On Sun, 2007-05-06 at 14:45 +0200, Corentin CHARY wrote:
> Hi Len,
> Some asus-laptop patchs for 2.6.22 =).
I recently had a look at an ASUS and wanted to try out
the video module.
The laptop had the ACPI specific general brightness
and other video AML functions.
But also the ATKxy Asus specific device that asus_acpi
makes use of.
In AML code one could see, that the use of those was
exclusive, a variable (or method?) was used to either
return out immediately from ATKxy or general ACPI funcs
(the ones from ACPI spec. Appendix B).
On a quick try asus_acpi worked, video did not.
It looks as if asus begins to move to the spec?
Some problems might come up:
- Interference between asus_acpi and video
- Which model works better with what kind
of method (there might come a break point,
(possibly Vista?), when the ACPI spec functions
work better than ATKxy the asus specific device
vanishes totally at some point).
While I like the idea that vendors move on to the standard, I fear
some more very machine specific problems might hit us in future...
Just some info, if anyone finds out more, I'd be interested in
any related info...
Thanks,
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] asus-laptop
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
` (4 preceding siblings ...)
2007-05-07 10:00 ` [PATCH 0/4] asus-laptop Thomas Renninger
@ 2007-05-10 6:44 ` Len Brown
5 siblings, 0 replies; 7+ messages in thread
From: Len Brown @ 2007-05-10 6:44 UTC (permalink / raw)
To: corentincj; +Cc: linux-acpi
1-4 applied.
thanks,
-Len
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-05-10 6:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-06 12:45 [PATCH 0/4] asus-laptop Corentin CHARY
2007-05-06 12:46 ` [PATCH 1/4] asus-laptop notify ALL events Corentin CHARY
2007-05-06 12:47 ` [PATCH 2/4] asus-laptop add GPS support Corentin CHARY
2007-05-06 12:47 ` [PATCH 3/4] asus-laptop fix light sens init Corentin CHARY
2007-05-06 12:48 ` [PATCH 4/4] asus-laptop version bump and lindent Corentin CHARY
2007-05-07 10:00 ` [PATCH 0/4] asus-laptop Thomas Renninger
2007-05-10 6:44 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox