RE: [PATCH] Input: Set INPUT_PROP_-property for HID_UP_DIGITIZERS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Would anyone like to review this patch?
If there's any problem inserting the changes in the lines, I would like to discuss about implementing INPUT_PROP_TABLET and INPUT_PROP_DIRECT more
proper way.

Thanks,

Tats

-----Original Message-----
From: linux-input-owner@xxxxxxxxxxxxxxx <linux-input-owner@xxxxxxxxxxxxxxx> On Behalf Of Tatsunosuke Tobita
Sent: Wednesday, August 8, 2018 9:32 AM
To: linux-input@xxxxxxxxxxxxxxx
Cc: Tobita, Tatsunosuke <tatsunosuke.tobita@xxxxxxxxx>
Subject: [PATCH] Input: Set INPUT_PROP_-property for HID_UP_DIGITIZERS

Some system may want to know if a detected digitizer device is either an integrated or an external device.
In order to distinguish such condition, setting either INPUT_PROP_DIRECT or INPUT_PROP_POINTER is required, checking the member, "application", in "hid_field" structure.

Signed-off-by: Tatsunosuke Tobita <tobita.tatsunosuke@xxxxxxxxxxx>
---
 drivers/hid/hid-input.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 930652c..3e98537 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -758,6 +758,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		break;
 
 	case HID_UP_DIGITIZER:
+		if ((field->application & 0xff) == 0x01) /* Digitizer */
+			__set_bit(INPUT_PROP_POINTER, input->propbit);
+		else if ((field->application & 0xff) == 0x02) /* Pen */
+			__set_bit(INPUT_PROP_DIRECT, input->propbit);
+
 		switch (usage->hid & 0xff) {
 		case 0x00: /* Undefined */
 			goto ignore;
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux