From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Vincent Knecht <vincent.knecht@mailoo.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Henrik Rydberg <rydberg@bitmath.org>,
Linus Walleij <linus.walleij@linaro.org>,
Michael Srba <Michael.Srba@seznam.cz>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v4 2/2] Input: add MStar MSG2638 touchscreen driver
Date: Sat, 20 Feb 2021 15:23:51 -0800 [thread overview]
Message-ID: <YDGaB6L5+Aa2snUM@google.com> (raw)
In-Reply-To: <20210210173403.667482-2-vincent.knecht@mailoo.org>
Hi Vincent,
On Wed, Feb 10, 2021 at 06:33:52PM +0100, Vincent Knecht wrote:
> +
> + for (i = 0; i < MAX_SUPPORTED_FINGER_NUM; i++) {
> + p = &touch_event.pkt[i];
> + /* Ignore non-pressed finger data */
> + if (p->xy_hi == 0xFF && p->x_low == 0xFF && p->y_low == 0xFF)
> + continue;
> +
> + coord.x = (((p->xy_hi & 0xF0) << 4) | p->x_low) * msg2638->prop.max_x / TPD_WIDTH;
> + coord.y = (((p->xy_hi & 0x0F) << 8) | p->y_low) * msg2638->prop.max_y / TPD_HEIGHT;
> + msg2638_report_finger(msg2638, i, &coord);
We do not scale the coordinates in the kernel. Rather we provide
resolution, if known, and min/max coordinates reported by the hardware,
and let userspace handle the rest.
> +static int __maybe_unused msg2638_suspend(struct device *dev)
> +{
> + struct i2c_client *client = to_i2c_client(dev);
> + struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client);
> +
> + mutex_lock(&msg2638->input_dev->mutex);
> +
> + if (input_device_enabled(msg2638->input_dev))
> + msg2638_stop(msg2638);
I believe that you should power down the device only if it is not
configures as wakeup source. In fact (and I think most drivers are
wrong in this), you may want to power up the device if it is a wakeup
source and it does not have any users.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2021-02-20 23:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 17:33 [PATCH v4 1/2] dt-bindings: input/touchscreen: add bindings for msg2638 Vincent Knecht
2021-02-10 17:33 ` [PATCH v4 2/2] Input: add MStar MSG2638 touchscreen driver Vincent Knecht
2021-02-20 23:23 ` Dmitry Torokhov [this message]
2021-02-22 20:51 ` Vincent Knecht
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=YDGaB6L5+Aa2snUM@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=Michael.Srba@seznam.cz \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=rydberg@bitmath.org \
--cc=vincent.knecht@mailoo.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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).