aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAzael Avalos <coproscefalo@gmail.com>2015-03-20 18:55:16 -0400
committerDarren Hart <dvhart@linux.intel.com>2015-03-25 13:58:24 -0400
commit56e6b353396187a6e79acdbe3934fcd796a15e2e (patch)
tree1bb395ebaff89095420ee08412553d369318e1ad
parentf62a4ffd43c8739aa4b0358710ace0a4e91d2071 (diff)
toshiba_acpi: Add Hotkey Event Type function and definitions
This patch adds support to query the "Hotkey Event Type" the system supports. There are two main event types (so far), 0x10 and 0x11, with the first being all those laptops that have the old keyboard layout, and the latter all those new laptops with the new keyboard layout. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r--drivers/platform/x86/toshiba_acpi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 5009d8539c50..2a63ad043c4b 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -116,6 +116,7 @@ MODULE_LICENSE("GPL");
116#define HCI_KBD_ILLUMINATION 0x0095 116#define HCI_KBD_ILLUMINATION 0x0095
117#define HCI_ECO_MODE 0x0097 117#define HCI_ECO_MODE 0x0097
118#define HCI_ACCELEROMETER2 0x00a6 118#define HCI_ACCELEROMETER2 0x00a6
119#define HCI_SYSTEM_INFO 0xc000
119#define SCI_PANEL_POWER_ON 0x010d 120#define SCI_PANEL_POWER_ON 0x010d
120#define SCI_ILLUMINATION 0x014e 121#define SCI_ILLUMINATION 0x014e
121#define SCI_USB_SLEEP_CHARGE 0x0150 122#define SCI_USB_SLEEP_CHARGE 0x0150
@@ -133,6 +134,8 @@ MODULE_LICENSE("GPL");
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)
135#define HCI_MISC_SHIFT 0x10 136#define HCI_MISC_SHIFT 0x10
137#define HCI_SYSTEM_TYPE1 0x10
138#define HCI_SYSTEM_TYPE2 0x11
136#define HCI_VIDEO_OUT_LCD 0x1 139#define HCI_VIDEO_OUT_LCD 0x1
137#define HCI_VIDEO_OUT_CRT 0x2 140#define HCI_VIDEO_OUT_CRT 0x2
138#define HCI_VIDEO_OUT_TV 0x4 141#define HCI_VIDEO_OUT_TV 0x4
@@ -1149,6 +1152,28 @@ static int toshiba_usb_three_set(struct toshiba_acpi_dev *dev, u32 state)
1149 return 0; 1152 return 0;
1150} 1153}
1151 1154
1155/* Hotkey Event type */
1156static int toshiba_hotkey_event_type_get(struct toshiba_acpi_dev *dev,
1157 u32 *type)
1158{
1159 u32 val1 = 0x03;
1160 u32 val2 = 0;
1161 u32 result;
1162
1163 result = hci_read2(dev, HCI_SYSTEM_INFO, &val1, &val2);
1164 if (result == TOS_FAILURE) {
1165 pr_err("ACPI call to get System type failed\n");
1166 return -EIO;
1167 } else if (result == TOS_NOT_SUPPORTED) {
1168 pr_info("System type not supported\n");
1169 return -ENODEV;
1170 }
1171
1172 *type = val2;
1173
1174 return 0;
1175}
1176
1152/* Bluetooth rfkill handlers */ 1177/* Bluetooth rfkill handlers */
1153 1178
1154static u32 hci_get_bt_present(struct toshiba_acpi_dev *dev, bool *present) 1179static u32 hci_get_bt_present(struct toshiba_acpi_dev *dev, bool *present)