summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pdata-quirks.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-09-25 15:44:40 -0700
committerTony Lindgren <tony@atomide.com>2013-09-25 15:44:40 -0700
commit5f0a2c6976d0bfaeda1eaba1837f28e5a3146a69 (patch)
treecf19210eb04d075af5ba48bd8f767fc8dedbbaea /arch/arm/mach-omap2/pdata-quirks.c
parent3e7a318530c3d536972e9a2bb44e0ce0c16eaa4e (diff)
downloadlinux-5f0a2c6976d0bfaeda1eaba1837f28e5a3146a69.tar.bz2
ARM: OMAP2+: Use pdata quirks for wl12xx legacy init
Let's use the platform data quirk support for wl12xx and move the board specific code out of devices.c. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/pdata-quirks.c')
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 648d9573aaea..04bfa647a934 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -8,8 +8,10 @@
* published by the Free Software Foundation.
*/
#include <linux/clk.h>
+#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/wl12xx.h>
#include "common.h"
#include "common-board-devices.h"
@@ -34,16 +36,47 @@ static void __init __used legacy_init_ehci_clk(char *clkname)
__func__, clkname, ret);
}
+#if IS_ENABLED(CONFIG_WL12XX)
+
+static struct wl12xx_platform_data wl12xx __initdata;
+
+static void __init __used legacy_init_wl12xx(unsigned ref_clock,
+ unsigned tcxo_clock,
+ int gpio)
+{
+ int res;
+
+ wl12xx.board_ref_clock = ref_clock;
+ wl12xx.board_tcxo_clock = tcxo_clock;
+ wl12xx.irq = gpio_to_irq(gpio);
+
+ res = wl12xx_set_platform_data(&wl12xx);
+ if (res) {
+ pr_err("error setting wl12xx data: %d\n", res);
+ return;
+ }
+}
+#else
+static inline void legacy_init_wl12xx(unsigned ref_clock,
+ unsigned tcxo_clock,
+ int gpio)
+{
+}
+#endif
+
#ifdef CONFIG_ARCH_OMAP4
static void __init omap4_sdp_legacy_init(void)
{
omap_4430sdp_display_init_of();
+ legacy_init_wl12xx(WL12XX_REFCLOCK_26,
+ WL12XX_TCXOCLOCK_26, 53);
}
static void __init omap4_panda_legacy_init(void)
{
omap4_panda_display_init_of();
legacy_init_ehci_clk("auxclk3_ck");
+ legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
}
#endif