toshiba_acpi: Qosmio backlight and keymap fixes
Subsystems (2)
Azael Avalos
maintainercover toshiba_acpi: Qosmio backlight and keymap fixes
The following two patches fixes some issues regarding the backlight method on Qosmios series X500/X505 and X75-A (and probably others too), as well as adding the latter to the new alternate keymap list.
Azael Avalos (2):
toshiba_acpi: Add extra check to backlight code
toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi list
drivers/platform/x86/toshiba_acpi.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
Signature · 1 line
2.0.0
Azael Avalos
maintainerPATCH 1/2 toshiba_acpi: Add extra check to backlight code
Some Toshiba models (most notably Qosmios) come with an incomplete backlight method where the AML code doesn't check for write or read commands and always returns HCI_SUCCESS and the actual brightness (and in some cases the max brightness), thus allowing the backlight interface to be registered without write support.
This patch changes the set_lcd_brightness function, checking the returned values for values greater than zero to avoid registering a broken backlight interface.
--- drivers/platform/x86/toshiba_acpi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/platform/x86/toshiba_acpi.c +17 -4
@@ -872,7 +872,9 @@ static int lcd_proc_open(struct inode *inode, struct file *file)static int set_lcd_brightness (struct toshiba_acpi_dev *dev,int value) { -u32 hci_result; +u32 in[HCI_WORDS ] = {HCI_SET ,HCI_LCD_BRIGHTNESS ,0 ,0 ,0 ,0 }; +u32 out[HCI_WORDS ]; +acpi_status status;if (dev->tr_backlight_supported) {bool enable = !value;
@@ -883,9 +885,20 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) value--; } - value = value <<HCI_LCD_BRIGHTNESS_SHIFT ; -hci_write1 (dev,HCI_LCD_BRIGHTNESS , value, &hci_result); -return hci_result ==HCI_SUCCESS ?0 : -EIO ; + in[2 ] = value <<HCI_LCD_BRIGHTNESS_SHIFT ; + status =hci_raw (dev, in, out); +if (ACPI_FAILURE (status) || out[0 ] ==HCI_FAILURE ) { +pr_err ("ACPI call to set brightness failed" ); +return -EIO ; + } +/* Extra check for "incomplete" backlight method, where the AML code +* doesn't check for HCI_SET or HCI_GET and returns HCI_SUCCESS, +* the actual brightness, and in some cases the max brightness. +*/ +if (out[2 ] >0 || out[3 ] ==0xE000 ) +return -ENODEV ; + +return out[0 ] ==HCI_SUCCESS ?0 : -EIO ; }static int set_lcd_status (struct backlight_device *bd)
Signature · 1 line
2.0.0
Azael Avalos
maintainerPATCH 2/2 toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi list
In reply to Azael AvalosThe Toshiba Qosmio X75-A series models also come with the new keymap layout.
This patch adds this model to the alt_keymap_dmi list, along with an extra key found on these models.
--- drivers/platform/x86/toshiba_acpi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/platform/x86/toshiba_acpi.c +7 -0
@@ -222,6 +222,12 @@ static const struct dmi_system_id toshiba_alt_keymap_dmi[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Satellite M840"), }, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), + DMI_MATCH(DMI_PRODUCT_NAME, "Qosmio X75-A"), + }, + }, {} };
@@ -229,6 +235,7 @@ static const struct key_entry toshiba_acpi_alt_keymap[] = { { KE_KEY, 0x157, { KEY_MUTE } }, { KE_KEY, 0x102, { KEY_ZOOMOUT } }, { KE_KEY, 0x103, { KEY_ZOOMIN } }, + { KE_KEY, 0x12c, { KEY_KBDILLUMTOGGLE } }, { KE_KEY, 0x139, { KEY_ZOOMRESET } }, { KE_KEY, 0x13e, { KEY_SWITCHVIDEOMODE } }, { KE_KEY, 0x13c, { KEY_BRIGHTNESSDOWN } },
Signature · 1 line
2.0.0
Re: [PATCH 1/2] toshiba_acpi: Add extra check to backlight code
In reply to Azael AvalosQuoted 7 lines · Azael Avalos
Some Toshiba models (most notably Qosmios) come with an incomplete backlight method where the AML code doesn't check for write or read commands and always returns
HCI_SUCCESSand the actual brightness (and in some cases the max brightness), thus allowing the backlight interface to be registered without write support.
Quoted 8 lines
This patch changes the
set_lcd_brightnessfunction, checking the returned values for values greater than zero to avoid registering a broken backlight interface.Signed-off-by Azael Avalos <[email protected]>--- drivers/platform/x86/toshiba_acpi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.
</formletter>
Re: [PATCH 2/2] toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi list
In reply to Azael AvalosQuoted 10 lines · Azael Avalos
The Toshiba Qosmio X75-A series models also come with the new keymap layout.
This patch adds this model to the
alt_keymap_dmilist, along with an extra key found on these models.Signed-off-by Azael Avalos <[email protected]>--- drivers/platform/x86/toshiba_acpi.c | 7 +++++++ 1 file changed, 7 insertions(+)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.
</formletter>
Quoted 5 lines · Azael Avalos
The following two patches fixes some issues regarding the backlight method on Qosmios series X500/X505 and X75-A (and probably others too), as well as adding the latter to the new alternate keymap list.
Quoted 7 lines
Azael Avalos (2):
toshiba_acpi: Add extra check to backlight code
toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi listdrivers/platform/x86/toshiba_acpi.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.
</formletter>