Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185057
b: refs/heads/master
c: e5593bf
h: refs/heads/master
i:
  185055: 6d8b207
v: v3
  • Loading branch information
Corentin Chary committed Feb 28, 2010
1 parent 827e23a commit ab12357
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d99b577c729c4a29679fb1f605f9ccace154e0e5
refs/heads/master: e5593bf18be79b4897c7ec8b392dc7f07cbc1b11
33 changes: 25 additions & 8 deletions trunk/drivers/platform/x86/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method,
}

/* Generic LED function */
static void asus_led_set(struct asus_laptop *asus, char *method,
static int asus_led_set(struct asus_laptop *asus, char *method,
int value)
{
if (!strcmp(method, METHOD_MLED))
Expand All @@ -360,7 +360,7 @@ static void asus_led_set(struct asus_laptop *asus, char *method,
else
value = !!value;

write_acpi_int(asus->handle, method, value);
return write_acpi_int(asus->handle, method, value);
}

/*
Expand Down Expand Up @@ -817,6 +817,15 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
/*
* WLAN
*/
static int asus_wlan_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) {
pr_warning("Error setting wlan status to %d", status);
return -EIO;
}
return 0;
}

static ssize_t show_wlan(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand All @@ -836,6 +845,15 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
/*
* Bluetooth
*/
static int asus_bluetooth_set(struct asus_laptop *asus, int status)
{
if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) {
pr_warning("Error setting bluetooth status to %d", status);
return -EIO;
}
return 0;
}

static ssize_t show_bluetooth(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -1353,8 +1371,8 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
(uint) bsts_result);

/* This too ... */
write_acpi_int(asus->handle, "CWAP", wapf);

if (write_acpi_int(asus->handle, "CWAP", wapf))
pr_err("Error calling CWAP(%d)\n", wapf);
/*
* Try to match the object returned by INIT to the specific model.
* Handle every possible object (or the lack of thereof) the DSDT
Expand Down Expand Up @@ -1426,11 +1444,10 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)

/* WLED and BLED are on by default */
if (bluetooth_status >= 0)
write_acpi_int(asus->handle, METHOD_BLUETOOTH,
!!bluetooth_status);
asus_bluetooth_set(asus, !!bluetooth_status);

if (wireless_status >= 0)
write_acpi_int(asus->handle, METHOD_WLAN,
!!wireless_status);
asus_wlan_set(asus, !!wireless_status);

/* Keyboard Backlight is on by default */
if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL))
Expand Down

0 comments on commit ab12357

Please sign in to comment.