linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: voice.shen@atmel.com (Bo Shen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] input: qt1070: add pinctrl consumer
Date: Fri, 26 Oct 2012 11:51:22 +0800	[thread overview]
Message-ID: <508A08BA.1070302@atmel.com> (raw)
In-Reply-To: <1350998942-713-1-git-send-email-plagnioj@jcrosoft.com>

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 at 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;
>

  parent reply	other threads:[~2012-10-26  3:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Bo Shen [this message]
2012-10-30 21:37   ` [PATCH 1/2] input: qt1070: " Linus Walleij
2012-10-31 13:02     ` Jean-Christophe PLAGNIOL-VILLARD

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=508A08BA.1070302@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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).