linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Bastian Hecht <hechtb@gmail.com>
Cc: linux-sh@vger.kernel.org, linux-input@vger.kernel.org,
	Tony SIM <chinyeow.sim.xt@renesas.com>,
	Laurent Pichart <laurent.pinchart@ideasonboard.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Simon Horman <horms@verge.net.au>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH v2 1/2] input: st1232: Add reset pin handling
Date: Tue, 9 Apr 2013 23:51:14 -0700	[thread overview]
Message-ID: <20130410065114.GA21515@core.coreip.homeip.net> (raw)
In-Reply-To: <1365425547-10391-1-git-send-email-hechtb+renesas@gmail.com>

Hi Bastian,

On Mon, Apr 08, 2013 at 02:52:26PM +0200, Bastian Hecht wrote:
> +static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron)
> +{
> +	if (ts->reset_gpio >= 0)

This should be gpio_is_valid() I think.

> +		gpio_direction_output(ts->reset_gpio, poweron);
> +}
> +
>  static int st1232_ts_probe(struct i2c_client *client,
>  					const struct i2c_device_id *id)
>  {
>  	struct st1232_ts_data *ts;
> +	struct st1232_pdata *pdata = client->dev.platform_data;
>  	struct input_dev *input_dev;
>  	int error;
>  
> @@ -167,6 +178,25 @@ static int st1232_ts_probe(struct i2c_client *client,
>  	ts->client = client;
>  	ts->input_dev = input_dev;
>  
> +	if (client->dev.of_node)
> +		ts->reset_gpio = of_get_gpio(client->dev.of_node, 0);
> +	else if (pdata)
> +		ts->reset_gpio = pdata->reset_gpio;

I believe we should favor platform data, then firmware, so that you can
override if necessary.

> +	else
> +		ts->reset_gpio = -ENODEV;
> +
> +	if (ts->reset_gpio >= 0) {

gpio_is_valid() again?

> +		error = devm_gpio_request(&client->dev, ts->reset_gpio, NULL);

Frankly I do not like mixing managed and noon-managed resources. Maybe
the entire driver needs to be converted to managed resources?

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2013-04-10  6:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 12:52 [PATCH v2 1/2] input: st1232: Add reset pin handling Bastian Hecht
2013-04-08 12:52 ` [PATCH v2 2/2] ARM: shmobile: Armadillo800EVA: Move st1232 " Bastian Hecht
2013-04-08 14:17   ` Laurent Pinchart
2013-04-09  8:26     ` Simon Horman
2013-04-09  9:11       ` Simon Horman
2013-04-09  9:16         ` Bastian Hecht
2013-04-09 11:55           ` Simon Horman
2013-04-09 15:01           ` Simon Horman
2013-04-09 15:04             ` Bastian Hecht
2013-04-08 14:17 ` [PATCH v2 1/2] input: st1232: Add " Laurent Pinchart
2013-04-09  8:28   ` Simon Horman
2013-04-09  9:23     ` Bastian Hecht
2013-04-09 15:01       ` Simon Horman
2013-04-10  6:51         ` Dmitry Torokhov
2013-04-10  7:25           ` Simon Horman
2013-04-10  6:51 ` Dmitry Torokhov [this message]
2013-04-10  9:11   ` Laurent Pinchart
2013-04-10 21:38     ` Bastian Hecht

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=20130410065114.GA21515@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=chinyeow.sim.xt@renesas.com \
    --cc=hechtb@gmail.com \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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).