diff options
Diffstat (limited to 'arch/arm/plat-samsung/s5p-dev-mfc.c')
-rw-r--r-- | arch/arm/plat-samsung/s5p-dev-mfc.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/s5p-dev-mfc.c b/arch/arm/plat-samsung/s5p-dev-mfc.c index ad6089465e2a..5ec104b5408b 100644 --- a/arch/arm/plat-samsung/s5p-dev-mfc.c +++ b/arch/arm/plat-samsung/s5p-dev-mfc.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
15 | #include <linux/memblock.h> | 15 | #include <linux/memblock.h> |
16 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
17 | #include <linux/of_fdt.h> | ||
18 | #include <linux/of.h> | ||
17 | 19 | ||
18 | #include <mach/map.h> | 20 | #include <mach/map.h> |
19 | #include <plat/devs.h> | 21 | #include <plat/devs.h> |
@@ -69,3 +71,35 @@ static int __init s5p_mfc_memory_init(void) | |||
69 | return 0; | 71 | return 0; |
70 | } | 72 | } |
71 | device_initcall(s5p_mfc_memory_init); | 73 | device_initcall(s5p_mfc_memory_init); |
74 | |||
75 | #ifdef CONFIG_OF | ||
76 | int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, | ||
77 | int depth, void *data) | ||
78 | { | ||
79 | __be32 *prop; | ||
80 | unsigned long len; | ||
81 | struct s5p_mfc_dt_meminfo *mfc_mem = data; | ||
82 | |||
83 | if (!data) | ||
84 | return 0; | ||
85 | |||
86 | if (!of_flat_dt_is_compatible(node, mfc_mem->compatible)) | ||
87 | return 0; | ||
88 | |||
89 | prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len); | ||
90 | if (!prop || (len != 2 * sizeof(unsigned long))) | ||
91 | return 0; | ||
92 | |||
93 | mfc_mem->loff = be32_to_cpu(prop[0]); | ||
94 | mfc_mem->lsize = be32_to_cpu(prop[1]); | ||
95 | |||
96 | prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len); | ||
97 | if (!prop || (len != 2 * sizeof(unsigned long))) | ||
98 | return 0; | ||
99 | |||
100 | mfc_mem->roff = be32_to_cpu(prop[0]); | ||
101 | mfc_mem->rsize = be32_to_cpu(prop[1]); | ||
102 | |||
103 | return 1; | ||
104 | } | ||
105 | #endif | ||