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

ARM: dts: Fix WLAN regression on omap5-uevm

Commit 99f84cae43df ("ARM: dts: add wl12xx/wl18xx bindings") added
device tree bindings for the TI WLAN SDIO on many omap variants.

I recall wondering how come omap5-uevm did not have the WLAN
added and this issue has been bugging me for a while now, and
I finally tracked it down to a bad pinmux regression, and a missing
deferred probe handling for the 32k clock from palmas that's
requested by twl6040.

Basically 392adaf796b9 ("ARM: dts: omap5-evm: Add mcspi data")
added pin muxing for mcspi4 that conflicts with the onboard
WLAN. While some omap5-uevm don't have WLAN populated, the
pins are not reused for other devices. And as the SDIO bus
should be probed, let's try to enable WLAN by default.

Let's fix the regression and add the WLAN configuration as
done for the other boards in 99f84cae43df ("ARM: dts: add
wl12xx/wl18xx bindings"). And let's use the new MMC pwrseq for
the 32k clock as suggested by Javier Martinez Canillas
<javier@dowhile0.org>.

Note that without a related deferred probe fix for twl6040,
the 32k clock is not initialized if palmas-clk is a module
and twl6040 is built-in.

Let's also use the generic "non-removable" instead of the
legacy "ti,non-removable" property while at it.

And finally, note that omap5 seems to require WAKEUP_EN for
the WLAN GPIO interrupt.

Fixes: 392adaf796b9 ("ARM: dts: omap5-evm: Add mcspi data")
Cc: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

+55 -11
+55 -11
arch/arm/boot/dts/omap5-uevm.dts
··· 31 31 regulator-max-microvolt = <3000000>; 32 32 }; 33 33 34 + mmc3_pwrseq: sdhci0_pwrseq { 35 + compatible = "mmc-pwrseq-simple"; 36 + clocks = <&clk32kgaudio>; 37 + clock-names = "ext_clock"; 38 + }; 39 + 40 + vmmcsdio_fixed: fixedregulator-mmcsdio { 41 + compatible = "regulator-fixed"; 42 + regulator-name = "vmmcsdio_fixed"; 43 + regulator-min-microvolt = <1800000>; 44 + regulator-max-microvolt = <1800000>; 45 + gpio = <&gpio5 12 GPIO_ACTIVE_HIGH>; /* gpio140 WLAN_EN */ 46 + enable-active-high; 47 + startup-delay-us = <70000>; 48 + pinctrl-names = "default"; 49 + pinctrl-0 = <&wlan_pins>; 50 + }; 51 + 34 52 /* HS USB Host PHY on PORT 2 */ 35 53 hsusb2_phy: hsusb2_phy { 36 54 compatible = "usb-nop-xceiv"; ··· 215 197 >; 216 198 }; 217 199 218 - mcspi4_pins: pinmux_mcspi4_pins { 200 + mmc3_pins: pinmux_mmc3_pins { 219 201 pinctrl-single,pins = < 220 - 0x164 (PIN_INPUT | MUX_MODE1) /* mcspi4_clk */ 221 - 0x168 (PIN_INPUT | MUX_MODE1) /* mcspi4_simo */ 222 - 0x16a (PIN_INPUT | MUX_MODE1) /* mcspi4_somi */ 223 - 0x16c (PIN_INPUT | MUX_MODE1) /* mcspi4_cs0 */ 202 + OMAP5_IOPAD(0x01a4, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_clk */ 203 + OMAP5_IOPAD(0x01a6, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_cmd */ 204 + OMAP5_IOPAD(0x01a8, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data0 */ 205 + OMAP5_IOPAD(0x01aa, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data1 */ 206 + OMAP5_IOPAD(0x01ac, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data2 */ 207 + OMAP5_IOPAD(0x01ae, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data3 */ 208 + >; 209 + }; 210 + 211 + wlan_pins: pinmux_wlan_pins { 212 + pinctrl-single,pins = < 213 + OMAP5_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE6) /* mcspi1_clk.gpio5_140 */ 224 214 >; 225 215 }; 226 216 ··· 302 276 0x1A (PIN_OUTPUT | MUX_MODE0) /* fref_clk1_out, USB hub clk */ 303 277 >; 304 278 }; 279 + 280 + wlcore_irq_pin: pinmux_wlcore_irq_pin { 281 + pinctrl-single,pins = < 282 + OMAP5_IOPAD(0x040, WAKEUP_EN | PIN_INPUT_PULLUP | MUX_MODE6) /* llia_wakereqin.gpio1_wk14 */ 283 + >; 284 + }; 305 285 }; 306 286 307 287 &mmc1 { ··· 322 290 }; 323 291 324 292 &mmc3 { 293 + vmmc-supply = <&vmmcsdio_fixed>; 294 + mmc-pwrseq = <&mmc3_pwrseq>; 325 295 bus-width = <4>; 326 - ti,non-removable; 296 + non-removable; 297 + cap-power-off-card; 298 + pinctrl-names = "default"; 299 + pinctrl-0 = <&mmc3_pins &wlcore_irq_pin>; 300 + interrupts-extended = <&gic GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH 301 + &omap5_pmx_core 0x168>; 302 + 303 + #address-cells = <1>; 304 + #size-cells = <0>; 305 + wlcore: wlcore@2 { 306 + compatible = "ti,wl1271"; 307 + reg = <2>; 308 + interrupt-parent = <&gpio1>; 309 + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; /* gpio 14 */ 310 + ref-clock-frequency = <26000000>; 311 + }; 327 312 }; 328 313 329 314 &mmc4 { ··· 645 596 &mcspi3 { 646 597 pinctrl-names = "default"; 647 598 pinctrl-0 = <&mcspi3_pins>; 648 - }; 649 - 650 - &mcspi4 { 651 - pinctrl-names = "default"; 652 - pinctrl-0 = <&mcspi4_pins>; 653 599 }; 654 600 655 601 &uart1 {