* [PATCH 0/2] qt1070 & gpio_keys add pinctrl consumer
@ 2012-10-23 13:16 Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 1/2] input: qt1070: " Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-23 13:16 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Linus Walleij, linux-input
Hi,
The following patch series add the pinctrl support to the follwing
keybords:
- gpio_keys
- qt1070
The pinctrl is optionnal as not everyone need it
If no objection I'll apply them via at91 as I have a long patch series
of pinctrl for at91
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (2):
input: qt1070: add pinctrl consumer
input: gpio_keys: add pinctrl consumer
drivers/input/keyboard/gpio_keys.c | 11 +++++++++++
drivers/input/keyboard/qt1070.c | 11 +++++++++++
2 files changed, 22 insertions(+)
Best Regards,
J.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] input: qt1070: add pinctrl consumer
2012-10-23 13:16 [PATCH 0/2] qt1070 & gpio_keys add pinctrl consumer Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-23 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 2/2] input: gpio_keys: " Jean-Christophe PLAGNIOL-VILLARD
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-23 13:29 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Linus Walleij, Jean-Christophe PLAGNIOL-VILLARD, linux-input
If no pinctrl available just report a warning as some architecture may not
need to do anything.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-input@vger.kernel.org
---
drivers/input/keyboard/qt1070.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index ca68f29..967734e 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -33,6 +33,7 @@
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
+#include <linux/pinctrl/consumer.h>
/* Address for each register */
#define CHIP_ID 0x00
@@ -147,6 +148,7 @@ static int __devinit qt1070_probe(struct i2c_client *client,
struct input_dev *input;
int i;
int err;
+ struct pinctrl *pinctrl;
err = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE);
if (!err) {
@@ -155,6 +157,15 @@ static int __devinit qt1070_probe(struct i2c_client *client,
return -ENODEV;
}
+ pinctrl = devm_pinctrl_get_select_default(&client->dev);
+ if (IS_ERR(pinctrl)) {
+ err = PTR_ERR(pinctrl);
+ if (err == -EPROBE_DEFER)
+ return err;
+
+ dev_warn(&client->dev, "No pinctrl provided\n");
+ }
+
if (!client->irq) {
dev_err(&client->dev, "please assign the irq to this device\n");
return -EINVAL;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] input: gpio_keys: add pinctrl consumer
2012-10-23 13:29 ` [PATCH 1/2] input: qt1070: " Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-23 13:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-26 3:51 ` [PATCH 1/2] input: qt1070: " Bo Shen
2012-10-30 21:37 ` Linus Walleij
2 siblings, 0 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-23 13:29 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Linus Walleij, Jean-Christophe PLAGNIOL-VILLARD, linux-input
If no pinctrl available just report a warning as some architecture may not
need to do anything.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-input@vger.kernel.org
---
drivers/input/keyboard/gpio_keys.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 6a68041..c0432fe 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);
@@ -673,6 +675,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
return PTR_ERR(pdata);
}
+ pinctrl = devm_pinctrl_get_select_default(dev);
+ if (IS_ERR(pinctrl)) {
+ error = PTR_ERR(pinctrl);
+ if (error == -EPROBE_DEFER)
+ return error;
+
+ dev_warn(dev, "No pinctrl provided\n");
+ }
+
ddata = kzalloc(sizeof(struct gpio_keys_drvdata) +
pdata->nbuttons * sizeof(struct gpio_button_data),
GFP_KERNEL);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] input: qt1070: add pinctrl consumer
2012-10-23 13:29 ` [PATCH 1/2] input: qt1070: " Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 2/2] input: gpio_keys: " Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-26 3:51 ` Bo Shen
2012-10-30 21:37 ` Linus Walleij
2 siblings, 0 replies; 6+ messages in thread
From: Bo Shen @ 2012-10-26 3:51 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: linux-arm-kernel, Linus Walleij, linux-input
On 10/23/2012 21:29, Jean-Christophe PLAGNIOL-VILLARD wrote:
> If no pinctrl available just report a warning as some architecture may not
> need to do anything.
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-input@vger.kernel.org
> ---
> drivers/input/keyboard/qt1070.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Test it on sam9x5ek board with qt1070. It works well.
Tested-by: Bo Shen <voice.shen@atmel.com>
> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
> index ca68f29..967734e 100644
> --- a/drivers/input/keyboard/qt1070.c
> +++ b/drivers/input/keyboard/qt1070.c
> @@ -33,6 +33,7 @@
> #include <linux/interrupt.h>
> #include <linux/jiffies.h>
> #include <linux/delay.h>
> +#include <linux/pinctrl/consumer.h>
>
> /* Address for each register */
> #define CHIP_ID 0x00
> @@ -147,6 +148,7 @@ static int __devinit qt1070_probe(struct i2c_client *client,
> struct input_dev *input;
> int i;
> int err;
> + struct pinctrl *pinctrl;
>
> err = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE);
> if (!err) {
> @@ -155,6 +157,15 @@ static int __devinit qt1070_probe(struct i2c_client *client,
> return -ENODEV;
> }
>
> + pinctrl = devm_pinctrl_get_select_default(&client->dev);
> + if (IS_ERR(pinctrl)) {
> + err = PTR_ERR(pinctrl);
> + if (err == -EPROBE_DEFER)
> + return err;
> +
> + dev_warn(&client->dev, "No pinctrl provided\n");
> + }
> +
> if (!client->irq) {
> dev_err(&client->dev, "please assign the irq to this device\n");
> return -EINVAL;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] input: qt1070: add pinctrl consumer
2012-10-23 13:29 ` [PATCH 1/2] input: qt1070: " Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 2/2] input: gpio_keys: " Jean-Christophe PLAGNIOL-VILLARD
2012-10-26 3:51 ` [PATCH 1/2] input: qt1070: " Bo Shen
@ 2012-10-30 21:37 ` Linus Walleij
2012-10-31 13:02 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2012-10-30 21:37 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: linux-arm-kernel, linux-input
On Tue, Oct 23, 2012 at 3:29 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> If no pinctrl available just report a warning as some architecture may not
> need to do anything.
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-input@vger.kernel.org
We're having a discussion on the level of where to impose pinctrl.
Jean-Christophe, could you please check the thread
"Input: omap4-keypad: Add pinctrl support"
and tell us what you think is the best approach?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] input: qt1070: add pinctrl consumer
2012-10-30 21:37 ` Linus Walleij
@ 2012-10-31 13:02 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-31 13:02 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-arm-kernel, linux-input
On 22:37 Tue 30 Oct , Linus Walleij wrote:
>
> On Tue, Oct 23, 2012 at 3:29 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
>
> > If no pinctrl available just report a warning as some architecture may not
> > need to do anything.
> >
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: linux-input@vger.kernel.org
>
> We're having a discussion on the level of where to impose pinctrl.
>
> Jean-Christophe, could you please check the thread
> "Input: omap4-keypad: Add pinctrl support"
> and tell us what you think is the best approach?
ok I check it
Best Regards,
J.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-31 13:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-23 13:16 [PATCH 0/2] qt1070 & gpio_keys add pinctrl consumer Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 1/2] input: qt1070: " Jean-Christophe PLAGNIOL-VILLARD
2012-10-23 13:29 ` [PATCH 2/2] input: gpio_keys: " Jean-Christophe PLAGNIOL-VILLARD
2012-10-26 3:51 ` [PATCH 1/2] input: qt1070: " Bo Shen
2012-10-30 21:37 ` Linus Walleij
2012-10-31 13:02 ` Jean-Christophe PLAGNIOL-VILLARD
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).