Commit d0a2281d authored by Andy Grover's avatar Andy Grover

ACPI: Update Toshiba driver to 0.15 (John Belmonte)

- workaround sporadic problem with hotkey ceasing to work
- cleanups
parent 50528758
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* *
*/ */
#define TOSHIBA_ACPI_VERSION "0.14" #define TOSHIBA_ACPI_VERSION "0.15"
#define PROC_INTERFACE_VERSION 1 #define PROC_INTERFACE_VERSION 1
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -172,9 +172,7 @@ hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS]) ...@@ -172,9 +172,7 @@ hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS])
for (i = 0; i < HCI_WORDS; ++i) { for (i = 0; i < HCI_WORDS; ++i) {
in_objs[i].type = ACPI_TYPE_INTEGER; in_objs[i].type = ACPI_TYPE_INTEGER;
in_objs[i].integer.value = in[i]; in_objs[i].integer.value = in[i];
/*printk("%04x ", in[i]);*/
} }
/*printk("\n");*/
results.length = sizeof(out_objs); results.length = sizeof(out_objs);
results.pointer = out_objs; results.pointer = out_objs;
...@@ -184,9 +182,7 @@ hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS]) ...@@ -184,9 +182,7 @@ hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS])
if ((status == AE_OK) && (out_objs->package.count <= HCI_WORDS)) { if ((status == AE_OK) && (out_objs->package.count <= HCI_WORDS)) {
for (i = 0; i < out_objs->package.count; ++i) { for (i = 0; i < out_objs->package.count; ++i) {
out[i] = out_objs->package.elements[i].integer.value; out[i] = out_objs->package.elements[i].integer.value;
/*printk("%04x ", out[i]);*/
} }
/*printk("\n");*/
} }
return status; return status;
...@@ -226,7 +222,7 @@ static int key_event_valid; ...@@ -226,7 +222,7 @@ static int key_event_valid;
typedef struct _ProcItem typedef struct _ProcItem
{ {
char* name; const char* name;
char* (*read_func)(char*); char* (*read_func)(char*);
unsigned long (*write_func)(const char*, unsigned long); unsigned long (*write_func)(const char*, unsigned long);
} ProcItem; } ProcItem;
...@@ -284,10 +280,8 @@ static unsigned long ...@@ -284,10 +280,8 @@ static unsigned long
write_lcd(const char* buffer, unsigned long count) write_lcd(const char* buffer, unsigned long count)
{ {
int value; int value;
/*int byte_count;*/
u32 hci_result; u32 hci_result;
/* ISSUE: %i doesn't work with hex values as advertised */
if (snscanf(buffer, count, " brightness : %i", &value) == 1 && if (snscanf(buffer, count, " brightness : %i", &value) == 1 &&
value >= 0 && value < HCI_LCD_BRIGHTNESS_LEVELS) { value >= 0 && value < HCI_LCD_BRIGHTNESS_LEVELS) {
value = value << HCI_LCD_BRIGHTNESS_SHIFT; value = value << HCI_LCD_BRIGHTNESS_SHIFT;
...@@ -414,6 +408,11 @@ read_keys(char* p) ...@@ -414,6 +408,11 @@ read_keys(char* p)
last_key_event = value; last_key_event = value;
} else if (hci_result == HCI_EMPTY) { } else if (hci_result == HCI_EMPTY) {
/* better luck next time */ /* better luck next time */
} else if (hci_result == HCI_NOT_SUPPORTED) {
/* This is a workaround for an unresolved issue on
* some machines where system events sporadically
* become disabled. */
hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
} else { } else {
p += sprintf(p, "ERROR\n"); p += sprintf(p, "ERROR\n");
goto end; goto end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment