move rockchip_ion.h file to include/linux/
authorCMY <cmy@rock-chips.com>
Tue, 11 Feb 2014 08:48:16 +0000 (16:48 +0800)
committerCMY <cmy@rock-chips.com>
Tue, 11 Feb 2014 08:49:54 +0000 (16:49 +0800)
drivers/staging/android/ion/ion.h
drivers/staging/android/ion/rockchip/rockchip_ion.c
drivers/staging/android/uapi/rockchip_ion.h [deleted file]
drivers/video/rockchip/rk_fb.c
include/linux/rockchip_ion.h [new file with mode: 0644]

index dbae7ae175616ad917495134053b6b53fa17edfb..dcd2a0cdb192ed51f63c27da409bd8bfa7a2d026 100755 (executable)
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 
 #include "../uapi/ion.h"
-#include "../uapi/rockchip_ion.h"
 
 struct ion_handle;
 struct ion_device;
index e82abcd7fc9980f44017aa01e60c02101ab8b645..78bdcba7640667f0268f9fb9749539396f0dfe6c 100755 (executable)
@@ -17,7 +17,7 @@
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
-#include "../ion.h"
+#include <linux/rockchip_ion.h>
 #include "../ion_priv.h"
 
 #ifdef CONFIG_OF
 static struct ion_device *idev;
 static int num_heaps;
 static struct ion_heap **heaps;
-/*
-static struct ion_platform_heap s_heap_data = {
-        .type = ION_HEAP_TYPE_DMA,
-        .id = 1,
-        .name = "norheap",
-        .size = 256*SZ_1M,
-        .align = SZ_1M,
-};
-*/
+
 struct ion_heap_desc {
        unsigned int id;
        enum ion_heap_type type;
@@ -144,12 +136,12 @@ static struct ion_platform_data *rockchip_ion_parse_dt(
                if (ret)
                        goto free_heaps;
 
-//             msm_ion_get_heap_align(node, &pdata->heaps[idx]);
+//             rockchip_ion_get_heap_align(node, &pdata->heaps[idx]);
                ret = rockchip_ion_get_heap_size(node, &pdata->heaps[idx]);
                if (ret)
                        goto free_heaps;
 
-//             msm_ion_get_heap_adjacent(node, &pdata->heaps[idx]);
+//             rockchip_ion_get_heap_adjacent(node, &pdata->heaps[idx]);
                 pdata->heaps[idx].priv = dev;
                 pr_info("%d:  %d  %d  %s  0x%08X\n", idx, pdata->heaps[idx].type, pdata->heaps[idx].id, pdata->heaps[idx].name, pdata->heaps[idx].size);
 
diff --git a/drivers/staging/android/uapi/rockchip_ion.h b/drivers/staging/android/uapi/rockchip_ion.h
deleted file mode 100755 (executable)
index 4fa54d7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*\r
- *\r
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.\r
- *\r
- * This software is licensed under the terms of the GNU General Public\r
- * License version 2, as published by the Free Software Foundation, and\r
- * may be copied, distributed, and modified under those terms.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- */\r
-\r
-#ifndef _LINUX_ROCKCHIP_ION_H\r
-#define _LINUX_ROCKCHIP_ION_H\r
-\r
-enum ion_heap_ids {\r
-       INVALID_HEAP_ID = -1,\r
-       ION_VIDEO_HEAP_ID = 1,\r
-       ION_CAMERA_HEAP_ID,\r
-       ION_IOMMU_HEAP_ID,\r
-       ION_AUDIO_HEAP_ID,\r
-       ION_SYSTEM_HEAP_ID,\r
-\r
-       ION_HEAP_ID_RESERVED = 31\r
-};\r
-\r
-#define ION_HEAP(bit) (1 << (bit))\r
-\r
-#define ION_VIDEO_HEAP_NAME    "video"\r
-#define ION_AUDIO_HEAP_NAME    "audio"\r
-#define ION_CAMERA_HEAP_NAME   "camera_preview"\r
-#define ION_IOMMU_HEAP_NAME    "iommu"\r
-#define ION_VMALLOC_HEAP_NAME  "vmalloc"\r
-\r
-#define ION_SET_CACHED(__cache)                (__cache | ION_FLAG_CACHED)\r
-#define ION_SET_UNCACHED(__cache)      (__cache & ~ION_FLAG_CACHED)\r
-\r
-#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED)\r
-\r
-/* struct ion_flush_data - data passed to ion for flushing caches\r
- *\r
- * @handle:    handle with data to flush\r
- * @fd:                fd to flush\r
- * @vaddr:     userspace virtual address mapped with mmap\r
- * @offset:    offset into the handle to flush\r
- * @length:    length of handle to flush\r
- *\r
- * Performs cache operations on the handle. If p is the start address\r
- * of the handle, p + offset through p + offset + length will have\r
- * the cache operations performed\r
- */\r
-struct ion_flush_data {\r
-       struct ion_handle *handle;\r
-       int fd;\r
-       void *vaddr;\r
-       unsigned int offset;\r
-       unsigned int length;\r
-};\r
-\r
-#define ION_IOC_ROCKCHIP_MAGIC 'R'\r
-\r
-/**\r
- * DOC: ION_IOC_CLEAN_CACHES - clean the caches\r
- *\r
- * Clean the caches of the handle specified.\r
- */\r
-#define ION_IOC_CLEAN_CACHES   _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \\r
-                                               struct ion_flush_data)\r
-/**\r
- * DOC: ION_IOC_INV_CACHES - invalidate the caches\r
- *\r
- * Invalidate the caches of the handle specified.\r
- */\r
-#define ION_IOC_INV_CACHES     _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \\r
-                                               struct ion_flush_data)\r
-/**\r
- * DOC: ION_IOC_CLEAN_INV_CACHES - clean and invalidate the caches\r
- *\r
- * Clean and invalidate the caches of the handle specified.\r
- */\r
-#define ION_IOC_CLEAN_INV_CACHES       _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \\r
-                                               struct ion_flush_data)\r
-\r
-#endif\r
index 2578b9b74d2ae2ede2396568cd9248e30b85efca..3a8f2cc1ab31a4aa4563849489df1bd63dbf9f7d 100755 (executable)
@@ -44,7 +44,7 @@
 #endif
 
 #if defined(CONFIG_ION_ROCKCHIP)
-#include "../../staging/android/ion/ion.h"
+#include <linux/rockchip_ion.h>
 #endif
 
 
diff --git a/include/linux/rockchip_ion.h b/include/linux/rockchip_ion.h
new file mode 100644 (file)
index 0000000..501c3cd
--- /dev/null
@@ -0,0 +1,89 @@
+/*\r
+ *\r
+ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.\r
+ *\r
+ * This software is licensed under the terms of the GNU General Public\r
+ * License version 2, as published by the Free Software Foundation, and\r
+ * may be copied, distributed, and modified under those terms.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ */\r
+\r
+#ifndef _LINUX_ROCKCHIP_ION_H\r
+#define _LINUX_ROCKCHIP_ION_H\r
+\r
+#include "../../drivers/staging/android/ion/ion.h"\r
+\r
+enum ion_heap_ids {\r
+       INVALID_HEAP_ID = -1,\r
+       ION_VIDEO_HEAP_ID = 1,\r
+       ION_CAMERA_HEAP_ID,\r
+       ION_IOMMU_HEAP_ID,\r
+       ION_AUDIO_HEAP_ID,\r
+       ION_SYSTEM_HEAP_ID,\r
+\r
+       ION_HEAP_ID_RESERVED = 31\r
+};\r
+\r
+#define ION_HEAP(bit) (1 << (bit))\r
+\r
+#define ION_VIDEO_HEAP_NAME    "video"\r
+#define ION_AUDIO_HEAP_NAME    "audio"\r
+#define ION_CAMERA_HEAP_NAME   "camera_preview"\r
+#define ION_IOMMU_HEAP_NAME    "iommu"\r
+#define ION_VMALLOC_HEAP_NAME  "vmalloc"\r
+\r
+#define ION_SET_CACHED(__cache)                (__cache | ION_FLAG_CACHED)\r
+#define ION_SET_UNCACHED(__cache)      (__cache & ~ION_FLAG_CACHED)\r
+\r
+#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED)\r
+\r
+/* struct ion_flush_data - data passed to ion for flushing caches\r
+ *\r
+ * @handle:    handle with data to flush\r
+ * @fd:                fd to flush\r
+ * @vaddr:     userspace virtual address mapped with mmap\r
+ * @offset:    offset into the handle to flush\r
+ * @length:    length of handle to flush\r
+ *\r
+ * Performs cache operations on the handle. If p is the start address\r
+ * of the handle, p + offset through p + offset + length will have\r
+ * the cache operations performed\r
+ */\r
+struct ion_flush_data {\r
+       struct ion_handle *handle;\r
+       int fd;\r
+       void *vaddr;\r
+       unsigned int offset;\r
+       unsigned int length;\r
+};\r
+\r
+#define ION_IOC_ROCKCHIP_MAGIC 'R'\r
+\r
+/**\r
+ * DOC: ION_IOC_CLEAN_CACHES - clean the caches\r
+ *\r
+ * Clean the caches of the handle specified.\r
+ */\r
+#define ION_IOC_CLEAN_CACHES   _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \\r
+                                               struct ion_flush_data)\r
+/**\r
+ * DOC: ION_IOC_INV_CACHES - invalidate the caches\r
+ *\r
+ * Invalidate the caches of the handle specified.\r
+ */\r
+#define ION_IOC_INV_CACHES     _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \\r
+                                               struct ion_flush_data)\r
+/**\r
+ * DOC: ION_IOC_CLEAN_INV_CACHES - clean and invalidate the caches\r
+ *\r
+ * Clean and invalidate the caches of the handle specified.\r
+ */\r
+#define ION_IOC_CLEAN_INV_CACHES       _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \\r
+                                               struct ion_flush_data)\r
+\r
+#endif\r