diff mbox series

HID: Add support for Logitech G11 extra keys

Message ID 20200413164628.38283-1-fabian.schindlatz@fau.de (mailing list archive)
State Mainlined
Commit b1bd0f75288f60e8d142a1b3e979ed0192c04931
Delegated to: Jiri Kosina
Headers show
Series HID: Add support for Logitech G11 extra keys | expand

Commit Message

Fabian Schindlatz April 13, 2020, 4:46 p.m. UTC
The Logitech G11 keyboard is a cheap variant of the G15 without the LCD
screen. It uses the same layout for its extra and macro keys (G1 - G18,
M1-M3, MR) and - from the input subsystem's perspective - behaves just
like the G15, so we can treat it as such.

Tested it with my own keyboard.

Signed-off-by: Fabian Schindlatz <fabian.schindlatz@fau.de>
---
 drivers/hid/hid-ids.h    | 1 +
 drivers/hid/hid-lg-g15.c | 4 ++++
 2 files changed, 5 insertions(+)

Comments

Hans de Goede April 13, 2020, 5:16 p.m. UTC | #1
Hi,

On 4/13/20 6:46 PM, Fabian Schindlatz wrote:
> The Logitech G11 keyboard is a cheap variant of the G15 without the LCD
> screen. It uses the same layout for its extra and macro keys (G1 - G18,
> M1-M3, MR) and - from the input subsystem's perspective - behaves just
> like the G15, so we can treat it as such.
> 
> Tested it with my own keyboard.
> 
> Signed-off-by: Fabian Schindlatz <fabian.schindlatz@fau.de>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/hid/hid-ids.h    | 1 +
>   drivers/hid/hid-lg-g15.c | 4 ++++
>   2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index b18b13147..c6d614413 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -759,6 +759,7 @@
>   #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2	0xc218
>   #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2	0xc219
>   #define USB_DEVICE_ID_LOGITECH_G15_LCD		0xc222
> +#define USB_DEVICE_ID_LOGITECH_G11		0xc225
>   #define USB_DEVICE_ID_LOGITECH_G15_V2_LCD	0xc227
>   #define USB_DEVICE_ID_LOGITECH_G510		0xc22d
>   #define USB_DEVICE_ID_LOGITECH_G510_USB_AUDIO	0xc22e
> diff --git a/drivers/hid/hid-lg-g15.c b/drivers/hid/hid-lg-g15.c
> index ad4b5412a..ef0cbcd75 100644
> --- a/drivers/hid/hid-lg-g15.c
> +++ b/drivers/hid/hid-lg-g15.c
> @@ -872,6 +872,10 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
>   }
>   
>   static const struct hid_device_id lg_g15_devices[] = {
> +	/* The G11 is a G15 without the LCD, treat it as a G15 */
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
> +		USB_DEVICE_ID_LOGITECH_G11),
> +		.driver_data = LG_G15 },
>   	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
>   			 USB_DEVICE_ID_LOGITECH_G15_LCD),
>   		.driver_data = LG_G15 },
>
Jiri Kosina April 14, 2020, 9:16 a.m. UTC | #2
On Mon, 13 Apr 2020, Fabian Schindlatz wrote:

> The Logitech G11 keyboard is a cheap variant of the G15 without the LCD
> screen. It uses the same layout for its extra and macro keys (G1 - G18,
> M1-M3, MR) and - from the input subsystem's perspective - behaves just
> like the G15, so we can treat it as such.
> 
> Tested it with my own keyboard.
> 
> Signed-off-by: Fabian Schindlatz <fabian.schindlatz@fau.de>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index b18b13147..c6d614413 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -759,6 +759,7 @@ 
 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2	0xc218
 #define USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2	0xc219
 #define USB_DEVICE_ID_LOGITECH_G15_LCD		0xc222
+#define USB_DEVICE_ID_LOGITECH_G11		0xc225
 #define USB_DEVICE_ID_LOGITECH_G15_V2_LCD	0xc227
 #define USB_DEVICE_ID_LOGITECH_G510		0xc22d
 #define USB_DEVICE_ID_LOGITECH_G510_USB_AUDIO	0xc22e
diff --git a/drivers/hid/hid-lg-g15.c b/drivers/hid/hid-lg-g15.c
index ad4b5412a..ef0cbcd75 100644
--- a/drivers/hid/hid-lg-g15.c
+++ b/drivers/hid/hid-lg-g15.c
@@ -872,6 +872,10 @@  static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
 }
 
 static const struct hid_device_id lg_g15_devices[] = {
+	/* The G11 is a G15 without the LCD, treat it as a G15 */
+	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
+		USB_DEVICE_ID_LOGITECH_G11),
+		.driver_data = LG_G15 },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
 			 USB_DEVICE_ID_LOGITECH_G15_LCD),
 		.driver_data = LG_G15 },