diff mbox

[v8,09/12] pinctrl: generic: add auto pull config parameter

Message ID 1360602659-4774-10-git-send-email-haojian.zhuang@linaro.org
State Superseded
Headers show

Commit Message

Haojian Zhuang Feb. 11, 2013, 5:10 p.m. UTC
There's only one bit to control pin bias as enabled or disabled for some
pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
since they're similiar concepts.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 drivers/pinctrl/pinconf-generic.c       |    1 +
 include/linux/pinctrl/pinconf-generic.h |    3 +++
 2 files changed, 4 insertions(+)

Comments

Tony Lindgren Feb. 13, 2013, 11:40 p.m. UTC | #1
* Haojian Zhuang <haojian.zhuang@linaro.org> [130211 09:15]:
> There's only one bit to control pin bias as enabled or disabled for some
> pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
> User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
> since they're similiar concepts.

Please just drop patch from the series for now. This needs further research
on what the hardware is actually doing. I suspect we can replace this with
just either PIN_CONFIG_BIAS_PULL_UP or PIN_CONFIG_BIAS_PULL_DOWN.

Regards,

Tony
 
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> ---
>  drivers/pinctrl/pinconf-generic.c       |    1 +
>  include/linux/pinctrl/pinconf-generic.h |    3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
> index ef24230..4a67848 100644
> --- a/drivers/pinctrl/pinconf-generic.c
> +++ b/drivers/pinctrl/pinconf-generic.c
> @@ -37,6 +37,7 @@ struct pin_config_item {
>  struct pin_config_item conf_items[] = {
>  	PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL),
>  	PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL),
> +	PCONFDUMP(PIN_CONFIG_BIAS_AUTO_PULL, "input bias auto pull", NULL),
>  	PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL),
>  	PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL),
>  	PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL),
> diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
> index 3e7909a..f2daff4 100644
> --- a/include/linux/pinctrl/pinconf-generic.h
> +++ b/include/linux/pinctrl/pinconf-generic.h
> @@ -29,6 +29,8 @@
>   *	if for example some other pin is going to drive the signal connected
>   *	to it for a while. Pins used for input are usually always high
>   *	impedance.
> + * @PIN_CONFIG_BIAS_AUTO_PULL: the pin will be pulled without specifying
> + *      pull-up or pull-down.
>   * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
>   *	impedance to VDD). If the argument is != 0 pull-up is enabled,
>   *	if it is 0, pull-up is disabled.
> @@ -76,6 +78,7 @@
>  enum pin_config_param {
>  	PIN_CONFIG_BIAS_DISABLE,
>  	PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
> +	PIN_CONFIG_BIAS_AUTO_PULL,
>  	PIN_CONFIG_BIAS_PULL_UP,
>  	PIN_CONFIG_BIAS_PULL_DOWN,
>  	PIN_CONFIG_DRIVE_PUSH_PULL,
> -- 
> 1.7.10.4
>
Linus Walleij Feb. 15, 2013, 8:54 a.m. UTC | #2
On Mon, Feb 11, 2013 at 6:10 PM, Haojian Zhuang
<haojian.zhuang@linaro.org> wrote:

> There's only one bit to control pin bias as enabled or disabled for some
> pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
> User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
> since they're similiar concepts.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

Makes perfect sense.
Patch applied with Tony's ACK!

Yours,
Linus Walleij
Tony Lindgren Feb. 15, 2013, 4:37 p.m. UTC | #3
* Linus Walleij <linus.walleij@linaro.org> [130215 00:58]:
> On Mon, Feb 11, 2013 at 6:10 PM, Haojian Zhuang
> <haojian.zhuang@linaro.org> wrote:
> 
> > There's only one bit to control pin bias as enabled or disabled for some
> > pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
> > User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
> > since they're similiar concepts.
> >
> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> 
> Makes perfect sense.
> Patch applied with Tony's ACK!

Sorry the conclusion was that this probably won't be needed and can
probably be done with just PULL_UP/PULL_DOWN.

So can you please drop or revert this AUTO_PULL one?

Regards,

Tony
Linus Walleij Feb. 15, 2013, 8:55 p.m. UTC | #4
On Fri, Feb 15, 2013 at 5:37 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Linus Walleij <linus.walleij@linaro.org> [130215 00:58]:
>> On Mon, Feb 11, 2013 at 6:10 PM, Haojian Zhuang
>> <haojian.zhuang@linaro.org> wrote:
>>
>> > There's only one bit to control pin bias as enabled or disabled for some
>> > pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
>> > User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
>> > since they're similiar concepts.
>> >
>> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
>>
>> Makes perfect sense.
>> Patch applied with Tony's ACK!
>
> Sorry the conclusion was that this probably won't be needed and can
> probably be done with just PULL_UP/PULL_DOWN.
>
> So can you please drop or revert this AUTO_PULL one?

Sorry I was drunk or something.

I never applied this patch, I applied the other one,
with the title "pinctrl: generic: rename input schmitt disable".

This one stays out.

Yours,
Linus Walleij
Tony Lindgren Feb. 15, 2013, 9:06 p.m. UTC | #5
* Linus Walleij <linus.walleij@linaro.org> [130215 12:58]:
> On Fri, Feb 15, 2013 at 5:37 PM, Tony Lindgren <tony@atomide.com> wrote:
> > * Linus Walleij <linus.walleij@linaro.org> [130215 00:58]:
> >> On Mon, Feb 11, 2013 at 6:10 PM, Haojian Zhuang
> >> <haojian.zhuang@linaro.org> wrote:
> >>
> >> > There's only one bit to control pin bias as enabled or disabled for some
> >> > pins in OMAP SoC. So append PIN_CONFIG_BIAS_AUTO_PULL for this case.
> >> > User shouldn't switch pin state between AUTO_PULL and PULL_UP/PULL_DOWN,
> >> > since they're similiar concepts.
> >> >
> >> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> >>
> >> Makes perfect sense.
> >> Patch applied with Tony's ACK!
> >
> > Sorry the conclusion was that this probably won't be needed and can
> > probably be done with just PULL_UP/PULL_DOWN.
> >
> > So can you please drop or revert this AUTO_PULL one?
> 
> Sorry I was drunk or something.
> 
> I never applied this patch, I applied the other one,
> with the title "pinctrl: generic: rename input schmitt disable".
> 
> This one stays out.

OK thanks for clarifying it :)

Tony
diff mbox

Patch

diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index ef24230..4a67848 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -37,6 +37,7 @@  struct pin_config_item {
 struct pin_config_item conf_items[] = {
 	PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL),
 	PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL),
+	PCONFDUMP(PIN_CONFIG_BIAS_AUTO_PULL, "input bias auto pull", NULL),
 	PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL),
 	PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL),
 	PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL),
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 3e7909a..f2daff4 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -29,6 +29,8 @@ 
  *	if for example some other pin is going to drive the signal connected
  *	to it for a while. Pins used for input are usually always high
  *	impedance.
+ * @PIN_CONFIG_BIAS_AUTO_PULL: the pin will be pulled without specifying
+ *      pull-up or pull-down.
  * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
  *	impedance to VDD). If the argument is != 0 pull-up is enabled,
  *	if it is 0, pull-up is disabled.
@@ -76,6 +78,7 @@ 
 enum pin_config_param {
 	PIN_CONFIG_BIAS_DISABLE,
 	PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
+	PIN_CONFIG_BIAS_AUTO_PULL,
 	PIN_CONFIG_BIAS_PULL_UP,
 	PIN_CONFIG_BIAS_PULL_DOWN,
 	PIN_CONFIG_DRIVE_PUSH_PULL,