mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards
@ 2023-10-13 11:47 Christopher Obbard
  2023-10-13 11:47 ` [PATCH v1 1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 Christopher Obbard
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christopher Obbard @ 2023-10-13 11:47 UTC (permalink / raw)
  To: linux-rockchip
  Cc: kernel, Christopher Obbard, Arnaud Ferraris, Brian Norris,
	Caleb Connolly, Conor Dooley, Corentin Labbe, FUKAUMI Naoki,
	Heiko Stuebner, Jagan Teki, Johan Jonker, Judy Hsiao,
	Krzysztof Kozlowski, Rick Wertenbroek, Rob Herring, Yogesh Hegde,
	devicetree, linux-arm-kernel, linux-kernel

i2s0 fails to probe on my Radxa ROCK 4SE and ROCK Pi 4B boards with:

    rockchip-pinctrl pinctrl: pin gpio3-29 already requested by leds; cannot claim for ff880000.i2s
    rockchip-pinctrl pinctrl: pin-125 (ff880000.i2s) status -22
    rockchip-pinctrl pinctrl: could not request pin 125 (gpio3-29) from group i2s0-8ch-bus-bclk-off  on device rockchip-pinctrl
    rockchip-i2s ff880000.i2s: Error applying setting, reverse things back
    rockchip-i2s ff880000.i2s: bclk disable failed -22

This is due to the pinctl attempting to request a GPIO which the boards
use for a different function.

The first patch adds a missing pinctl node i2s0_2ch_bus_bclk_off to the
RK3399 devicetree.

The second patch sets the i2s0 pinctrl to use the new node when idle and
fixes the issue.


Christopher Obbard (2):
  arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399
  arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards

 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi |  1 +
 arch/arm64/boot/dts/rockchip/rk3399.dtsi           | 10 ++++++++++
 2 files changed, 11 insertions(+)

-- 
2.42.0


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

* [PATCH v1 1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399
  2023-10-13 11:47 [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Christopher Obbard
@ 2023-10-13 11:47 ` Christopher Obbard
  2023-10-13 11:47 ` [PATCH v1 2/2] arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards Christopher Obbard
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christopher Obbard @ 2023-10-13 11:47 UTC (permalink / raw)
  To: linux-rockchip
  Cc: kernel, Christopher Obbard, Arnaud Ferraris, Brian Norris,
	Caleb Connolly, Conor Dooley, Corentin Labbe, Heiko Stuebner,
	Johan Jonker, Judy Hsiao, Krzysztof Kozlowski, Rick Wertenbroek,
	Rob Herring, devicetree, linux-arm-kernel, linux-kernel

Commit 0efaf8078393 ("arm64: dts: rockchip: add i2s0-2ch-bus pins on
rk3399") introduced a pinctl for i2s0 in two-channel mode. Commit
91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch on rk3399")
modified i2s0 to switch the corresponding pins off when idle.

Although an idle pinctrl node was added for i2s0 in 8-channel mode, a
similar idle pinctrl node for i2s0 in 2-channel mode was not added. Add
it.

Fixes: 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch on rk3399")
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 9da0b6d77c8d2..5bc2d4faeea6d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -2457,6 +2457,16 @@ i2s0_2ch_bus: i2s0-2ch-bus {
 					<4 RK_PA0 1 &pcfg_pull_none>;
 			};
 
+			i2s0_2ch_bus_bclk_off: i2s0-2ch-bus-bclk-off {
+				rockchip,pins =
+					<3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
+					<3 RK_PD1 1 &pcfg_pull_none>,
+					<3 RK_PD2 1 &pcfg_pull_none>,
+					<3 RK_PD3 1 &pcfg_pull_none>,
+					<3 RK_PD7 1 &pcfg_pull_none>,
+					<4 RK_PA0 1 &pcfg_pull_none>;
+			};
+
 			i2s0_8ch_bus: i2s0-8ch-bus {
 				rockchip,pins =
 					<3 RK_PD0 1 &pcfg_pull_none>,
-- 
2.42.0


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

* [PATCH v1 2/2] arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards
  2023-10-13 11:47 [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Christopher Obbard
  2023-10-13 11:47 ` [PATCH v1 1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 Christopher Obbard
@ 2023-10-13 11:47 ` Christopher Obbard
  2023-10-13 14:11 ` [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Folker Schwesinger
  2023-10-16 20:12 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Christopher Obbard @ 2023-10-13 11:47 UTC (permalink / raw)
  To: linux-rockchip
  Cc: kernel, Christopher Obbard, Brian Norris, Conor Dooley,
	FUKAUMI Naoki, Heiko Stuebner, Jagan Teki, Judy Hsiao,
	Krzysztof Kozlowski, Rob Herring, Yogesh Hegde, devicetree,
	linux-arm-kernel, linux-kernel

Commit 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch on
rk3399") modified i2s0 to switch the corresponding pins off when idle.
For the ROCK Pi 4 boards, this means that i2s0 has the following pinctrl
setting:

    pinctrl-names = "bclk_on", "bclk_off";
    pinctrl-0 = <&i2s0_2ch_bus>;
    pinctrl-1 = <&i2s0_8ch_bus_bclk_off>;

Due to this change, i2s0 fails to probe on my Radxa ROCK 4SE and ROCK Pi
4B boards:

    rockchip-pinctrl pinctrl: pin gpio3-29 already requested by leds; cannot claim for ff880000.i2s
    rockchip-pinctrl pinctrl: pin-125 (ff880000.i2s) status -22
    rockchip-pinctrl pinctrl: could not request pin 125 (gpio3-29) from group i2s0-8ch-bus-bclk-off  on device rockchip-pinctrl
    rockchip-i2s ff880000.i2s: Error applying setting, reverse things back
    rockchip-i2s ff880000.i2s: bclk disable failed -22

A pin requested for i2s0_8ch_bus_bclk_off has already been requested by
user_led2, so whichever driver probes first will have the pin allocated.

The hardware uses 2-channel i2s so fix this error by setting pinctl-1 to
i2s0_2ch_bus_bclk_off which doesn't contain the pin allocated to user_led2.

I checked the schematics for all Radxa boards based on ROCK Pi 4 and this
change is compatible with all boards.

Fixes: 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch on rk3399")
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
index 7dccbe8a93930..f2279aa6ca9e1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
@@ -492,6 +492,7 @@ &i2c4 {
 
 &i2s0 {
 	pinctrl-0 = <&i2s0_2ch_bus>;
+	pinctrl-1 = <&i2s0_2ch_bus_bclk_off>;
 	rockchip,capture-channels = <2>;
 	rockchip,playback-channels = <2>;
 	status = "okay";
-- 
2.42.0


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

* Re: [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards
  2023-10-13 11:47 [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Christopher Obbard
  2023-10-13 11:47 ` [PATCH v1 1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 Christopher Obbard
  2023-10-13 11:47 ` [PATCH v1 2/2] arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards Christopher Obbard
@ 2023-10-13 14:11 ` Folker Schwesinger
  2023-10-16 20:12 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Folker Schwesinger @ 2023-10-13 14:11 UTC (permalink / raw)
  To: Christopher Obbard, linux-rockchip
  Cc: kernel, Arnaud Ferraris, Brian Norris, Caleb Connolly,
	Conor Dooley, Corentin Labbe, FUKAUMI Naoki, Heiko Stuebner,
	Jagan Teki, Johan Jonker, Judy Hsiao, Krzysztof Kozlowski,
	Rick Wertenbroek, Rob Herring, Yogesh Hegde, devicetree,
	linux-arm-kernel, linux-kernel

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


On Fri Oct 13, 2023 at 1:47 PM CEST, Christopher Obbard wrote:
> i2s0 fails to probe on my Radxa ROCK 4SE and ROCK Pi 4B boards with:
>
>     rockchip-pinctrl pinctrl: pin gpio3-29 already requested by leds; cannot claim for ff880000.i2s
>     rockchip-pinctrl pinctrl: pin-125 (ff880000.i2s) status -22
>     rockchip-pinctrl pinctrl: could not request pin 125 (gpio3-29) from group i2s0-8ch-bus-bclk-off  on device rockchip-pinctrl
>     rockchip-i2s ff880000.i2s: Error applying setting, reverse things back
>     rockchip-i2s ff880000.i2s: bclk disable failed -22
>
> This is due to the pinctl attempting to request a GPIO which the boards
> use for a different function.
>
> The first patch adds a missing pinctl node i2s0_2ch_bus_bclk_off to the
> RK3399 devicetree.
>
> The second patch sets the i2s0 pinctrl to use the new node when idle and
> fixes the issue.
>
>
> Christopher Obbard (2):
>   arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399
>   arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards
>
>  arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi |  1 +
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi           | 10 ++++++++++
>  2 files changed, 11 insertions(+)

Thanks, works as advertised on my Rock 4SE!

So for the entire series:

Tested-By: Folker Schwesinger <dev@folker-schwesinger.de>

Kind regards,
Folker

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

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

* Re: [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards
  2023-10-13 11:47 [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Christopher Obbard
                   ` (2 preceding siblings ...)
  2023-10-13 14:11 ` [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Folker Schwesinger
@ 2023-10-16 20:12 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2023-10-16 20:12 UTC (permalink / raw)
  To: Christopher Obbard, linux-rockchip
  Cc: Heiko Stuebner, Judy Hsiao, linux-arm-kernel, Brian Norris,
	Rob Herring, Caleb Connolly, Yogesh Hegde, Arnaud Ferraris,
	FUKAUMI Naoki, Corentin Labbe, devicetree, Johan Jonker,
	Conor Dooley, linux-kernel, Rick Wertenbroek, kernel,
	Krzysztof Kozlowski, Jagan Teki

On Fri, 13 Oct 2023 12:47:25 +0100, Christopher Obbard wrote:
> i2s0 fails to probe on my Radxa ROCK 4SE and ROCK Pi 4B boards with:
> 
>     rockchip-pinctrl pinctrl: pin gpio3-29 already requested by leds; cannot claim for ff880000.i2s
>     rockchip-pinctrl pinctrl: pin-125 (ff880000.i2s) status -22
>     rockchip-pinctrl pinctrl: could not request pin 125 (gpio3-29) from group i2s0-8ch-bus-bclk-off  on device rockchip-pinctrl
>     rockchip-i2s ff880000.i2s: Error applying setting, reverse things back
>     rockchip-i2s ff880000.i2s: bclk disable failed -22
> 
> [...]

Applied, thanks!

[1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399
      commit: 3975e72b164dc8347a28dd0d5f11b346af534635
[2/2] arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards
      commit: 8cd79b729e746cb167f1563d015a93fc0a079899

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2023-10-16 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 11:47 [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Christopher Obbard
2023-10-13 11:47 ` [PATCH v1 1/2] arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399 Christopher Obbard
2023-10-13 11:47 ` [PATCH v1 2/2] arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards Christopher Obbard
2023-10-13 14:11 ` [PATCH v1 0/2] Fix i2s0 pin conflict on ROCK Pi 4 RK3399 boards Folker Schwesinger
2023-10-16 20:12 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®