devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix some GPIO setup on Pinebook Pro
@ 2020-04-14 16:39 Tobias Schramm
  2020-04-14 16:39 ` [PATCH 1/2] arm64: dts: rockchip: fix inverted headphone detection Tobias Schramm
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tobias Schramm @ 2020-04-14 16:39 UTC (permalink / raw)
  To: Rob Herring, Heiko Stuebner
  Cc: devicetree, linux-rockchip, linux-kernel, Tobias Schramm

This patchset contains two small fixes for the dts of the Pinebook Pro.
The first fixes inverted logic on the headphone detect GPIO.
The second patch fixes unreliable DC charger detection.

Tobias Schramm (2):
  arm64: dts: rockchip: fix inverted headphone detection
  arm64: dts: rockchip: enable DC charger detection pullup

 arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.26.0


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

* [PATCH 1/2] arm64: dts: rockchip: fix inverted headphone detection
  2020-04-14 16:39 [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Tobias Schramm
@ 2020-04-14 16:39 ` Tobias Schramm
  2020-04-14 16:39 ` [PATCH 2/2] arm64: dts: rockchip: enable DC charger detection pullup Tobias Schramm
  2020-04-19 11:39 ` [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Tobias Schramm @ 2020-04-14 16:39 UTC (permalink / raw)
  To: Rob Herring, Heiko Stuebner
  Cc: devicetree, linux-rockchip, linux-kernel, Tobias Schramm

On the Pinebook Pro the headphone jack is dual use. It can be used either
as a normal headphone jack or as a debug serial connection. This
functionality is controlled via a small hardware switch on the mainboard.
Unfortunately flipping this switch biases the headphone detection switch
inside the headphone jack at 3.3 V if in `debug UART` position but
to GND when in `headphone out` position.
This results in an inversion of the headphone detection logic depending
on the switch position.
Since the headphone jack can only be used for audio when in
`headphone out` position this commit changes the headphone detect GPIO
logic to be correct for that case rather than for the debug UART.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index 5ea281b55fe2..c3f15f5bd550 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -147,7 +147,7 @@ es8316-sound {
 			"Speaker", "Speaker Amplifier OUTL",
 			"Speaker", "Speaker Amplifier OUTR";
 
-		simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>;
+		simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
 		simple-audio-card,aux-devs = <&speaker_amp>;
 		simple-audio-card,pin-switches = "Speaker";
 
@@ -794,7 +794,7 @@ dc_det_gpio: dc-det-gpio {
 
 	es8316 {
 		hp_det_gpio: hp-det-gpio {
-			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
+			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
-- 
2.26.0


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

* [PATCH 2/2] arm64: dts: rockchip: enable DC charger detection pullup
  2020-04-14 16:39 [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Tobias Schramm
  2020-04-14 16:39 ` [PATCH 1/2] arm64: dts: rockchip: fix inverted headphone detection Tobias Schramm
@ 2020-04-14 16:39 ` Tobias Schramm
  2020-04-19 11:39 ` [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Tobias Schramm @ 2020-04-14 16:39 UTC (permalink / raw)
  To: Rob Herring, Heiko Stuebner
  Cc: devicetree, linux-rockchip, linux-kernel, Tobias Schramm

On the Pinebook Pro the DC charger is detected via an open collector
transistor attached to a GPIO. This GPIO requires its pullup to be
enabled for the detection to work reliably.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index c3f15f5bd550..294d21bf45f5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -788,7 +788,7 @@ lidbtn_gpio: lidbtn-gpio {
 
 	dc-charger {
 		dc_det_gpio: dc-det-gpio {
-			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
-- 
2.26.0


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

* Re: [PATCH 0/2] Fix some GPIO setup on Pinebook Pro
  2020-04-14 16:39 [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Tobias Schramm
  2020-04-14 16:39 ` [PATCH 1/2] arm64: dts: rockchip: fix inverted headphone detection Tobias Schramm
  2020-04-14 16:39 ` [PATCH 2/2] arm64: dts: rockchip: enable DC charger detection pullup Tobias Schramm
@ 2020-04-19 11:39 ` Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2020-04-19 11:39 UTC (permalink / raw)
  To: Tobias Schramm; +Cc: Rob Herring, devicetree, linux-rockchip, linux-kernel

Am Dienstag, 14. April 2020, 18:39:50 CEST schrieb Tobias Schramm:
> This patchset contains two small fixes for the dts of the Pinebook Pro.
> The first fixes inverted logic on the headphone detect GPIO.
> The second patch fixes unreliable DC charger detection.
> 
> Tobias Schramm (2):
>   arm64: dts: rockchip: fix inverted headphone detection
>   arm64: dts: rockchip: enable DC charger detection pullup

applied as fixes for 5.7

Thanks
Heiko



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

end of thread, other threads:[~2020-04-19 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 16:39 [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Tobias Schramm
2020-04-14 16:39 ` [PATCH 1/2] arm64: dts: rockchip: fix inverted headphone detection Tobias Schramm
2020-04-14 16:39 ` [PATCH 2/2] arm64: dts: rockchip: enable DC charger detection pullup Tobias Schramm
2020-04-19 11:39 ` [PATCH 0/2] Fix some GPIO setup on Pinebook Pro Heiko Stuebner

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