[PATCH v2 2/2] sandbox: add dummy pinctrl nodes

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jul 16 05:03:10 PDT 2024


Now that I/O ports are represented in the device tree , let's use it
describe a fake pinctrl-single controller. This allows testing common
pinctrl code in sandbox.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
v1 -> v2:
  - remove power/watchdog pinmux to reduce dupication
  - add an unknown device to test that scenario too
---
 arch/sandbox/dts/sandbox.dts | 41 ++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index ea75f3a6a9b0..cf47513c76fe 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -59,6 +59,35 @@ io-ports {
 		compatible = "barebox,sandbox-ioport-bus";
 		#address-cells = <2>;
 		#size-cells = <2>;
+
+		pinctrl at 0 {
+			compatible = "pinctrl-single";
+			/* Proxy 0 addressing */
+			reg = <0x0 0x0 0x0 0x4>;
+			#pinctrl-cells = <1>;
+			pinctrl-single,register-width = <8>;
+			pinctrl-single,function-mask = <0x0000000f>;
+
+			pinctrl_sound_default: sound-default-pins {
+				pinctrl-single,pins = <0x00	0x01>;
+			};
+
+			pinctrl_sound_sleep: sound-sleep-pins {
+				pinctrl-single,pins = <0x00	0x02>;
+			};
+
+			pinctrl_led_default: led-default-pins {
+				pinctrl-single,pins = <0x01	0x01>;
+			};
+
+			pinctrl_led_sleep: led-sleep-pins {
+				pinctrl-single,pins = <0x01	0x02>;
+			};
+
+			pinctrl_unknown_default: unknown-default-pins {
+				pinctrl-single,pins = <0x02	0x01>;
+			};
+		};
 	};
 
 	stickypage: stickypage {
@@ -128,9 +157,21 @@ watchdog {
 
 	sound {
 		compatible = "barebox,sandbox-sound";
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&pinctrl_sound_default>;
+		pinctrl-1 = <&pinctrl_sound_sleep>;
+	};
+
+	unknown-device {
+		compatible = "barebox,unknown-device";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_unknown_default>;
 	};
 
 	led {
 		compatible = "barebox,sandbox-led";
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&pinctrl_led_default>;
+		pinctrl-1 = <&pinctrl_led_sleep>;
 	};
 };
-- 
2.39.2




More information about the barebox mailing list