public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] toshiba_acpi: Fix regression caused by backlight extra  check code
@ 2014-11-04  3:58 Azael Avalos
  2014-11-04  6:21 ` Darren Hart
  0 siblings, 1 reply; 5+ messages in thread
From: Azael Avalos @ 2014-11-04  3:58 UTC (permalink / raw)
  To: Darren Hart, platform-driver-x86, linux-kernel; +Cc: Nuno Lopes, Azael Avalos

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 makes sure that the extra check is being done
on a TOS1900 device and then make the check for the broken
backlight code.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
---
 drivers/platform/x86/toshiba_acpi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index ef3a190..e3fed12 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -944,9 +944,13 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value)
 	/* Extra check for "incomplete" backlight method, where the AML code
 	 * doesn't check for HCI_SET or HCI_GET and returns TOS_SUCCESS,
 	 * the actual brightness, and in some cases the max brightness.
+	 * Use the SPFC method as an indicator that we're on a TOS1900 device,
+	 * otherwise some TOS6208 devices might get bailed out, see bug 86521
 	 */
-	if (out[2] > 0  || out[3] == 0xE000)
-		return -ENODEV;
+	if (acpi_has_method(dev->acpi_dev->handle, "SPFC")) {
+		if (out[2] > 0  || out[3] == 0xE000)
+			return -ENODEV;
+	}
 
 	return out[0] == TOS_SUCCESS ? 0 : -EIO;
 }
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-11 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-04  3:58 [PATCH] toshiba_acpi: Fix regression caused by backlight extra check code Azael Avalos
2014-11-04  6:21 ` Darren Hart
2014-11-10 16:58   ` Azael Avalos
2014-11-11  5:49     ` Darren Hart
2014-11-11 16:01       ` Azael Avalos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox