All of lore.kernel.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: establish pull-up/pull-down terminology
Date: Wed, 19 Jun 2013 16:03:01 -0600	[thread overview]
Message-ID: <51C22A95.4050703@wwwdotorg.org> (raw)
In-Reply-To: <1371379548-6482-1-git-send-email-linus.walleij@stericsson.com>

On 06/16/2013 04:45 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> It is counter-intuitive to have "0" mean disable in a boolean
> manner for electronic properties of pins such as pull-up and
> pull-down. Therefore, define that a pull-up/pull-down argument
> of 0 to such a generic option means that the pin is
> short-circuited to VDD or GROUND. Pull disablement shall be
> done using PIN_CONFIG_BIAS_DISABLE.
> 
> Cc: Heiko St?bner <heiko@sntech.de>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/pinctrl/pinconf-generic.h | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
> index d414a77..67780f5 100644
> --- a/include/linux/pinctrl/pinconf-generic.h
> +++ b/include/linux/pinctrl/pinconf-generic.h
> @@ -36,14 +36,15 @@
>   *	tristate. The argument is ignored.
>   * @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.
> + *	if it is 0, pull-up it total, i.e. the pin is connected to VDD.
>   * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
>   *	impedance to GROUND). If the argument is != 0 pull-down is enabled,
> - *	if it is 0, pull-down is disabled.
> + *	if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
>   * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
>   *	on embedded knowledge of the controller, like current mux function.
> - *	If the argument is != 0 pull up/down is enabled, if it is 0,
> - *	the pull is disabled.
> + *	If the argument is != 0 pull up/down is enabled, if it is 0, the
> + *	configuration is ignored. The proper way to disable it is to use
> + *	@PIN_CONFIG_BIAS_DISABLE.

Why treat PULL_UP/PULL_DOWN differently from PULL_PIN_DEFAULT?
PULL_PIN_DEFAULT is logically simply a macro that selects PULL_UP/DOWN
based on what's "normal" for the pin's expected usage, so surely the
value associated with that option should behave identically?

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"James Hogan" <james.hogan@imgtec.com>,
	"Stephen Warren" <swarren@nvidia.com>, � <heiko@sntech.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Anmar Oueja" <anmar.oueja@linaro.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH] pinctrl: establish pull-up/pull-down terminology
Date: Wed, 19 Jun 2013 16:03:01 -0600	[thread overview]
Message-ID: <51C22A95.4050703@wwwdotorg.org> (raw)
In-Reply-To: <1371379548-6482-1-git-send-email-linus.walleij@stericsson.com>

On 06/16/2013 04:45 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> It is counter-intuitive to have "0" mean disable in a boolean
> manner for electronic properties of pins such as pull-up and
> pull-down. Therefore, define that a pull-up/pull-down argument
> of 0 to such a generic option means that the pin is
> short-circuited to VDD or GROUND. Pull disablement shall be
> done using PIN_CONFIG_BIAS_DISABLE.
> 
> Cc: Heiko St�bner <heiko@sntech.de>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/pinctrl/pinconf-generic.h | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
> index d414a77..67780f5 100644
> --- a/include/linux/pinctrl/pinconf-generic.h
> +++ b/include/linux/pinctrl/pinconf-generic.h
> @@ -36,14 +36,15 @@
>   *	tristate. The argument is ignored.
>   * @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.
> + *	if it is 0, pull-up it total, i.e. the pin is connected to VDD.
>   * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
>   *	impedance to GROUND). If the argument is != 0 pull-down is enabled,
> - *	if it is 0, pull-down is disabled.
> + *	if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
>   * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
>   *	on embedded knowledge of the controller, like current mux function.
> - *	If the argument is != 0 pull up/down is enabled, if it is 0,
> - *	the pull is disabled.
> + *	If the argument is != 0 pull up/down is enabled, if it is 0, the
> + *	configuration is ignored. The proper way to disable it is to use
> + *	@PIN_CONFIG_BIAS_DISABLE.

Why treat PULL_UP/PULL_DOWN differently from PULL_PIN_DEFAULT?
PULL_PIN_DEFAULT is logically simply a macro that selects PULL_UP/DOWN
based on what's "normal" for the pin's expected usage, so surely the
value associated with that option should behave identically?


  parent reply	other threads:[~2013-06-19 22:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16 10:45 [PATCH] pinctrl: establish pull-up/pull-down terminology Linus Walleij
2013-06-16 10:45 ` Linus Walleij
2013-06-16 14:39 ` Heiko Stübner
2013-06-16 14:39   ` Heiko Stübner
2013-06-17  2:53 ` Laurent Pinchart
2013-06-17  2:53   ` Laurent Pinchart
2013-06-17  4:38 ` Tony Prisk
2013-06-17  4:38   ` Tony Prisk
2013-06-17  5:57 ` Lothar Waßmann
2013-06-17 15:51   ` Linus Walleij
2013-06-17 15:51     ` Linus Walleij
2013-06-19 22:03 ` Stephen Warren [this message]
2013-06-19 22:03   ` Stephen Warren
2013-06-20 12:38   ` James Hogan
2013-06-20 12:38     ` James Hogan
2013-06-21 19:06     ` Stephen Warren
2013-06-21 19:06       ` Stephen Warren
2013-06-21 23:30       ` Laurent Pinchart
2013-06-21 23:30         ` Laurent Pinchart
2013-06-21 23:39         ` Heiko Stübner
2013-06-21 23:39           ` Heiko Stübner
2013-06-24 12:24           ` Linus Walleij
2013-06-24 12:24             ` Linus Walleij
2013-06-24 12:39             ` Heiko Stübner
2013-06-24 12:39               ` Heiko Stübner
2013-06-24 18:04         ` Stephen Warren
2013-06-24 18:04           ` Stephen Warren

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=51C22A95.4050703@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.