diff mbox series

arm64: dts: renesas: ulcb-kf: sort nodes

Message ID 1563905015-2911-1-git-send-email-ykaneko0929@gmail.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series arm64: dts: renesas: ulcb-kf: sort nodes | expand

Commit Message

Yoshihiro Kaneko July 23, 2019, 6:03 p.m. UTC
Sort nodes.

If node address is present
   * Sort by node address, grouping all nodes with the same compat string
     and sorting the group alphabetically.
Else
   * Sort alphabetically

This should not have any run-time effect.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on the devel branch of Simon Horman's renesas tree.

 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 118 +++++++++++++++----------------
 1 file changed, 59 insertions(+), 59 deletions(-)

Comments

Simon Horman July 25, 2019, 6:16 a.m. UTC | #1
On Wed, Jul 24, 2019 at 03:03:35AM +0900, Yoshihiro Kaneko wrote:
> Sort nodes.
> 
> If node address is present
>    * Sort by node address, grouping all nodes with the same compat string
>      and sorting the group alphabetically.
> Else
>    * Sort alphabetically
> 
> This should not have any run-time effect.
> 
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Geert Uytterhoeven July 30, 2019, 9:14 a.m. UTC | #2
Hi Kaneko-san,

On Tue, Jul 23, 2019 at 8:03 PM Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> Sort nodes.
>
> If node address is present
>    * Sort by node address, grouping all nodes with the same compat string
>      and sorting the group alphabetically.
> Else
>    * Sort alphabetically
>
> This should not have any run-time effect.
>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

You forgot to sort the i2c slave nodes.
As this kind of patches is hard to rebase and rework, I'm fixing that up while
applying:

--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -83,6 +83,56 @@
 };

 &i2c2 {
+       i2cswitch2: i2c-switch@71 {
+               compatible = "nxp,pca9548";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x71>;
+               reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
+
+               /* Audio_SDA, Audio_SCL */
+               i2c@7 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <7>;
+
+                       pcm3168a: audio-codec@44 {
+                               #sound-dai-cells = <0>;
+                               compatible = "ti,pcm3168a";
+                               reg = <0x44>;
+                               clocks = <&clksndsel>;
+                               clock-names = "scki";
+
+                               VDD1-supply     = <&snd_3p3v>;
+                               VDD2-supply     = <&snd_3p3v>;
+                               VCCAD1-supply   = <&snd_vcc5v>;
+                               VCCAD2-supply   = <&snd_vcc5v>;
+                               VCCDA1-supply   = <&snd_vcc5v>;
+                               VCCDA2-supply   = <&snd_vcc5v>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       mclk-fs = <512>;
+                                       port@0 {
+                                               reg = <0>;
+                                               pcm3168a_endpoint_p: endpoint {
+
remote-endpoint = <&rsnd_for_pcm3168a_play>;
+                                                       clocks = <&clksndsel>;
+                                               };
+                                       };
+                                       port@1 {
+                                               reg = <1>;
+                                               pcm3168a_endpoint_c: endpoint {
+
remote-endpoint = <&rsnd_for_pcm3168a_capture>;
+                                                       clocks = <&clksndsel>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+
        /* U11 */
        gpio_exp_74: gpio@74 {
                compatible = "ti,tca9539";
@@ -153,56 +203,6 @@
                interrupt-parent = <&gpio6>;
                interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
        };
-
-       i2cswitch2: i2c-switch@71 {
-               compatible = "nxp,pca9548";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               reg = <0x71>;
-               reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
-
-               /* Audio_SDA, Audio_SCL */
-               i2c@7 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       reg = <7>;
-
-                       pcm3168a: audio-codec@44 {
-                               #sound-dai-cells = <0>;
-                               compatible = "ti,pcm3168a";
-                               reg = <0x44>;
-                               clocks = <&clksndsel>;
-                               clock-names = "scki";
-
-                               VDD1-supply     = <&snd_3p3v>;
-                               VDD2-supply     = <&snd_3p3v>;
-                               VCCAD1-supply   = <&snd_vcc5v>;
-                               VCCAD2-supply   = <&snd_vcc5v>;
-                               VCCDA1-supply   = <&snd_vcc5v>;
-                               VCCDA2-supply   = <&snd_vcc5v>;
-
-                               ports {
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-                                       mclk-fs = <512>;
-                                       port@0 {
-                                               reg = <0>;
-                                               pcm3168a_endpoint_p: endpoint {
-
remote-endpoint = <&rsnd_for_pcm3168a_play>;
-                                                       clocks = <&clksndsel>;
-                                               };
-                                       };
-                                       port@1 {
-                                               reg = <1>;
-                                               pcm3168a_endpoint_c: endpoint {
-
remote-endpoint = <&rsnd_for_pcm3168a_capture>;
-                                                       clocks = <&clksndsel>;
-                                               };
-                                       };
-                               };
-                       };
-               };
-       };
 };

 &i2c4 {

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.4.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven July 30, 2019, 9:23 a.m. UTC | #3
On Tue, Jul 30, 2019 at 11:14 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Tue, Jul 23, 2019 at 8:03 PM Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> > Sort nodes.
> >
> > If node address is present
> >    * Sort by node address, grouping all nodes with the same compat string
> >      and sorting the group alphabetically.
> > Else
> >    * Sort alphabetically
> >
> > This should not have any run-time effect.
> >
> > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>
> You forgot to sort the i2c slave nodes.
> As this kind of patches is hard to rebase and rework, I'm fixing that up while
> applying:
>
> --- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
> +++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
> @@ -83,6 +83,56 @@
>  };
>
>  &i2c2 {
> +       i2cswitch2: i2c-switch@71 {
> +               compatible = "nxp,pca9548";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               reg = <0x71>;
> +               reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
> +
> +               /* Audio_SDA, Audio_SCL */
> +               i2c@7 {
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       reg = <7>;
> +
> +                       pcm3168a: audio-codec@44 {
> +                               #sound-dai-cells = <0>;
> +                               compatible = "ti,pcm3168a";
> +                               reg = <0x44>;
> +                               clocks = <&clksndsel>;
> +                               clock-names = "scki";
> +
> +                               VDD1-supply     = <&snd_3p3v>;
> +                               VDD2-supply     = <&snd_3p3v>;
> +                               VCCAD1-supply   = <&snd_vcc5v>;
> +                               VCCAD2-supply   = <&snd_vcc5v>;
> +                               VCCDA1-supply   = <&snd_vcc5v>;
> +                               VCCDA2-supply   = <&snd_vcc5v>;
> +
> +                               ports {
> +                                       #address-cells = <1>;
> +                                       #size-cells = <0>;
> +                                       mclk-fs = <512>;
> +                                       port@0 {
> +                                               reg = <0>;
> +                                               pcm3168a_endpoint_p: endpoint {
> +
> remote-endpoint = <&rsnd_for_pcm3168a_play>;
> +                                                       clocks = <&clksndsel>;
> +                                               };
> +                                       };
> +                                       port@1 {
> +                                               reg = <1>;
> +                                               pcm3168a_endpoint_c: endpoint {
> +
> remote-endpoint = <&rsnd_for_pcm3168a_capture>;
> +                                                       clocks = <&clksndsel>;
> +                                               };
> +                                       };
> +                               };
> +                       };
> +               };
> +       };
> +
>         /* U11 */
>         gpio_exp_74: gpio@74 {
>                 compatible = "ti,tca9539";
> @@ -153,56 +203,6 @@
>                 interrupt-parent = <&gpio6>;
>                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
>         };
> -
> -       i2cswitch2: i2c-switch@71 {
> -               compatible = "nxp,pca9548";
> -               #address-cells = <1>;
> -               #size-cells = <0>;
> -               reg = <0x71>;
> -               reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
> -
> -               /* Audio_SDA, Audio_SCL */
> -               i2c@7 {
> -                       #address-cells = <1>;
> -                       #size-cells = <0>;
> -                       reg = <7>;
> -
> -                       pcm3168a: audio-codec@44 {
> -                               #sound-dai-cells = <0>;
> -                               compatible = "ti,pcm3168a";
> -                               reg = <0x44>;
> -                               clocks = <&clksndsel>;
> -                               clock-names = "scki";
> -
> -                               VDD1-supply     = <&snd_3p3v>;
> -                               VDD2-supply     = <&snd_3p3v>;
> -                               VCCAD1-supply   = <&snd_vcc5v>;
> -                               VCCAD2-supply   = <&snd_vcc5v>;
> -                               VCCDA1-supply   = <&snd_vcc5v>;
> -                               VCCDA2-supply   = <&snd_vcc5v>;
> -
> -                               ports {
> -                                       #address-cells = <1>;
> -                                       #size-cells = <0>;
> -                                       mclk-fs = <512>;
> -                                       port@0 {
> -                                               reg = <0>;
> -                                               pcm3168a_endpoint_p: endpoint {
> -
> remote-endpoint = <&rsnd_for_pcm3168a_play>;
> -                                                       clocks = <&clksndsel>;
> -                                               };
> -                                       };
> -                                       port@1 {
> -                                               reg = <1>;
> -                                               pcm3168a_endpoint_c: endpoint {
> -
> remote-endpoint = <&rsnd_for_pcm3168a_capture>;
> -                                                       clocks = <&clksndsel>;
> -                                               };
> -                                       };
> -                               };
> -                       };
> -               };
> -       };
>  };
>
>  &i2c4 {
>

and the second i2c bus, too, of course:

--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -206,6 +206,14 @@
 };

 &i2c4 {
+       i2cswitch4: i2c-switch@71 {
+               compatible = "nxp,pca9548";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x71>;
+               reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>;
+       };
+
        gpio_exp_76: gpio@76 {
                compatible = "ti,tca9539";
                reg = <0x76>;
@@ -225,14 +233,6 @@
                interrupt-parent = <&gpio5>;
                interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
        };
-
-       i2cswitch4: i2c-switch@71 {
-               compatible = "nxp,pca9548";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               reg = <0x71>;
-               reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>;
-       };
 };

 &ohci0 {

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 27851a7..5ac22a8 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -100,13 +100,6 @@ 
 			line-name = "Audio_Out_OFF";
 		};
 
-		sd-wifi-mux {
-			gpio-hog;
-			gpios = <5 GPIO_ACTIVE_HIGH>;
-			output-low;	/* Connect WL1837 */
-			line-name = "SD WiFi mux";
-		};
-
 		hub_pwen {
 			gpio-hog;
 			gpios = <6 GPIO_ACTIVE_HIGH>;
@@ -121,6 +114,13 @@ 
 			line-name = "HUB rst";
 		};
 
+		otg_extlpn {
+			gpio-hog;
+			gpios = <9 GPIO_ACTIVE_HIGH>;
+			output-high;
+			line-name = "OTG EXTLPn";
+		};
+
 		otg_offvbusn {
 			gpio-hog;
 			gpios = <8 GPIO_ACTIVE_HIGH>;
@@ -128,11 +128,11 @@ 
 			line-name = "OTG OFFVBUSn";
 		};
 
-		otg_extlpn {
+		sd-wifi-mux {
 			gpio-hog;
-			gpios = <9 GPIO_ACTIVE_HIGH>;
-			output-high;
-			line-name = "OTG EXTLPn";
+			gpios = <5 GPIO_ACTIVE_HIGH>;
+			output-low;	/* Connect WL1837 */
+			line-name = "SD WiFi mux";
 		};
 
 		snd_rst {
@@ -279,14 +279,50 @@ 
 		power-source = <3300>;
 	};
 
+	sound_pcm_pins: sound-pcm {
+		groups = "ssi349_ctrl", "ssi3_data", "ssi4_data";
+		function = "ssi";
+	};
+
 	usb0_pins: usb0 {
 		groups = "usb0";
 		function = "usb0";
 	};
+};
 
-	sound_pcm_pins: sound-pcm {
-		groups = "ssi349_ctrl", "ssi3_data", "ssi4_data";
-		function = "ssi";
+&rcar_sound {
+	pinctrl-0 = <&sound_pins
+		     &sound_clk_pins
+		     &sound_pcm_pins>;
+
+	ports {
+		/* rsnd_port0/1 are on salvator-common */
+		rsnd_port2: port@2 {
+			reg = <2>;
+			rsnd_for_pcm3168a_play: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_p>;
+
+				dai-format = "i2s";
+				bitclock-master = <&rsnd_for_pcm3168a_play>;
+				frame-master = <&rsnd_for_pcm3168a_play>;
+				dai-tdm-slot-num = <8>;
+
+				playback = <&ssi3>;
+			};
+		};
+		rsnd_port3: port@3 {
+			reg = <3>;
+			rsnd_for_pcm3168a_capture: endpoint {
+				remote-endpoint = <&pcm3168a_endpoint_c>;
+
+				dai-format = "i2s";
+				bitclock-master = <&rsnd_for_pcm3168a_capture>;
+				frame-master = <&rsnd_for_pcm3168a_capture>;
+				dai-tdm-slot-num = <6>;
+
+				capture  = <&ssi4>;
+			};
+		};
 	};
 };
 
@@ -322,17 +358,6 @@ 
 	};
 };
 
-&usb2_phy0 {
-	pinctrl-0 = <&usb0_pins>;
-	pinctrl-names = "default";
-
-	status = "okay";
-};
-
-&xhci0 {
-	status = "okay";
-};
-
 &sound_card {
 	dais = <&rsnd_port0	/* ak4613 */
 		&rsnd_port1	/* HDMI0  */
@@ -341,42 +366,17 @@ 
 		>;
 };
 
-&rcar_sound {
-	pinctrl-0 = <&sound_pins
-		     &sound_clk_pins
-		     &sound_pcm_pins>;
-
-	ports {
-		/* rsnd_port0/1 are on salvator-common */
-		rsnd_port2: port@2 {
-			reg = <2>;
-			rsnd_for_pcm3168a_play: endpoint {
-				remote-endpoint = <&pcm3168a_endpoint_p>;
-
-				dai-format = "i2s";
-				bitclock-master = <&rsnd_for_pcm3168a_play>;
-				frame-master = <&rsnd_for_pcm3168a_play>;
-				dai-tdm-slot-num = <8>;
-
-				playback = <&ssi3>;
-			};
-		};
-		rsnd_port3: port@3 {
-			reg = <3>;
-			rsnd_for_pcm3168a_capture: endpoint {
-				remote-endpoint = <&pcm3168a_endpoint_c>;
+&ssi4 {
+	shared-pin;
+};
 
-				dai-format = "i2s";
-				bitclock-master = <&rsnd_for_pcm3168a_capture>;
-				frame-master = <&rsnd_for_pcm3168a_capture>;
-				dai-tdm-slot-num = <6>;
+&usb2_phy0 {
+	pinctrl-0 = <&usb0_pins>;
+	pinctrl-names = "default";
 
-				capture  = <&ssi4>;
-			};
-		};
-	};
+	status = "okay";
 };
 
-&ssi4 {
-	shared-pin;
+&xhci0 {
+	status = "okay";
 };