Commit dad12d11 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP2+: Add support for legacy auxdata for twl

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: default avatarTony Lindgren <tony@atomide.com>
parent 841af81f
...@@ -293,6 +293,7 @@ static inline void omap4_cpu_resume(void) ...@@ -293,6 +293,7 @@ static inline void omap4_cpu_resume(void)
#endif #endif
void pdata_quirks_init(struct of_device_id *); 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)); void omap_pcs_legacy_init(int irq, void (*rearm)(void));
struct omap_sdrc_params; struct omap_sdrc_params;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include "common.h"
#include "soc.h" #include "soc.h"
#include "omap_device.h" #include "omap_device.h"
#include "omap_hwmod.h" #include "omap_hwmod.h"
...@@ -200,6 +201,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb, ...@@ -200,6 +201,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
case BUS_NOTIFY_ADD_DEVICE: case BUS_NOTIFY_ADD_DEVICE:
if (pdev->dev.of_node) if (pdev->dev.of_node)
omap_device_build_from_dt(pdev); omap_device_build_from_dt(pdev);
omap_auxdata_legacy_init(dev);
/* fall through */ /* fall through */
default: default:
od = to_omap_device(pdev); od = to_omap_device(pdev);
......
...@@ -27,6 +27,7 @@ struct pdata_init { ...@@ -27,6 +27,7 @@ struct pdata_init {
}; };
struct of_dev_auxdata omap_auxdata_lookup[]; struct of_dev_auxdata omap_auxdata_lookup[];
static struct twl4030_gpio_platform_data twl_gpio_auxdata;
/* /*
* Create alias for USB host PHY clock. * Create alias for USB host PHY clock.
...@@ -136,6 +137,21 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void)) ...@@ -136,6 +137,21 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void))
pcs_pdata.rearm = rearm; pcs_pdata.rearm = rearm;
} }
/*
* 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 * Few boards still need auxdata populated before we populate
* the dev entries in of_platform_populate(). * the dev entries in of_platform_populate().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment