Skip to content

Commit a39f46d

Browse files
Coproscefalodvhart
authored andcommitted
toshiba_acpi: Fix regression caused by backlight extra check code
Bug 86521 uncovered that some TOS6208 devices also return non zero values on a write call to the backlight method, thus getting caught and bailed out by the extra check code. This patch changes the set_lcd_brightness function to its "original" state by just adapting it to the new function format. Signed-off-by: Azael Avalos <[email protected]> Signed-off-by: Darren Hart <[email protected]>
1 parent 841e11c commit a39f46d

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

drivers/platform/x86/toshiba_acpi.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,7 @@ static int lcd_proc_open(struct inode *inode, struct file *file)
928928

929929
static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value)
930930
{
931-
u32 in[TCI_WORDS] = { HCI_SET, HCI_LCD_BRIGHTNESS, 0, 0, 0, 0 };
932-
u32 out[TCI_WORDS];
933-
acpi_status status;
931+
u32 hci_result;
934932

935933
if (dev->tr_backlight_supported) {
936934
bool enable = !value;
@@ -941,20 +939,9 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value)
941939
value--;
942940
}
943941

944-
in[2] = value << HCI_LCD_BRIGHTNESS_SHIFT;
945-
status = tci_raw(dev, in, out);
946-
if (ACPI_FAILURE(status) || out[0] == TOS_FAILURE) {
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;
942+
value = value << HCI_LCD_BRIGHTNESS_SHIFT;
943+
hci_result = hci_write1(dev, HCI_LCD_BRIGHTNESS, value);
944+
return hci_result == TOS_SUCCESS ? 0 : -EIO;
958945
}
959946

960947
static int set_lcd_status(struct backlight_device *bd)

0 commit comments

Comments
 (0)