ARM: OMAP2+: Add quirk support for legacy platform data init
We want to drop the board-*.c files but keep things working. Let's make it a bit easier to support legacy platform data init with quirks. This also keeps board-generic.c clean from board specific hacks. For now, the quirks table is empty, that is populated in the later patches. Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
f2acae69a2
commit
6a08e1e6f7
|
@ -233,7 +233,7 @@ obj-y += drm.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Specific board support
|
# Specific board support
|
||||||
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
|
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o
|
||||||
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
|
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
|
||||||
obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
|
obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
|
||||||
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
|
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
|
||||||
|
|
|
@ -56,6 +56,7 @@ static void __init omap_generic_init(void)
|
||||||
omap_sdrc_init(NULL, NULL);
|
omap_sdrc_init(NULL, NULL);
|
||||||
|
|
||||||
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
|
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
|
||||||
|
pdata_quirks_init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HACK: call display setup code for selected boards to enable omapdss.
|
* HACK: call display setup code for selected boards to enable omapdss.
|
||||||
|
|
|
@ -288,6 +288,8 @@ static inline void omap4_cpu_resume(void)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void pdata_quirks_init(void);
|
||||||
|
|
||||||
struct omap_sdrc_params;
|
struct omap_sdrc_params;
|
||||||
extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
|
extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
|
||||||
struct omap_sdrc_params *sdrc_cs1);
|
struct omap_sdrc_params *sdrc_cs1);
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* Legacy platform_data quirks
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Texas Instruments
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "common-board-devices.h"
|
||||||
|
#include "dss-common.h"
|
||||||
|
|
||||||
|
struct pdata_init {
|
||||||
|
const char *compatible;
|
||||||
|
void (*fn)(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct pdata_init pdata_quirks[] __initdata = {
|
||||||
|
{ /* sentinel */ },
|
||||||
|
};
|
||||||
|
|
||||||
|
void __init pdata_quirks_init(void)
|
||||||
|
{
|
||||||
|
struct pdata_init *quirks = pdata_quirks;
|
||||||
|
|
||||||
|
while (quirks->compatible) {
|
||||||
|
if (of_machine_is_compatible(quirks->compatible)) {
|
||||||
|
if (quirks->fn)
|
||||||
|
quirks->fn();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
quirks++;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue