1 /*
2  *
3  * Copyright (C) 2014 ROCKCHIP, Inc.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15 
16 #ifndef _LINUX_ROCKCHIP_ION_H
17 #define _LINUX_ROCKCHIP_ION_H
18 
19 #ifdef __KERNEL__
20 #include "../../drivers/staging/android/ion/ion.h"
21 #else
22 #include <linux/ion.h>
23 #endif
24 
25 struct ion_phys_data {
26     ion_user_handle_t handle;
27     unsigned long phys;
28     unsigned long size;
29 };
30 
31 #define ION_IOC_ROCKCHIP_MAGIC 'R'
32 
33 /* Get phys addr of the handle specified. */
34 #define ION_IOC_GET_PHYS _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, struct ion_phys_data)
35 
36 extern struct ion_device *rockchip_ion_dev;
37 
38 struct ion_client *rockchip_ion_client_create(const char *name);
39 
40 #endif
41