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:
39
arch/arm/mach-omap2/pdata-quirks.c
Normal file
39
arch/arm/mach-omap2/pdata-quirks.c
Normal file
@@ -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++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user