summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-05-17 10:45:10 -0700
committerTony Lindgren <tony@atomide.com>2013-05-30 12:53:58 -0700
commit26f45c29e3c18c6f41a6bf64c791a5dcbd239683 (patch)
tree3312f6be12b45c73aca37db40920b23b442e5b5f /arch/arm/mach-omap2/devices.c
parente4aa937ec75df0eea0bee03bffa3303ad36c986b (diff)
ARM: OMAP2+: Legacy support for wl12xx when booted with devicetree
Without WLAN we cannot switch omap4 to use device tree only booting. This patch can be reverted when the binding for wl12xx is added. Cc: Benoit Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: devicetree-discuss@lists.ozlabs.org Tested-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 4269fc145698..d428b95bd137 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,12 +15,14 @@
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
+#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/omap4-keypad.h>
#include <linux/platform_data/omap_ocp2scp.h>
#include <linux/usb/omap_control_usb.h>
+#include <linux/wl12xx.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
@@ -633,6 +635,40 @@ static void __init omap_init_ocp2scp(void)
static inline void omap_init_ocp2scp(void) { }
#endif
+#if IS_ENABLED(CONFIG_WL12XX)
+
+static struct wl12xx_platform_data wl12xx __initdata;
+
+void __init omap_init_wl12xx_of(void)
+{
+ int ret;
+
+ if (!of_have_populated_dt())
+ return;
+
+ if (of_machine_is_compatible("ti,omap4-sdp")) {
+ wl12xx.board_ref_clock = WL12XX_REFCLOCK_26;
+ wl12xx.board_tcxo_clock = WL12XX_TCXOCLOCK_26;
+ wl12xx.irq = gpio_to_irq(53);
+ } else if (of_machine_is_compatible("ti,omap4-panda")) {
+ wl12xx.board_ref_clock = WL12XX_REFCLOCK_38;
+ wl12xx.irq = gpio_to_irq(53);
+ } else {
+ return;
+ }
+
+ ret = wl12xx_set_platform_data(&wl12xx);
+ if (ret) {
+ pr_err("error setting wl12xx data: %d\n", ret);
+ return;
+ }
+}
+#else
+static inline void omap_init_wl12xx_of(void)
+{
+}
+#endif
+
/*-------------------------------------------------------------------------*/
static int __init omap2_init_devices(void)
@@ -657,6 +693,9 @@ static int __init omap2_init_devices(void)
omap_init_mcspi();
omap_init_sham();
omap_init_aes();
+ } else {
+ /* These can be removed when bindings are done */
+ omap_init_wl12xx_of();
}
omap_init_sti();
omap_init_rng();