ARM: SAMSUNG: make local s5p-dev-mfc in mach-exynos
authorKukjin Kim <kgene@kernel.org>
Wed, 29 Jul 2015 16:48:17 +0000 (01:48 +0900)
committerKukjin Kim <kgene@kernel.org>
Wed, 29 Jul 2015 16:49:00 +0000 (01:49 +0900)
This patch moves s5p-dev-mfc from plat-samsung into mach-exynos
because it is used for only exynos no other platforms.

Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/Makefile
arch/arm/mach-exynos/s5p-dev-mfc.c [new file with mode: 0644]
arch/arm/plat-samsung/Kconfig
arch/arm/plat-samsung/Makefile
arch/arm/plat-samsung/s5p-dev-mfc.c [deleted file]

index 81064cd61a0a9e72536d6dd6df56555bae352d61..4c4858c566d8c6e22a8dba63b967d85708a08516 100644 (file)
@@ -30,6 +30,11 @@ menuconfig ARCH_EXYNOS
 
 if ARCH_EXYNOS
 
+config S5P_DEV_MFC
+       bool
+       help
+         Compile in setup memory (init) code for MFC
+
 config ARCH_EXYNOS3
        bool "SAMSUNG EXYNOS3"
        select ARM_CPU_SUSPEND if PM
index bcefb5473ee42540b409ba6824d38730c83c2620..2f306767cdfe425b8f522a20fd756310bc5e2fad 100644 (file)
@@ -23,3 +23,5 @@ AFLAGS_sleep.o                        :=-Wa,-march=armv7-a$(plus_sec)
 
 obj-$(CONFIG_EXYNOS5420_MCPM)  += mcpm-exynos.o
 CFLAGS_mcpm-exynos.o           += -march=armv7-a
+
+obj-$(CONFIG_S5P_DEV_MFC)      += s5p-dev-mfc.o
diff --git a/arch/arm/mach-exynos/s5p-dev-mfc.c b/arch/arm/mach-exynos/s5p-dev-mfc.c
new file mode 100644 (file)
index 0000000..0b04b6b
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2010-2011 Samsung Electronics Co.Ltd
+ *
+ * Base S5P MFC resource and device definitions
+ *
+ * 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/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+#include <linux/memblock.h>
+#include <linux/ioport.h>
+#include <linux/of_fdt.h>
+#include <linux/of.h>
+
+static struct platform_device s5p_device_mfc_l;
+static struct platform_device s5p_device_mfc_r;
+
+struct s5p_mfc_dt_meminfo {
+       unsigned long   loff;
+       unsigned long   lsize;
+       unsigned long   roff;
+       unsigned long   rsize;
+       char            *compatible;
+};
+
+struct s5p_mfc_reserved_mem {
+       phys_addr_t     base;
+       unsigned long   size;
+       struct device   *dev;
+};
+
+static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata;
+
+
+static void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
+                               phys_addr_t lbase, unsigned int lsize)
+{
+       int i;
+
+       s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev;
+       s5p_mfc_mem[0].base = rbase;
+       s5p_mfc_mem[0].size = rsize;
+
+       s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev;
+       s5p_mfc_mem[1].base = lbase;
+       s5p_mfc_mem[1].size = lsize;
+
+       for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) {
+               struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i];
+               if (memblock_remove(area->base, area->size)) {
+                       printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n",
+                              area->size, (unsigned long) area->base);
+                       area->base = 0;
+               }
+       }
+}
+
+int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
+                               int depth, void *data)
+{
+       const __be32 *prop;
+       int len;
+       struct s5p_mfc_dt_meminfo mfc_mem;
+
+       if (!data)
+               return 0;
+
+       if (!of_flat_dt_is_compatible(node, data))
+               return 0;
+
+       prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
+       if (!prop || (len != 2 * sizeof(unsigned long)))
+               return 0;
+
+       mfc_mem.loff = be32_to_cpu(prop[0]);
+       mfc_mem.lsize = be32_to_cpu(prop[1]);
+
+       prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
+       if (!prop || (len != 2 * sizeof(unsigned long)))
+               return 0;
+
+       mfc_mem.roff = be32_to_cpu(prop[0]);
+       mfc_mem.rsize = be32_to_cpu(prop[1]);
+
+       s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
+                       mfc_mem.loff, mfc_mem.lsize);
+
+       return 1;
+}
index 0e1874ccf1ea1830818493b21f74e192534d25e8..57729b915003e4d8be246a28070a5ba9bc7a6638 100644 (file)
@@ -233,11 +233,6 @@ config SAMSUNG_PM_GPIO
          pinctrl-samsung driver.
 endif
 
-config S5P_DEV_MFC
-       bool
-       help
-         Compile in setup memory (init) code for MFC
-
 comment "Power management"
 
 config SAMSUNG_PM_DEBUG
index 624f5db0e39ce2bffa1aeaaf765703641be2c018..8c911760f55f220710bf740a5c35aad39b13c863 100644 (file)
@@ -20,7 +20,6 @@ obj-$(CONFIG_SAMSUNG_ATAGS)   += platformdata.o
 
 obj-$(CONFIG_SAMSUNG_ATAGS)    += devs.o
 obj-$(CONFIG_SAMSUNG_ATAGS)    += dev-uart.o
-obj-$(CONFIG_S5P_DEV_MFC)      += s5p-dev-mfc.o
 
 # PM support
 
diff --git a/arch/arm/plat-samsung/s5p-dev-mfc.c b/arch/arm/plat-samsung/s5p-dev-mfc.c
deleted file mode 100644 (file)
index 0b04b6b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2010-2011 Samsung Electronics Co.Ltd
- *
- * Base S5P MFC resource and device definitions
- *
- * 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/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/memblock.h>
-#include <linux/ioport.h>
-#include <linux/of_fdt.h>
-#include <linux/of.h>
-
-static struct platform_device s5p_device_mfc_l;
-static struct platform_device s5p_device_mfc_r;
-
-struct s5p_mfc_dt_meminfo {
-       unsigned long   loff;
-       unsigned long   lsize;
-       unsigned long   roff;
-       unsigned long   rsize;
-       char            *compatible;
-};
-
-struct s5p_mfc_reserved_mem {
-       phys_addr_t     base;
-       unsigned long   size;
-       struct device   *dev;
-};
-
-static struct s5p_mfc_reserved_mem s5p_mfc_mem[2] __initdata;
-
-
-static void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
-                               phys_addr_t lbase, unsigned int lsize)
-{
-       int i;
-
-       s5p_mfc_mem[0].dev = &s5p_device_mfc_r.dev;
-       s5p_mfc_mem[0].base = rbase;
-       s5p_mfc_mem[0].size = rsize;
-
-       s5p_mfc_mem[1].dev = &s5p_device_mfc_l.dev;
-       s5p_mfc_mem[1].base = lbase;
-       s5p_mfc_mem[1].size = lsize;
-
-       for (i = 0; i < ARRAY_SIZE(s5p_mfc_mem); i++) {
-               struct s5p_mfc_reserved_mem *area = &s5p_mfc_mem[i];
-               if (memblock_remove(area->base, area->size)) {
-                       printk(KERN_ERR "Failed to reserve memory for MFC device (%ld bytes at 0x%08lx)\n",
-                              area->size, (unsigned long) area->base);
-                       area->base = 0;
-               }
-       }
-}
-
-int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
-                               int depth, void *data)
-{
-       const __be32 *prop;
-       int len;
-       struct s5p_mfc_dt_meminfo mfc_mem;
-
-       if (!data)
-               return 0;
-
-       if (!of_flat_dt_is_compatible(node, data))
-               return 0;
-
-       prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
-       if (!prop || (len != 2 * sizeof(unsigned long)))
-               return 0;
-
-       mfc_mem.loff = be32_to_cpu(prop[0]);
-       mfc_mem.lsize = be32_to_cpu(prop[1]);
-
-       prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
-       if (!prop || (len != 2 * sizeof(unsigned long)))
-               return 0;
-
-       mfc_mem.roff = be32_to_cpu(prop[0]);
-       mfc_mem.rsize = be32_to_cpu(prop[1]);
-
-       s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
-                       mfc_mem.loff, mfc_mem.lsize);
-
-       return 1;
-}