tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / media / sprd_rotation / rot_drv.h
1 /*
2  * Copyright (C) 2012 Spreadtrum Communications Inc.
3  *
4  * This software is licensed under the terms of the GNU General Public
5  * License version 2, as published by the Free Software Foundation, and
6  * may be copied, distributed, and modified under those terms.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13 #ifndef _ROT_DRV_H_
14 #define _ROT_DRV_H_
15
16 #include <linux/of.h>
17 #include <linux/of_device.h>
18
19 #include "rot_reg.h"
20
21 /*#define ROTATE_DEBUG*/
22
23 #ifdef ROTATE_DEBUG
24         #define ROTATE_TRACE printk
25 #else
26         #define ROTATE_TRACE pr_debug
27 #endif
28
29
30 typedef void (*rot_isr_func)(void *rot_k_private);
31
32 typedef struct _rot_param_tag {
33         ROT_SIZE_T img_size;
34         ROT_DATA_FORMAT_E format;
35         ROT_ANGLE_E angle;
36         ROT_ADDR_T src_addr;
37         ROT_ADDR_T dst_addr;
38         uint32_t s_addr;
39         uint32_t d_addr;
40         ROT_PIXEL_FORMAT_E pixel_format;
41         ROT_UV_MODE_E uv_mode;
42         int is_end;
43         ROT_ENDIAN_E src_endian;
44         ROT_ENDIAN_E dst_endian;
45 } ROT_PARAM_CFG_T;
46
47 struct rot_drv_private{
48         ROT_PARAM_CFG_T cfg;
49         rot_isr_func user_isr_func;
50         spinlock_t rot_drv_lock;
51         void *rot_fd;/*rot file*/
52 };
53
54 int rot_k_module_en(struct device_node *dn);
55 int rot_k_module_dis(struct device_node *dn);
56 int rot_k_isr_reg(rot_isr_func user_func,struct rot_drv_private *drv_private);
57 int rot_k_is_end(ROT_PARAM_CFG_T *s);
58 int rot_k_set_UV_param(ROT_PARAM_CFG_T *s);
59 void rot_k_register_cfg(ROT_PARAM_CFG_T *s);
60 void rot_k_close(void);
61 int rot_k_io_cfg(ROT_CFG_T * param_ptr, ROT_PARAM_CFG_T *s);
62 #endif