Skip to content

Commit b530ebd

Browse files
committed
overlays: Fix sc16is752-spi1 emulation
[1] Removed the sc16is752-spi1 overlay, replacing it with an entry in overlay_map.dts that invokes sc16is75x-spi with specific parameters. This does not work because it fails to configure the SPI1 interface. Most such overlays would require the respective SPI interface to have already been configured using one of the spi<n>-<m> overlays, but it is not possible to do that using overlay_map, and it is unreasonable to suddenly impose that requirement on users. Work around that specific problem by adding an extra parameter to sc16is75x to configure SPI1. It's not ideal, but better than a complete dedicated overlay. Link: #6962 Fixes: ce20a8f ("overlays: sc16is75x: Add generic SPI overlay") Signed-off-by: Phil Elwell <[email protected]> [1] commit ce20a8f ("overlays: sc16is75x: Add generic SPI overlay")
1 parent caaa516 commit b530ebd

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4543,7 +4543,7 @@ Load: <Deprecated>
45434543

45444544
Name: sc16is752-spi1
45454545
Info: This overlay is now deprecated. Use
4546-
"dtoverlay=sc16is75x-spi,sc16is752,spi1-0,..." instead.
4546+
"dtoverlay=sc16is75x-spi,sc16is752,spi1-1cs,spi1-0,..." instead.
45474547
Load: <Deprecated>
45484548

45494549

@@ -4558,6 +4558,8 @@ Params: sc16is750 Device is a SC16IS750 UART (default on)
45584558
(boolean, required)
45594559
int_pin GPIO used for IRQ (default 24)
45604560
xtal On-board crystal frequency (default 14745600)
4561+
spi1-1cs A special case to support sc16is752-spi1. Not
4562+
intended for general use.
45614563

45624564

45634565
Name: sdhost

arch/arm/boot/dts/overlays/overlay_map.dts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,12 @@
292292
renamed = "sc16is75x-spi,sc16is750,spi0-0";
293293
};
294294

295-
sc16is750-spi1 {
296-
renamed = "sc16is75x-spi,sc16is750,spi1-0";
297-
};
298-
299295
sc16is752-spi0 {
300296
renamed = "sc16is75x-spi,sc16is752,spi0-0";
301297
};
302298

303299
sc16is752-spi1 {
304-
renamed = "sc16is75x-spi,sc16is752,spi1-0";
300+
renamed = "sc16is75x-spi,sc16is752,spi1-1cs,spi1-0";
305301
};
306302

307303
sdhost {

arch/arm/boot/dts/overlays/sc16is75x-spi-overlay.dts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,48 @@
5353
fragment@3 {
5454
target = <&gpio>;
5555
__overlay__ {
56-
sc16is75x_pins: sc16is75x_pins@24 {
56+
sc16is75x_pins: sc16is75x_pins@18 {
5757
brcm,pins = <24>;
5858
brcm,function = <BCM2835_FSEL_GPIO_IN>;
5959
brcm,pull = <BCM2835_PUD_OFF>;
6060
};
6161
};
6262
};
6363

64+
fragment@4 {
65+
target = <&gpio>;
66+
__dormant__ {
67+
spi1_pins: spi1_pins {
68+
brcm,pins = <19 20 21>;
69+
brcm,function = <3>; /* alt4 */
70+
};
71+
72+
spi1_cs_pins: spi1_cs_pins {
73+
brcm,pins = <18>;
74+
brcm,function = <1>; /* output */
75+
};
76+
};
77+
};
78+
79+
fragment@5 {
80+
target = <&spi1>;
81+
__dormant__ {
82+
#address-cells = <1>;
83+
#size-cells = <0>;
84+
pinctrl-names = "default";
85+
pinctrl-0 = <&spi1_pins &spi1_cs_pins>;
86+
cs-gpios = <&gpio 18 1>;
87+
status = "okay";
88+
};
89+
};
90+
91+
fragment@6 {
92+
target = <&aux>;
93+
__dormant__ {
94+
status = "okay";
95+
};
96+
};
97+
6498
__overrides__ {
6599
sc16is750 = <&sc16is75x>,"compatible=nxp,sc16is750",
66100
<&sc16is75x>, "name=sc16is750@0";
@@ -80,6 +114,7 @@
80114
spi1-0 = <0>, "-0",
81115
<&sc16is75x_frag>, "target:0=", <&spi1>,
82116
<&sc16is75x_pins>, "name=sc16is75x_spi1_0_pins";
117+
spi1-1cs = <0>,"+4+5+6";
83118
spi1-1 = <0>, "-0",
84119
<&sc16is75x_frag>, "target:0=", <&spi1>,
85120
<&sc16is75x>, "reg:0=1",

0 commit comments

Comments
 (0)