From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dirk Behme <dirk.behme@de.bosch.com>
Cc: linux-input@vger.kernel.org,
Knut Wohlrab <Knut.Wohlrab@de.bosch.com>,
Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
Subject: Re: [PATCH] input: zforce_ts: add DT support for reset GPIO polarity
Date: Mon, 29 Jun 2015 17:08:58 -0700 [thread overview]
Message-ID: <20150630000858.GA35823@dtor-ws> (raw)
In-Reply-To: <558A3DAE.8090203@de.bosch.com>
On Wed, Jun 24, 2015 at 07:18:38AM +0200, Dirk Behme wrote:
> On 17.06.2015 01:57, Dmitry Torokhov wrote:
> >On Mon, Jun 15, 2015 at 07:54:25AM +0200, Dirk Behme wrote:
> >>From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
> >>
> >>According to
> >>
> >>Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> >>
> >>the RST GPIO is supposed to provide a polarity flag parameter
> >>
> >>gpios = <&GPIO_BANK GPIO_NUMBER GPIO_POLARITY>
> >>
> >>with GPIO_POLARITY
> >>
> >>reset active low = 1 (GPIO_ACTIVE_LOW)
> >>reset active high = 0 (GPIO_ACTIVE_HIGH)
> >>
> >>Example for GPIO_ACTIVE_LOW (1) reset GPIO:
> >>
> >> zforce_ts@50 { /* Neonode zForce I2C */
> >> compatible = "neonode,zforce-ts";
> >> ...
> >> gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>, /* INT */
> >> <&gpio1 29 GPIO_ACTIVE_LOW>; /* RST */
> >> ...
> >> };
> >>
> >>Add the missing polarity flag evaluation to the driver.
> >>
> >>Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com>
> >>Signed-off-by: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
> >>Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
> >>---
> >> drivers/input/touchscreen/zforce_ts.c | 27 +++++++++++++++++++++++----
> >> include/linux/platform_data/zforce_ts.h | 3 +++
> >> 2 files changed, 26 insertions(+), 4 deletions(-)
> >>
> >>diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
> >>index 19880c7..125311d 100644
> >>--- a/drivers/input/touchscreen/zforce_ts.c
> >>+++ b/drivers/input/touchscreen/zforce_ts.c
> >>@@ -162,6 +162,20 @@ static int zforce_command(struct zforce_ts *ts, u8 cmd)
> >> return 0;
> >> }
> >>
> >>+static void zforce_reset_assert(struct zforce_ts *ts)
> >>+{
> >>+ const struct zforce_ts_platdata *pdata = ts->pdata;
> >>+
> >>+ gpio_set_value(pdata->gpio_rst, pdata->reset_active_low ? 0 : 1);
> >
> >Instead of doing this I'd rather we converted the driver to use gpiod
> >that handles polarity automatically.
>
>
> Thanks, we'll look into that.
>
> Just to understand correctly: Converting this driver to gpiod will
> be an additional patch on top of this patch as it doesn't change any
> functionality provided by this patch, but does some clean up.
> Correct?
No, gpiod understands annotations on gpio descriptions and converts the
logical "active"/"inactive" value into appropriate output depending on
the polarity specified for gpio. So zforce_reset_assert() woudl only
need to do
gpiod_set_value[_cansleep](ts->gpio_rst, 1);
Thanks.
--
Dmitry
next prev parent reply other threads:[~2015-06-30 0:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 5:54 [PATCH] input: zforce_ts: add DT support for reset GPIO polarity Dirk Behme
2015-06-16 23:57 ` Dmitry Torokhov
2015-06-24 5:18 ` Dirk Behme
2015-06-30 0:08 ` Dmitry Torokhov [this message]
2015-06-30 5:40 ` Dirk Behme
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=20150630000858.GA35823@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=Knut.Wohlrab@de.bosch.com \
--cc=dirk.behme@de.bosch.com \
--cc=external.Oleksij.Rempel@de.bosch.com \
--cc=linux-input@vger.kernel.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).