linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect
@ 2016-12-16  9:44 Peter Rosin
  2016-12-16 10:55 ` Jon Hunter
  2016-12-17 14:50 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Rosin @ 2016-12-16  9:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Sebastian Reichel, Rob Herring, Mark Rutland,
	Jon Hunter, Stephen Warren, linux-pm, devicetree

The ACOK pin on the bq24735 is active-high, of course meaning that when
AC is OK the pin is high. However, all Tegra dts files have incorrectly
specified active-high even though the signal is inverted on the Tegra
boards. This has worked since the Linux driver has also inverted the
meaning of the GPIO. Fix this situation by simply specifying in the
bindings what everybody else agrees on; that the ti,ac-detect-gpios is
active on AC adapter absence.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 Documentation/devicetree/bindings/power/supply/ti,bq24735.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Hi!

v3 -> v4 changes:
- improve the bindings text in the spirit of remarks from Jon Hunter

(There were no v1 nor v2, I made a mistake and started from v3 this time.)

This patch is the result of this discussion:
http://marc.info/?t=148152531800002

I don't like how it changes the one thing that is seems correct, but
what to do?

Cheers,
peda

diff --git a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
index 3bf55757ceec..c95e16e2dc56 100644
--- a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
+++ b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
@@ -8,8 +8,10 @@ Optional properties :
  - interrupts : Specify the interrupt to be used to trigger when the AC
    adapter is either plugged in or removed.
  - ti,ac-detect-gpios : This GPIO is optionally used to read the AC adapter
-   presence. This is a Host GPIO that is configured as an input and
-   connected to the bq24735.
+   status. This is a Host GPIO that is configured as an input and connected
+   to the ACOK pin on the bq24735. Note: for backwards compatibility reasons,
+   the GPIO must be active on AC adapter absence despite ACOK being active
+   (high) on AC adapter presence.
  - ti,charge-current : Used to control and set the charging current. This value
    must be between 128mA and 8.128A with a 64mA step resolution. The POR value
    is 0x0000h. This number is in mA (e.g. 8192), see spec for more information
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect
  2016-12-16  9:44 [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect Peter Rosin
@ 2016-12-16 10:55 ` Jon Hunter
  2016-12-17 14:50 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2016-12-16 10:55 UTC (permalink / raw)
  To: Peter Rosin, linux-kernel
  Cc: Sebastian Reichel, Rob Herring, Mark Rutland, Stephen Warren,
	linux-pm, devicetree


On 16/12/16 09:44, Peter Rosin wrote:
> The ACOK pin on the bq24735 is active-high, of course meaning that when
> AC is OK the pin is high. However, all Tegra dts files have incorrectly
> specified active-high even though the signal is inverted on the Tegra
> boards. This has worked since the Linux driver has also inverted the
> meaning of the GPIO. Fix this situation by simply specifying in the
> bindings what everybody else agrees on; that the ti,ac-detect-gpios is
> active on AC adapter absence.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
>  Documentation/devicetree/bindings/power/supply/ti,bq24735.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Hi!
> 
> v3 -> v4 changes:
> - improve the bindings text in the spirit of remarks from Jon Hunter
> 
> (There were no v1 nor v2, I made a mistake and started from v3 this time.)
> 
> This patch is the result of this discussion:
> http://marc.info/?t=148152531800002
> 
> I don't like how it changes the one thing that is seems correct, but
> what to do?
> 
> Cheers,
> peda
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
> index 3bf55757ceec..c95e16e2dc56 100644
> --- a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
> +++ b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
> @@ -8,8 +8,10 @@ Optional properties :
>   - interrupts : Specify the interrupt to be used to trigger when the AC
>     adapter is either plugged in or removed.
>   - ti,ac-detect-gpios : This GPIO is optionally used to read the AC adapter
> -   presence. This is a Host GPIO that is configured as an input and
> -   connected to the bq24735.
> +   status. This is a Host GPIO that is configured as an input and connected
> +   to the ACOK pin on the bq24735. Note: for backwards compatibility reasons,
> +   the GPIO must be active on AC adapter absence despite ACOK being active
> +   (high) on AC adapter presence.
>   - ti,charge-current : Used to control and set the charging current. This value
>     must be between 128mA and 8.128A with a 64mA step resolution. The POR value
>     is 0x0000h. This number is in mA (e.g. 8192), see spec for more information

Thanks.

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect
  2016-12-16  9:44 [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect Peter Rosin
  2016-12-16 10:55 ` Jon Hunter
@ 2016-12-17 14:50 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2016-12-17 14:50 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Rob Herring, Mark Rutland, Jon Hunter,
	Stephen Warren, linux-pm, devicetree

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

Hi,

On Fri, Dec 16, 2016 at 10:44:00AM +0100, Peter Rosin wrote:
> The ACOK pin on the bq24735 is active-high, of course meaning that when
> AC is OK the pin is high. However, all Tegra dts files have incorrectly
> specified active-high even though the signal is inverted on the Tegra
> boards. This has worked since the Linux driver has also inverted the
> meaning of the GPIO. Fix this situation by simply specifying in the
> bindings what everybody else agrees on; that the ti,ac-detect-gpios is
> active on AC adapter absence.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>

Thanks for your patch. We are currently in the merge
window and your patch will appear in linux-next once
4.10-rc1 has been tagged by Linus Torvalds.

Until then I queued it into this branch:

https://git.kernel.org/cgit/linux/kernel/git/sre/linux-power-supply.git/log/?h=for-next-next

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-17 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16  9:44 [PATCH v4] dt-bindings: power: supply: bq24735: reverse the polarity of ac-detect Peter Rosin
2016-12-16 10:55 ` Jon Hunter
2016-12-17 14:50 ` Sebastian Reichel

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).