* [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl
@ 2012-12-06 10:18 Sachin Kamat
2012-12-06 19:29 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2012-12-06 10:18 UTC (permalink / raw)
To: linux-input
Cc: dmitry.torokhov, kgene.kim, sachin.kamat, linus.walleij, patches
Added support for pin configuration using pinctrl subsystem
to the Samsung keypad driver.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
.../devicetree/bindings/input/samsung-keypad.txt | 12 ++++++++++++
drivers/input/keyboard/samsung-keypad.c | 7 ++++++-
2 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/samsung-keypad.txt b/Documentation/devicetree/bindings/input/samsung-keypad.txt
index ce3e394..616cfeb 100644
--- a/Documentation/devicetree/bindings/input/samsung-keypad.txt
+++ b/Documentation/devicetree/bindings/input/samsung-keypad.txt
@@ -25,6 +25,7 @@ Required Board Specific Properties:
- samsung,keypad-num-columns: Number of column lines connected to the
keypad controller.
+- Samsung GPIO variant (deprecated):
- row-gpios: List of gpios used as row lines. The gpio specifier for
this property depends on the gpio controller to which these row lines
are connected.
@@ -33,6 +34,10 @@ Required Board Specific Properties:
this property depends on the gpio controller to which these column
lines are connected.
+- Pinctrl variant (preferred, if available):
+ - pinctrl-0: Pin control group to be used for this controller.
+ - pinctrl-names: Should contain only one value - "default".
+
- Keys represented as child nodes: Each key connected to the keypad
controller is represented as a child node to the keypad controller
device node and should include the following properties.
@@ -56,6 +61,7 @@ Example:
linux,input-no-autorepeat;
linux,input-wakeup;
+ /* Samsung GPIO variant begins here */
row-gpios = <&gpx2 0 3 3 0
&gpx2 1 3 3 0>;
@@ -67,6 +73,12 @@ Example:
&gpx1 5 3 0 0
&gpx1 6 3 0 0
&gpx1 7 3 0 0>;
+ /* Samsung GPIO variant ends here */
+
+ /* Pinctrl variant begins here */
+ pinctrl-0 = <&keypad_row0 &keypad_col0>;
+ pinctrl-names = "default";
+ /* Pinctrl variant ends here */
key_1 {
keypad,row = <0>;
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 22e357b..18770e4 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -27,6 +27,7 @@
#include <linux/of_gpio.h>
#include <linux/sched.h>
#include <linux/input/samsung-keypad.h>
+#include <linux/pinctrl/consumer.h>
#define SAMSUNG_KEYIFCON 0x00
#define SAMSUNG_KEYIFSTSCLR 0x04
@@ -79,6 +80,7 @@ struct samsung_keypad {
unsigned int rows;
unsigned int cols;
unsigned int row_state[SAMSUNG_MAX_COLS];
+ struct pinctrl *pctrl;
#ifdef CONFIG_OF
int row_gpios[SAMSUNG_MAX_ROWS];
int col_gpios[SAMSUNG_MAX_COLS];
@@ -424,9 +426,12 @@ static int samsung_keypad_probe(struct platform_device *pdev)
keypad->stopped = true;
init_waitqueue_head(&keypad->wait);
+ keypad->pctrl = devm_pinctrl_get_select_default(&pdev->dev);
+
if (pdev->dev.of_node) {
#ifdef CONFIG_OF
- samsung_keypad_parse_dt_gpio(&pdev->dev, keypad);
+ if (IS_ERR(keypad->pctrl))
+ samsung_keypad_parse_dt_gpio(&pdev->dev, keypad);
keypad->type = of_device_is_compatible(pdev->dev.of_node,
"samsung,s5pv210-keypad");
#endif
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl
2012-12-06 10:18 [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl Sachin Kamat
@ 2012-12-06 19:29 ` Linus Walleij
2012-12-31 3:45 ` Sachin Kamat
0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2012-12-06 19:29 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-input, dmitry.torokhov, kgene.kim, patches
On Thu, Dec 6, 2012 at 11:18 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Added support for pin configuration using pinctrl subsystem
> to the Samsung keypad driver.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
So we've tried to add some pinctrl default fetchers into the input drivers
and Dmitry don't like sprinking calls like that all over the drivers so
we're trying to come up with some other scheme.
I sent one patch that tried to pick the pinctrl handles by using
notifiers but it doesn't work basically due to probe deferral.
So next approach will be to try and modify the device core to
fetch default pinctrl states.
You might try to lobby Dmitry to accepting this in the meantime,
as a stepping stone. (I'm OK with it, Acked-by).
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl
2012-12-06 19:29 ` Linus Walleij
@ 2012-12-31 3:45 ` Sachin Kamat
2012-12-31 20:20 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2012-12-31 3:45 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, kgene.kim, patches, Linus Walleij
Hi Dmitry,
On 7 December 2012 00:59, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Dec 6, 2012 at 11:18 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>
>> Added support for pin configuration using pinctrl subsystem
>> to the Samsung keypad driver.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>
> So we've tried to add some pinctrl default fetchers into the input drivers
> and Dmitry don't like sprinking calls like that all over the drivers so
> we're trying to come up with some other scheme.
>
> I sent one patch that tried to pick the pinctrl handles by using
> notifiers but it doesn't work basically due to probe deferral.
>
> So next approach will be to try and modify the device core to
> fetch default pinctrl states.
>
> You might try to lobby Dmitry to accepting this in the meantime,
> as a stepping stone. (I'm OK with it, Acked-by).
What is your opinion about this patch? Can you please accept this
until we have some common scheme to handle this.
>
> Yours,
> Linus Walleij
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl
2012-12-31 3:45 ` Sachin Kamat
@ 2012-12-31 20:20 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2012-12-31 20:20 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-input, kgene.kim, patches, Linus Walleij
Hi Sachin,
On Mon, Dec 31, 2012 at 09:15:38AM +0530, Sachin Kamat wrote:
> Hi Dmitry,
>
> On 7 December 2012 00:59, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Thu, Dec 6, 2012 at 11:18 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> >
> >> Added support for pin configuration using pinctrl subsystem
> >> to the Samsung keypad driver.
> >>
> >> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> >
> > So we've tried to add some pinctrl default fetchers into the input drivers
> > and Dmitry don't like sprinking calls like that all over the drivers so
> > we're trying to come up with some other scheme.
> >
> > I sent one patch that tried to pick the pinctrl handles by using
> > notifiers but it doesn't work basically due to probe deferral.
> >
> > So next approach will be to try and modify the device core to
> > fetch default pinctrl states.
> >
> > You might try to lobby Dmitry to accepting this in the meantime,
> > as a stepping stone. (I'm OK with it, Acked-by).
>
> What is your opinion about this patch? Can you please accept this
> until we have some common scheme to handle this.
I'd rather we wait for the device core patch to get in (I believe Greg
KH was basically OK with it so 3.9 is the current target) and you
carried this patch locally for now.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-31 20:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06 10:18 [PATCH 1/1] Input: samsung-keypad: Add support for pinctrl Sachin Kamat
2012-12-06 19:29 ` Linus Walleij
2012-12-31 3:45 ` Sachin Kamat
2012-12-31 20:20 ` Dmitry Torokhov
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).