[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

7 messages, 4 authors, 2011-02-03 · open the first message on its own page

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Sourav Poddar <hidden>
Date: 2011-02-03 09:48:50

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 <redacted>
---
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

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Felipe Balbi <hidden>
Date: 2011-02-03 09:58:45

On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
quoted hunk
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 <redacted>
---
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

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Varadarajan, Charulatha <hidden>
Date: 2011-02-03 10:04:56

Sourav,

On Thu, Feb 3, 2011 at 15:28, Felipe Balbi [off-list ref] wrote:
On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
quoted
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 <redacted>
---
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

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Wolfram Sang <hidden>
Date: 2011-02-03 10:10:33

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:
quoted
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 <redacted>
---
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/  |

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Felipe Balbi <hidden>
Date: 2011-02-03 10:22:42

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:
quoted
On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
quoted
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 <redacted>
---
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

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Poddar, Sourav <hidden>
Date: 2011-02-03 11:42:56

On Thu, Feb 3, 2011 at 3:40 PM, Wolfram Sang [off-list ref] wrote:
On Thu, Feb 03, 2011 at 11:58:45AM +0200, Felipe Balbi wrote:
quoted
On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
quoted
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 <redacted>
---
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

[PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input

From: Poddar, Sourav <hidden>
Date: 2011-02-03 13:01:24

On Thu, Feb 3, 2011 at 3:34 PM, Varadarajan, Charulatha [off-list ref] wrote:
Sourav,

On Thu, Feb 3, 2011 at 15:28, Felipe Balbi [off-list ref] wrote:
quoted
On Thu, Feb 03, 2011 at 03:18:50PM +0530, Sourav Poddar wrote:
quoted
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 <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help