linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neeraj Upadhyay <neeraju@codeaurora.org>
To: jikos@kernel.org, benjamin.tissoires@redhat.com, rydberg@bitmath.org
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm-owner@vger.kernel.org, prsood@codeaurora.org,
	gkohli@codeaurora.org
Subject: Query regarding hid-multitouch.c driver in 4.14/4.19
Date: Wed, 13 Nov 2019 07:59:54 +0530	[thread overview]
Message-ID: <e1e05bd3-19f5-0dfe-66ad-70717c1c29c6@codeaurora.org> (raw)

Hi,

I have one query regarding hid-multitouch.c driver and need your guidance on
how hid-multitouchc can restore/support the original behaviour, where, for
devices, for which application is not 
HID_DG_TOUCHSCREEN/HID_DG_TOUCHPAD, and has
HID_DG_CONTACTID usage in its report, can still use generic input mappings.

We are using kernel versions 4.14 , 4.19 respectively in 2 different 
projects:

4.14: 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/hid/hid-multitouch.c?h=v4.14.153
4.19: 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/hid/hid-multitouch.c?h=v4.19.83

I checked the application for our hid device, it's HID_DG_PEN, device 
also has a HID_DG_CONTACTID usage defined in

its report.

In 4.19, is_mt_collection is set to 'true'. All multitouch code paths or 
input mapping is configured

mt_allocate_report_data()
         ...
         for (n = 0; n < field->report_count; n++) {
                         if (field->usage[n].hid == HID_DG_CONTACTID)
                                 rdata->is_mt_collection = true;   // 
is_mt_collection is set to 'true'
                 }
         }

mt_input_mapping()
         ...
         if (rdata->is_mt_collection)
             return mt_touch_input_mapping(...)  // 
mt_touch_input_mapping() is called

mt_event()
         if (rdata && rdata->is_mt_collection)
             return mt_touch_event();  // mt_touch_event() is called

However, in 4.14, the behaviour was different, mt input mapping was done 
only
for HID_DG_TOUCHSCREEN/HID_DG_TOUCHPAD , and because our hid device is
HID_DG_PEN, generic mappings were applied for it; with these settings, 
device
responds to events.

static int mt_input_mapping()
         if (field->application == HID_DG_TOUCHSCREEN ||
             field->application == HID_DG_TOUCHPAD)
             return mt_touch_input_mapping();  // This is not called.


mt_touch_input_mapping()
         case HID_DG_CONTACTID:
                         mt_store_field(usage, td, hi);
                         td->touches_by_report++;
                         td->mt_report_id = field->report->id; // 
mt_report_id is not set.
                         return 1;


Looks like this behaviour changed, with below commits:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/hid/hid-multitouch.c?h=v4.19.83&id=8dfe14b3b47ff832cb638731f9fc696a3a84f804
8dfe14b3b47f    HID: multitouch: ditch mt_report_id
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/hid/hid-multitouch.c?h=v4.19.83&id=ba6b055e0f3b4ff4942e4ab273260affcfad9bff
ba6b055e0f3b     HID: input: enable Totem on the Dell Canvas 27

Can you please suggest on how we can support/preserve the original 
behaviour?


Thanks
Neeraj

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation


             reply	other threads:[~2019-11-13  2:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  2:29 Neeraj Upadhyay [this message]
2019-11-13  9:30 ` Query regarding hid-multitouch.c driver in 4.14/4.19 Benjamin Tissoires
2019-11-14  4:31   ` Neeraj Upadhyay
2019-11-22  4:41     ` Neeraj Upadhyay
     [not found]     ` <0101016e916ab42c-fbc61178-9bdd-42ba-b111-722c46db5dc1-000000@us-west-2.amazonses.com>
2019-11-22  9:25       ` Benjamin Tissoires
2019-12-09  3:51         ` Neeraj Upadhyay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1e05bd3-19f5-0dfe-66ad-70717c1c29c6@codeaurora.org \
    --to=neeraju@codeaurora.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=gkohli@codeaurora.org \
    --cc=jikos@kernel.org \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prsood@codeaurora.org \
    --cc=rydberg@bitmath.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).