* [patch 6/7] asus-laptop: add ledd support
@ 2007-01-25 11:54 Corentin CHARY
2007-01-26 13:04 ` Corentin CHARY
0 siblings, 1 reply; 3+ messages in thread
From: Corentin CHARY @ 2007-01-25 11:54 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, acpi4asus-user
Ledd is a special led ... /sys/.../asus-laptop/ledd works like /proc/acpi/asus/ledd
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
asus-laptop.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
---
diff -Naur a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
--- a/drivers/misc/asus-laptop.c 2007-01-21 15:35:37.000000000 +0100
+++ b/drivers/misc/asus-laptop.c 2007-01-21 15:38:44.000000000 +0100
@@ -104,6 +104,9 @@
ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */
ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */
+/* LEDD */
+ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM");
+
/* Bluetooth and WLAN
* WLED and BLED are not handled like other XLED, because in some dsdt
* they also control the WLAN/Bluetooth device.
@@ -151,6 +154,7 @@
struct acpi_device *device; //the device we are in
acpi_handle handle; //the handle of the hotk device
char status; //status of the hotk, for LEDs, ...
+ u32 ledd_status; //status of the LED display
u16 event_count[128]; //count for each event TODO make this better
};
@@ -477,6 +481,30 @@
}
/*
+ * LEDD display
+ */
+static ssize_t show_ledd(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sprintf(buf, "0x%08x\n", hotk->ledd_status);
+}
+
+static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int rv, value;
+
+ rv = parse_arg(buf, count, &value);
+ if (rv > 0) {
+ if (!write_acpi_int(ledd_set_handle, NULL, value, NULL))
+ printk(ASUS_WARNING "LED display write failed\n");
+ else
+ hotk->ledd_status = (u32) value;
+ }
+ return rv;
+}
+
+/*
* WLAN
*/
static ssize_t show_wlan(struct device *dev,
@@ -605,12 +633,14 @@
static ASUS_CREATE_DEVICE_ATTR(wlan);
static ASUS_CREATE_DEVICE_ATTR(bluetooth);
static ASUS_CREATE_DEVICE_ATTR(display);
+static ASUS_CREATE_DEVICE_ATTR(ledd);
static struct attribute *asuspf_attributes[] = {
&dev_attr_infos.attr,
&dev_attr_wlan.attr,
&dev_attr_bluetooth.attr,
&dev_attr_display.attr,
+ &dev_attr_ledd.attr,
NULL
};
@@ -644,6 +674,9 @@
else if(display_set_handle)
ASUS_SET_DEVICE_ATTR(display, 0200, NULL, store_disp);
+ if (ledd_set_handle)
+ ASUS_SET_DEVICE_ATTR(ledd, 0644, show_ledd, store_ledd);
+
}
static int asus_handle_init(char *name, acpi_handle *handle,
@@ -739,6 +772,8 @@
ASUS_HANDLE_INIT(rled_set);
ASUS_HANDLE_INIT(pled_set);
+ ASUS_HANDLE_INIT(ledd_set);
+
/*
* The HWRS method return informations about the hardware.
* 0x80 bit is for WLAN, 0x100 for Bluetooth.
@@ -833,6 +868,9 @@
/* LCD Backlight is on by default */
hotk->status |= LCD_ON;
+ /* LED display is off by default */
+ hotk->ledd_status = 0xFFF;
+
if(wl_switch_handle)
write_acpi_int(wl_switch_handle, NULL, 1, NULL);
--
CHARY 'Iksaif' Corentin
http://xf.iksaif.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 6/7] asus-laptop: add ledd support
2007-01-25 11:54 [patch 6/7] asus-laptop: add ledd support Corentin CHARY
@ 2007-01-26 13:04 ` Corentin CHARY
2007-01-30 6:41 ` Len Brown
0 siblings, 1 reply; 3+ messages in thread
From: Corentin CHARY @ 2007-01-26 13:04 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, acpi4asus-user
From: Corentin Chary <corentincj@iksaif.net>
Ledd is a special led ... /sys/.../asus-laptop/ledd works like
/proc/acpi/asus/ledd
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
drivers/misc/asus-laptop.c | 38 +++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff -Naur a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
--- a/drivers/misc/asus-laptop.c 2007-01-26 13:02:37.000000000 +0100
+++ b/drivers/misc/asus-laptop.c 2007-01-26 13:03:15.000000000 +0100
@@ -104,6 +104,9 @@
ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */
ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */
+/* LEDD */
+ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM");
+
/* Bluetooth and WLAN
* WLED and BLED are not handled like other XLED, because in some dsdt
* they also control the WLAN/Bluetooth device.
@@ -151,6 +154,7 @@
struct acpi_device *device; //the device we are in
acpi_handle handle; //the handle of the hotk device
char status; //status of the hotk, for LEDs, ...
+ u32 ledd_status; //status of the LED display
u16 event_count[128]; //count for each event TODO make this better
};
@@ -479,6 +483,30 @@
}
/*
+ * LEDD display
+ */
+static ssize_t show_ledd(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sprintf(buf, "0x%08x\n", hotk->ledd_status);
+}
+
+static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int rv, value;
+
+ rv = parse_arg(buf, count, &value);
+ if (rv > 0) {
+ if (!write_acpi_int(ledd_set_handle, NULL, value, NULL))
+ printk(ASUS_WARNING "LED display write failed\n");
+ else
+ hotk->ledd_status = (u32) value;
+ }
+ return rv;
+}
+
+/*
* WLAN
*/
static ssize_t show_wlan(struct device *dev,
@@ -607,12 +635,14 @@
static ASUS_CREATE_DEVICE_ATTR(wlan);
static ASUS_CREATE_DEVICE_ATTR(bluetooth);
static ASUS_CREATE_DEVICE_ATTR(display);
+static ASUS_CREATE_DEVICE_ATTR(ledd);
static struct attribute *asuspf_attributes[] = {
&dev_attr_infos.attr,
&dev_attr_wlan.attr,
&dev_attr_bluetooth.attr,
&dev_attr_display.attr,
+ &dev_attr_ledd.attr,
NULL
};
@@ -646,6 +676,9 @@
else if(display_set_handle)
ASUS_SET_DEVICE_ATTR(display, 0200, NULL, store_disp);
+ if (ledd_set_handle)
+ ASUS_SET_DEVICE_ATTR(ledd, 0644, show_ledd, store_ledd);
+
}
static int asus_handle_init(char *name, acpi_handle *handle,
@@ -741,6 +774,8 @@
ASUS_HANDLE_INIT(rled_set);
ASUS_HANDLE_INIT(pled_set);
+ ASUS_HANDLE_INIT(ledd_set);
+
/*
* The HWRS method return informations about the hardware.
* 0x80 bit is for WLAN, 0x100 for Bluetooth.
@@ -836,6 +871,9 @@
/* LCD Backlight is on by default */
write_status(NULL, 1, LCD_ON, 0);
+ /* LED display is off by default */
+ hotk->ledd_status = 0xFFF;
+
end:
if (result) {
kfree(hotk->name);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 6/7] asus-laptop: add ledd support
2007-01-26 13:04 ` Corentin CHARY
@ 2007-01-30 6:41 ` Len Brown
0 siblings, 0 replies; 3+ messages in thread
From: Len Brown @ 2007-01-30 6:41 UTC (permalink / raw)
To: corentincj; +Cc: linux-acpi, acpi4asus-user
Note the corrected whitespace errors:
Applying 'asus-laptop: add ledd support'
Space in indent is followed by a tab.
.dotest/patch:95: /* LED display is off by default */
Space in indent is followed by a tab.
.dotest/patch:96: hotk->ledd_status = 0xFFF;
warning: 2 lines applied after stripping trailing whitespaces.
Wrote tree 6f1769ee1ee2be9067a6c1112c9cff974f40497e
Committed: 722ad97153015aaf5becba3084565e98e71a2aed
Commit Body is:
--------------------------
asus-laptop: add light sensor support
/proc/acpi/asus/lslvl is now /sys/.../asus-laptop/ls_level
/proc/acpi/asus/lssw is now /sys/.../asus-laptop/ls_switch nothing
else ..
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-30 6:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 11:54 [patch 6/7] asus-laptop: add ledd support Corentin CHARY
2007-01-26 13:04 ` Corentin CHARY
2007-01-30 6:41 ` Len Brown
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.