[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220508125056.354001-1-jb@ip.fi>
Date: Sun, 8 May 2022 14:50:56 +0200
From: Johan Boger <jb@...fi>
To: jikos@...nel.org
Cc: benjamin.tissoires@...hat.com, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, Johan Boger <jb@...fi>
Subject: [PATCH] staging: drivers: hid: hid-asus.c: Fixed brace/formatting issues.
Fixed formatting issues based on recommendations from
scripts/checkpatch.pl, in accordance with coding style.
Signed-off-by: Johan Boger <jb@...fi>
---
drivers/hid/hid-asus.c | 172 +++++++++++++++++++++++++++++------------
1 file changed, 121 insertions(+), 51 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 08c9a9a60ae4..c76ca7416bac 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -339,7 +339,7 @@ static int asus_raw_event(struct hid_device *hdev,
/*
* Skip these report ID, the device emits a continuous stream associated
* with the AURA mode it is in which looks like an 'echo'.
- */
+ */
if (report->id == FEATURE_KBD_LED_REPORT_ID1 ||
report->id == FEATURE_KBD_LED_REPORT_ID2) {
return -1;
@@ -349,7 +349,7 @@ static int asus_raw_event(struct hid_device *hdev,
* G14 and G15 send these codes on some keypresses with no
* discernable reason for doing so. We'll filter them out to avoid
* unmapped warning messages later.
- */
+ */
if (data[1] == 0xea || data[1] == 0xec || data[1] == 0x02 ||
data[1] == 0x8a || data[1] == 0x9e) {
return -1;
@@ -359,10 +359,9 @@ static int asus_raw_event(struct hid_device *hdev,
/*
* G713 and G733 send these codes on some keypresses, depending on
* the key pressed it can trigger a shutdown event if not caught.
- */
- if(data[0] == 0x02 && data[1] == 0x30) {
+ */
+ if (data[0] == 0x02 && data[1] == 0x30)
return -1;
- }
}
}
@@ -371,11 +370,10 @@ static int asus_raw_event(struct hid_device *hdev,
/*
* CLAYMORE II keyboard sends this packet when it goes to sleep
* this causes the whole system to go into suspend.
- */
+ */
- if(size == 2 && data[0] == 0x02 && data[1] == 0x00) {
+ if (size == 2 && data[0] == 0x02 && data[1] == 0x00)
return -1;
- }
}
return 0;
@@ -393,7 +391,7 @@ static int asus_kbd_set_report(struct hid_device *hdev, u8 *buf, size_t buf_size
/*
* The report ID should be set from the incoming buffer due to LED and key
* interfaces having different pages
- */
+ */
ret = hid_hw_raw_request(hdev, buf[0], dmabuf,
buf_size, HID_FEATURE_REPORT,
HID_REQ_SET_REPORT);
@@ -852,47 +850,86 @@ static int asus_input_mapping(struct hid_device *hdev,
/* ASUS-specific keyboard hotkeys and led backlight */
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_ASUSVENDOR) {
switch (usage->hid & HID_USAGE) {
- case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN); break;
- case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP); break;
- case 0x35: asus_map_key_clear(KEY_DISPLAY_OFF); break;
- case 0x6c: asus_map_key_clear(KEY_SLEEP); break;
- case 0x7c: asus_map_key_clear(KEY_MICMUTE); break;
- case 0x82: asus_map_key_clear(KEY_CAMERA); break;
- case 0x88: asus_map_key_clear(KEY_RFKILL); break;
- case 0xb5: asus_map_key_clear(KEY_CALC); break;
- case 0xc4: asus_map_key_clear(KEY_KBDILLUMUP); break;
- case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN); break;
+ case 0x10:
+ asus_map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x20:
+ asus_map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ case 0x35:
+ asus_map_key_clear(KEY_DISPLAY_OFF);
+ break;
+ case 0x6c:
+ asus_map_key_clear(KEY_SLEEP);
+ break;
+ case 0x7c:
+ asus_map_key_clear(KEY_MICMUTE);
+ break;
+ case 0x82:
+ asus_map_key_clear(KEY_CAMERA);
+ break;
+ case 0x88:
+ asus_map_key_clear(KEY_RFKILL);
+ break;
+ case 0xb5:
+ asus_map_key_clear(KEY_CALC);
+ break;
+ case 0xc4:
+ asus_map_key_clear(KEY_KBDILLUMUP);
+ break;
+ case 0xc5:
+ asus_map_key_clear(KEY_KBDILLUMDOWN);
+ break;
/* ASUS touchpad toggle */
- case 0x6b: asus_map_key_clear(KEY_F21); break;
+ case 0x6b:
+ asus_map_key_clear(KEY_F21);
+ break;
/* ROG key */
- case 0x38: asus_map_key_clear(KEY_PROG1); break;
+ case 0x38:
+ asus_map_key_clear(KEY_PROG1);
+ break;
/* Fn+C ASUS Splendid */
- case 0xba: asus_map_key_clear(KEY_PROG2); break;
+ case 0xba:
+ asus_map_key_clear(KEY_PROG2);
+ break;
/* Fn+Space Power4Gear Hybrid */
- case 0x5c: asus_map_key_clear(KEY_PROG3); break;
+ case 0x5c:
+ asus_map_key_clear(KEY_PROG3);
+ break;
/* Fn+F5 "fan" symbol on FX503VD */
- case 0x99: asus_map_key_clear(KEY_PROG4); break;
+ case 0x99:
+ asus_map_key_clear(KEY_PROG4);
+ break;
/* Fn+F5 "fan" symbol on N-Key keyboard */
- case 0xae: asus_map_key_clear(KEY_PROG4); break;
+ case 0xae:
+ asus_map_key_clear(KEY_PROG4);
+ break;
/* Fn+Ret "Calc" symbol on N-Key keyboard */
- case 0x92: asus_map_key_clear(KEY_CALC); break;
+ case 0x92:
+ asus_map_key_clear(KEY_CALC);
+ break;
/* Fn+Left Aura mode previous on N-Key keyboard */
- case 0xb2: asus_map_key_clear(KEY_PROG2); break;
+ case 0xb2:
+ asus_map_key_clear(KEY_PROG2);
+ break;
/* Fn+Right Aura mode next on N-Key keyboard */
- case 0xb3: asus_map_key_clear(KEY_PROG3); break;
+ case 0xb3:
+ asus_map_key_clear(KEY_PROG3);
+ break;
default:
/* ASUS lazily declares 256 usages, ignore the rest,
- * as some make the keyboard appear as a pointer device. */
+ * as some make the keyboard appear as a pointer device.
+ */
return -1;
}
@@ -911,23 +948,57 @@ static int asus_input_mapping(struct hid_device *hdev,
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
switch (usage->hid & HID_USAGE) {
- case 0xff01: asus_map_key_clear(BTN_1); break;
- case 0xff02: asus_map_key_clear(BTN_2); break;
- case 0xff03: asus_map_key_clear(BTN_3); break;
- case 0xff04: asus_map_key_clear(BTN_4); break;
- case 0xff05: asus_map_key_clear(BTN_5); break;
- case 0xff06: asus_map_key_clear(BTN_6); break;
- case 0xff07: asus_map_key_clear(BTN_7); break;
- case 0xff08: asus_map_key_clear(BTN_8); break;
- case 0xff09: asus_map_key_clear(BTN_9); break;
- case 0xff0a: asus_map_key_clear(BTN_A); break;
- case 0xff0b: asus_map_key_clear(BTN_B); break;
- case 0x00f1: asus_map_key_clear(KEY_WLAN); break;
- case 0x00f2: asus_map_key_clear(KEY_BRIGHTNESSDOWN); break;
- case 0x00f3: asus_map_key_clear(KEY_BRIGHTNESSUP); break;
- case 0x00f4: asus_map_key_clear(KEY_DISPLAY_OFF); break;
- case 0x00f7: asus_map_key_clear(KEY_CAMERA); break;
- case 0x00f8: asus_map_key_clear(KEY_PROG1); break;
+ case 0xff01:
+ asus_map_key_clear(BTN_1);
+ break;
+ case 0xff02:
+ asus_map_key_clear(BTN_2);
+ break;
+ case 0xff03:
+ asus_map_key_clear(BTN_3);
+ break;
+ case 0xff04:
+ asus_map_key_clear(BTN_4);
+ break;
+ case 0xff05:
+ asus_map_key_clear(BTN_5);
+ break;
+ case 0xff06:
+ asus_map_key_clear(BTN_6);
+ break;
+ case 0xff07:
+ asus_map_key_clear(BTN_7);
+ break;
+ case 0xff08:
+ asus_map_key_clear(BTN_8);
+ break;
+ case 0xff09:
+ asus_map_key_clear(BTN_9);
+ break;
+ case 0xff0a:
+ asus_map_key_clear(BTN_A);
+ break;
+ case 0xff0b:
+ asus_map_key_clear(BTN_B);
+ break;
+ case 0x00f1:
+ asus_map_key_clear(KEY_WLAN);
+ break;
+ case 0x00f2:
+ asus_map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x00f3:
+ asus_map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ case 0x00f4:
+ asus_map_key_clear(KEY_DISPLAY_OFF);
+ break;
+ case 0x00f7:
+ asus_map_key_clear(KEY_CAMERA);
+ break;
+ case 0x00f8:
+ asus_map_key_clear(KEY_PROG1);
+ break;
default:
return 0;
}
@@ -1100,11 +1171,10 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_stop_hw;
}
- if (drvdata->tp) {
+ if (drvdata->tp)
drvdata->input->name = "Asus TouchPad";
- } else {
+ else
drvdata->input->name = "Asus Keyboard";
- }
if (drvdata->tp) {
ret = asus_start_multitouch(hdev);
@@ -1131,8 +1201,8 @@ static void asus_remove(struct hid_device *hdev)
}
static const __u8 asus_g752_fixed_rdesc[] = {
- 0x19, 0x00, /* Usage Minimum (0x00) */
- 0x2A, 0xFF, 0x00, /* Usage Maximum (0xFF) */
+ 0x19, 0x00, /* Usage Minimum (0x00) */
+ 0x2A, 0xFF, 0x00, /* Usage Maximum (0xFF) */
};
static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
--
2.30.2
Powered by blists - more mailing lists