linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benoit Cousson <b-cousson-l0cyMroinI0@public.gmane.org>
To: Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support
Date: Tue, 23 Oct 2012 11:18:12 +0200	[thread overview]
Message-ID: <508660D4.9030507@ti.com> (raw)
In-Reply-To: <20121022155028.GA13791-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>

Hi Dimitry,

On 10/22/2012 05:50 PM, Dmitry Torokhov wrote:
> Hi Sourav,
> 
> On Mon, Oct 22, 2012 at 06:43:00PM +0530, Sourav Poddar wrote:
>> Adapt keypad to use pinctrl framework.
>>
>> Tested on omap4430 sdp with 3.7-rc1 kernel.
> 
> I do not see anything in the driver that would directly use pinctrl. Is
> there a better place to select default pin configuration; maybe when
> instantiating platform device?

Why?
The devm_pinctrl_get_select_default is using the pinctrl.
That's why it is named "get_select_default" and not "get" only.
This API ensure that the pin will be set to the default state, and this
is all we need to do during the probe.

There is no point to change the mux if the driver is not probed, because
potentially the pin can be use be another driver.
So probe is the right place to do that for my point of view. Moreover
with DT we don't have that board static config like we had before to do
that kind of pin mux init.

But, maybe I'm missing your point.

Regards,
Benoit


> 
> Thanks.
> 
>>
>> Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
>> Cc: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Signed-off-by: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
>> ---
>> v1->v2
>> - Added "PROBE_DEFER" check 
>>  drivers/input/keyboard/omap4-keypad.c |   11 +++++++++++
>>  1 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
>> index c05f98c..502b832 100644
>> --- a/drivers/input/keyboard/omap4-keypad.c
>> +++ b/drivers/input/keyboard/omap4-keypad.c
>> @@ -31,6 +31,7 @@
>>  #include <linux/input.h>
>>  #include <linux/slab.h>
>>  #include <linux/pm_runtime.h>
>> +#include <linux/pinctrl/consumer.h>
>>  
>>  #include <linux/platform_data/omap4-keypad.h>
>>  
>> @@ -76,6 +77,7 @@ enum {
>>  
>>  struct omap4_keypad {
>>  	struct input_dev *input;
>> +	struct pinctrl	*pins;
>>  
>>  	void __iomem *base;
>>  	unsigned int irq;
>> @@ -298,6 +300,15 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>>  		goto err_release_mem;
>>  	}
>>  
>> +	keypad_data->pins = devm_pinctrl_get_select_default(&pdev->dev);
>> +	if (IS_ERR(keypad_data->pins)) {
>> +		if (PTR_ERR(keypad_data->pins) == -EPROBE_DEFER)
>> +			return -EPROBE_DEFER;
>> +
>> +		dev_warn(&pdev->dev, "did not get pins for keypad error: %li\n",
>> +					PTR_ERR(keypad_data->pins));
>> +		keypad_data->pins = NULL;
>> +	}
>>  
>>  	/*
>>  	 * Enable clocks for the keypad module so that we can read
>> -- 
>> 1.7.1
>>
> 

  parent reply	other threads:[~2012-10-23  9:18 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 13:13 [PATCHv2] Input: omap4-keypad: Add pinctrl support Sourav Poddar
2012-10-22 15:50 ` Dmitry Torokhov
2012-10-23  9:13   ` Linus Walleij
2012-10-23  9:35     ` Benoit Cousson
2012-10-23 10:04       ` Linus Walleij
2012-10-23 10:03         ` Felipe Balbi
2012-10-23 10:23           ` Thomas Petazzoni
2012-10-23 10:29             ` Linus Walleij
2012-10-23 10:29               ` Felipe Balbi
2012-10-23 10:45                 ` Linus Walleij
2012-10-23 10:42                   ` Felipe Balbi
2012-10-23 11:11                   ` Thomas Petazzoni
2012-10-23 17:02           ` Mitch Bradley
2012-10-23 17:20             ` Felipe Balbi
2012-10-23 17:51               ` Mitch Bradley
     [not found]                 ` <5086D91A.5080109-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-10-23 17:51                   ` Felipe Balbi
     [not found]   ` <20121022155028.GA13791-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-23  9:18     ` Benoit Cousson [this message]
2012-10-23 20:02       ` Dmitry Torokhov
     [not found]         ` <20121023200249.GA2712-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-24  8:37           ` Felipe Balbi
2012-10-24 16:14             ` Dmitry Torokhov
2012-10-24 16:51               ` Linus Walleij
2012-10-24 17:28                 ` Dmitry Torokhov
2012-10-24 18:58                   ` Felipe Balbi
     [not found]                     ` <20121024185818.GB772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-25 20:59                       ` Mark Brown
2012-10-26  6:20                         ` Felipe Balbi
2012-10-26 16:03                           ` Mark Brown
2012-10-29 19:49                             ` Felipe Balbi
2012-10-30 11:24                               ` Mark Brown
2012-10-30 11:49                                 ` Felipe Balbi
2012-10-30 14:07                                   ` Mark Brown
2012-10-30 14:16                                     ` Linus Walleij
2012-10-30 14:54                                       ` Mark Brown
2012-10-30 15:16                                     ` Felipe Balbi
2012-10-30 15:58                                       ` Mark Brown
2012-10-30 17:25                                         ` Felipe Balbi
2012-10-30 18:20                                           ` Dmitry Torokhov
2012-10-30 18:48                                             ` Felipe Balbi
2012-10-30 18:37                                           ` Mark Brown
2012-10-30 21:51                                             ` Linus Walleij
2012-10-30 22:57                                               ` Rafael J. Wysocki
2012-11-02 18:26                                               ` Mark Brown
2012-10-30 14:11                                   ` Linus Walleij
2012-10-28 20:12                   ` Linus Walleij
     [not found]                     ` <CACRpkdaiLXVeUg1quuw3XPTenbKOjn+aWbGQezpcyvzQCtCWow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-30 11:34                       ` Mark Brown
2012-10-30 14:02                         ` Linus Walleij
2012-10-30 14:37                           ` Mark Brown
2012-10-31 20:10                           ` Kevin Hilman
     [not found]                             ` <87obji8kta.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2012-11-01  8:54                               ` Linus Walleij
2012-11-01  8:56                                 ` Fwd: " Linus Walleij
2012-11-01 11:42                                   ` Kevin Hilman
2012-11-01 13:22                                     ` Linus Walleij
2012-11-01 12:07                                 ` Mark Brown
2012-11-01 14:01                                   ` Linus Walleij
2012-11-01 14:19                                     ` Mark Brown
2012-11-11 12:32                                     ` Linus Walleij
2012-10-31 13:19                     ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]               ` <20121024161429.GA16350-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-24 16:52                 ` Felipe Balbi
2012-10-24 17:13                   ` Linus Walleij
2012-10-24 17:34                   ` Dmitry Torokhov
2012-10-24 17:46               ` Benoit Cousson
2012-10-24 12:54         ` Linus Walleij
2012-10-24 16:18           ` Dmitry Torokhov
2012-10-24 16:57             ` Felipe Balbi
2012-10-24 17:18               ` Linus Walleij
2012-10-24 17:58               ` Dmitry Torokhov
2012-10-24 19:10                 ` Felipe Balbi
     [not found]                   ` <20121024191042.GC772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-24 19:38                     ` Dmitry Torokhov
2012-10-24 19:51                       ` Felipe Balbi
2012-10-24 17:01             ` Linus Walleij

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=508660D4.9030507@ti.com \
    --to=b-cousson-l0cymroini0@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sourav.poddar-l0cyMroinI0@public.gmane.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).