linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dirk Behme <dirk.behme@de.bosch.com>
Cc: linux-input@vger.kernel.org, Dirk Behme <dirk.behme@gmail.com>
Subject: Re: [PATCH 2/4] Input: zforce - swap reset and interrupt GPIO
Date: Fri, 24 Jul 2015 14:32:23 -0700	[thread overview]
Message-ID: <20150724213223.GD33241@dtor-ws> (raw)
In-Reply-To: <1437396997-3182-3-git-send-email-dirk.behme@de.bosch.com>

On Mon, Jul 20, 2015 at 02:56:35PM +0200, Dirk Behme wrote:
> From: Dirk Behme <dirk.behme@gmail.com>
> 
> Swap the order of the reset and interrupt GPIO. This is the preparation
> to make the interrupt GPIO optional.
> 
> Note that this needs the same change in the device tree. But as mainline
> doesn't contain any zforce device tree entries, nothing has to be done
> for us, here.
> 
> All non-mainline device trees have to be adapted, though.

No, we can not do that. We will have to switch to using named gpios
(probably call then attn-gpio and reset-gpio respectively and
handle old-style DTSes with unnamed 2-entry gpios list).

Thanks.

> 
> Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
> ---
>  .../bindings/input/touchscreen/zforce_ts.txt         |  4 ++--
>  drivers/input/touchscreen/zforce_ts.c                | 20 ++++++++++----------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> index 80c37df..a19b508 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
> @@ -23,8 +23,8 @@ Example:
>  			interrupts = <2 0>;
>  			vdd-supply = <&reg_zforce_vdd>;
>  
> -			gpios = <&gpio5 6 0>, /* INT */
> -				<&gpio5 9 0>; /* RST */
> +			gpios = <&gpio5 9 0>, /* RST */
> +				<&gpio5 6 0>; /* INT */
>  
>  			x-size = <800>;
>  			y-size = <600>;
> diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
> index edf01c3..ac7b661 100644
> --- a/drivers/input/touchscreen/zforce_ts.c
> +++ b/drivers/input/touchscreen/zforce_ts.c
> @@ -754,17 +754,8 @@ static int zforce_probe(struct i2c_client *client,
>  	if (!ts)
>  		return -ENOMEM;
>  
> -	/* INT GPIO */
> -	ts->gpio_int = devm_gpiod_get_index(&client->dev, NULL, 0, GPIOD_IN);
> -	if (IS_ERR(ts->gpio_int)) {
> -		ret = PTR_ERR(ts->gpio_int);
> -		dev_err(&client->dev,
> -			"failed to request interrupt GPIO: %d\n", ret);
> -		return ret;
> -	}
> -
>  	/* RST GPIO */
> -	ts->gpio_rst = devm_gpiod_get_index(&client->dev, NULL, 1,
> +	ts->gpio_rst = devm_gpiod_get_index(&client->dev, NULL, 0,
>  					    GPIOD_OUT_HIGH);
>  	if (IS_ERR(ts->gpio_rst)) {
>  		ret = PTR_ERR(ts->gpio_rst);
> @@ -773,6 +764,15 @@ static int zforce_probe(struct i2c_client *client,
>  		return ret;
>  	}
>  
> +	/* INT GPIO */
> +	ts->gpio_int = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_IN);
> +	if (IS_ERR(ts->gpio_int)) {
> +		ret = PTR_ERR(ts->gpio_int);
> +		dev_err(&client->dev,
> +			"failed to request interrupt GPIO: %d\n", ret);
> +		return ret;
> +	}
> +
>  	ts->reg_vdd = devm_regulator_get_optional(&client->dev, "vdd");
>  	if (IS_ERR(ts->reg_vdd)) {
>  		ret = PTR_ERR(ts->reg_vdd);
> -- 
> 2.3.4
> 

-- 
Dmitry

  reply	other threads:[~2015-07-24 21:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 12:56 [PATCH 0/4 v2] Input: zforce - update interrupt handling Dirk Behme
2015-07-20 12:56 ` [PATCH 1/4] Input: zforce - don't invert the interrupt GPIO Dirk Behme
2015-07-20 16:55   ` Dmitry Torokhov
2015-07-20 12:56 ` [PATCH 2/4] Input: zforce - swap reset and " Dirk Behme
2015-07-24 21:32   ` Dmitry Torokhov [this message]
2015-07-25  5:19     ` Dirk Behme
2015-07-27  8:12       ` Dirk Behme
2015-07-27 21:17         ` Dmitry Torokhov
2015-07-28  8:29           ` Dirk Behme
2015-07-27 21:18       ` Dmitry Torokhov
2015-07-20 12:56 ` [PATCH 3/4 v2] Input: zforce - make the interrupt GPIO optional Dirk Behme
2015-07-20 12:56 ` [PATCH 4/4 v2] Input: zforce - enable irq only if we are ready to process it Dirk Behme
2015-07-21  8:47   ` 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=20150724213223.GD33241@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=dirk.behme@gmail.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).