Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e762532 authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina
Browse files

HID: move petalynx quirks



Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent b5635b12
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -154,6 +154,13 @@ config HID_MICROSOFT
	Support for some Microsoft devices which breaks less or more
	HID specification.

config HID_PETALYNX
	tristate "Petalynx"
	default m
	depends on USB_HID
	---help---
	Support for Petalynx Maxter remote.

config HID_SUNPLUS
	tristate "Sunplus"
	default m
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
obj-$(CONFIG_HID_LOGITECH)	+= hid-logitech.o
obj-$(CONFIG_HID_MICROSOFT)	+= hid-microsoft.o
obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o

obj-$(CONFIG_USB_HID)		+= usbhid/
+1 −0
Original line number Diff line number Diff line
@@ -1191,6 +1191,7 @@ static const struct hid_device_id hid_blacklist[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },

	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) },
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ static int __init hid_dummy_init(void)
#ifdef CONFIG_HID_MICROSOFT_MODULE
	HID_COMPAT_CALL_DRIVER(microsoft);
#endif
#ifdef CONFIG_HID_PETALYNX_MODULE
	HID_COMPAT_CALL_DRIVER(petalynx);
#endif
#ifdef CONFIG_HID_SUNPLUS_MODULE
	HID_COMPAT_CALL_DRIVER(sunplus);
#endif
+0 −33
Original line number Diff line number Diff line
@@ -42,34 +42,6 @@ static int quirk_gyration_remote(struct hid_usage *usage,
	return 1;
}

static int quirk_petalynx_remote(struct hid_usage *usage,
		struct hid_input *hidinput, unsigned long **bit, int *max)
{
	if (((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) &&
			((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER))
		return 0;

	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR)
		switch(usage->hid & HID_USAGE) {
			case 0x05a: map_key_clear(KEY_TEXT);		break;
			case 0x05b: map_key_clear(KEY_RED);		break;
			case 0x05c: map_key_clear(KEY_GREEN);		break;
			case 0x05d: map_key_clear(KEY_YELLOW);		break;
			case 0x05e: map_key_clear(KEY_BLUE);		break;
			default:
				return 0;
		}

	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER)
		switch(usage->hid & HID_USAGE) {
			case 0x0f6: map_key_clear(KEY_NEXT);            break;
			case 0x0fa: map_key_clear(KEY_BACK);            break;
			default:
				return 0;
		}
	return 1;
}

static int quirk_cherry_genius_29e(struct hid_usage *usage,
		struct hid_input *hidinput, unsigned long **bit, int *max)
{
@@ -94,9 +66,6 @@ static int quirk_cherry_genius_29e(struct hid_usage *usage,
#define VENDOR_ID_MONTEREY			0x0566
#define DEVICE_ID_GENIUS_KB29E			0x3004

#define VENDOR_ID_PETALYNX			0x18b1
#define DEVICE_ID_PETALYNX_MAXTER_REMOTE	0x0037

static const struct hid_input_blacklist {
	__u16 idVendor;
	__u16 idProduct;
@@ -107,8 +76,6 @@ static const struct hid_input_blacklist {

	{ VENDOR_ID_MONTEREY, DEVICE_ID_GENIUS_KB29E, quirk_cherry_genius_29e },

	{ VENDOR_ID_PETALYNX, DEVICE_ID_PETALYNX_MAXTER_REMOTE, quirk_petalynx_remote },

	{ 0, 0, NULL }
};

Loading