diff options
| -rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 2781b149a95d..17a259eb3eed 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
| @@ -129,6 +129,7 @@ MODULE_LICENSE("GPL"); | |||
| 129 | #define HCI_ACCEL_MASK 0x7fff | 129 | #define HCI_ACCEL_MASK 0x7fff |
| 130 | #define HCI_HOTKEY_DISABLE 0x0b | 130 | #define HCI_HOTKEY_DISABLE 0x0b |
| 131 | #define HCI_HOTKEY_ENABLE 0x09 | 131 | #define HCI_HOTKEY_ENABLE 0x09 |
| 132 | #define HCI_HOTKEY_SPECIAL_FUNCTIONS 0x10 | ||
| 132 | #define HCI_LCD_BRIGHTNESS_BITS 3 | 133 | #define HCI_LCD_BRIGHTNESS_BITS 3 |
| 133 | #define HCI_LCD_BRIGHTNESS_SHIFT (16-HCI_LCD_BRIGHTNESS_BITS) | 134 | #define HCI_LCD_BRIGHTNESS_SHIFT (16-HCI_LCD_BRIGHTNESS_BITS) |
| 134 | #define HCI_LCD_BRIGHTNESS_LEVELS (1 << HCI_LCD_BRIGHTNESS_BITS) | 135 | #define HCI_LCD_BRIGHTNESS_LEVELS (1 << HCI_LCD_BRIGHTNESS_BITS) |
| @@ -2335,6 +2336,20 @@ static int toshiba_acpi_enable_hotkeys(struct toshiba_acpi_dev *dev) | |||
| 2335 | return 0; | 2336 | return 0; |
| 2336 | } | 2337 | } |
| 2337 | 2338 | ||
| 2339 | static void toshiba_acpi_enable_special_functions(struct toshiba_acpi_dev *dev) | ||
| 2340 | { | ||
| 2341 | u32 result; | ||
| 2342 | |||
| 2343 | /* | ||
| 2344 | * Re-activate the hotkeys, but this time, we are using the | ||
| 2345 | * "Special Functions" mode. | ||
| 2346 | */ | ||
| 2347 | result = hci_write1(dev, HCI_HOTKEY_EVENT, | ||
| 2348 | HCI_HOTKEY_SPECIAL_FUNCTIONS); | ||
| 2349 | if (result != TOS_SUCCESS) | ||
| 2350 | pr_err("Could not enable the Special Function mode\n"); | ||
| 2351 | } | ||
| 2352 | |||
| 2338 | static bool toshiba_acpi_i8042_filter(unsigned char data, unsigned char str, | 2353 | static bool toshiba_acpi_i8042_filter(unsigned char data, unsigned char str, |
| 2339 | struct serio *port) | 2354 | struct serio *port) |
| 2340 | { | 2355 | { |
| @@ -2638,6 +2653,7 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) | |||
| 2638 | { | 2653 | { |
| 2639 | struct toshiba_acpi_dev *dev; | 2654 | struct toshiba_acpi_dev *dev; |
| 2640 | const char *hci_method; | 2655 | const char *hci_method; |
| 2656 | u32 special_functions; | ||
| 2641 | u32 dummy; | 2657 | u32 dummy; |
| 2642 | bool bt_present; | 2658 | bool bt_present; |
| 2643 | int ret = 0; | 2659 | int ret = 0; |
| @@ -2669,7 +2685,7 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) | |||
| 2669 | * with the new keyboard layout, query for its presence to help | 2685 | * with the new keyboard layout, query for its presence to help |
| 2670 | * determine the keymap layout to use. | 2686 | * determine the keymap layout to use. |
| 2671 | */ | 2687 | */ |
| 2672 | ret = toshiba_function_keys_get(dev, &dummy); | 2688 | ret = toshiba_function_keys_get(dev, &special_functions); |
| 2673 | dev->kbd_function_keys_supported = !ret; | 2689 | dev->kbd_function_keys_supported = !ret; |
| 2674 | 2690 | ||
| 2675 | if (toshiba_acpi_setup_keyboard(dev)) | 2691 | if (toshiba_acpi_setup_keyboard(dev)) |
| @@ -2761,6 +2777,13 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) | |||
| 2761 | ret = get_fan_status(dev, &dummy); | 2777 | ret = get_fan_status(dev, &dummy); |
| 2762 | dev->fan_supported = !ret; | 2778 | dev->fan_supported = !ret; |
| 2763 | 2779 | ||
| 2780 | /* | ||
| 2781 | * Enable the "Special Functions" mode only if they are | ||
| 2782 | * supported and if they are activated. | ||
| 2783 | */ | ||
| 2784 | if (dev->kbd_function_keys_supported && special_functions) | ||
| 2785 | toshiba_acpi_enable_special_functions(dev); | ||
| 2786 | |||
| 2764 | ret = sysfs_create_group(&dev->acpi_dev->dev.kobj, | 2787 | ret = sysfs_create_group(&dev->acpi_dev->dev.kobj, |
| 2765 | &toshiba_attr_group); | 2788 | &toshiba_attr_group); |
| 2766 | if (ret) { | 2789 | if (ret) { |
