aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-09-25 18:44:40 -0400
committerTony Lindgren <tony@atomide.com>2013-09-25 18:44:40 -0400
commit5f0a2c6976d0bfaeda1eaba1837f28e5a3146a69 (patch)
treecf19210eb04d075af5ba48bd8f767fc8dedbbaea /arch/arm/mach-omap2
parent3e7a318530c3d536972e9a2bb44e0ce0c16eaa4e (diff)
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')
-rw-r--r--arch/arm/mach-omap2/devices.c38
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c33
2 files changed, 33 insertions, 38 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5c5315ba129b..5336c75926cd 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -19,7 +19,6 @@
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/pinctrl/machine.h> 20#include <linux/pinctrl/machine.h>
21#include <linux/platform_data/omap4-keypad.h> 21#include <linux/platform_data/omap4-keypad.h>
22#include <linux/wl12xx.h>
23#include <linux/platform_data/mailbox-omap.h> 22#include <linux/platform_data/mailbox-omap.h>
24 23
25#include <asm/mach-types.h> 24#include <asm/mach-types.h>
@@ -475,40 +474,6 @@ static void omap_init_vout(void)
475static inline void omap_init_vout(void) {} 474static inline void omap_init_vout(void) {}
476#endif 475#endif
477 476
478#if IS_ENABLED(CONFIG_WL12XX)
479
480static struct wl12xx_platform_data wl12xx __initdata;
481
482void __init omap_init_wl12xx_of(void)
483{
484 int ret;
485
486 if (!of_have_populated_dt())
487 return;
488
489 if (of_machine_is_compatible("ti,omap4-sdp")) {
490 wl12xx.board_ref_clock = WL12XX_REFCLOCK_26;
491 wl12xx.board_tcxo_clock = WL12XX_TCXOCLOCK_26;
492 wl12xx.irq = gpio_to_irq(53);
493 } else if (of_machine_is_compatible("ti,omap4-panda")) {
494 wl12xx.board_ref_clock = WL12XX_REFCLOCK_38;
495 wl12xx.irq = gpio_to_irq(53);
496 } else {
497 return;
498 }
499
500 ret = wl12xx_set_platform_data(&wl12xx);
501 if (ret) {
502 pr_err("error setting wl12xx data: %d\n", ret);
503 return;
504 }
505}
506#else
507static inline void omap_init_wl12xx_of(void)
508{
509}
510#endif
511
512/*-------------------------------------------------------------------------*/ 477/*-------------------------------------------------------------------------*/
513 478
514static int __init omap2_init_devices(void) 479static int __init omap2_init_devices(void)
@@ -531,9 +496,6 @@ static int __init omap2_init_devices(void)
531 omap_init_sham(); 496 omap_init_sham();
532 omap_init_aes(); 497 omap_init_aes();
533 omap_init_rng(); 498 omap_init_rng();
534 } else {
535 /* These can be removed when bindings are done */
536 omap_init_wl12xx_of();
537 } 499 }
538 omap_init_sti(); 500 omap_init_sti();
539 omap_init_vout(); 501 omap_init_vout();
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 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/gpio.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/wl12xx.h>
13 15
14#include "common.h" 16#include "common.h"
15#include "common-board-devices.h" 17#include "common-board-devices.h"
@@ -34,16 +36,47 @@ static void __init __used legacy_init_ehci_clk(char *clkname)
34 __func__, clkname, ret); 36 __func__, clkname, ret);
35} 37}
36 38
39#if IS_ENABLED(CONFIG_WL12XX)
40
41static struct wl12xx_platform_data wl12xx __initdata;
42
43static void __init __used legacy_init_wl12xx(unsigned ref_clock,
44 unsigned tcxo_clock,
45 int gpio)
46{
47 int res;
48
49 wl12xx.board_ref_clock = ref_clock;
50 wl12xx.board_tcxo_clock = tcxo_clock;
51 wl12xx.irq = gpio_to_irq(gpio);
52
53 res = wl12xx_set_platform_data(&wl12xx);
54 if (res) {
55 pr_err("error setting wl12xx data: %d\n", res);
56 return;
57 }
58}
59#else
60static inline void legacy_init_wl12xx(unsigned ref_clock,
61 unsigned tcxo_clock,
62 int gpio)
63{
64}
65#endif
66
37#ifdef CONFIG_ARCH_OMAP4 67#ifdef CONFIG_ARCH_OMAP4
38static void __init omap4_sdp_legacy_init(void) 68static void __init omap4_sdp_legacy_init(void)
39{ 69{
40 omap_4430sdp_display_init_of(); 70 omap_4430sdp_display_init_of();
71 legacy_init_wl12xx(WL12XX_REFCLOCK_26,
72 WL12XX_TCXOCLOCK_26, 53);
41} 73}
42 74
43static void __init omap4_panda_legacy_init(void) 75static void __init omap4_panda_legacy_init(void)
44{ 76{
45 omap4_panda_display_init_of(); 77 omap4_panda_display_init_of();
46 legacy_init_ehci_clk("auxclk3_ck"); 78 legacy_init_ehci_clk("auxclk3_ck");
79 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
47} 80}
48#endif 81#endif
49 82