[PATCH] brcmfmac: add device tree support for panda board

From: Arend van Spriel
Date: Thu Aug 22 2013 - 06:29:23 EST


In linux mainline the pandaboard specific code moved to using
the device tree. Changing our internal patches to get platform
specific info from the device tree.

Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
---
arch/arm/boot/dts/omap4-panda-common.dtsi | 20 +++++++++++++++-
arch/arm/mach-omap2/devices.c | 36 ++++++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index faa95b5..6ebeb8e 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -226,6 +226,22 @@
0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */
>;
};
+ mmc2_brcmf_en: pinmux_mmc2_brcmf_en {
+ pinctrl-single,pins = <
+ 0x92 (PIN_OUTPUT | MUX_MODE3) /* brcmf-power */
+ >;
+ };
+ mmc2_pins: pinmux_mmc2_pins {
+ pinctrl-single,pins = <
+ 0x44 (MUX_MODE1 | PIN_INPUT_PULLUP) /* mmc2-cmd */
+ 0x42 (MUX_MODE1 | PIN_INPUT_PULLUP) /* mmc2-clk */
+ 0x00 (MUX_MODE1 | PIN_INPUT_PULLUP) /* mmc2-dat 0-3 */
+ 0x02 (MUX_MODE1 | PIN_INPUT_PULLUP)
+ 0x04 (MUX_MODE1 | PIN_INPUT_PULLUP)
+ 0x06 (MUX_MODE1 | PIN_INPUT_PULLUP)
+ 0x9a (MUX_MODE3 | PIN_INPUT_PULLDOWN) /* oob-irq */
+ >;
+ };
};

&omap4_pmx_wkup {
@@ -302,7 +318,9 @@
};

&mmc2 {
- status = "disabled";
+ vmmc-supply = <&vaux1>;
+ bus-width = <4>;
+ non-removable;
};

&mmc3 {
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 3c1279f..7a47535 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -21,7 +21,7 @@
#include <linux/platform_data/omap4-keypad.h>
#include <linux/wl12xx.h>
#include <linux/platform_data/mailbox-omap.h>
-
+#include <linux/platform_data/brcmfmac-sdio.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>

@@ -547,6 +547,39 @@ static inline void omap_init_wl12xx_of(void)
}
#endif

+#define GPIO_BRCMF_SDIO_PWR 134
+#define GPIO_BRCMF_SDIO_OOB 138
+static struct brcmfmac_sdio_platform_data brcmfmac_sdio_pdata;
+
+static struct platform_device brcmf_sdio_device = {
+ .name = BRCMFMAC_SDIO_PDATA_NAME,
+ .id = PLATFORM_DEVID_NONE,
+ .dev.platform_data = &brcmfmac_sdio_pdata
+};
+
+static struct gpio brcmf_sdio_gpios[] __initdata = {
+ { GPIO_BRCMF_SDIO_PWR, GPIOF_OUT_INIT_HIGH, "brcmf_sdio_pwr"},
+ { GPIO_BRCMF_SDIO_OOB, GPIOF_IN, "brcmf_sdio_oob"},
+};
+
+void __init omap_init_brcmfmac_of(void)
+{
+ if (!of_have_populated_dt())
+ return;
+
+ if (!of_machine_is_compatible("ti,omap4-panda"))
+ return;
+
+ if (gpio_request_array(brcmf_sdio_gpios,
+ ARRAY_SIZE(brcmf_sdio_gpios))) {
+ pr_err("%s: failed to request gpio array\n", __func__);
+ return;
+ }
+
+ brcmfmac_sdio_pdata.oob_irq_supported = false;
+ platform_device_register(&brcmf_sdio_device);
+}
+
/*-------------------------------------------------------------------------*/

static int __init omap2_init_devices(void)
@@ -573,6 +606,7 @@ static int __init omap2_init_devices(void)
} else {
/* These can be removed when bindings are done */
omap_init_wl12xx_of();
+ omap_init_brcmfmac_of();
}
omap_init_sti();
omap_init_rng();
--
1.7.10.4


--------------000307010108090003000303--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/