From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Subject: [PATCH 06/11] ARM: OMAP2+: Add quirks support for n8x0
Date: Thu, 14 Nov 2013 16:09:53 -0800 [thread overview]
Message-ID: <1384474198-20756-7-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1384474198-20756-1-git-send-email-tony@atomide.com>
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.
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-n8x0.c | 21 ++++++++++++++++++++-
arch/arm/mach-omap2/common-board-devices.h | 1 +
arch/arm/mach-omap2/pdata-quirks.c | 14 ++++++++++++++
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index c9eef2b..da0d494 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)
* MMC controller2 is not in use.
*/
static struct omap_mmc_platform_data mmc1_data = {
- .nr_slots = 2,
+ .nr_slots = 0,
.switch_slot = n8x0_mmc_switch_slot,
.init = n8x0_mmc_late_init,
.cleanup = n8x0_mmc_cleanup,
@@ -596,6 +596,7 @@ static void __init n8x0_mmc_init(void)
}
}
+ mmc1_data.nr_slots = 2;
mmc_data[0] = &mmc1_data;
if (!of_have_populated_dt())
omap242x_init_mmc(mmc_data);
@@ -746,6 +747,24 @@ static int __init n8x0_late_initcall(void)
}
omap_late_initcall(n8x0_late_initcall);
+/*
+ * Legacy init pdata init for n8x0. Note that we want to follow the
+ * I2C bus numbering starting at 0 for device tree like other omaps.
+ */
+void * __init n8x0_legacy_init(void)
+{
+ board_check_revision();
+ spi_register_board_info(n800_spi_board_info,
+ ARRAY_SIZE(n800_spi_board_info));
+ i2c_register_board_info(0, n8x0_i2c_board_info_1,
+ ARRAY_SIZE(n8x0_i2c_board_info_1));
+ if (board_is_n810())
+ i2c_register_board_info(1, n810_i2c_board_info_2,
+ ARRAY_SIZE(n810_i2c_board_info_2));
+
+ return &mmc1_data;
+}
+
static void __init n8x0_init_machine(void)
{
board_check_revision();
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index 72bb41b..f338177 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;
void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
struct ads7846_platform_data *board_pdata);
+void *n8x0_legacy_init(void);
#endif /* __OMAP_COMMON_BOARD_DEVICES__ */
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index cb2863d..7f0ff2a 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -26,6 +26,8 @@ struct pdata_init {
void (*fn)(void);
};
+struct of_dev_auxdata omap_auxdata_lookup[];
+
/*
* Create alias for USB host PHY clock.
* Remove this when clock phandle can be provided via DT
@@ -68,6 +70,13 @@ static inline void legacy_init_wl12xx(unsigned ref_clock,
}
#endif
+#ifdef CONFIG_SOC_OMAP2420
+static void __init omap2420_n8x0_legacy_init(void)
+{
+ omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
+}
+#endif
+
#ifdef CONFIG_ARCH_OMAP3
static void __init hsmmc2_internal_input_clk(void)
{
@@ -130,6 +139,11 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
* the dev entries in of_platform_populate().
*/
static struct pdata_init auxdata_quirks[] __initdata = {
+#ifdef CONFIG_SOC_OMAP2420
+ { "nokia,n800", omap2420_n8x0_legacy_init, },
+ { "nokia,n810", omap2420_n8x0_legacy_init, },
+ { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
+#endif
{ /* sentinel */ },
};
--
1.8.1.1
next prev parent reply other threads:[~2013-11-15 0:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 0:09 [PATCH 00/11] Make omap24xx booting device tree based for v3.14 merge window Tony Lindgren
2013-11-15 0:09 ` [PATCH 01/11] ARM: dts: Add basic device tree support for omap2430 sdp Tony Lindgren
2013-11-15 0:09 ` [PATCH 02/11] ARM: dts: Add basic Nokia N8X0 support Tony Lindgren
2013-11-15 0:09 ` [PATCH 03/11] ARM: OMAP2+: Add support for board specific auxdata quirks Tony Lindgren
2013-11-15 0:09 ` [PATCH 04/11] ARM: OMAP2+: Add device tree compatible revision checks for n8x0 Tony Lindgren
2013-11-15 0:09 ` [PATCH 05/11] ARM: OMAP2+: Make n8x0 behave better with device tree based booting Tony Lindgren
2013-11-15 0:09 ` Tony Lindgren [this message]
2013-11-15 0:09 ` [PATCH 07/11] ARM: OMAP2+: Remove legacy booting support for n8x0 Tony Lindgren
2013-11-15 0:09 ` [PATCH 08/11] ARM: OMAP2+: Remove board file for H4 Tony Lindgren
2013-11-15 0:09 ` [PATCH 09/11] ARM: OMAP2+: Remove legacy board file for 2430sdp Tony Lindgren
2013-11-15 0:09 ` [PATCH 10/11] ARM: OMAP2+: Remove legacy mux code for omap2 Tony Lindgren
2013-11-15 0:09 ` [PATCH 11/11] ARM: OMAP2+: Remove legacy hwmod entries " Tony Lindgren
2013-11-15 18:47 ` [PATCH 00/11] Make omap24xx booting device tree based for v3.14 merge window Aaro Koskinen
2013-11-15 19:02 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384474198-20756-7-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=aaro.koskinen@iki.fi \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).