camera: add v4l2_subdev_core_ops ioctl function in sensor driver, and all sensor...
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / include / mach / rk29_camera.h
1 /*
2     camera.h - PXA camera driver header file
3
4     Copyright (C) 2003, Intel Corporation
5     Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
6
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #ifndef __ASM_ARCH_CAMERA_H_
23 #define __ASM_ARCH_CAMERA_H_
24
25
26 #define RK29_CAM_DRV_NAME "rk29xx-camera"
27 #define RK29_CAM_PLATFORM_DEV_ID 33
28
29 #define RK29_CAM_SENSOR_NAME_OV9650 "ov9650"
30 #define RK29_CAM_SENSOR_NAME_OV2655 "ov2655"
31 #define RK29_CAM_SENSOR_NAME_OV2659 "ov2659"
32 #define RK29_CAM_SENSOR_NAME_OV3640 "ov3640"
33 #define RK29_CAM_SENSOR_NAME_OV5642 "ov5642"
34
35 #define RK29_CAM_POWERACTIVE_BITPOS     0x00
36 #define RK29_CAM_POWERACTIVE_MASK       (1<<RK29_CAM_POWERACTIVE_BITPOS)
37 #define RK29_CAM_POWERACTIVE_H  (0x01<<RK29_CAM_POWERACTIVE_BITPOS)
38 #define RK29_CAM_POWERACTIVE_L  (0x00<<RK29_CAM_POWERACTIVE_BITPOS)
39
40 #define RK29_CAM_RESETACTIVE_BITPOS     0x01
41 #define RK29_CAM_RESETACTIVE_MASK       (1<<RK29_CAM_RESETACTIVE_BITPOS)
42 #define RK29_CAM_RESETACTIVE_H  (0x01<<RK29_CAM_RESETACTIVE_BITPOS)
43 #define RK29_CAM_RESETACTIVE_L  (0x00<<RK29_CAM_RESETACTIVE_BITPOS)
44
45 /* v4l2_subdev_core_ops.ioctl  ioctl_cmd macro */
46 #define RK29_CAM_SUBDEV_ACTIVATE            0x00
47 #define RK29_CAM_SUBDEV_DEACTIVATE          0x01
48
49 struct rk29camera_gpio_res {
50     unsigned int gpio_reset;
51     unsigned int gpio_power;
52     unsigned int gpio_flag;
53     const char *dev_name;
54 };
55
56 struct rk29camera_platform_data {
57     int (*io_init)(void);
58     int (*io_deinit)(void);
59     struct rk29camera_gpio_res gpio_res[2];
60 };
61
62 #endif /* __ASM_ARCH_CAMERA_H_ */
63