* [HID Patchsets for Samsung driver v3 0/6]
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <CGME20240124161058epcas5p40b641fe9049630c2a9ce69cab17c40b9@epcas5p4.samsung.com>
Dear Kernel Team Members,
I hope this email finds you well.
As per the review comments given by Mr. Joe Perches in our last converstaion over mail.
We have incorporated the feedback on our driver. Please check this set of series and help us to improve the samsung driver.
As of today, Opensource kernel Samsung driver only supports USB HID devices and do not have support for Bluetooth HID devices.
Samsung would like to improve the samsung driver and extend it's support for bluetooth devices as well.
Summary of changes in Samsung driver:
1. Add support for below bluetooth devices
Samsung wireless Keyboard
Samsung wireless GamePad
Samsung Wireless Action Mouse
Samsung Wireless Book Cover
Samsung Wireless Universal Keyboard
Samsung Wireless HOGP Keyboard
2. Add support for Special key processing on each of the above devices.
Patch Series Overview:
--------------------------------------
[Patch 1/6]
HID Samsung : Broaden device compatibility in samsung driver.
hid_is_usb() check being moved.
[Patch 2/6]
HID: Samsung : Fix the checkpatch complain.
Warning found by checkpatch.pl script.
[Patch 3/6]
HID: Samsung : Add Samsung wireless keyboard support.
[Patch 4/6]
HID: Samsung : Add Samsung wireless gamepad support.
[Patch 5/6]
HID: Samsung : Add Samsung wireless action mouse support.
[Patch 6/6]
HID: Samsung : Add Samsung wireless bookcover and universal keyboard support.
All these changes have been verified and tested thoroughly in android devices.
Please accept our changes.
Thanks for your time and consideration.
Best regards
Sandeep C S
Sandeep C S (6):
HID Samsung : Broaden device compatibility in samsung driver.
HID: Samsung : Fix the checkpatch complain. Rewritten code using
memcmp where applicable.
HID: Samsung : Add Samsung wireless keyboard support.
HID: Samsung : Add Samsung wireless gamepad support.
HID: Samsung : Add Samsung wireless action mouse support.
HID: Samsung : Add Samsung wireless bookcover and universal keyboard
support.
drivers/hid/hid-ids.h | 7 +
drivers/hid/hid-samsung.c | 459 +++++++++++++++++++++++++++++++++++---
2 files changed, 430 insertions(+), 36 deletions(-)
--
2.34.1
^ permalink raw reply
* [HID Patchsets for Samsung driver v3 1/6] HID Samsung : Broaden device compatibility in samsung driver.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
The USB validation check has been moved wherever its required.
Earlier Samsung driver only handles USB HID devices and returns an error if it encounters a Bluetooth type of HID device.
This changes improves driver compatibility and extends its support for a wide range of devices.
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
---
drivers/hid/hid-samsung.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index cf5992e97094..3a8756232731 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -128,7 +128,7 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
- if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product)
+ if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product && hid_is_usb(hdev))
rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize);
return rdesc;
}
@@ -139,7 +139,7 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
{
int ret = 0;
- if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product)
+ if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product && hid_is_usb(hdev))
ret = samsung_kbd_mouse_input_mapping(hdev,
hi, field, usage, bit, max);
@@ -152,9 +152,6 @@ static int samsung_probe(struct hid_device *hdev,
int ret;
unsigned int cmask = HID_CONNECT_DEFAULT;
- if (!hid_is_usb(hdev))
- return -EINVAL;
-
ret = hid_parse(hdev);
if (ret) {
hid_err(hdev, "parse failed\n");
@@ -162,6 +159,10 @@ static int samsung_probe(struct hid_device *hdev,
}
if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) {
+ if (!hid_is_usb(hdev)) {
+ ret = -EINVAL;
+ goto err_free;
+ }
if (hdev->rsize == 184) {
/* disable hidinput, force hiddev */
cmask = (cmask & ~HID_CONNECT_HIDINPUT) |
--
2.34.1
^ permalink raw reply related
* [HID Patchsets for Samsung driver v3 2/6] HID: Samsung : Fix the checkpatch complain. Rewritten code using memcmp where applicable.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
Resolved warnings found by checkpatch.pl script.
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
---
drivers/hid/hid-samsung.c | 80 +++++++++++++++++++++++----------------
1 file changed, 47 insertions(+), 33 deletions(-)
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index 3a8756232731..97d0bf7d4d7e 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -58,33 +58,25 @@ static inline void samsung_irda_dev_trace(struct hid_device *hdev,
static __u8 *samsung_irda_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
- if (*rsize == 184 && rdesc[175] == 0x25 && rdesc[176] == 0x40 &&
- rdesc[177] == 0x75 && rdesc[178] == 0x30 &&
- rdesc[179] == 0x95 && rdesc[180] == 0x01 &&
+ if (*rsize == 184 && !memcmp(&rdesc[175], "\x25\x40\x75\x30\x95\x01", 6) &&
rdesc[182] == 0x40) {
samsung_irda_dev_trace(hdev, 184);
rdesc[176] = 0xff;
rdesc[178] = 0x08;
rdesc[180] = 0x06;
rdesc[182] = 0x42;
- } else
- if (*rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 &&
- rdesc[194] == 0x25 && rdesc[195] == 0x12) {
+ } else if (*rsize == 203 && !memcmp(&rdesc[192], "\x15\x00\x25\x12", 4)) {
samsung_irda_dev_trace(hdev, 203);
- rdesc[193] = 0x1;
- rdesc[195] = 0xf;
- } else
- if (*rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 &&
- rdesc[126] == 0x25 && rdesc[127] == 0x11) {
+ rdesc[193] = 0x01;
+ rdesc[195] = 0x0f;
+ } else if (*rsize == 135 && !memcmp(&rdesc[124], "\x15\x00\x25\x11", 4)) {
samsung_irda_dev_trace(hdev, 135);
- rdesc[125] = 0x1;
- rdesc[127] = 0xe;
- } else
- if (*rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 &&
- rdesc[162] == 0x25 && rdesc[163] == 0x01) {
+ rdesc[125] = 0x01;
+ rdesc[127] = 0x0e;
+ } else if (*rsize == 171 && !memcmp(&rdesc[160], "\x15\x00\x25\x01", 4)) {
samsung_irda_dev_trace(hdev, 171);
- rdesc[161] = 0x1;
- rdesc[163] = 0x3;
+ rdesc[161] = 0x01;
+ rdesc[163] = 0x03;
}
return rdesc;
}
@@ -99,7 +91,7 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
unsigned short ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
- if (1 != ifnum || HID_UP_CONSUMER != (usage->hid & HID_USAGE_PAGE))
+ if (ifnum != 1 || HID_UP_CONSUMER != (usage->hid & HID_USAGE_PAGE))
return 0;
dbg_hid("samsung wireless keyboard/mouse input mapping event [0x%x]\n",
@@ -107,17 +99,39 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
switch (usage->hid & HID_USAGE) {
/* report 2 */
- case 0x183: samsung_kbd_mouse_map_key_clear(KEY_MEDIA); break;
- case 0x195: samsung_kbd_mouse_map_key_clear(KEY_EMAIL); break;
- case 0x196: samsung_kbd_mouse_map_key_clear(KEY_CALC); break;
- case 0x197: samsung_kbd_mouse_map_key_clear(KEY_COMPUTER); break;
- case 0x22b: samsung_kbd_mouse_map_key_clear(KEY_SEARCH); break;
- case 0x22c: samsung_kbd_mouse_map_key_clear(KEY_WWW); break;
- case 0x22d: samsung_kbd_mouse_map_key_clear(KEY_BACK); break;
- case 0x22e: samsung_kbd_mouse_map_key_clear(KEY_FORWARD); break;
- case 0x22f: samsung_kbd_mouse_map_key_clear(KEY_FAVORITES); break;
- case 0x230: samsung_kbd_mouse_map_key_clear(KEY_REFRESH); break;
- case 0x231: samsung_kbd_mouse_map_key_clear(KEY_STOP); break;
+ case 0x183:
+ samsung_kbd_mouse_map_key_clear(KEY_MEDIA);
+ break;
+ case 0x195:
+ samsung_kbd_mouse_map_key_clear(KEY_EMAIL);
+ break;
+ case 0x196:
+ samsung_kbd_mouse_map_key_clear(KEY_CALC);
+ break;
+ case 0x197:
+ samsung_kbd_mouse_map_key_clear(KEY_COMPUTER);
+ break;
+ case 0x22b:
+ samsung_kbd_mouse_map_key_clear(KEY_SEARCH);
+ break;
+ case 0x22c:
+ samsung_kbd_mouse_map_key_clear(KEY_WWW);
+ break;
+ case 0x22d:
+ samsung_kbd_mouse_map_key_clear(KEY_BACK);
+ break;
+ case 0x22e:
+ samsung_kbd_mouse_map_key_clear(KEY_FORWARD);
+ break;
+ case 0x22f:
+ samsung_kbd_mouse_map_key_clear(KEY_FAVORITES);
+ break;
+ case 0x230:
+ samsung_kbd_mouse_map_key_clear(KEY_REFRESH);
+ break;
+ case 0x231:
+ samsung_kbd_mouse_map_key_clear(KEY_STOP);
+ break;
default:
return 0;
}
@@ -128,7 +142,7 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
- if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product && hid_is_usb(hdev))
+ if (hdev->product == USB_DEVICE_ID_SAMSUNG_IR_REMOTE && hid_is_usb(hdev))
rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize);
return rdesc;
}
@@ -139,7 +153,7 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
{
int ret = 0;
- if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product && hid_is_usb(hdev))
+ if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE && hid_is_usb(hdev))
ret = samsung_kbd_mouse_input_mapping(hdev,
hi, field, usage, bit, max);
@@ -158,7 +172,7 @@ static int samsung_probe(struct hid_device *hdev,
goto err_free;
}
- if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) {
+ if (hdev->product == USB_DEVICE_ID_SAMSUNG_IR_REMOTE) {
if (!hid_is_usb(hdev)) {
ret = -EINVAL;
goto err_free;
--
2.34.1
^ permalink raw reply related
* [HID Patchsets for Samsung driver v3 3/6] HID: Samsung : Add Samsung wireless keyboard support.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
Add Support for samsung wireless keyboard with input mapping events.
Device 7021 (Samsung wireless keyboard)
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
---
drivers/hid/hid-ids.h | 2 +
drivers/hid/hid-samsung.c | 108 ++++++++++++++++++++++++++++++++++++++
2 files changed, 110 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index fb30e228d35f..c4a2490a6496 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1143,8 +1143,10 @@
#define USB_DEVICE_ID_SAITEK_X65 0x0b6a
#define USB_VENDOR_ID_SAMSUNG 0x0419
+#define USB_VENDOR_ID_SAMSUNG_ELECTRONICS 0x04e8
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021
#define USB_VENDOR_ID_SEMICO 0x1a2c
#define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index 97d0bf7d4d7e..cec532be987a 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -139,6 +139,110 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
return 1;
}
+static int samsung_kbd_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ if (!(HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE) ||
+ HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)))
+ return 0;
+
+ dbg_hid("samsung wireless keyboard input mapping event [0x%x]\n",
+ usage->hid & HID_USAGE);
+
+ if (HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)) {
+ set_bit(EV_REP, hi->input->evbit);
+ switch (usage->hid & HID_USAGE) {
+ /* Only for UK keyboard */
+ /* key found */
+#ifdef CONFIG_HID_KK_UPGRADE
+ case 0x32:
+ samsung_kbd_mouse_map_key_clear(KEY_KBDILLUMTOGGLE);
+ break;
+ case 0x64:
+ samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH);
+ break;
+#else
+ case 0x32:
+ samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH);
+ break;
+ case 0x64:
+ samsung_kbd_mouse_map_key_clear(KEY_102ND);
+ break;
+#endif
+ /* Only for BR keyboard */
+ case 0x87:
+ samsung_kbd_mouse_map_key_clear(KEY_RO);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ if (HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)) {
+ switch (usage->hid & HID_USAGE) {
+ /* report 2 */
+ /* MENU */
+ case 0x040:
+ samsung_kbd_mouse_map_key_clear(KEY_MENU);
+ break;
+ case 0x18a:
+ samsung_kbd_mouse_map_key_clear(KEY_MAIL);
+ break;
+ case 0x196:
+ samsung_kbd_mouse_map_key_clear(KEY_WWW);
+ break;
+ case 0x19e:
+ samsung_kbd_mouse_map_key_clear(KEY_SCREENLOCK);
+ break;
+ case 0x221:
+ samsung_kbd_mouse_map_key_clear(KEY_SEARCH);
+ break;
+ case 0x223:
+ samsung_kbd_mouse_map_key_clear(KEY_HOMEPAGE);
+ break;
+ /* Smtart Voice Key */
+ case 0x300:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY13);
+ break;
+ /* RECENTAPPS */
+ case 0x301:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY1);
+ break;
+ /* APPLICATION */
+ case 0x302:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY2);
+ break;
+ /* Voice search */
+ case 0x305:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY4);
+ break;
+ /* QPANEL on/off */
+ case 0x306:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY5);
+ break;
+ /* SIP on/off */
+ case 0x307:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY3);
+ break;
+ /* LANG */
+ case 0x308:
+ samsung_kbd_mouse_map_key_clear(KEY_LANGUAGE);
+ break;
+ case 0x30a:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x30b:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
@@ -156,6 +260,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE && hid_is_usb(hdev))
ret = samsung_kbd_mouse_input_mapping(hdev,
hi, field, usage, bit, max);
+ else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD)
+ ret = samsung_kbd_input_mapping(hdev,
+ hi, field, usage, bit, max);
return ret;
}
@@ -198,6 +305,7 @@ static int samsung_probe(struct hid_device *hdev,
static const struct hid_device_id samsung_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) },
{ }
};
MODULE_DEVICE_TABLE(hid, samsung_devices);
--
2.34.1
^ permalink raw reply related
* [HID Patchsets for Samsung driver v3 4/6] HID: Samsung : Add Samsung wireless gamepad support.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
Add support for samsung wireless gamepad with input mapping events.
Device a000 (Samsung wireless gamepad)
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
---
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-samsung.c | 95 +++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index c4a2490a6496..621853b21923 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1147,6 +1147,7 @@
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000
#define USB_VENDOR_ID_SEMICO 0x1a2c
#define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index cec532be987a..b786888ec077 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -243,6 +243,97 @@ static int samsung_kbd_input_mapping(struct hid_device *hdev,
return 1;
}
+static int samsung_gamepad_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ if (!(HID_UP_BUTTON == (usage->hid & HID_USAGE_PAGE) ||
+ HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)))
+ return 0;
+
+ dbg_hid("samsung wireless gamepad input mapping event [0x%x], %ld, %ld, [0x%x]\n",
+ usage->hid & HID_USAGE, hi->input->evbit[0], hi->input->absbit[0], usage->hid & HID_USAGE_PAGE);
+
+ if (HID_UP_BUTTON == (usage->hid & HID_USAGE_PAGE)) {
+ switch (usage->hid & HID_USAGE) {
+ case 0x01:
+ samsung_kbd_mouse_map_key_clear(BTN_A);
+ break;
+ case 0x02:
+ samsung_kbd_mouse_map_key_clear(BTN_B);
+ break;
+ case 0x03:
+ samsung_kbd_mouse_map_key_clear(BTN_C);
+ break;
+ case 0x04:
+ samsung_kbd_mouse_map_key_clear(BTN_X);
+ break;
+ case 0x05:
+ samsung_kbd_mouse_map_key_clear(BTN_Y);
+ break;
+ case 0x06:
+ samsung_kbd_mouse_map_key_clear(BTN_Z);
+ break;
+ case 0x07:
+ samsung_kbd_mouse_map_key_clear(BTN_TL);
+ break;
+ case 0x08:
+ samsung_kbd_mouse_map_key_clear(BTN_TR);
+ break;
+ case 0x09:
+ samsung_kbd_mouse_map_key_clear(BTN_TL2);
+ break;
+ case 0x0a:
+ samsung_kbd_mouse_map_key_clear(BTN_TR2);
+ break;
+ case 0x0b:
+ samsung_kbd_mouse_map_key_clear(BTN_SELECT);
+ break;
+ case 0x0c:
+ samsung_kbd_mouse_map_key_clear(BTN_START);
+ break;
+ case 0x0d:
+ samsung_kbd_mouse_map_key_clear(BTN_MODE);
+ break;
+ case 0x0e:
+ samsung_kbd_mouse_map_key_clear(BTN_THUMBL);
+ break;
+ case 0x0f:
+ samsung_kbd_mouse_map_key_clear(BTN_THUMBR);
+ break;
+ case 0x10:
+ samsung_kbd_mouse_map_key_clear(0x13f);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ if (HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)) {
+ switch (usage->hid & HID_USAGE) {
+ case 0x040:
+ samsung_kbd_mouse_map_key_clear(KEY_MENU);
+ break;
+ case 0x223:
+ samsung_kbd_mouse_map_key_clear(KEY_HOMEPAGE);
+ break;
+ case 0x224:
+ samsung_kbd_mouse_map_key_clear(KEY_BACK);
+ break;
+
+ /* Screen Capture */
+ case 0x303:
+ samsung_kbd_mouse_map_key_clear(KEY_SYSRQ);
+ break;
+
+ default:
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
@@ -263,6 +354,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD)
ret = samsung_kbd_input_mapping(hdev,
hi, field, usage, bit, max);
+ else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD)
+ ret = samsung_gamepad_input_mapping(hdev,
+ hi, field, usage, bit, max);
return ret;
}
@@ -306,6 +400,7 @@ static const struct hid_device_id samsung_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) },
{ }
};
MODULE_DEVICE_TABLE(hid, samsung_devices);
--
2.34.1
^ permalink raw reply related
* [HID Patchsets for Samsung driver v3 5/6] HID: Samsung : Add Samsung wireless action mouse support.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
Add support for samsung wireless action mouse with input mapping events.
Device a004 (Samsung wireless action mouse)
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
---
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-samsung.c | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 621853b21923..43a990086225 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1148,6 +1148,7 @@
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE 0xa004
#define USB_VENDOR_ID_SEMICO 0x1a2c
#define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index b786888ec077..df0de72062b7 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -334,6 +334,29 @@ static int samsung_gamepad_input_mapping(struct hid_device *hdev,
return 1;
}
+static int samsung_actionmouse_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+
+ dbg_hid("samsung wireless actionmouse input mapping event [0x%x], [0x%x], %ld, %ld, [0x%x]\n",
+ usage->hid, usage->hid & HID_USAGE, hi->input->evbit[0], hi->input->absbit[0],
+ usage->hid & HID_USAGE_PAGE);
+
+ if (((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) && ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON))
+ return 0;
+
+ switch (usage->hid & HID_USAGE) {
+ case 0x301:
+ samsung_kbd_mouse_map_key_clear(254);
+ break;
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
@@ -357,6 +380,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD)
ret = samsung_gamepad_input_mapping(hdev,
hi, field, usage, bit, max);
+ else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE)
+ ret = samsung_actionmouse_input_mapping(hdev,
+ hi, field, usage, bit, max);
return ret;
}
@@ -401,6 +427,7 @@ static const struct hid_device_id samsung_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE) },
{ }
};
MODULE_DEVICE_TABLE(hid, samsung_devices);
--
2.34.1
^ permalink raw reply related
* [HID Patchsets for Samsung driver v3 6/6] HID: Samsung : Add Samsung wireless bookcover and universal keyboard support.
From: Sandeep C S @ 2024-01-24 16:10 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com>
Add support for samsung wireless bookcover and universal keyboard with input mapping events.
Device a005 (Samsung wireless bookcover keyboard)
Device a006 (Samsung wireless universal keyboard)
Device a064 (Samsung wireless multi hogp keyboard)
Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
Signed-off-by: Gwangho Lee <gaudium.lee@samsung.com>
---
drivers/hid/hid-ids.h | 3 +
drivers/hid/hid-samsung.c | 142 ++++++++++++++++++++++++++++++++++++++
2 files changed, 145 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 43a990086225..e44a48b852fd 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1149,6 +1149,9 @@
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE 0xa004
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_BOOKCOVER 0xa005
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_UNIVERSAL_KBD 0xa006
+#define USB_DEVICE_ID_SAMSUNG_WIRELESS_MULTI_HOGP_KBD 0xa064
#define USB_VENDOR_ID_SEMICO 0x1a2c
#define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index df0de72062b7..845768397036 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -357,6 +357,140 @@ static int samsung_actionmouse_input_mapping(struct hid_device *hdev,
return 1;
}
+static int samsung_universal_kbd_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ if (!(HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE) ||
+ HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)))
+ return 0;
+
+ dbg_hid("samsung wireless keyboard input mapping event [0x%x]\n",
+ usage->hid & HID_USAGE);
+
+ if (HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)) {
+ set_bit(EV_REP, hi->input->evbit);
+ switch (usage->hid & HID_USAGE) {
+ /* Only for UK keyboard */
+ /* key found */
+#ifdef CONFIG_HID_KK_UPGRADE
+ case 0x32:
+ samsung_kbd_mouse_map_key_clear(KEY_KBDILLUMTOGGLE);
+ break;
+ case 0x64:
+ samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH);
+ break;
+#else
+ case 0x32:
+ samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH);
+ break;
+ case 0x64:
+ samsung_kbd_mouse_map_key_clear(KEY_102ND);
+ break;
+#endif
+ /* Only for BR keyboard */
+ case 0x87:
+ samsung_kbd_mouse_map_key_clear(KEY_RO);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ if (HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)) {
+ switch (usage->hid & HID_USAGE) {
+ /* report 2 */
+ /* MENU */
+ case 0x040:
+ samsung_kbd_mouse_map_key_clear(KEY_MENU);
+ break;
+ case 0x18a:
+ samsung_kbd_mouse_map_key_clear(KEY_MAIL);
+ break;
+ case 0x196:
+ samsung_kbd_mouse_map_key_clear(KEY_WWW);
+ break;
+ case 0x19e:
+ samsung_kbd_mouse_map_key_clear(KEY_SCREENLOCK);
+ break;
+ case 0x221:
+ samsung_kbd_mouse_map_key_clear(KEY_SEARCH);
+ break;
+ case 0x223:
+ samsung_kbd_mouse_map_key_clear(KEY_HOMEPAGE);
+ break;
+ /* RECENTAPPS */
+ case 0x301:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY1);
+ break;
+ /* APPLICATION */
+ case 0x302:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY2);
+ break;
+ /* Voice search */
+ case 0x305:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY4);
+ break;
+ /* QPANEL on/off */
+ case 0x306:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY5);
+ break;
+ /* SIP on/off */
+ case 0x307:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY3);
+ break;
+ /* LANG */
+ case 0x308:
+ samsung_kbd_mouse_map_key_clear(KEY_LANGUAGE);
+ break;
+ case 0x30a:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x070:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSDOWN);
+ break;
+ case 0x30b:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ case 0x06f:
+ samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSUP);
+ break;
+ /* S-Finder */
+ case 0x304:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY7);
+ break;
+ /* Screen Capture */
+ case 0x303:
+ samsung_kbd_mouse_map_key_clear(KEY_SYSRQ);
+ break;
+ /* Multi Window */
+ case 0x309:
+ samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY9);
+ break;
+ /* HotKey App 1 */
+ case 0x071:
+ samsung_kbd_mouse_map_key_clear(0x2f5);
+ break;
+ /* HotKey App 2 */
+ case 0x072:
+ samsung_kbd_mouse_map_key_clear(0x2f6);
+ break;
+ /* HotKey App 3 */
+ case 0x073:
+ samsung_kbd_mouse_map_key_clear(0x2f7);
+ break;
+ /* Dex */
+ case 0x06e:
+ samsung_kbd_mouse_map_key_clear(0x2bd);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
@@ -383,6 +517,12 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE)
ret = samsung_actionmouse_input_mapping(hdev,
hi, field, usage, bit, max);
+ else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_UNIVERSAL_KBD)
+ ret = samsung_universal_kbd_input_mapping(hdev,
+ hi, field, usage, bit, max);
+ else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_MULTI_HOGP_KBD)
+ ret = samsung_universal_kbd_input_mapping(hdev,
+ hi, field, usage, bit, max);
return ret;
}
@@ -428,6 +568,8 @@ static const struct hid_device_id samsung_devices[] = {
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_UNIVERSAL_KBD) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_MULTI_HOGP_KBD) },
{ }
};
MODULE_DEVICE_TABLE(hid, samsung_devices);
--
2.34.1
^ permalink raw reply related
* Re: [PATCH] Input: cap11xx - stop using chip ID when configuring it
From: Jiri Valek - 2N @ 2024-01-24 16:57 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
In-Reply-To: <ZalnEZ83M0jlQI2s@google.com>
On 1/18/24 18:59, Dmitry Torokhov wrote:
> On Tue, Dec 12, 2023 at 09:33:58PM -0800, Dmitry Torokhov wrote:
>> struct cap11xx_hw_model is supposed to describe the chip capabilities,
>> however later code changes introduced checks against chip ID.
>>
>> Introduce new capabilities in cap11xx_hw_model and use them when applying
>> chip configuration, and remove the enum for chip ID. While at it, rename
>> no_gain to has_gain to match the rest of the new capabilities.
>
> Jiri, if you could give this a spin on your device that would be great.
>
> Thanks!
>
Hi Dmitry,
thanks for changes. Looks good to me.
I verified the functionality on real HW with CAP1293.
Reviewed-by: Jiri Valek - 2N <jiriv@axis.com>
^ permalink raw reply
* Re: [PATCH v2 00/33] spi: get rid of some legacy macros
From: Greg Kroah-Hartman @ 2024-01-24 17:13 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, kernel, Moritz Fischer, Wu Hao, Xu Yilun, Tom Rix,
linux-fpga, linux-kernel, Alexander Aring, Stefan Schmidt,
Miquel Raynal, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-wpan, netdev, Lars-Peter Clausen,
Michael Hennerich, Jonathan Cameron, linux-iio, Dmitry Torokhov,
linux-input, Ulf Hansson, Rayyan Ansari, Andy Shevchenko,
Jonathan Cameron, Martin Tuma, Mauro Carvalho Chehab, linux-media,
Sergey Kozlov, Arnd Bergmann, Yang Yingliang, linux-mmc,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Heiko Stuebner, Michal Simek, Amit Kumar Mahapatra via Alsa-devel,
linux-mtd, Martin Blumenstingl, Geert Uytterhoeven,
Pali Rohár, Simon Horman, Ronald Wahl, Benson Leung,
Tzung-Bi Shih, Guenter Roeck, chrome-platform, Max Filippov,
linux-spi, linux-arm-kernel, Bjorn Andersson, Konrad Dybcio,
linux-arm-msm, Matthias Brugger, AngeloGioacchino Del Regno,
linux-mediatek, Thomas Zimmermann, Javier Martinez Canillas,
Amit Kumar Mahapatra, dri-devel, linux-fbdev, linux-staging,
Viresh Kumar, Rui Miguel Silva, Johan Hovold, Alex Elder,
greybus-dev, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe,
linux-integrity, Herve Codina, Alan Stern, Aaro Koskinen,
Krzysztof Kozlowski, linux-usb, Helge Deller, Dario Binacchi,
Kalle Valo, Dmitry Antipov, libertas-dev, linux-wireless,
Jonathan Corbet, James Clark, Bjorn Helgaas, linux-doc
In-Reply-To: <cover.1705944943.git.u.kleine-koenig@pengutronix.de>
On Mon, Jan 22, 2024 at 07:06:55PM +0100, Uwe Kleine-König wrote:
> Hello,
>
> this is v2 of this patch set.
>
> Changes since (implicit) v1, sent with Message-Id:
> cover.1705348269.git.u.kleine-koenig@pengutronix.de:
>
> - Rebase to v6.8-rc1
> - Fix a build failure on sh
> - Added the tags received in (implicit) v1.
>
> The slave-mt27xx driver needs some more work. The patch presented here
> is enough however to get rid of the defines handled in patch 32.
> Cleaning that up is out-of-scope for this series, so I'll delay that
> until later.
>
> Note that Jonathan Cameron has already applied patch 3 to his tree, it
> didn't appear in a public tree though yet. I still included it here to
> make the kernel build bots happy.
Are we supposed to take the individual changes in our different
subsystem trees, or do you want them all to go through the spi tree?
Either is fine with me, just need to know.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH v2 00/33] spi: get rid of some legacy macros
From: Mark Brown @ 2024-01-24 17:22 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Uwe Kleine-König, kernel, Moritz Fischer, Wu Hao, Xu Yilun,
Tom Rix, linux-fpga, linux-kernel, Alexander Aring,
Stefan Schmidt, Miquel Raynal, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
linux-iio, Dmitry Torokhov, linux-input, Ulf Hansson,
Rayyan Ansari, Andy Shevchenko, Jonathan Cameron, Martin Tuma,
Mauro Carvalho Chehab, linux-media, Sergey Kozlov, Arnd Bergmann,
Yang Yingliang, linux-mmc, Richard Weinberger,
Vignesh Raghavendra, Rob Herring, Heiko Stuebner, Michal Simek,
Amit Kumar Mahapatra via Alsa-devel, linux-mtd,
Martin Blumenstingl, Geert Uytterhoeven, Pali Rohár,
Simon Horman, Ronald Wahl, Benson Leung, Tzung-Bi Shih,
Guenter Roeck, chrome-platform, Max Filippov, linux-spi,
linux-arm-kernel, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
Thomas Zimmermann, Javier Martinez Canillas, Amit Kumar Mahapatra,
dri-devel, linux-fbdev, linux-staging, Viresh Kumar,
Rui Miguel Silva, Johan Hovold, Alex Elder, greybus-dev,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
Herve Codina, Alan Stern, Aaro Koskinen, Krzysztof Kozlowski,
linux-usb, Helge Deller, Dario Binacchi, Kalle Valo,
Dmitry Antipov, libertas-dev, linux-wireless, Jonathan Corbet,
James Clark, Bjorn Helgaas, linux-doc
In-Reply-To: <2024012417-prissy-sworn-bc55@gregkh>
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
On Wed, Jan 24, 2024 at 09:13:49AM -0800, Greg Kroah-Hartman wrote:
> On Mon, Jan 22, 2024 at 07:06:55PM +0100, Uwe Kleine-König wrote:
> > Note that Jonathan Cameron has already applied patch 3 to his tree, it
> > didn't appear in a public tree though yet. I still included it here to
> > make the kernel build bots happy.
> Are we supposed to take the individual changes in our different
> subsystem trees, or do you want them all to go through the spi tree?
Given that the final patch removes the legacy interfaces I'm expecting
to take them via SPI.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH v2 00/33] spi: get rid of some legacy macros
From: Greg Kroah-Hartman @ 2024-01-24 17:30 UTC (permalink / raw)
To: Mark Brown
Cc: Uwe Kleine-König, kernel, Moritz Fischer, Wu Hao, Xu Yilun,
Tom Rix, linux-fpga, linux-kernel, Alexander Aring,
Stefan Schmidt, Miquel Raynal, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
linux-iio, Dmitry Torokhov, linux-input, Ulf Hansson,
Rayyan Ansari, Andy Shevchenko, Jonathan Cameron, Martin Tuma,
Mauro Carvalho Chehab, linux-media, Sergey Kozlov, Arnd Bergmann,
Yang Yingliang, linux-mmc, Richard Weinberger,
Vignesh Raghavendra, Rob Herring, Heiko Stuebner, Michal Simek,
Amit Kumar Mahapatra via Alsa-devel, linux-mtd,
Martin Blumenstingl, Geert Uytterhoeven, Pali Rohár,
Simon Horman, Ronald Wahl, Benson Leung, Tzung-Bi Shih,
Guenter Roeck, chrome-platform, Max Filippov, linux-spi,
linux-arm-kernel, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
Thomas Zimmermann, Javier Martinez Canillas, Amit Kumar Mahapatra,
dri-devel, linux-fbdev, linux-staging, Viresh Kumar,
Rui Miguel Silva, Johan Hovold, Alex Elder, greybus-dev,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
Herve Codina, Alan Stern, Aaro Koskinen, Krzysztof Kozlowski,
linux-usb, Helge Deller, Dario Binacchi, Kalle Valo,
Dmitry Antipov, libertas-dev, linux-wireless, Jonathan Corbet,
James Clark, Bjorn Helgaas, linux-doc
In-Reply-To: <c1e38a30-5075-4d01-af24-ac684e77cf29@sirena.org.uk>
On Wed, Jan 24, 2024 at 05:22:00PM +0000, Mark Brown wrote:
> On Wed, Jan 24, 2024 at 09:13:49AM -0800, Greg Kroah-Hartman wrote:
> > On Mon, Jan 22, 2024 at 07:06:55PM +0100, Uwe Kleine-König wrote:
>
> > > Note that Jonathan Cameron has already applied patch 3 to his tree, it
> > > didn't appear in a public tree though yet. I still included it here to
> > > make the kernel build bots happy.
>
> > Are we supposed to take the individual changes in our different
> > subsystem trees, or do you want them all to go through the spi tree?
>
> Given that the final patch removes the legacy interfaces I'm expecting
> to take them via SPI.
Great, thanks, I'll go ack the subsystem patches that are relevent for
me.
greg k-h
^ permalink raw reply
* Re: [HID Patchsets for Samsung driver v3 3/6] HID: Samsung : Add Samsung wireless keyboard support.
From: Jiri Kosina @ 2024-01-24 18:19 UTC (permalink / raw)
To: Sandeep C S
Cc: Benjamin Tissoires, gaudium.lee, ih0923.kim, suhyun_.kim,
jitender.s21, junwan.cho, linux-input, linux-kernel
In-Reply-To: <20240124161029.3756075-4-sandeep.cs@samsung.com>
On Wed, 24 Jan 2024, Sandeep C S wrote:
> Add Support for samsung wireless keyboard with input mapping events.
>
> Device 7021 (Samsung wireless keyboard)
>
> Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
> Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
> Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
> ---
> drivers/hid/hid-ids.h | 2 +
> drivers/hid/hid-samsung.c | 108 ++++++++++++++++++++++++++++++++++++++
> 2 files changed, 110 insertions(+)
[ ... snip ... ]
> +#ifdef CONFIG_HID_KK_UPGRADE
Where is CONFIG_HID_KK_UPGRADE coming from, please? This is the first time
I am seeing it, and it's definitely not being introduced by your patchset.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v2 00/33] spi: get rid of some legacy macros
From: Jonathan Cameron @ 2024-01-24 20:02 UTC (permalink / raw)
To: Mark Brown, linux-spi
Cc: Uwe Kleine-König, kernel, Moritz Fischer, Wu Hao, Xu Yilun,
Tom Rix, linux-fpga, linux-kernel, Alexander Aring,
Stefan Schmidt, Miquel Raynal, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
Lars-Peter Clausen, Michael Hennerich, linux-iio, Dmitry Torokhov,
linux-input, Ulf Hansson, Rayyan Ansari, Andy Shevchenko,
Jonathan Cameron, Martin Tuma, Mauro Carvalho Chehab, linux-media,
Sergey Kozlov, Arnd Bergmann, Greg Kroah-Hartman, Yang Yingliang,
linux-mmc, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Heiko Stuebner, Michal Simek, Amit Kumar Mahapatra via Alsa-devel,
linux-mtd, Martin Blumenstingl, Geert Uytterhoeven,
Pali Rohár, Simon Horman, Ronald Wahl, Benson Leung,
Tzung-Bi Shih, Guenter Roeck, chrome-platform, Max Filippov,
linux-arm-kernel, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
Thomas Zimmermann, Javier Martinez Canillas, Amit Kumar Mahapatra,
dri-devel, linux-fbdev, linux-staging, Viresh Kumar,
Rui Miguel Silva, Johan Hovold, Alex Elder, greybus-dev,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
Herve Codina, Alan Stern, Aaro Koskinen, Krzysztof Kozlowski,
linux-usb, Helge Deller, Dario Binacchi, Kalle Valo,
Dmitry Antipov, libertas-dev, linux-wireless, Jonathan Corbet,
James Clark, Bjorn Helgaas, linux-doc
In-Reply-To: <20240122192343.148a0b6d@jic23-huawei>
On Mon, 22 Jan 2024 19:23:43 +0000
Jonathan Cameron <jic23@kernel.org> wrote:
> On Mon, 22 Jan 2024 18:18:22 +0000
> Mark Brown <broonie@kernel.org> wrote:
>
> > On Mon, Jan 22, 2024 at 07:06:55PM +0100, Uwe Kleine-König wrote:
> >
> > > Note that Jonathan Cameron has already applied patch 3 to his tree, it
> > > didn't appear in a public tree though yet. I still included it here to
> > > make the kernel build bots happy.
> >
> > It's also going to be needed for buildability of the end of the series.
>
> Ah. I thought intent was to split this across all the different trees
> then do the final patch only after they were all gone?
>
> I'm fine with it going all in one go if people prefer that.
>
> My tree will be out in a few mins. Was just waiting to rebase on rc1
> which I've just done.
>
> Jonathan
>
Dropped from my tree.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
^ permalink raw reply
* [PATCH V4] Input: adc-joystick: Handle inverted axes
From: Chris Morgan @ 2024-01-24 20:47 UTC (permalink / raw)
To: linux-input
Cc: contact, hdegoede, paul, peter.hutterer, svv, biswarupp,
Chris Morgan
From: Chris Morgan <macromorgan@hotmail.com>
When one or more axes are inverted, (where min > max), normalize the
data so that min < max and invert the values reported to the input
stack.
This ensures we can continue defining the device correctly in the
device tree while not breaking downstream assumptions that min is
always less than max.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
Changes since V3:
- Add include for minmax.h.
- Use swap() instead of min_array()/max_array().
- Dropped Ack due to change.
Changes since V2:
- Explicitly set bool value to "true" instead of "1".
- Split adc_joystick_invert() function definition to 2 lines.
- Corrected changes message location.
Changes since V1:
- Moved proposed helper for inversion from input stack to adc-joystick
driver.
drivers/input/joystick/adc-joystick.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/input/joystick/adc-joystick.c b/drivers/input/joystick/adc-joystick.c
index c0deff5d4282..3b05b2e413d0 100644
--- a/drivers/input/joystick/adc-joystick.c
+++ b/drivers/input/joystick/adc-joystick.c
@@ -7,6 +7,7 @@
#include <linux/input.h>
#include <linux/iio/iio.h>
#include <linux/iio/consumer.h>
+#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
@@ -18,6 +19,7 @@ struct adc_joystick_axis {
s32 range[2];
s32 fuzz;
s32 flat;
+ bool inverted;
};
struct adc_joystick {
@@ -29,6 +31,15 @@ struct adc_joystick {
bool polled;
};
+static int adc_joystick_invert(struct input_dev *dev,
+ unsigned int axis, int val)
+{
+ int min = dev->absinfo[axis].minimum;
+ int max = dev->absinfo[axis].maximum;
+
+ return (max + min) - val;
+}
+
static void adc_joystick_poll(struct input_dev *input)
{
struct adc_joystick *joy = input_get_drvdata(input);
@@ -38,6 +49,8 @@ static void adc_joystick_poll(struct input_dev *input)
ret = iio_read_channel_raw(&joy->chans[i], &val);
if (ret < 0)
return;
+ if (joy->axes[i].inverted)
+ val = adc_joystick_invert(input, i, val);
input_report_abs(input, joy->axes[i].code, val);
}
input_sync(input);
@@ -86,6 +99,8 @@ static int adc_joystick_handle(const void *data, void *private)
val = sign_extend32(val, msb);
else
val &= GENMASK(msb, 0);
+ if (joy->axes[i].inverted)
+ val = adc_joystick_invert(joy->input, i, val);
input_report_abs(joy->input, joy->axes[i].code, val);
}
@@ -168,6 +183,12 @@ static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy)
goto err_fwnode_put;
}
+ if (axes[i].range[0] > axes[i].range[1]) {
+ dev_dbg(dev, "abs-axis %d inverted\n", i);
+ axes[i].inverted = true;
+ swap(axes[i].range[0], axes[i].range[1]);
+ }
+
fwnode_property_read_u32(child, "abs-fuzz", &axes[i].fuzz);
fwnode_property_read_u32(child, "abs-flat", &axes[i].flat);
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v5 4/5] Input: cs40l50 - Add support for the CS40L50 haptic driver
From: James Ogletree @ 2024-01-24 20:58 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: James Ogletree, Fred Treven, Ben Bright, Conor Dooley,
Simon Trimmer, Charles Keepax, James Schulman, David Rhodes,
Jeff LaBundy, open list:CIRRUS LOGIC HAPTIC DRIVERS,
open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...,
open list
In-Reply-To: <F1282174-6152-4EC3-BF53-2EDAA3CBB838@cirrus.com>
Hi Dmitry,
> On Jan 12, 2024, at 9:41 AM, James Ogletree <James.Ogletree@cirrus.com> wrote:
>
>> On Jan 11, 2024, at 1:28 AM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>>
>> On Wed, Jan 10, 2024 at 02:36:55PM +0000, James Ogletree wrote:
>>>
>>>> On Jan 9, 2024, at 4:31 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>>>>
>>>> On Tue, Jan 09, 2024 at 10:03:02PM +0000, James Ogletree wrote:
>>>>>
>>>>>
>>>>>> On Jan 6, 2024, at 7:58 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>>>>>>
>>>>>> On Thu, Jan 04, 2024 at 10:36:37PM +0000, James Ogletree wrote:
>>>>>>> + } else {
>>>>>>> + queue_work(info->vibe_wq, &info->vibe_stop_work);
>>>>>>
>>>>>> Which effect are you stopping? All of them? You need to stop a
>>>>>> particular one.
>>>>>
>>>>> Our implementation of “stop” stops all effects in flight which is intended.
>>>>> That is probably unusual so I will add a comment here in the next
>>>>> version.
>>>>
>>>> Again, please implement the driver properly, not define your own
>>>> carveouts for the expected behavior.
>>>
>>> Ack, and a clarification question: the device is not actually able to
>>> play multiple effects at once. In that case, does stopping a specific
>>> effect entail just cancelling an effect in the queue?
>>
>> In this case I believe the device should declare maximum number of
>> effects as 1. Userspace is supposed to determine maximum number of
>> simultaneously playable effects by issuing EVIOCGEFFECTS ioctl on the
>> corresponding event device.
>
> Is it possible to specify the device’s maximum simultaneous effects
> without also restricting the number of effects the user can upload? It
> looks like both are tied to ff->max_effects.
>
> Best,
> James
>
Is there an opportunity here for a subsystem change to disassociate max
upload-able effects and max simultaneously playable effects, or if not what
do you advise in the case of a device in which the two differ? Or is this
a misuse of the subsystem in some way?
Best,
James
^ permalink raw reply
* Re: [PATCH V4] Input: adc-joystick: Handle inverted axes
From: Artur Rojek @ 2024-01-24 21:33 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-input, hdegoede, paul, peter.hutterer, svv, biswarupp,
Chris Morgan
In-Reply-To: <20240124204754.43982-1-macroalpha82@gmail.com>
On 2024-01-24 21:47, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> When one or more axes are inverted, (where min > max), normalize the
> data so that min < max and invert the values reported to the input
> stack.
>
> This ensures we can continue defining the device correctly in the
> device tree while not breaking downstream assumptions that min is
> always less than max.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Artur Rojek <contact@artur-rojek.eu>
Cheers,
Artur
> ---
> Changes since V3:
> - Add include for minmax.h.
> - Use swap() instead of min_array()/max_array().
> - Dropped Ack due to change.
> Changes since V2:
> - Explicitly set bool value to "true" instead of "1".
> - Split adc_joystick_invert() function definition to 2 lines.
> - Corrected changes message location.
> Changes since V1:
> - Moved proposed helper for inversion from input stack to adc-joystick
> driver.
>
> drivers/input/joystick/adc-joystick.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/input/joystick/adc-joystick.c
> b/drivers/input/joystick/adc-joystick.c
> index c0deff5d4282..3b05b2e413d0 100644
> --- a/drivers/input/joystick/adc-joystick.c
> +++ b/drivers/input/joystick/adc-joystick.c
> @@ -7,6 +7,7 @@
> #include <linux/input.h>
> #include <linux/iio/iio.h>
> #include <linux/iio/consumer.h>
> +#include <linux/minmax.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/property.h>
> @@ -18,6 +19,7 @@ struct adc_joystick_axis {
> s32 range[2];
> s32 fuzz;
> s32 flat;
> + bool inverted;
> };
>
> struct adc_joystick {
> @@ -29,6 +31,15 @@ struct adc_joystick {
> bool polled;
> };
>
> +static int adc_joystick_invert(struct input_dev *dev,
> + unsigned int axis, int val)
> +{
> + int min = dev->absinfo[axis].minimum;
> + int max = dev->absinfo[axis].maximum;
> +
> + return (max + min) - val;
> +}
> +
> static void adc_joystick_poll(struct input_dev *input)
> {
> struct adc_joystick *joy = input_get_drvdata(input);
> @@ -38,6 +49,8 @@ static void adc_joystick_poll(struct input_dev
> *input)
> ret = iio_read_channel_raw(&joy->chans[i], &val);
> if (ret < 0)
> return;
> + if (joy->axes[i].inverted)
> + val = adc_joystick_invert(input, i, val);
> input_report_abs(input, joy->axes[i].code, val);
> }
> input_sync(input);
> @@ -86,6 +99,8 @@ static int adc_joystick_handle(const void *data,
> void *private)
> val = sign_extend32(val, msb);
> else
> val &= GENMASK(msb, 0);
> + if (joy->axes[i].inverted)
> + val = adc_joystick_invert(joy->input, i, val);
> input_report_abs(joy->input, joy->axes[i].code, val);
> }
>
> @@ -168,6 +183,12 @@ static int adc_joystick_set_axes(struct device
> *dev, struct adc_joystick *joy)
> goto err_fwnode_put;
> }
>
> + if (axes[i].range[0] > axes[i].range[1]) {
> + dev_dbg(dev, "abs-axis %d inverted\n", i);
> + axes[i].inverted = true;
> + swap(axes[i].range[0], axes[i].range[1]);
> + }
> +
> fwnode_property_read_u32(child, "abs-fuzz", &axes[i].fuzz);
> fwnode_property_read_u32(child, "abs-flat", &axes[i].flat);
^ permalink raw reply
* Re: [PATCH v1 0/7] HID: playstation: DS4: LED bugfix, third-party gamepad support
From: Roderick Colenbrander @ 2024-01-24 22:24 UTC (permalink / raw)
To: Jiri Kosina
Cc: Max Staudt, Roderick Colenbrander, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <nycvar.YFH.7.76.2401231047140.29548@cbobk.fhfr.pm>
On Tue, Jan 23, 2024 at 1:51 AM Jiri Kosina <jikos@kernel.org> wrote:
>
> On Mon, 15 Jan 2024, Max Staudt wrote:
>
> > Dear hid-playstation maintainers,
> >
> > Could you please have a look at the enclosed patches for the DualShock 4
> > driver in hid-playstation, and upstream them if possible?
> >
> > There is one bugfix, and a few small patches to enable third-party
> > controllers. They sometimes don't implement features that they
> > semantically "don't need", but which currently trip the driver.
> >
> > For example, for the DualShock 4, we don't actually need to know the
> > firmware version in order to work with the gamepad - unlike with the
> > DualSense, which has different driver logic depending on the version.
> >
> > Finally, there are two patches to add a DS4 compatible controller with
> > an unassigned VID/PID - I'd appreciate your thoughts on that.
> >
> > If I can make it easier to upstream these patches, please let me know.
> >
> > Thanks!
> >
> > Max
> >
> > Patches in this series:
> > [PATCH v1 1/7] HID: playstation: DS4: Fix LED blinking
> > [PATCH v1 2/7] HID: playstation: DS4: Don't fail on MAC address
> > [PATCH v1 3/7] HID: playstation: DS4: Don't fail on FW/HW version
> > [PATCH v1 4/7] HID: playstation: DS4: Don't fail on calibration data
> > [PATCH v1 5/7] HID: playstation: DS4: Parse minimal report 0x01
> > [PATCH v1 6/7] HID: playstation: Simplify device type ID
> > [PATCH v1 7/7] HID: playstation: DS4: Add VID/PID for SZ-MYPOWER
>
> Roderick, any word on this series, please?
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>
>
Sorry for the late reply. I had glanced over them, but didn't have an
opportunity for a detailed review yet.
I will have some input (there was a goto I remember not being needed).
My general fear is a balance between supporting clone devices vs
reliability. This driver is heavily used in devices (phones, tablets,
TVs, cars). There have been bug reports in the past and just getting
the fixes downstream takes a lot of time (e.g. Android devices).
One of the key things I really would like to see enhanced are the unit
tests (hid-tools / kernel side now). To really make sure we emulate
behavior of these other devices well. The tricky part is that they
don't always support all the HID requests of the real device (which is
weird as the game console does use those HID reports and others and I
don't know how it would have worked there).
That's in general the key feedback about the tests. A question for
Max: do you have access to all the devices being added?
Thanks,
Roderick
^ permalink raw reply
* Re: [PATCH v1 2/7] HID: playstation: DS4: Don't fail on MAC address request
From: Roderick Colenbrander @ 2024-01-25 0:39 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <20240115144538.12018-3-max@enpas.org>
On Mon, Jan 15, 2024 at 6:58 AM Max Staudt <max@enpas.org> wrote:
>
> Some third-party controllers can't report their MAC address.
>
> Since a unique ID is needed for ps_devices_list_add() and
> ps_device_register_battery(), let's use hdev->id for this when we don't
> have a MAC address.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> drivers/hid/hid-playstation.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index 7f50e13601f0..0a3c442af305 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -1966,7 +1966,10 @@ static int dualshock4_get_mac_address(struct dualshock4 *ds4)
> DS4_FEATURE_REPORT_PAIRING_INFO_SIZE, false);
> if (ret) {
> hid_err(hdev, "Failed to retrieve DualShock4 pairing info: %d\n", ret);
> - goto err_free;
> + hid_err(hdev, "Generating fake MAC address for this device.\n");
> + buf[1] = (hdev->id >> 0) & 0xff;
> + buf[2] = (hdev->id >> 8) & 0xff;
> + buf[3] = (hdev->id >> 16) & 0xff;
> }
>
> memcpy(ds4->base.mac_address, &buf[1], sizeof(ds4->base.mac_address));
> @@ -1986,7 +1989,6 @@ static int dualshock4_get_mac_address(struct dualshock4 *ds4)
> return 0;
> }
>
> -err_free:
> kfree(buf);
> return ret;
> }
> @@ -2552,7 +2554,7 @@ static struct ps_device *dualshock4_create(struct hid_device *hdev)
> ret = dualshock4_get_mac_address(ds4);
> if (ret) {
> hid_err(hdev, "Failed to get MAC address from DualShock4\n");
> - return ERR_PTR(ret);
> + hid_err(hdev, "Can't detect simultaneous USB/BT connections from this device.\n");
> }
> snprintf(hdev->uniq, sizeof(hdev->uniq), "%pMR", ds4->base.mac_address);
>
> --
> 2.39.2
>
>
Hi Max,
For what type of devices is this not working? This one example of this
request which is very foundational for a controller working on even
the game console. Are this perhaps USB-only devices? If the case maybe
some kind of error is only needed for USB connections.
Thanks,
Roderick
^ permalink raw reply
* Re: [PATCH v1 3/7] HID: playstation: DS4: Don't fail on FW/HW version request
From: Roderick Colenbrander @ 2024-01-25 0:43 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <20240115144538.12018-4-max@enpas.org>
On Mon, Jan 15, 2024 at 6:51 AM Max Staudt <max@enpas.org> wrote:
>
> Some third-party controllers can't report firmware/hardware version.
>
> Unlike for the DualSense, the driver does not use these values for
> anything in the DualShock 4 case, but merely exposes them via sysfs.
> They will simply be 0x0.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> drivers/hid/hid-playstation.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index 0a3c442af305..12321cae4416 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -2561,7 +2561,7 @@ static struct ps_device *dualshock4_create(struct hid_device *hdev)
> ret = dualshock4_get_firmware_info(ds4);
> if (ret) {
> hid_err(hdev, "Failed to get firmware info from DualShock4\n");
> - return ERR_PTR(ret);
> + hid_err(hdev, "HW/FW version data in sysfs will be invalid.\n");
> }
>
> ret = ps_devices_list_add(ps_dev);
> --
> 2.39.2
>
>
This looks good. Perhaps could have been a hid_warn then, but err is
probably fine.
Roderick
^ permalink raw reply
* Re: [PATCH v1 5/7] HID: playstation: DS4: Parse minimal report 0x01
From: Roderick Colenbrander @ 2024-01-25 0:54 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <20240115144538.12018-6-max@enpas.org>
Hi Max,
On Mon, Jan 15, 2024 at 6:52 AM Max Staudt <max@enpas.org> wrote:
>
> Some third-party controllers never switch to the full 0x11 report.
>
> They keep sending the short 0x01 report, so let's parse that instead.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> drivers/hid/hid-playstation.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index 2bf44bd3cc8a..086b0768fa51 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -287,6 +287,8 @@ struct dualsense_output_report {
>
> #define DS4_INPUT_REPORT_USB 0x01
> #define DS4_INPUT_REPORT_USB_SIZE 64
> +#define DS4_INPUT_REPORT_BT_MINIMAL 0x01
> +#define DS4_INPUT_REPORT_BT_MINIMAL_SIZE 10
> #define DS4_INPUT_REPORT_BT 0x11
> #define DS4_INPUT_REPORT_BT_SIZE 78
> #define DS4_OUTPUT_REPORT_USB 0x05
> @@ -2198,6 +2200,7 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
> int battery_status, i, j;
> uint16_t sensor_timestamp;
> unsigned long flags;
> + bool is_minimal = false;
>
> /*
> * DualShock4 in USB uses the full HID report for reportID 1, but
> @@ -2225,6 +2228,18 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
> ds4_report = &bt->common;
> num_touch_reports = bt->num_touch_reports;
> touch_reports = bt->touch_reports;
> + } else if (hdev->bus == BUS_BLUETOOTH &&
> + report->id == DS4_INPUT_REPORT_BT_MINIMAL &&
> + size == DS4_INPUT_REPORT_BT_MINIMAL_SIZE) {
> + /* Some third-party pads never switch to the full 0x11 report.
> + * The short 0x01 report is 10 bytes long:
> + * u8 report_id == 0x01
> + * u8 first_bytes_of_full_report[9]
> + * So let's reuse the full report parser, and stop it after
> + * parsing the buttons.
> + */
> + ds4_report = (struct dualshock4_input_report_common *)&data[1];
> + is_minimal = true;
> } else {
> hid_err(hdev, "Unhandled reportID=%d\n", report->id);
> return -1;
> @@ -2258,6 +2273,9 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
> input_report_key(ds4->gamepad, BTN_MODE, ds4_report->buttons[2] & DS_BUTTONS2_PS_HOME);
> input_sync(ds4->gamepad);
>
> + if (is_minimal)
> + goto finish_minimal;
> +
I would say let's turn this into a 'return 0'. The goto is not useful
since there is no need for any common cleanup or some other common
logic later.
> /* Parse and calibrate gyroscope data. */
> for (i = 0; i < ARRAY_SIZE(ds4_report->gyro); i++) {
> int raw_data = (short)le16_to_cpu(ds4_report->gyro[i]);
> @@ -2365,6 +2383,7 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
> ps_dev->battery_status = battery_status;
> spin_unlock_irqrestore(&ps_dev->lock, flags);
>
> +finish_minimal:
> return 0;
> }
>
> --
> 2.39.2
>
>
Thanks,
Roderick
^ permalink raw reply
* Re: [PATCH v1 6/7] HID: playstation: Simplify device type ID
From: Roderick Colenbrander @ 2024-01-25 1:01 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <20240115144538.12018-7-max@enpas.org>
On Mon, Jan 15, 2024 at 6:55 AM Max Staudt <max@enpas.org> wrote:
>
> Distinguish PS4/PS5 type controllers using .driver_data in
> MODULE_DEVICE_TABLE rather than by VID/PID.
>
> This allows adding compatible controllers with different VID/PID.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> drivers/hid/hid-playstation.c | 40 +++++++++++++++++++++++------------
> 1 file changed, 26 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index 086b0768fa51..a0eb36d695d9 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -27,6 +27,11 @@ static DEFINE_IDA(ps_player_id_allocator);
>
> #define HID_PLAYSTATION_VERSION_PATCH 0x8000
>
> +enum PS_TYPE {
> + PS_TYPE_PS4_DUALSHOCK4,
> + PS_TYPE_PS5_DUALSENSE,
> +};
> +
> /* Base class for playstation devices. */
> struct ps_device {
> struct list_head list;
> @@ -2690,17 +2695,14 @@ static int ps_probe(struct hid_device *hdev, const struct hid_device_id *id)
> goto err_stop;
> }
>
> - if (hdev->product == USB_DEVICE_ID_SONY_PS4_CONTROLLER ||
> - hdev->product == USB_DEVICE_ID_SONY_PS4_CONTROLLER_2 ||
> - hdev->product == USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) {
> + if (id->driver_data == PS_TYPE_PS4_DUALSHOCK4) {
> dev = dualshock4_create(hdev);
> if (IS_ERR(dev)) {
> hid_err(hdev, "Failed to create dualshock4.\n");
> ret = PTR_ERR(dev);
> goto err_close;
> }
> - } else if (hdev->product == USB_DEVICE_ID_SONY_PS5_CONTROLLER ||
> - hdev->product == USB_DEVICE_ID_SONY_PS5_CONTROLLER_2) {
> + } else if (id->driver_data == PS_TYPE_PS5_DUALSENSE) {
> dev = dualsense_create(hdev);
> if (IS_ERR(dev)) {
> hid_err(hdev, "Failed to create dualsense.\n");
> @@ -2734,16 +2736,26 @@ static void ps_remove(struct hid_device *hdev)
>
> static const struct hid_device_id ps_devices[] = {
> /* Sony DualShock 4 controllers for PS4 */
> - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
> - { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
> - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
> - { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) },
> - { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) },
> + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> +
> /* Sony DualSense controllers for PS5 */
> - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
> - { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
> - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2) },
> - { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2) },
> + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER),
> + .driver_data = PS_TYPE_PS5_DUALSENSE },
> + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER),
> + .driver_data = PS_TYPE_PS5_DUALSENSE },
> + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2),
> + .driver_data = PS_TYPE_PS5_DUALSENSE },
> + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER_2),
> + .driver_data = PS_TYPE_PS5_DUALSENSE },
> { }
> };
> MODULE_DEVICE_TABLE(hid, ps_devices);
> --
> 2.39.2
>
>
Hi Max,
This one looks good to me.
Roderick
^ permalink raw reply
* Re: [PATCH v1 7/7] HID: playstation: DS4: Add VID/PID for SZ-MYPOWER controllers
From: Roderick Colenbrander @ 2024-01-25 1:03 UTC (permalink / raw)
To: Max Staudt
Cc: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
In-Reply-To: <20240115144538.12018-8-max@enpas.org>
On Mon, Jan 15, 2024 at 6:52 AM Max Staudt <max@enpas.org> wrote:
>
> It seems like this USB VID is not officially assigned, so let's create a
> hid-ids.h entry without a vendor or product name.
>
> Signed-off-by: Max Staudt <max@enpas.org>
> ---
> drivers/hid/hid-ids.h | 3 +++
> drivers/hid/hid-playstation.c | 4 ++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 72046039d1be..df831ab464a4 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -22,6 +22,9 @@
> #define USB_DEVICE_ID_3M2256 0x0502
> #define USB_DEVICE_ID_3M3266 0x0506
>
> +#define USB_VENDOR_ID_7545 0x7545
> +#define USB_DEVICE_ID_7545_0104 0x0104
> +
> #define USB_VENDOR_ID_A4TECH 0x09da
> #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006
> #define USB_DEVICE_ID_A4TECH_X5_005D 0x000a
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index a0eb36d695d9..0aa474f1e96f 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -2747,6 +2747,10 @@ static const struct hid_device_id ps_devices[] = {
> { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE),
> .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
>
> + /* Third-party controllers identifying as "SZ-MYPOWER" */
> + { HID_USB_DEVICE(USB_VENDOR_ID_7545, USB_DEVICE_ID_7545_0104),
> + .driver_data = PS_TYPE_PS4_DUALSHOCK4 },
> +
> /* Sony DualSense controllers for PS5 */
> { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER),
> .driver_data = PS_TYPE_PS5_DUALSENSE },
> --
> 2.39.2
>
>
I'm not familiar with this device, but if it indeed works. Then I'm
okay with it.
Thanks,
Roderick
^ permalink raw reply
* RE: [HID Patchsets for Samsung driver v3 3/6] HID: Samsung : Add Samsung wireless keyboard support.
From: sandeep.cs @ 2024-01-25 1:51 UTC (permalink / raw)
To: 'Jiri Kosina'
Cc: 'Benjamin Tissoires', gaudium.lee, ih0923.kim,
suhyun_.kim, jitender.s21, junwan.cho, linux-input, linux-kernel
In-Reply-To: <nycvar.YFH.7.76.2401241917490.29548@cbobk.fhfr.pm>
>On Wed, 24 Jan 2024, Sandeep C S wrote:
>
> Add Support for samsung wireless keyboard with input mapping events.
>
> Device 7021 (Samsung wireless keyboard)
>
> Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
> Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
> Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
> ---
> drivers/hid/hid-ids.h | 2 +
> drivers/hid/hid-samsung.c | 108
> ++++++++++++++++++++++++++++++++++++++
> 2 files changed, 110 insertions(+)
>[ ... snip ... ]
>> +#ifdef CONFIG_HID_KK_UPGRADE
>
>Where is CONFIG_HID_KK_UPGRADE coming from, please? This is the first time
I
>am seeing it, and it's definitely not being introduced by your patchset.
Yes, Please ignore this commit message line. Only our changes are related to
bringing up Samsung driver only.
Thank you
^ permalink raw reply
* RE: [HID Patchsets for Samsung driver v3 3/6] HID: Samsung : Add Samsung wireless keyboard support.
From: sandeep.cs @ 2024-01-25 2:56 UTC (permalink / raw)
To: 'Jiri Kosina'
Cc: 'Benjamin Tissoires', gaudium.lee, ih0923.kim,
suhyun_.kim, jitender.s21, junwan.cho, linux-input, linux-kernel
In-Reply-To: <nycvar.YFH.7.76.2401241917490.29548@cbobk.fhfr.pm>
>On Wed, 24 Jan 2024, Sandeep C S wrote:
>
> Add Support for samsung wireless keyboard with input mapping events.
>
> Device 7021 (Samsung wireless keyboard)
>
> Signed-off-by: Sandeep C S <sandeep.cs@samsung.com>
> Signed-off-by: Junwan Cho <junwan.cho@samsung.com>
> Signed-off-by: Jitender Sajwan <jitender.s21@samsung.com>
> ---
> drivers/hid/hid-ids.h | 2 +
> drivers/hid/hid-samsung.c | 108
> ++++++++++++++++++++++++++++++++++++++
> 2 files changed, 110 insertions(+)
>[ ... snip ... ]
> +#ifdef CONFIG_HID_KK_UPGRADE
>
>Where is CONFIG_HID_KK_UPGRADE coming from, please? This is the first time
I
>am seeing it, and it's definitely not being introduced by your patchset.
>
>Thanks,
>
>--
>Jiri Kosina
>SUSE Labs
Hello
Sorry for oversight!
It is custom handling code for keyboard keys in Samsung driver for android
devices. As suggested I will exclude this macro from open source submission.
I will be sending v4 patchsets shortly.
Thank you
^ permalink raw reply
* [HID Patchsets for Samsung driver v4 0/6] Patchsets for Samsung driver
From: Sandeep C S @ 2024-01-25 4:36 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: gaudium.lee, ih0923.kim, suhyun_.kim, jitender.s21, junwan.cho,
sandeep.cs, linux-input, linux-kernel
In-Reply-To: <CGME20240125043646epcas5p1d599fecff0fc37926295fc5260a80682@epcas5p1.samsung.com>
Dear Jiri & Team,
I hope this email finds you well.
As per the review comments given by Mr. Jiri and Mr. Joe Perches in our last converstaion over mail.
We have incorporated the feedback on our driver. Please check this set of series and help us to improve samsung driver.
As of today, Opensource kernel Samsung driver only supports USB HID devices and do not have support for Bluetooth HID devices.
Samsung would like to improve the samsung driver and extend it's support for bluetooth devices as well.
Summary of changes in Samsung driver:
1. Add support for below bluetooth devices
Samsung wireless Keyboard
Samsung wireless GamePad
Samsung Wireless Action Mouse
Samsung Wireless Book Cover
Samsung Wireless Universal Keyboard
Samsung Wireless HOGP Keyboard
2. Add support for Special key processing on each of the above devices.
Patch Series Overview:
--------------------------------------
[Patch 1/6]
HID Samsung : Broaden device compatibility in samsung driver.
hid_is_usb() check being moved.
[Patch 2/6]
HID: Samsung : Fix the checkpatch complain.
Warning found by checkpatch.pl script.
[Patch 3/6]
HID: Samsung : Add Samsung wireless keyboard support.
[Patch 4/6]
HID: Samsung : Add Samsung wireless gamepad support.
[Patch 5/6]
HID: Samsung : Add Samsung wireless action mouse support.
[Patch 6/6]
HID: Samsung : Add Samsung wireless bookcover and universal keyboard support.
All these changes have been verified and tested thoroughly in android devices.
Please accept our changes.
Thanks for your time and consideration.
Best regards
Sandeep C S
Sandeep C S (6):
HID Samsung : Broaden device compatibility in samsung driver.
HID: Samsung : Fix the checkpatch complain. Rewritten code using
memcmp where applicable.
HID: Samsung : Add Samsung wireless keyboard support.
HID: Samsung : Add Samsung wireless gamepad support.
HID: Samsung : Add Samsung wireless action mouse support.
HID: Samsung : Add Samsung wireless bookcover and universal keyboard
support.
drivers/hid/hid-ids.h | 7 +
drivers/hid/hid-samsung.c | 437 ++++++++++++++++++++++++++++++++++----
2 files changed, 408 insertions(+), 36 deletions(-)
--
2.34.1
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox