Skip to contentSkip to conversation

input: gpio_keys_polled: Request GPIO pin as input.

DISCUSSION Vincent Pelletier 3 participants 6 messages Aug 17, 2015 – Aug 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

Please keep me cc'ed on replies, I'm not subscribed.

Regards,
--
Vincent Pelletier

#1 lore raw

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

---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/gpio_keys_polled.c +1 -1
index 097d721..c6dc644 100644
@@ -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;
Signature · 1 line
2.5.0
#3 lore raw

Changes since try 1:
- Added Reviewed-By Mika
- Made commit log more verbose (I'm very bad at this suggestions very welcome)

Regards,
--
Vincent Pelletier

#4 lore raw

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

---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/gpio_keys_polled.c +1 -1
index 097d721..c6dc644 100644
@@ -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;
Signature · 1 line
2.5.0
maintainer
#5 lore raw
Quoted 9 lines · Vincent Pelletier

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

Applied and tagged for stable, thank you.

Quoted 24 lines
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/gpio_keys_polled.c +1 -1
index 097d721..c6dc644 100644
@@ -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;
Signature · 6 lines
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Dmitry