--- asus_core.c.orig 2005-07-13 11:35:34.000000000 +0100 +++ asus_core.c 2005-07-13 11:39:03.000000000 +0100 @@ -52,6 +52,7 @@ #define PROC_MLED "mled" #define PROC_WLED "wled" #define PROC_TLED "tled" +#define PROC_BTLED "bled" #define PROC_INFO "info" #define PROC_LCD "lcd" #define PROC_BRN "brn" @@ -74,6 +75,7 @@ #define MLED_ON 0x01 //is MLED ON ? #define WLED_ON 0x02 #define TLED_ON 0x04 +#define BTLED_ON 0x08 MODULE_AUTHOR("Julien Lerouge, Karol Kozimor"); MODULE_DESCRIPTION(ACPI_HOTK_NAME); @@ -99,6 +101,8 @@ char *mt_tled; //method to handle tled_____________R char *tled_status; //node to handle tled reading_______A char *mt_lcd_switch; //method to turn LCD ON/OFF_________A + char *mt_btled; //method to handle btled____________R + char *btled_status; //node to handle btled reading______A char *lcd_status; //node to read LCD panel state______A char *brightness_up; //method to set brightness up_______A char *brightness_down; //guess what ?______________________A @@ -138,7 +142,8 @@ S2x, //S200 (J1 reported), Victor MP-XP7210 xxN, //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON //(Centrino) - END_MODEL + W5A, //W5A - 8012 + END_MODEL } model; //Models currently supported u16 event_count[128]; //count for each event TODO make this better }; @@ -364,7 +369,18 @@ .brightness_get = "GPLV", .display_set = "SDSP", .display_get = "\\ADVG" - } + }, + + { + .name = "W5A", + .mt_btled = "BLED", + .display_get = "\\SSTE", + .display_set = "SDSP", + .brightness_set = "SPLV", + .brightness_get = "GPLV", + .mt_lcd_switch = xxN_PREFIX "_Q10", + .lcd_status = "\\VGAF", + } }; /* procdir we use */ @@ -594,6 +613,26 @@ } /* + * Proc handlers for BTLED + */ +static int +proc_read_btled(char *page, char **start, off_t off, int count, int *eof, + void *data) +{ + struct asus_hotk *hotk = (struct asus_hotk *) data; + return sprintf(page, "%d\n", read_led(hotk, hotk->methods->btled_status, BTLED_ON)); +} + + +static int +proc_write_btled(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + struct asus_hotk *hotk = (struct asus_hotk *) data; + return write_led(buffer, count, hotk, hotk->methods->mt_btled, BTLED_ON, 0); +} + +/* * Proc handlers for TLED */ static int @@ -889,6 +928,9 @@ asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled, mode, device); } + if (hotk->methods->mt_btled) { + asus_proc_add(PROC_BTLED, &proc_write_btled, &proc_read_btled, mode, device); + } if (hotk->methods->mt_tled) { asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled, mode, device); } @@ -924,6 +966,8 @@ remove_proc_entry(PROC_WLED,acpi_device_dir(device)); if (hotk->methods->mt_mled) remove_proc_entry(PROC_MLED,acpi_device_dir(device)); + if (hotk->methods->mt_btled) + remove_proc_entry(PROC_BTLED,acpi_device_dir(device)); if (hotk->methods->mt_tled) remove_proc_entry(PROC_TLED,acpi_device_dir(device)); if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) @@ -1062,6 +1106,8 @@ hotk->model = S2x; else if (strncmp(model->string.pointer, "L5", 2) == 0) hotk->model = L5x; + else if (strncmp(model->string.pointer, "W5A", 3) == 0) + hotk->model = W5A; if (hotk->model == END_MODEL) { printk("unsupported, trying default values, supply the " @@ -1243,3 +1289,5 @@ module_init(asus_acpi_init); module_exit(asus_acpi_exit); + +