aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-25 18:17:10 -0500
committerTony Lindgren <tony@atomide.com>2013-11-25 18:31:17 -0500
commitfa590c923401368d86db361350849a7bf9f42b8a (patch)
tree382de4e97235d6572c6648305a8a01cced5f8d5f /arch/arm/mach-omap2
parent810ac2a1102880b6c66dc2f26979a896b2d84009 (diff)
ARM: OMAP2+: Add quirks support for n8x0
This allows us to keep things working when booted with device tree. Note that we still need to initialize most things with platform data as the drivers are lacking support for device tree. Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c23
-rw-r--r--arch/arm/mach-omap2/common-board-devices.h1
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c16
3 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index c9eef2b9b86f..99dd184f50f1 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -529,7 +529,7 @@ static void n8x0_mmc_cleanup(struct device *dev)
529 * MMC controller2 is not in use. 529 * MMC controller2 is not in use.
530 */ 530 */
531static struct omap_mmc_platform_data mmc1_data = { 531static struct omap_mmc_platform_data mmc1_data = {
532 .nr_slots = 2, 532 .nr_slots = 0,
533 .switch_slot = n8x0_mmc_switch_slot, 533 .switch_slot = n8x0_mmc_switch_slot,
534 .init = n8x0_mmc_late_init, 534 .init = n8x0_mmc_late_init,
535 .cleanup = n8x0_mmc_cleanup, 535 .cleanup = n8x0_mmc_cleanup,
@@ -596,12 +596,13 @@ static void __init n8x0_mmc_init(void)
596 } 596 }
597 } 597 }
598 598
599 mmc1_data.nr_slots = 2;
599 mmc_data[0] = &mmc1_data; 600 mmc_data[0] = &mmc1_data;
600 if (!of_have_populated_dt()) 601 if (!of_have_populated_dt())
601 omap242x_init_mmc(mmc_data); 602 omap242x_init_mmc(mmc_data);
602} 603}
603#else 604#else
604 605static struct omap_mmc_platform_data mmc1_data;
605void __init n8x0_mmc_init(void) 606void __init n8x0_mmc_init(void)
606{ 607{
607} 608}
@@ -746,6 +747,24 @@ static int __init n8x0_late_initcall(void)
746} 747}
747omap_late_initcall(n8x0_late_initcall); 748omap_late_initcall(n8x0_late_initcall);
748 749
750/*
751 * Legacy init pdata init for n8x0. Note that we want to follow the
752 * I2C bus numbering starting at 0 for device tree like other omaps.
753 */
754void * __init n8x0_legacy_init(void)
755{
756 board_check_revision();
757 spi_register_board_info(n800_spi_board_info,
758 ARRAY_SIZE(n800_spi_board_info));
759 i2c_register_board_info(0, n8x0_i2c_board_info_1,
760 ARRAY_SIZE(n8x0_i2c_board_info_1));
761 if (board_is_n810())
762 i2c_register_board_info(1, n810_i2c_board_info_2,
763 ARRAY_SIZE(n810_i2c_board_info_2));
764
765 return &mmc1_data;
766}
767
749static void __init n8x0_init_machine(void) 768static void __init n8x0_init_machine(void)
750{ 769{
751 board_check_revision(); 770 board_check_revision();
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index 72bb41b3fd25..f338177e6900 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -10,5 +10,6 @@ struct ads7846_platform_data;
10 10
11void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 11void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
12 struct ads7846_platform_data *board_pdata); 12 struct ads7846_platform_data *board_pdata);
13void *n8x0_legacy_init(void);
13 14
14#endif /* __OMAP_COMMON_BOARD_DEVICES__ */ 15#endif /* __OMAP_COMMON_BOARD_DEVICES__ */
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 468e4c1f2976..6a7554515b6e 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -26,6 +26,8 @@ struct pdata_init {
26 void (*fn)(void); 26 void (*fn)(void);
27}; 27};
28 28
29struct of_dev_auxdata omap_auxdata_lookup[];
30
29/* 31/*
30 * Create alias for USB host PHY clock. 32 * Create alias for USB host PHY clock.
31 * Remove this when clock phandle can be provided via DT 33 * Remove this when clock phandle can be provided via DT
@@ -68,6 +70,15 @@ static inline void legacy_init_wl12xx(unsigned ref_clock,
68} 70}
69#endif 71#endif
70 72
73#ifdef CONFIG_MACH_NOKIA_N8X0
74static void __init omap2420_n8x0_legacy_init(void)
75{
76 omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
77}
78#else
79#define omap2420_n8x0_legacy_init NULL
80#endif
81
71#ifdef CONFIG_ARCH_OMAP3 82#ifdef CONFIG_ARCH_OMAP3
72static void __init hsmmc2_internal_input_clk(void) 83static void __init hsmmc2_internal_input_clk(void)
73{ 84{
@@ -130,6 +141,11 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
130 * the dev entries in of_platform_populate(). 141 * the dev entries in of_platform_populate().
131 */ 142 */
132static struct pdata_init auxdata_quirks[] __initdata = { 143static struct pdata_init auxdata_quirks[] __initdata = {
144#ifdef CONFIG_SOC_OMAP2420
145 { "nokia,n800", omap2420_n8x0_legacy_init, },
146 { "nokia,n810", omap2420_n8x0_legacy_init, },
147 { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
148#endif
133 { /* sentinel */ }, 149 { /* sentinel */ },
134}; 150};
135 151