Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c9b1bc2 authored by Kevin Hilman's avatar Kevin Hilman Committed by Sekhar Nori
Browse files

ARM: davinci: add skeleton for pdata-quirks



Add skeleton pdata-quirks for davinci.

Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
[nsekhar@ti.com: move changes to build pdata-quirks.c and call
		 to pdata_quirks_init() to this patch]
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 7ce7d89f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC) += irq.o
obj-$(CONFIG_CP_INTC)			+= cp_intc.o

# Board specific
obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o
obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
obj-$(CONFIG_MACH_SFFSDR)		+= board-sffsdr.o
obj-$(CONFIG_MACH_NEUROS_OSD2)		+= board-neuros-osd2.o
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ static void __init da850_init_machine(void)

	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
	davinci_pm_init();
	pdata_quirks_init();
}

static const char *const da850_boards_compat[] __initconst = {
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ int davinci_pm_init(void);
static inline int davinci_pm_init(void) { return 0; }
#endif

void __init pdata_quirks_init(void);

#define SRAM_SIZE	SZ_128K

#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
+39 −0
Original line number Diff line number Diff line
/*
 * Legacy platform_data quirks
 *
 * Copyright (C) 2016 BayLibre, Inc
 *
 * 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/kernel.h>
#include <linux/of_platform.h>

#include <mach/common.h>

struct pdata_init {
	const char *compatible;
	void (*fn)(void);
};

static void pdata_quirks_check(struct pdata_init *quirks)
{
	while (quirks->compatible) {
		if (of_machine_is_compatible(quirks->compatible)) {
			if (quirks->fn)
				quirks->fn();
			break;
		}
		quirks++;
	}
}

static struct pdata_init pdata_quirks[] __initdata = {
	{ /* sentinel */ },
};

void __init pdata_quirks_init(void)
{
	pdata_quirks_check(pdata_quirks);
}