Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: sunxi: dt: Split the SPI pinctrl groups

The pinctrl groups for SPI until now were also adding the chip selects in
the SPI pinctrl group.

This was causing a few issues, since a board was forced to use a random
number of chipselects, even though it might use one of these chip selects
for another pin.

The number of chipselects defined was also not the same from one group to
another because of different needs at the time these groups have been
introduced, resulting in no clear view from the board DTS on what exactly
is being muxed, which even might change in the future.

Solve this by creating different pinctrl groups for the chipselects and the
standard SPI pins (CLK, MOSI and MISO) so that we fix both issues.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

+87 -15
+2 -1
arch/arm/boot/dts/sun4i-a10-cubieboard.dts
··· 201 201 202 202 &spi0 { 203 203 pinctrl-names = "default"; 204 - pinctrl-0 = <&spi0_pins_a>; 204 + pinctrl-0 = <&spi0_pins_a>, 205 + <&spi0_cs0_pins_a>; 205 206 status = "okay"; 206 207 }; 207 208
+2 -1
arch/arm/boot/dts/sun4i-a10-marsboard.dts
··· 169 169 170 170 &spi0 { 171 171 pinctrl-names = "default"; 172 - pinctrl-0 = <&spi0_pins_a>; 172 + pinctrl-0 = <&spi0_pins_a>, 173 + <&spi0_cs0_pins_a>; 173 174 status = "okay"; 174 175 }; 175 176
+32 -4
arch/arm/boot/dts/sun4i-a10.dtsi
··· 825 825 }; 826 826 827 827 spi0_pins_a: spi0@0 { 828 - allwinner,pins = "PI10", "PI11", "PI12", "PI13"; 828 + allwinner,pins = "PI11", "PI12", "PI13"; 829 + allwinner,function = "spi0"; 830 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 831 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 832 + }; 833 + 834 + spi0_cs0_pins_a: spi0_cs0@0 { 835 + allwinner,pins = "PI10"; 829 836 allwinner,function = "spi0"; 830 837 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 831 838 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 832 839 }; 833 840 834 841 spi1_pins_a: spi1@0 { 835 - allwinner,pins = "PI16", "PI17", "PI18", "PI19"; 842 + allwinner,pins = "PI17", "PI18", "PI19"; 843 + allwinner,function = "spi1"; 844 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 845 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 846 + }; 847 + 848 + spi1_cs0_pins_a: spi1_cs0@0 { 849 + allwinner,pins = "PI16"; 836 850 allwinner,function = "spi1"; 837 851 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 838 852 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 839 853 }; 840 854 841 855 spi2_pins_a: spi2@0 { 842 - allwinner,pins = "PB14", "PB15", "PB16", "PB17"; 856 + allwinner,pins = "PC20", "PC21", "PC22"; 843 857 allwinner,function = "spi2"; 844 858 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 845 859 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 846 860 }; 847 861 848 862 spi2_pins_b: spi2@1 { 849 - allwinner,pins = "PC19", "PC20", "PC21", "PC22"; 863 + allwinner,pins = "PB15", "PB16", "PB17"; 864 + allwinner,function = "spi2"; 865 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 866 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 867 + }; 868 + 869 + spi2_cs0_pins_a: spi2_cs0@0 { 870 + allwinner,pins = "PC19"; 871 + allwinner,function = "spi2"; 872 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 873 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 874 + }; 875 + 876 + spi2_cs0_pins_b: spi2_cs0@1 { 877 + allwinner,pins = "PB14"; 850 878 allwinner,function = "spi2"; 851 879 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 852 880 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+3 -1
arch/arm/boot/dts/sun7i-a20-bananapi.dts
··· 192 192 193 193 &spi0 { 194 194 pinctrl-names = "default"; 195 - pinctrl-0 = <&spi0_pins_a>; 195 + pinctrl-0 = <&spi0_pins_a>, 196 + <&spi0_cs0_pins_a>, 197 + <&spi0_cs1_pins_a>; 196 198 status = "okay"; 197 199 }; 198 200
+3 -1
arch/arm/boot/dts/sun7i-a20-bananapro.dts
··· 238 238 239 239 &spi0 { 240 240 pinctrl-names = "default"; 241 - pinctrl-0 = <&spi0_pins_a>; 241 + pinctrl-0 = <&spi0_pins_a>, 242 + <&spi0_cs0_pins_a>, 243 + <&spi0_cs1_pins_a>; 242 244 status = "okay"; 243 245 }; 244 246
+2 -1
arch/arm/boot/dts/sun7i-a20-hummingbird.dts
··· 240 240 241 241 &spi2 { 242 242 pinctrl-names = "default"; 243 - pinctrl-0 = <&spi2_pins_b>; 243 + pinctrl-0 = <&spi2_pins_b>, 244 + <&spi2_cs0_pins_b>; 244 245 status = "okay"; 245 246 }; 246 247
+4 -2
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
··· 245 245 246 246 &spi1 { 247 247 pinctrl-names = "default"; 248 - pinctrl-0 = <&spi1_pins_a>; 248 + pinctrl-0 = <&spi1_pins_a>, 249 + <&spi1_cs0_pins_a>; 249 250 status = "okay"; 250 251 }; 251 252 252 253 &spi2 { 253 254 pinctrl-names = "default"; 254 - pinctrl-0 = <&spi2_pins_a>; 255 + pinctrl-0 = <&spi2_pins_a>, 256 + <&spi2_cs0_pins_a>; 255 257 status = "okay"; 256 258 }; 257 259
+39 -4
arch/arm/boot/dts/sun7i-a20.dtsi
··· 945 945 }; 946 946 947 947 spi0_pins_a: spi0@0 { 948 - allwinner,pins = "PI10", "PI11", "PI12", "PI13", "PI14"; 948 + allwinner,pins = "PI11", "PI12", "PI13"; 949 + allwinner,function = "spi0"; 950 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 951 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 952 + }; 953 + 954 + spi0_cs0_pins_a: spi0_cs0@0 { 955 + allwinner,pins = "PI10"; 956 + allwinner,function = "spi0"; 957 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 958 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 959 + }; 960 + 961 + spi0_cs1_pins_a: spi0_cs1@0 { 962 + allwinner,pins = "PI14"; 949 963 allwinner,function = "spi0"; 950 964 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 951 965 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 952 966 }; 953 967 954 968 spi1_pins_a: spi1@0 { 955 - allwinner,pins = "PI16", "PI17", "PI18", "PI19"; 969 + allwinner,pins = "PI17", "PI18", "PI19"; 970 + allwinner,function = "spi1"; 971 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 972 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 973 + }; 974 + 975 + spi1_cs0_pins_a: spi1_cs0@0 { 976 + allwinner,pins = "PI16"; 956 977 allwinner,function = "spi1"; 957 978 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 958 979 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 959 980 }; 960 981 961 982 spi2_pins_a: spi2@0 { 962 - allwinner,pins = "PC19", "PC20", "PC21", "PC22"; 983 + allwinner,pins = "PC20", "PC21", "PC22"; 963 984 allwinner,function = "spi2"; 964 985 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 965 986 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 966 987 }; 967 988 968 989 spi2_pins_b: spi2@1 { 969 - allwinner,pins = "PB14", "PB15", "PB16", "PB17"; 990 + allwinner,pins = "PB15", "PB16", "PB17"; 991 + allwinner,function = "spi2"; 992 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 993 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 994 + }; 995 + 996 + spi2_cs0_pins_a: spi2_cs0@0 { 997 + allwinner,pins = "PC19"; 998 + allwinner,function = "spi2"; 999 + allwinner,drive = <SUN4I_PINCTRL_10_MA>; 1000 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 1001 + }; 1002 + 1003 + spi2_cs0_pins_b: spi2_cs0@1 { 1004 + allwinner,pins = "PB14"; 970 1005 allwinner,function = "spi2"; 971 1006 allwinner,drive = <SUN4I_PINCTRL_10_MA>; 972 1007 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;