diff options
Diffstat (limited to 'drivers/platform/x86/toshiba_acpi.c')
| -rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 76441dcbe5ff..b062d3d7b373 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
| @@ -222,6 +222,12 @@ static const struct dmi_system_id toshiba_alt_keymap_dmi[] = { | |||
| 222 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite M840"), | 222 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite M840"), |
| 223 | }, | 223 | }, |
| 224 | }, | 224 | }, |
| 225 | { | ||
| 226 | .matches = { | ||
| 227 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 228 | DMI_MATCH(DMI_PRODUCT_NAME, "Qosmio X75-A"), | ||
| 229 | }, | ||
| 230 | }, | ||
| 225 | {} | 231 | {} |
| 226 | }; | 232 | }; |
| 227 | 233 | ||
| @@ -229,6 +235,7 @@ static const struct key_entry toshiba_acpi_alt_keymap[] = { | |||
| 229 | { KE_KEY, 0x157, { KEY_MUTE } }, | 235 | { KE_KEY, 0x157, { KEY_MUTE } }, |
| 230 | { KE_KEY, 0x102, { KEY_ZOOMOUT } }, | 236 | { KE_KEY, 0x102, { KEY_ZOOMOUT } }, |
| 231 | { KE_KEY, 0x103, { KEY_ZOOMIN } }, | 237 | { KE_KEY, 0x103, { KEY_ZOOMIN } }, |
| 238 | { KE_KEY, 0x12c, { KEY_KBDILLUMTOGGLE } }, | ||
| 232 | { KE_KEY, 0x139, { KEY_ZOOMRESET } }, | 239 | { KE_KEY, 0x139, { KEY_ZOOMRESET } }, |
| 233 | { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } }, | 240 | { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } }, |
| 234 | { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } }, | 241 | { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } }, |
| @@ -872,7 +879,9 @@ static int lcd_proc_open(struct inode *inode, struct file *file) | |||
| 872 | 879 | ||
| 873 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | 880 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) |
| 874 | { | 881 | { |
| 875 | u32 hci_result; | 882 | u32 in[HCI_WORDS] = { HCI_SET, HCI_LCD_BRIGHTNESS, 0, 0, 0, 0 }; |
| 883 | u32 out[HCI_WORDS]; | ||
| 884 | acpi_status status; | ||
| 876 | 885 | ||
| 877 | if (dev->tr_backlight_supported) { | 886 | if (dev->tr_backlight_supported) { |
| 878 | bool enable = !value; | 887 | bool enable = !value; |
| @@ -883,9 +892,20 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | |||
| 883 | value--; | 892 | value--; |
| 884 | } | 893 | } |
| 885 | 894 | ||
| 886 | value = value << HCI_LCD_BRIGHTNESS_SHIFT; | 895 | in[2] = value << HCI_LCD_BRIGHTNESS_SHIFT; |
| 887 | hci_write1(dev, HCI_LCD_BRIGHTNESS, value, &hci_result); | 896 | status = hci_raw(dev, in, out); |
| 888 | return hci_result == HCI_SUCCESS ? 0 : -EIO; | 897 | if (ACPI_FAILURE(status) || out[0] == HCI_FAILURE) { |
| 898 | pr_err("ACPI call to set brightness failed"); | ||
| 899 | return -EIO; | ||
| 900 | } | ||
| 901 | /* Extra check for "incomplete" backlight method, where the AML code | ||
| 902 | * doesn't check for HCI_SET or HCI_GET and returns HCI_SUCCESS, | ||
| 903 | * the actual brightness, and in some cases the max brightness. | ||
| 904 | */ | ||
| 905 | if (out[2] > 0 || out[3] == 0xE000) | ||
| 906 | return -ENODEV; | ||
| 907 | |||
| 908 | return out[0] == HCI_SUCCESS ? 0 : -EIO; | ||
| 889 | } | 909 | } |
| 890 | 910 | ||
| 891 | static int set_lcd_status(struct backlight_device *bd) | 911 | static int set_lcd_status(struct backlight_device *bd) |
