summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-asus.c
diff options
context:
space:
mode:
authorBrendan McGrath <redmcg@redmandi.dyndns.org>2016-12-10 05:20:42 -0500
committerJiri Kosina <jkosina@suse.cz>2016-12-19 05:27:09 -0500
commitc8b1b3dd89ea7b3f77a73e59c4c4495e16338e15 (patch)
treec0c3a4c68fb3ae659406207712a576b10267eb71 /drivers/hid/hid-asus.c
parentf39fdf2ab846ecc636d6272b47f28a05a2052a14 (diff)
HID: asus: Fix keyboard support
The previous submission which added Touchpad support broke the Keyboard support of this driver. This patch: 1. fixes the Keyboard support (by assigning drvdata->input); 2. renames NOTEBOOK_QUIRKS to KEYBOARD_QUIRKS; 3. adds the NO_INIT_REPORT quirk to the KEYBOARD_QUIRKS; and 4. sets the input->name to 'Asus Keyboard' for the keyboard Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-asus.c')
-rw-r--r--drivers/hid/hid-asus.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index d40ed9fdf68d..70b12f89a193 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -64,7 +64,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
64#define QUIRK_SKIP_INPUT_MAPPING BIT(2) 64#define QUIRK_SKIP_INPUT_MAPPING BIT(2)
65#define QUIRK_IS_MULTITOUCH BIT(3) 65#define QUIRK_IS_MULTITOUCH BIT(3)
66 66
67#define NOTEBOOK_QUIRKS QUIRK_FIX_NOTEBOOK_REPORT 67#define KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
68 QUIRK_NO_INIT_REPORTS)
68#define TOUCHPAD_QUIRKS (QUIRK_NO_INIT_REPORTS | \ 69#define TOUCHPAD_QUIRKS (QUIRK_NO_INIT_REPORTS | \
69 QUIRK_SKIP_INPUT_MAPPING | \ 70 QUIRK_SKIP_INPUT_MAPPING | \
70 QUIRK_IS_MULTITOUCH) 71 QUIRK_IS_MULTITOUCH)
@@ -170,11 +171,11 @@ static int asus_raw_event(struct hid_device *hdev,
170 171
171static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) 172static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi)
172{ 173{
174 struct input_dev *input = hi->input;
173 struct asus_drvdata *drvdata = hid_get_drvdata(hdev); 175 struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
174 176
175 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { 177 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) {
176 int ret; 178 int ret;
177 struct input_dev *input = hi->input;
178 179
179 input_set_abs_params(input, ABS_MT_POSITION_X, 0, MAX_X, 0, 0); 180 input_set_abs_params(input, ABS_MT_POSITION_X, 0, MAX_X, 0, 0);
180 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, MAX_Y, 0, 0); 181 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, MAX_Y, 0, 0);
@@ -191,10 +192,10 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi)
191 hid_err(hdev, "Asus input mt init slots failed: %d\n", ret); 192 hid_err(hdev, "Asus input mt init slots failed: %d\n", ret);
192 return ret; 193 return ret;
193 } 194 }
194
195 drvdata->input = input;
196 } 195 }
197 196
197 drvdata->input = input;
198
198 return 0; 199 return 0;
199} 200}
200 201
@@ -286,7 +287,11 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
286 goto err_stop_hw; 287 goto err_stop_hw;
287 } 288 }
288 289
289 drvdata->input->name = "Asus TouchPad"; 290 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) {
291 drvdata->input->name = "Asus TouchPad";
292 } else {
293 drvdata->input->name = "Asus Keyboard";
294 }
290 295
291 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { 296 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) {
292 ret = asus_start_multitouch(hdev); 297 ret = asus_start_multitouch(hdev);
@@ -315,7 +320,7 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
315 320
316static const struct hid_device_id asus_devices[] = { 321static const struct hid_device_id asus_devices[] = {
317 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, 322 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
318 USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), NOTEBOOK_QUIRKS}, 323 USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), KEYBOARD_QUIRKS},
319 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, 324 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK,
320 USB_DEVICE_ID_ASUSTEK_TOUCHPAD), TOUCHPAD_QUIRKS }, 325 USB_DEVICE_ID_ASUSTEK_TOUCHPAD), TOUCHPAD_QUIRKS },
321 { } 326 { }