diff options
| -rw-r--r-- | arch/arm/mach-davinci/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/da8xx-dt.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/include/mach/common.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/pdata-quirks.c | 39 |
4 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 0a2e6da45f28..df96ca9eab6d 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile | |||
| @@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC) += irq.o | |||
| 21 | obj-$(CONFIG_CP_INTC) += cp_intc.o | 21 | obj-$(CONFIG_CP_INTC) += cp_intc.o |
| 22 | 22 | ||
| 23 | # Board specific | 23 | # Board specific |
| 24 | obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o | 24 | obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o |
| 25 | obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o | 25 | obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o |
| 26 | obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o | 26 | obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o |
| 27 | obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o | 27 | obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o |
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 9ee44da6eb7b..d2be1941a687 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c | |||
| @@ -62,6 +62,7 @@ static void __init da850_init_machine(void) | |||
| 62 | 62 | ||
| 63 | of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); | 63 | of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); |
| 64 | davinci_pm_init(); | 64 | davinci_pm_init(); |
| 65 | pdata_quirks_init(); | ||
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | static const char *const da850_boards_compat[] __initconst = { | 68 | static const char *const da850_boards_compat[] __initconst = { |
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index 0b3c169758ed..037aa66bcac1 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h | |||
| @@ -102,6 +102,8 @@ int davinci_pm_init(void); | |||
| 102 | static inline int davinci_pm_init(void) { return 0; } | 102 | static inline int davinci_pm_init(void) { return 0; } |
| 103 | #endif | 103 | #endif |
| 104 | 104 | ||
| 105 | void __init pdata_quirks_init(void); | ||
| 106 | |||
| 105 | #define SRAM_SIZE SZ_128K | 107 | #define SRAM_SIZE SZ_128K |
| 106 | 108 | ||
| 107 | #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ | 109 | #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ |
diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c new file mode 100644 index 000000000000..5b57da475065 --- /dev/null +++ b/arch/arm/mach-davinci/pdata-quirks.c | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * Legacy platform_data quirks | ||
| 3 | * | ||
| 4 | * Copyright (C) 2016 BayLibre, Inc | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/of_platform.h> | ||
| 12 | |||
| 13 | #include <mach/common.h> | ||
| 14 | |||
| 15 | struct pdata_init { | ||
| 16 | const char *compatible; | ||
| 17 | void (*fn)(void); | ||
| 18 | }; | ||
| 19 | |||
| 20 | static void pdata_quirks_check(struct pdata_init *quirks) | ||
| 21 | { | ||
| 22 | while (quirks->compatible) { | ||
| 23 | if (of_machine_is_compatible(quirks->compatible)) { | ||
| 24 | if (quirks->fn) | ||
| 25 | quirks->fn(); | ||
| 26 | break; | ||
| 27 | } | ||
| 28 | quirks++; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | static struct pdata_init pdata_quirks[] __initdata = { | ||
| 33 | { /* sentinel */ }, | ||
| 34 | }; | ||
| 35 | |||
| 36 | void __init pdata_quirks_init(void) | ||
| 37 | { | ||
| 38 | pdata_quirks_check(pdata_quirks); | ||
| 39 | } | ||
