From: Rob Herring <robh@kernel.org>
To: Guy Shapiro <guy.shapiro@mobi-wize.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
Mark Rutland <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Haibo Chen <haibo.chen@freescale.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] Input: imx6ul_tsc - generalize the averaging property
Date: Tue, 13 Dec 2016 13:54:54 -0600 [thread overview]
Message-ID: <CAL_JsqJAdxrUGL5pjTPDkrXTsKJU-vL1Y4TpqhP79bESs9vR-g@mail.gmail.com> (raw)
In-Reply-To: <1481440003-27168-1-git-send-email-guy.shapiro@mobi-wize.com>
On Sun, Dec 11, 2016 at 1:06 AM, Guy Shapiro <guy.shapiro@mobi-wize.com> wrote:
> Make the avarage-samples property a general touchscreen property
> rather than imx6ul device specific.
>
> Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com>
> ---
> .../bindings/input/touchscreen/imx6ul_tsc.txt | 11 ++----
> .../bindings/input/touchscreen/touchscreen.txt | 3 ++
> drivers/input/touchscreen/imx6ul_tsc.c | 46 ++++++++++++++++------
> 3 files changed, 41 insertions(+), 19 deletions(-)
[...]
> + switch (average_samples) {
> + case 1:
> + tsc->average_enable = false;
> + tsc->average_select = 0; /* value unused; initialize anyway */
> + break;
> + case 4:
> + tsc->average_enable = true;
> + tsc->average_select = 0;
> + break;
> + case 8:
> + tsc->average_enable = true;
> + tsc->average_select = 1;
> + break;
> + case 16:
> + tsc->average_enable = true;
> + tsc->average_select = 2;
> + break;
> + case 32:
> + tsc->average_enable = true;
> + tsc->average_select = 3;
> + break;
This could be more efficiently written as
tsc->average_select = log2(average_samples) - 2;
Then enable if >=0.
Rob
next prev parent reply other threads:[~2016-12-13 19:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-11 7:06 [PATCH] Input: imx6ul_tsc - generalize the averaging property Guy Shapiro
2016-12-13 19:10 ` Rob Herring
2016-12-13 19:14 ` Dmitry Torokhov
2016-12-13 19:48 ` Rob Herring
2016-12-13 19:54 ` Rob Herring [this message]
2016-12-14 7:09 ` Guy Shapiro
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=CAL_JsqJAdxrUGL5pjTPDkrXTsKJU-vL1Y4TpqhP79bESs9vR-g@mail.gmail.com \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=guy.shapiro@mobi-wize.com \
--cc=haibo.chen@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=mark.rutland@arm.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).