diff mbox

[2/3] ARM: dts: Add muxing for wl12xx on the SDIO bus for pandaboard

Message ID 20130426035213.26065.63243.stgit@muffinssi.local (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren April 26, 2013, 3:52 a.m. UTC
This is needed to get wl12xx working with device tree based
booting.

Note that we claim the various GPIO inputs in the regulator
as the proper muxing is needed to enable and disable the
regulator.

Also, we want to use non-removable instead of ti,non-removable
as the ti,non-removable also sets no_regulator_off_init which
is really not what we want as then wl12xx won't get powered
up and down which is needed for resetting it.

Cc: Luciano Coelho <coelho@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/omap4-panda-common.dtsi |   43 ++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

Comments

Luciano Coelho April 26, 2013, 1:23 p.m. UTC | #1
On Thu, 2013-04-25 at 20:52 -0700, Tony Lindgren wrote:
> This is needed to get wl12xx working with device tree based
> booting.
> 
> Note that we claim the various GPIO inputs in the regulator
> as the proper muxing is needed to enable and disable the
> regulator.
> 
> Also, we want to use non-removable instead of ti,non-removable
> as the ti,non-removable also sets no_regulator_off_init which
> is really not what we want as then wl12xx won't get powered
> up and down which is needed for resetting it.
> 
> Cc: Luciano Coelho <coelho@ti.com>
> Cc: Benoit Cousson <b-cousson@ti.com>
> Cc: Rajendra Nayak <rnayak@ti.com>
> Cc: devicetree-discuss@lists.ozlabs.org
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---

I tried this now and it seems to work fine too.  So:

Tested-by: Luciano Coelho <coelho@ti.com>

Except that with linux-next I'm getting some problems with the
interrupts when trying to use wl12xx.  It's not related to this patch
though, and I'm investigating it right now.

Also, I found one small whitespace problem in this patch:

[...]
> +	/* wl12xx GPIO inputs and SDIO pins */
> +	wl12xx_pins: pinmux_wl12xx_pins {
> +		pinctrl-single,pins = <
> +			0x38 0x103	/* gpmc_ncs2.gpio_52 INPUT | MODE3 */
> +			0x3a 0x103	/* gpmc_ncs3.gpio_53 INPUT | MODE3 */
> +			0x108 0x118	/* sdmmc5_clk.sdmmc5_clk INPUT_PULLUP | MODE0 */
> +			0x10a 0x118	/* sdmmc5_cmd.sdmmc5_cmd INPUT_PULLUP | MODE0 */
> +			0x10c 0x118	/* sdmmc5_dat0.sdmmc5_dat0 INPUT_PULLUP | MODE0 */
> +			0x10e 0x118	/* sdmmc5_dat1.sdmmc5_dat1 INPUT_PULLUP | MODE0 */
> +			0x110 0x118	/* sdmmc5_dat2.sdmmc5_dat2 INPUT_PULLUP | MODE0 */
> +			0x112 0x118	/* sdmmc5_dat3.sdmmc5_dat3 INPUT_PULLUP | MODE0 */
> +      		>;

git am reports a "space before tab in indent" here.
Tony Lindgren April 26, 2013, 3:58 p.m. UTC | #2
* Luciano Coelho <coelho@ti.com> [130426 06:29]:
> On Thu, 2013-04-25 at 20:52 -0700, Tony Lindgren wrote:
> > This is needed to get wl12xx working with device tree based
> > booting.
> > 
> > Note that we claim the various GPIO inputs in the regulator
> > as the proper muxing is needed to enable and disable the
> > regulator.
> > 
> > Also, we want to use non-removable instead of ti,non-removable
> > as the ti,non-removable also sets no_regulator_off_init which
> > is really not what we want as then wl12xx won't get powered
> > up and down which is needed for resetting it.
> > 
> > Cc: Luciano Coelho <coelho@ti.com>
> > Cc: Benoit Cousson <b-cousson@ti.com>
> > Cc: Rajendra Nayak <rnayak@ti.com>
> > Cc: devicetree-discuss@lists.ozlabs.org
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> 
> I tried this now and it seems to work fine too.  So:
> 
> Tested-by: Luciano Coelho <coelho@ti.com>
> 
> Except that with linux-next I'm getting some problems with the
> interrupts when trying to use wl12xx.  It's not related to this patch
> though, and I'm investigating it right now.

One thing I was worried is the early use of gpio_to_irq()
that's probably not safe always. We could fix that by moving the
gpio_to_irq() call to the driver if that's a problem.

But if the gpio_to_irq() is not the issue, can you please just
add a minimal binding to the wl12xx code so we can get rid of the
pdata init for the DT booting?

We can pass the clock reference the same way as we've discussed
already regarding the USB transceiver patch. Or you might be able
to find it out in the driver probe just by doing clk_get() and
clk_get_rate() on the source clock.

And the GPIO is just a standard resource that already has a
binding.
 
> Also, I found one small whitespace problem in this patch:
> 
> [...]
> > +	/* wl12xx GPIO inputs and SDIO pins */
> > +	wl12xx_pins: pinmux_wl12xx_pins {
> > +		pinctrl-single,pins = <
> > +			0x38 0x103	/* gpmc_ncs2.gpio_52 INPUT | MODE3 */
> > +			0x3a 0x103	/* gpmc_ncs3.gpio_53 INPUT | MODE3 */
> > +			0x108 0x118	/* sdmmc5_clk.sdmmc5_clk INPUT_PULLUP | MODE0 */
> > +			0x10a 0x118	/* sdmmc5_cmd.sdmmc5_cmd INPUT_PULLUP | MODE0 */
> > +			0x10c 0x118	/* sdmmc5_dat0.sdmmc5_dat0 INPUT_PULLUP | MODE0 */
> > +			0x10e 0x118	/* sdmmc5_dat1.sdmmc5_dat1 INPUT_PULLUP | MODE0 */
> > +			0x110 0x118	/* sdmmc5_dat2.sdmmc5_dat2 INPUT_PULLUP | MODE0 */
> > +			0x112 0x118	/* sdmmc5_dat3.sdmmc5_dat3 INPUT_PULLUP | MODE0 */
> > +      		>;
> 
> git am reports a "space before tab in indent" here.

OK thanks, will fix.

Regards,

Tony
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 628f744..16b23bf 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -86,6 +86,19 @@ 
 		clock-names = "main_clk";
 		clock-frequency = <19200000>;
 	};
+
+	/* regulator for wl12xx on sdio5 */
+	wl12xx_vmmc: wl12xx_vmmc {
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio2 11 0>;
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
 };
 
 &omap4_pmx_core {
@@ -185,6 +198,30 @@ 
 			0xf0 0x118     /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
 		>;
 	};
+
+	/* wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP */
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0x26 0x3	/* gpmc_a19.gpio_43 OUTPUT | MODE3 */
+			0x2c 0x3	/* gpmc_a22.gpio_46 OUTPUT | MODE3 */
+			0x30 0xb	/* gpmc_a24.gpio_48 OUTPUT | MODE3 */
+			0x32 0xb	/* gpmc_a25.gpio_49 OUTPUT | MODE3 */
+		>;
+	};
+
+	/* wl12xx GPIO inputs and SDIO pins */
+	wl12xx_pins: pinmux_wl12xx_pins {
+		pinctrl-single,pins = <
+			0x38 0x103	/* gpmc_ncs2.gpio_52 INPUT | MODE3 */
+			0x3a 0x103	/* gpmc_ncs3.gpio_53 INPUT | MODE3 */
+			0x108 0x118	/* sdmmc5_clk.sdmmc5_clk INPUT_PULLUP | MODE0 */
+			0x10a 0x118	/* sdmmc5_cmd.sdmmc5_cmd INPUT_PULLUP | MODE0 */
+			0x10c 0x118	/* sdmmc5_dat0.sdmmc5_dat0 INPUT_PULLUP | MODE0 */
+			0x10e 0x118	/* sdmmc5_dat1.sdmmc5_dat1 INPUT_PULLUP | MODE0 */
+			0x110 0x118	/* sdmmc5_dat2.sdmmc5_dat2 INPUT_PULLUP | MODE0 */
+			0x112 0x118	/* sdmmc5_dat3.sdmmc5_dat3 INPUT_PULLUP | MODE0 */
+      		>;
+	};
 };
 
 &i2c1 {
@@ -264,8 +301,12 @@ 
 };
 
 &mmc5 {
-	ti,non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&wl12xx_pins>;
+	vmmc-supply = <&wl12xx_vmmc>;
+	non-removable;
 	bus-width = <4>;
+	cap-power-off-card;
 };
 
 &emif1 {