linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
@ 2011-02-03  9:48 Sourav Poddar
  2011-02-03  9:58 ` Felipe Balbi
  0 siblings, 1 reply; 7+ messages in thread
From: Sourav Poddar @ 2011-02-03  9:48 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-omap, linux-arm-kernel, charu, gadiyar, linux-input, balbi,
	Sourav Poddar

The ads7846 driver requests a gpio to detect pendown events,
but does not configure its direction. Configure this gpio
as an input after requesting it.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
changes between v2 and v1: Added return error support in v2. 
 
drivers/input/touchscreen/ads7846.c |    7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 036f245..f30768b 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
 		return err;
 	}
 
+	err = gpio_direction_input(pdata->gpio_pendown);
+	if (err) {
+		dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
+			pdata->gpio_pendown);
+		return err;
+        }
+
 	ts->gpio_pendown = pdata->gpio_pendown;
 
 	return 0;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03  9:48 [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input Sourav Poddar
@ 2011-02-03  9:58 ` Felipe Balbi
  2011-02-03 10:04   ` Varadarajan, Charulatha
  2011-02-03 10:10   ` Wolfram Sang
  0 siblings, 2 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-02-03  9:58 UTC (permalink / raw)
  To: Sourav Poddar
  Cc: dmitry.torokhov, linux-omap, linux-arm-kernel, charu, gadiyar,
	linux-input, balbi

On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
> The ads7846 driver requests a gpio to detect pendown events,
> but does not configure its direction. Configure this gpio
> as an input after requesting it.
> 
> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> ---
> changes between v2 and v1: Added return error support in v2. 
>  
> drivers/input/touchscreen/ads7846.c |    7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index 036f245..f30768b 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>  		return err;
>  	}
>  
> +	err = gpio_direction_input(pdata->gpio_pendown);
> +	if (err) {
> +		dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
> +			pdata->gpio_pendown);
> +		return err;

and now you miss a gpio_free().

-- 
balbi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03  9:58 ` Felipe Balbi
@ 2011-02-03 10:04   ` Varadarajan, Charulatha
  2011-02-03 13:01     ` Poddar, Sourav
  2011-02-03 10:10   ` Wolfram Sang
  1 sibling, 1 reply; 7+ messages in thread
From: Varadarajan, Charulatha @ 2011-02-03 10:04 UTC (permalink / raw)
  To: Sourav Poddar
  Cc: dmitry.torokhov, linux-omap, linux-arm-kernel, gadiyar,
	linux-input, balbi

Sourav,

On Thu, Feb 3, 2011 at 15:28, Felipe Balbi <balbi@ti.com> wrote:
> On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
>> The ads7846 driver requests a gpio to detect pendown events,
>> but does not configure its direction. Configure this gpio
>> as an input after requesting it.
>>
>> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>> ---
>> changes between v2 and v1: Added return error support in v2.
>>
>> drivers/input/touchscreen/ads7846.c |    7 +++++++
>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>> index 036f245..f30768b 100644
>> --- a/drivers/input/touchscreen/ads7846.c
>> +++ b/drivers/input/touchscreen/ads7846.c
>> @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>               return err;
>>       }
>>
>> +     err = gpio_direction_input(pdata->gpio_pendown);
>> +     if (err) {
>> +             dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
>> +                     pdata->gpio_pendown);
>> +             return err;
>
> and now you miss a gpio_free().

My question to your previous version is still unanswered.
Would it be relevant to add gpio_set_debounce() for this
gpio?
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03  9:58 ` Felipe Balbi
  2011-02-03 10:04   ` Varadarajan, Charulatha
@ 2011-02-03 10:10   ` Wolfram Sang
  2011-02-03 10:22     ` Felipe Balbi
  2011-02-03 11:42     ` Poddar, Sourav
  1 sibling, 2 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-02-03 10:10 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Sourav Poddar, dmitry.torokhov, charu, linux-input, linux-omap,
	linux-arm-kernel, gadiyar

[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]

On Thu, Feb 03, 2011 at 11:58:45AM +0200, Felipe Balbi wrote:
> On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
> > The ads7846 driver requests a gpio to detect pendown events,
> > but does not configure its direction. Configure this gpio
> > as an input after requesting it.
> > 
> > Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> > ---
> > changes between v2 and v1: Added return error support in v2. 
> >  
> > drivers/input/touchscreen/ads7846.c |    7 +++++++
> > 1 files changed, 7 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> > index 036f245..f30768b 100644
> > --- a/drivers/input/touchscreen/ads7846.c
> > +++ b/drivers/input/touchscreen/ads7846.c
> > @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
> >  		return err;
> >  	}
> >  
> > +	err = gpio_direction_input(pdata->gpio_pendown);
> > +	if (err) {
> > +		dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
> > +			pdata->gpio_pendown);
> > +		return err;
> 
> and now you miss a gpio_free().

Better use gpio_request_one()?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03 10:10   ` Wolfram Sang
@ 2011-02-03 10:22     ` Felipe Balbi
  2011-02-03 11:42     ` Poddar, Sourav
  1 sibling, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-02-03 10:22 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Felipe Balbi, Sourav Poddar, dmitry.torokhov, charu, linux-input,
	linux-omap, linux-arm-kernel, gadiyar

On Thu, Feb 03, 2011 at 11:10:33AM +0100, Wolfram Sang wrote:
> On Thu, Feb 03, 2011 at 11:58:45AM +0200, Felipe Balbi wrote:
> > On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
> > > The ads7846 driver requests a gpio to detect pendown events,
> > > but does not configure its direction. Configure this gpio
> > > as an input after requesting it.
> > > 
> > > Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> > > ---
> > > changes between v2 and v1: Added return error support in v2. 
> > >  
> > > drivers/input/touchscreen/ads7846.c |    7 +++++++
> > > 1 files changed, 7 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> > > index 036f245..f30768b 100644
> > > --- a/drivers/input/touchscreen/ads7846.c
> > > +++ b/drivers/input/touchscreen/ads7846.c
> > > @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
> > >  		return err;
> > >  	}
> > >  
> > > +	err = gpio_direction_input(pdata->gpio_pendown);
> > > +	if (err) {
> > > +		dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
> > > +			pdata->gpio_pendown);
> > > +		return err;
> > 
> > and now you miss a gpio_free().
> 
> Better use gpio_request_one()?

Why not ?!? I'm not sure if $SUBJECT is the best for that though.

-- 
balbi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03 10:10   ` Wolfram Sang
  2011-02-03 10:22     ` Felipe Balbi
@ 2011-02-03 11:42     ` Poddar, Sourav
  1 sibling, 0 replies; 7+ messages in thread
From: Poddar, Sourav @ 2011-02-03 11:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Felipe Balbi, dmitry.torokhov, charu, linux-input, linux-omap,
	linux-arm-kernel, gadiyar

On Thu, Feb 3, 2011 at 3:40 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Thu, Feb 03, 2011 at 11:58:45AM +0200, Felipe Balbi wrote:
>> On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
>> > The ads7846 driver requests a gpio to detect pendown events,
>> > but does not configure its direction. Configure this gpio
>> > as an input after requesting it.
>> >
>> > Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>> > ---
>> > changes between v2 and v1: Added return error support in v2.
>> >
>> > drivers/input/touchscreen/ads7846.c |    7 +++++++
>> > 1 files changed, 7 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>> > index 036f245..f30768b 100644
>> > --- a/drivers/input/touchscreen/ads7846.c
>> > +++ b/drivers/input/touchscreen/ads7846.c
>> > @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>> >             return err;
>> >     }
>> >
>> > +   err = gpio_direction_input(pdata->gpio_pendown);
>> > +   if (err) {
>> > +           dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
>> > +                   pdata->gpio_pendown);
>> > +           return err;
>>
>> and now you miss a gpio_free().
>
> Better use gpio_request_one()?

Totally agreed,using gpio_request_one seems to be the better option.
Will post a patch for it.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
  2011-02-03 10:04   ` Varadarajan, Charulatha
@ 2011-02-03 13:01     ` Poddar, Sourav
  0 siblings, 0 replies; 7+ messages in thread
From: Poddar, Sourav @ 2011-02-03 13:01 UTC (permalink / raw)
  To: Varadarajan, Charulatha
  Cc: dmitry.torokhov, linux-omap, linux-arm-kernel, gadiyar,
	linux-input, balbi

On Thu, Feb 3, 2011 at 3:34 PM, Varadarajan, Charulatha <charu@ti.com> wrote:
> Sourav,
>
> On Thu, Feb 3, 2011 at 15:28, Felipe Balbi <balbi@ti.com> wrote:
>> On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
>>> The ads7846 driver requests a gpio to detect pendown events,
>>> but does not configure its direction. Configure this gpio
>>> as an input after requesting it.
>>>
>>> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>>> ---
>>> changes between v2 and v1: Added return error support in v2.
>>>
>>> drivers/input/touchscreen/ads7846.c |    7 +++++++
>>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>>> index 036f245..f30768b 100644
>>> --- a/drivers/input/touchscreen/ads7846.c
>>> +++ b/drivers/input/touchscreen/ads7846.c
>>> @@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
>>>               return err;
>>>       }
>>>
>>> +     err = gpio_direction_input(pdata->gpio_pendown);
>>> +     if (err) {
>>> +             dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
>>> +                     pdata->gpio_pendown);
>>> +             return err;
>>
>> and now you miss a gpio_free().
>
> My question to your previous version is still unanswered.
> Would it be relevant to add gpio_set_debounce() for this
> gpio?
>
 I was also wondering that.I too think that just a request and then an
 configuring direction would do.But,I am not so sure about this one.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-03 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03  9:48 [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input Sourav Poddar
2011-02-03  9:58 ` Felipe Balbi
2011-02-03 10:04   ` Varadarajan, Charulatha
2011-02-03 13:01     ` Poddar, Sourav
2011-02-03 10:10   ` Wolfram Sang
2011-02-03 10:22     ` Felipe Balbi
2011-02-03 11:42     ` Poddar, Sourav

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).