linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] gpio-keys: Pinctrl-fy
  2012-10-31 15:56 [PATCH] gpio-keys: Pinctrl-fy Pantelis Antoniou
@ 2012-10-30 18:25 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2012-10-30 18:25 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Dmitry Torokhov, linux-input, linux-kernel, Koen Kooi,
	Matt Porter, Russ Dill, linux-omap

* Pantelis Antoniou <panto@antoniou-consulting.com> [121030 11:23]:
> Enable pinctrl support for gpio-keys.

There's some discussion going on regarding doing the
pinctrl boilerplate things somewhere else started by
Dmitry, but meanwhile:

Acked-by: Tony Lindgren <tony@atomide.com>
 
> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
>  drivers/input/keyboard/gpio_keys.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 6a68041..e421082 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -29,6 +29,7 @@
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
>  #include <linux/spinlock.h>
> +#include <linux/pinctrl/consumer.h>
>  
>  struct gpio_button_data {
>  	const struct gpio_keys_button *button;
> @@ -666,6 +667,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
>  	struct input_dev *input;
>  	int i, error;
>  	int wakeup = 0;
> +	struct pinctrl *pinctrl;
>  
>  	if (!pdata) {
>  		pdata = gpio_keys_get_devtree_pdata(dev);
> @@ -731,6 +733,10 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
>  		goto fail3;
>  	}
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(&pdev->dev, "unable to select pin group\n");
> +
>  	/* get current state of buttons that are connected to GPIOs */
>  	for (i = 0; i < pdata->nbuttons; i++) {
>  		struct gpio_button_data *bdata = &ddata->data[i];
> -- 
> 1.7.12
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* [PATCH] gpio-keys: Pinctrl-fy
@ 2012-10-31 15:56 Pantelis Antoniou
  2012-10-30 18:25 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Pantelis Antoniou @ 2012-10-31 15:56 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Pantelis Antoniou, linux-input, linux-kernel, Koen Kooi,
	Matt Porter, Russ Dill, linux-omap

Enable pinctrl support for gpio-keys.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
 drivers/input/keyboard/gpio_keys.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 6a68041..e421082 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -29,6 +29,7 @@
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/spinlock.h>
+#include <linux/pinctrl/consumer.h>
 
 struct gpio_button_data {
 	const struct gpio_keys_button *button;
@@ -666,6 +667,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 	struct input_dev *input;
 	int i, error;
 	int wakeup = 0;
+	struct pinctrl *pinctrl;
 
 	if (!pdata) {
 		pdata = gpio_keys_get_devtree_pdata(dev);
@@ -731,6 +733,10 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 		goto fail3;
 	}
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		dev_warn(&pdev->dev, "unable to select pin group\n");
+
 	/* get current state of buttons that are connected to GPIOs */
 	for (i = 0; i < pdata->nbuttons; i++) {
 		struct gpio_button_data *bdata = &ddata->data[i];
-- 
1.7.12

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

end of thread, other threads:[~2012-10-31 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 15:56 [PATCH] gpio-keys: Pinctrl-fy Pantelis Antoniou
2012-10-30 18:25 ` Tony Lindgren

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