All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Pelletier <plr.vincent@gmail.com>
To: linux-input@vger.kernel.org
Cc: mika.westerberg@linux.intel.com, aaron.lu@intel.com
Subject: input: gpio_keys_polled: Request GPIO pin as input.
Date: Thu, 20 Aug 2015 19:50:00 +0200	[thread overview]
Message-ID: <7d70142c2f6133128c26cc1ca3a883d8cadbce64.1440092849.git.plr.vincent@gmail.com> (raw)
In-Reply-To: <1440093000-16946-1-git-send-email-plr.vincent@gmail.com>

GPIOF_IN flag was lost in:
Commit 633a21d80b4a("input: gpio_keys_polled: Add support for GPIO
descriptors").

Without this flag, legacy code path (for non-descriptor GPIO declarations)
would configure GPIO as output (0 meaning GPIOF_DIR_OUT | GPIOF_INIT_LOW).

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index 097d721..c6dc644 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -246,7 +246,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
 		 * convert it to descriptor.
 		 */
 		if (!button->gpiod && gpio_is_valid(button->gpio)) {
-			unsigned flags = 0;
+			unsigned flags = GPIOF_IN;
 
 			if (button->active_low)
 				flags |= GPIOF_ACTIVE_LOW;
-- 
2.5.0


  reply	other threads:[~2015-08-20 17:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-17 21:29 input: gpio_keys_polled: Request GPIO pin as input Vincent Pelletier
2015-08-17 21:29 ` Vincent Pelletier
2015-08-18 12:07   ` Mika Westerberg
2015-08-20 17:49     ` [Try 2] " Vincent Pelletier
2015-08-20 17:50       ` Vincent Pelletier [this message]
2015-08-20 19:12         ` Dmitry Torokhov

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=7d70142c2f6133128c26cc1ca3a883d8cadbce64.1440092849.git.plr.vincent@gmail.com \
    --to=plr.vincent@gmail.com \
    --cc=aaron.lu@intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.