From: "Henrik Rydberg" <rydberg@euromail.se>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: "Richard Nauber" <richard.nauber@googlemail.com>,
linux-input <linux-input@vger.kernel.org>,
"Jiri Kosina" <jkosina@suse.cz>,
"Stéphane Chatty" <chatty@enac.fr>
Subject: Re: [PATCH v3] [input-hid] Add hid-egalax driver to the unified hid-multitouch framework.
Date: Wed, 9 Mar 2011 10:23:37 +0100 [thread overview]
Message-ID: <20110309092337.GC3824@polaris.bitmath.org> (raw)
In-Reply-To: <AANLkTikDBTFNWhYoR5B-kfZ8Ud_aiW36qrTNJsJgHdTJ@mail.gmail.com>
> > @@ -147,11 +163,15 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> > {
> > struct mt_device *td = hid_get_drvdata(hdev);
> > struct mt_class *cls = td->mtclass;
> > + __s32 quirks = cls->quirks;
> > +
> > switch (usage->hid & HID_USAGE_PAGE) {
> >
> > case HID_UP_GENDESK:
> > switch (usage->hid) {
> > case HID_GD_X:
> > + if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
> > + field->logical_maximum = 32760;
>
> Please do not add numerical constants in a generic code. If I want to
> override the values for another device, I'll have to rename your quirk
> to MT_QUIRK_EGALAX_XYZ_FIXUP_WITH_0_32760_0_32760_0_x and add mine.
> These values have to be moved in the MT_CLS.
It is a specific value used for a specific code path, no need to
over-generalize. The quirk name could be specialized even more, i
suppose, but the point is that it makes the hid-multitouch driver do
exactly what is done in the hid-egalax driver, and it is easy to prove
that there are no side effects for other devices.
> > case HID_DG_TIPPRESSURE:
> > + if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
> > + field->logical_minimum = 0;
>
> No really need for the test and the quirk. In addition, here you do
> not override logical_max. This shows that the quirk is not
> MT_QUIRK_EGALAX_XYZ_FIXUP but the combination of
> MT_QUIRK_EGALAX_XY_FIXUP and MT_QUIRK_EGALAX_Z_MIN_FIXUP.
> Just drop it here.
The added code path simply reflects what is in the hid-egalax
driver. It is true that the statement _probably_ works for other
devices as well, but it cannot be proven just by looking at the
code. Also, we have no known additional case where it is needed.
I am trying to think of a better name for the quirk, but frankly, I
think it already says what it needs to say.
Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-03-09 9:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 13:25 [PATCH] [input-hid] Add hid-egalax driver to the unified hid-multitouch framework Richard Nauber
2011-03-07 10:07 ` Benjamin Tissoires
2011-03-08 6:08 ` [PATCH v2] " Richard Nauber
2011-03-08 8:04 ` Henrik Rydberg
2011-03-08 8:55 ` Benjamin Tissoires
2011-03-08 9:14 ` Henrik Rydberg
2011-03-08 9:23 ` Benjamin Tissoires
2011-03-08 9:46 ` Henrik Rydberg
2011-03-08 23:38 ` [PATCH v3] " Richard Nauber
2011-03-09 8:24 ` Henrik Rydberg
2011-03-09 8:54 ` Benjamin Tissoires
2011-03-09 9:23 ` Henrik Rydberg [this message]
2011-03-09 10:06 ` Benjamin Tissoires
2011-03-09 11:40 ` Henrik Rydberg
2011-03-11 6:02 ` Richard Nauber
2011-03-11 6:53 ` Benjamin Tissoires
2011-03-11 9:23 ` Richard Nauber
2011-03-11 9:52 ` Benjamin Tissoires
2011-03-11 11:31 ` Henrik Rydberg
2011-03-14 12:06 ` Jiri Kosina
2011-03-08 13:12 ` [PATCH] " Jiri Kosina
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=20110309092337.GC3824@polaris.bitmath.org \
--to=rydberg@euromail.se \
--cc=benjamin.tissoires@gmail.com \
--cc=chatty@enac.fr \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=richard.nauber@googlemail.com \
/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).