From: CMY Date: Tue, 11 Feb 2014 08:48:16 +0000 (+0800) Subject: move rockchip_ion.h file to include/linux/ X-Git-Tag: firefly_0821_release~6334 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=268a9b7111c4e8256341aa002b84aebe4b22e00f;p=firefly-linux-kernel-4.4.55.git move rockchip_ion.h file to include/linux/ --- diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index dbae7ae17561..dcd2a0cdb192 100755 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -20,7 +20,6 @@ #include #include "../uapi/ion.h" -#include "../uapi/rockchip_ion.h" struct ion_handle; struct ion_device; diff --git a/drivers/staging/android/ion/rockchip/rockchip_ion.c b/drivers/staging/android/ion/rockchip/rockchip_ion.c index e82abcd7fc99..78bdcba76406 100755 --- a/drivers/staging/android/ion/rockchip/rockchip_ion.c +++ b/drivers/staging/android/ion/rockchip/rockchip_ion.c @@ -17,7 +17,7 @@ #include #include #include -#include "../ion.h" +#include #include "../ion_priv.h" #ifdef CONFIG_OF @@ -29,15 +29,7 @@ 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 index 4fa54d7365b8..000000000000 --- a/drivers/staging/android/uapi/rockchip_ion.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _LINUX_ROCKCHIP_ION_H -#define _LINUX_ROCKCHIP_ION_H - -enum ion_heap_ids { - INVALID_HEAP_ID = -1, - ION_VIDEO_HEAP_ID = 1, - ION_CAMERA_HEAP_ID, - ION_IOMMU_HEAP_ID, - ION_AUDIO_HEAP_ID, - ION_SYSTEM_HEAP_ID, - - ION_HEAP_ID_RESERVED = 31 -}; - -#define ION_HEAP(bit) (1 << (bit)) - -#define ION_VIDEO_HEAP_NAME "video" -#define ION_AUDIO_HEAP_NAME "audio" -#define ION_CAMERA_HEAP_NAME "camera_preview" -#define ION_IOMMU_HEAP_NAME "iommu" -#define ION_VMALLOC_HEAP_NAME "vmalloc" - -#define ION_SET_CACHED(__cache) (__cache | ION_FLAG_CACHED) -#define ION_SET_UNCACHED(__cache) (__cache & ~ION_FLAG_CACHED) - -#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED) - -/* struct ion_flush_data - data passed to ion for flushing caches - * - * @handle: handle with data to flush - * @fd: fd to flush - * @vaddr: userspace virtual address mapped with mmap - * @offset: offset into the handle to flush - * @length: length of handle to flush - * - * Performs cache operations on the handle. If p is the start address - * of the handle, p + offset through p + offset + length will have - * the cache operations performed - */ -struct ion_flush_data { - struct ion_handle *handle; - int fd; - void *vaddr; - unsigned int offset; - unsigned int length; -}; - -#define ION_IOC_ROCKCHIP_MAGIC 'R' - -/** - * DOC: ION_IOC_CLEAN_CACHES - clean the caches - * - * Clean the caches of the handle specified. - */ -#define ION_IOC_CLEAN_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \ - struct ion_flush_data) -/** - * DOC: ION_IOC_INV_CACHES - invalidate the caches - * - * Invalidate the caches of the handle specified. - */ -#define ION_IOC_INV_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \ - struct ion_flush_data) -/** - * DOC: ION_IOC_CLEAN_INV_CACHES - clean and invalidate the caches - * - * Clean and invalidate the caches of the handle specified. - */ -#define ION_IOC_CLEAN_INV_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \ - struct ion_flush_data) - -#endif diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 2578b9b74d2a..3a8f2cc1ab31 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -44,7 +44,7 @@ #endif #if defined(CONFIG_ION_ROCKCHIP) -#include "../../staging/android/ion/ion.h" +#include #endif diff --git a/include/linux/rockchip_ion.h b/include/linux/rockchip_ion.h new file mode 100644 index 000000000000..501c3cd45633 --- /dev/null +++ b/include/linux/rockchip_ion.h @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _LINUX_ROCKCHIP_ION_H +#define _LINUX_ROCKCHIP_ION_H + +#include "../../drivers/staging/android/ion/ion.h" + +enum ion_heap_ids { + INVALID_HEAP_ID = -1, + ION_VIDEO_HEAP_ID = 1, + ION_CAMERA_HEAP_ID, + ION_IOMMU_HEAP_ID, + ION_AUDIO_HEAP_ID, + ION_SYSTEM_HEAP_ID, + + ION_HEAP_ID_RESERVED = 31 +}; + +#define ION_HEAP(bit) (1 << (bit)) + +#define ION_VIDEO_HEAP_NAME "video" +#define ION_AUDIO_HEAP_NAME "audio" +#define ION_CAMERA_HEAP_NAME "camera_preview" +#define ION_IOMMU_HEAP_NAME "iommu" +#define ION_VMALLOC_HEAP_NAME "vmalloc" + +#define ION_SET_CACHED(__cache) (__cache | ION_FLAG_CACHED) +#define ION_SET_UNCACHED(__cache) (__cache & ~ION_FLAG_CACHED) + +#define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED) + +/* struct ion_flush_data - data passed to ion for flushing caches + * + * @handle: handle with data to flush + * @fd: fd to flush + * @vaddr: userspace virtual address mapped with mmap + * @offset: offset into the handle to flush + * @length: length of handle to flush + * + * Performs cache operations on the handle. If p is the start address + * of the handle, p + offset through p + offset + length will have + * the cache operations performed + */ +struct ion_flush_data { + struct ion_handle *handle; + int fd; + void *vaddr; + unsigned int offset; + unsigned int length; +}; + +#define ION_IOC_ROCKCHIP_MAGIC 'R' + +/** + * DOC: ION_IOC_CLEAN_CACHES - clean the caches + * + * Clean the caches of the handle specified. + */ +#define ION_IOC_CLEAN_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \ + struct ion_flush_data) +/** + * DOC: ION_IOC_INV_CACHES - invalidate the caches + * + * Invalidate the caches of the handle specified. + */ +#define ION_IOC_INV_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \ + struct ion_flush_data) +/** + * DOC: ION_IOC_CLEAN_INV_CACHES - clean and invalidate the caches + * + * Clean and invalidate the caches of the handle specified. + */ +#define ION_IOC_CLEAN_INV_CACHES _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \ + struct ion_flush_data) + +#endif