diff options
Diffstat (limited to 'drivers/platform/x86/toshiba_acpi.c')
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 96076d99cf33..06362b7d3ad7 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -928,9 +928,7 @@ static int lcd_proc_open(struct inode *inode, struct file *file) | |||
928 | 928 | ||
929 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | 929 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) |
930 | { | 930 | { |
931 | u32 in[TCI_WORDS] = { HCI_SET, HCI_LCD_BRIGHTNESS, 0, 0, 0, 0 }; | 931 | u32 hci_result; |
932 | u32 out[TCI_WORDS]; | ||
933 | acpi_status status; | ||
934 | 932 | ||
935 | if (dev->tr_backlight_supported) { | 933 | if (dev->tr_backlight_supported) { |
936 | bool enable = !value; | 934 | bool enable = !value; |
@@ -941,20 +939,9 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | |||
941 | value--; | 939 | value--; |
942 | } | 940 | } |
943 | 941 | ||
944 | in[2] = value << HCI_LCD_BRIGHTNESS_SHIFT; | 942 | value = value << HCI_LCD_BRIGHTNESS_SHIFT; |
945 | status = tci_raw(dev, in, out); | 943 | hci_result = hci_write1(dev, HCI_LCD_BRIGHTNESS, value); |
946 | if (ACPI_FAILURE(status) || out[0] == TOS_FAILURE) { | 944 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
947 | pr_err("ACPI call to set brightness failed"); | ||
948 | return -EIO; | ||
949 | } | ||
950 | /* Extra check for "incomplete" backlight method, where the AML code | ||
951 | * doesn't check for HCI_SET or HCI_GET and returns TOS_SUCCESS, | ||
952 | * the actual brightness, and in some cases the max brightness. | ||
953 | */ | ||
954 | if (out[2] > 0 || out[3] == 0xE000) | ||
955 | return -ENODEV; | ||
956 | |||
957 | return out[0] == TOS_SUCCESS ? 0 : -EIO; | ||
958 | } | 945 | } |
959 | 946 | ||
960 | static int set_lcd_status(struct backlight_device *bd) | 947 | static int set_lcd_status(struct backlight_device *bd) |