mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/2] sandbox: add dummy pinctrl nodes
Date: Tue, 16 Jul 2024 14:03:10 +0200	[thread overview]
Message-ID: <20240716120310.1968471-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240716120310.1968471-1-a.fatoum@pengutronix.de>

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@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@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




  reply	other threads:[~2024-07-16 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 12:03 [PATCH v2 1/2] sandbox: alias I/O ports region in MMIO space Ahmad Fatoum
2024-07-16 12:03 ` Ahmad Fatoum [this message]
2024-07-19 12:31 ` Sascha Hauer

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=20240716120310.1968471-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox