Skip to content

Commit

Permalink
toshiba_acpi: Add a check for TOS_NOT_SUPPORTED in the sci_open function
Browse files Browse the repository at this point in the history
This was "toshiba_acpi: Change sci_open function return value"

Some Toshiba laptops have "poorly implemented" SCI calls on their
BIOSes and are not checking for sci_{open, close} calls, therefore,
the sci_open function is failing and making some of the supported
features unavailable (kbd backlight, touchpad, illumination, etc.).

This patch checks whether we receive TOS_NOT_SUPPORTED and returns
1, making the supported features work on such laptops.

In the case that some laptops really do not support the SCI, all the
SCI dependent functions check for TOS_NOT_SUPPORTED, and thus, not
registering support for the queried feature.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  • Loading branch information
Azael Avalos authored and Darren Hart committed Jan 29, 2015
1 parent ed52ccb commit fa46573
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/platform/x86/toshiba_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,19 @@ static int sci_open(struct toshiba_acpi_dev *dev)
} else if (out[0] == TOS_ALREADY_OPEN) {
pr_info("Toshiba SCI already opened\n");
return 1;
} else if (out[0] == TOS_NOT_SUPPORTED) {
/* Some BIOSes do not have the SCI open/close functions
* implemented and return 0x8000 (Not Supported), failing to
* register some supported features.
*
* Simply return 1 if we hit those affected laptops to make the
* supported features work.
*
* In the case that some laptops really do not support the SCI,
* all the SCI dependent functions check for TOS_NOT_SUPPORTED,
* and thus, not registering support for the queried feature.
*/
return 1;
} else if (out[0] == TOS_NOT_PRESENT) {
pr_info("Toshiba SCI is not present\n");
}
Expand Down

0 comments on commit fa46573

Please sign in to comment.