From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: [PATCH 2/5] ARM: OMAP2+: Add support for legacy auxdata for twl
Date: Fri, 15 Nov 2013 16:36:04 -0800 [thread overview]
Message-ID: <1384562167-14725-3-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1384562167-14725-1-git-send-email-tony@atomide.com>
As we currently need to support a mix of legacy platform data and
device tree intialized data, let's make sure things keep working
for the TWL GPIOs.
Mostly the issue is caused by the fact that DSS does not yet have
device tree bindings, so we need to rely on the TWL GPIO callback
for setting up things like LCD backlight for some boards.
As of_platform_populate() for the TWL GPIO is called by twl-core
after the I2C bus has been initialized, we cannot pass the auxdata
table from the board init code to twl-core like we used to with
just legacy platform data.
So let's use the omap_device bus hook to patch in the platform
data for TWL GPIO until we have sorted out the issues with the
TWL GPIOs and device tree bindings.
The other option was be to initialize twl core using legacy
platform data, which seems like a step backwards as we're moving
to device tree only initialization. And we really don't want to
add custom configuration functions to the TWL GPIO driver either
for this.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/omap_device.c | 2 ++
arch/arm/mach-omap2/pdata-quirks.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+)
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index f7644fe..d0f3308 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -293,6 +293,7 @@ static inline void omap4_cpu_resume(void)
#endif
void pdata_quirks_init(struct of_device_id *);
+void omap_auxdata_legacy_init(struct device *dev);
void omap_pcs_legacy_init(int irq, void (*rearm)(void));
struct omap_sdrc_params;
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 53f0735..828f538 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -36,6 +36,7 @@
#include <linux/of.h>
#include <linux/notifier.h>
+#include "common.h"
#include "soc.h"
#include "omap_device.h"
#include "omap_hwmod.h"
@@ -200,6 +201,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
case BUS_NOTIFY_ADD_DEVICE:
if (pdev->dev.of_node)
omap_device_build_from_dt(pdev);
+ omap_auxdata_legacy_init(dev);
/* fall through */
default:
od = to_omap_device(pdev);
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index e7e9984..f2fc072 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -27,6 +27,7 @@ struct pdata_init {
};
struct of_dev_auxdata omap_auxdata_lookup[];
+static struct twl4030_gpio_platform_data twl_gpio_auxdata;
/*
* Create alias for USB host PHY clock.
@@ -137,6 +138,21 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
}
/*
+ * GPIOs for TWL are initialized by the I2C bus and need custom
+ * handing until DSS has device tree bindings.
+ */
+void omap_auxdata_legacy_init(struct device *dev)
+{
+ if (dev->platform_data)
+ return;
+
+ if (strcmp("twl4030-gpio", dev_name(dev)))
+ return;
+
+ dev->platform_data = &twl_gpio_auxdata;
+}
+
+/*
* Few boards still need auxdata populated before we populate
* the dev entries in of_platform_populate().
*/
--
1.8.1.1
next prev parent reply other threads:[~2013-11-16 0:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 0:36 [PATCH 0/5] Prepare making omap3 device tree only and convert LDP Tony Lindgren
2013-11-16 0:36 ` [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case Tony Lindgren
2013-11-18 10:29 ` Lee Jones
2013-11-18 17:25 ` Felipe Balbi
2013-11-18 17:46 ` Lee Jones
2013-11-18 18:11 ` Tony Lindgren
2013-11-18 19:09 ` Lee Jones
2013-11-18 19:22 ` Tony Lindgren
2013-11-18 19:28 ` Lee Jones
2013-11-18 19:33 ` Tony Lindgren
2013-11-21 10:46 ` Lee Jones
2013-11-21 11:09 ` Lee Jones
2013-11-25 23:22 ` Tony Lindgren
2013-11-18 18:40 ` Felipe Balbi
2013-11-16 0:36 ` Tony Lindgren [this message]
2013-11-16 0:36 ` [PATCH 3/5] ARM: OMAP2+: Add DT init code for DPI displays and make omap3 LDP to use it Tony Lindgren
2013-11-18 13:06 ` Tomi Valkeinen
2013-11-18 18:19 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 4/5] ARM: dts: Add basic support for omap3 LDP zoom1 labrador Tony Lindgren
2013-11-16 8:04 ` Sebastian Reichel
2013-11-16 14:40 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 5/5] ARM: OMAP2+: Remove legacy booting support for LDP Tony Lindgren
2013-11-16 12:05 ` N900 board code in 3.14 Sebastian Reichel
2013-11-16 14:12 ` Tony Lindgren
2013-11-16 15:50 ` Sebastian Reichel
2013-11-21 18:58 ` Tony Lindgren
2013-11-21 23:51 ` Sebastian Reichel
2013-11-22 10:41 ` Javier Martinez Canillas
2013-11-23 21:09 ` Sebastian Reichel
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=1384562167-14725-3-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--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).