1 /* 2 * Copyright (C) 2010 Motorola, Inc. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 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 * You should have received a copy of the GNU General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 16 * 02111-1307, USA 17 */ 18 19 #ifndef __SOC2030_H__ 20 #define __SOC2030_H__ 21 22 #include <linux/ioctl.h> /* For IOCTL macros */ 23 24 #define SOC2030_IOCTL_SET_MODE _IOWR('o', 1, struct soc2030_mode) 25 #define SOC2030_IOCTL_GET_STATUS _IOC(_IOC_READ, 'o', 2, 10) 26 #define SOC2030_IOCTL_SET_PRIVATE _IOWR('o', 3, struct soc2030_regs) 27 #define SOC2030_IOCTL_GET_MODES _IO('o', 4) 28 #define SOC2030_IOCTL_GET_NUM_MODES _IOR('o', 5, unsigned int) 29 #define SOC2030_IOCTL_SET_EFFECT _IOWR('o', 6, unsigned int) 30 #define SOC2030_IOCTL_SET_WHITEBALANCE _IOWR('o', 7, unsigned int) 31 #define SOC2030_IOCTL_SET_EXP_COMP _IOWR('o', 8, int) 32 33 #define SOC2030_POLL_WAITMS 50 34 #define SOC2030_MAX_RETRIES 3 35 #define SOC2030_POLL_RETRIES 5 36 37 #define SOC2030_MAX_PRIVATE_SIZE 1024 38 #define SOC2030_MAX_NUM_MODES 6 39 40 #define SOC_EV_MAX 2 41 #define SOC_EV_MIN -2 42 #define EXP_TARGET 0x32 43 44 enum { 45 REG_TABLE_END, 46 WRITE_REG_DATA, 47 WRITE_REG_BIT_H, 48 WRITE_REG_BIT_L, 49 POLL_REG_DATA, 50 POLL_REG_BIT_H, 51 POLL_REG_BIT_L, 52 WRITE_VAR_DATA, 53 POLL_VAR_DATA, 54 DELAY_MS, 55 }; 56 57 enum { 58 EFFECT_NONE, 59 EFFECT_BW, 60 EFFECT_NEGATIVE, 61 EFFECT_POSTERIZE, 62 EFFECT_SEPIA, 63 EFFECT_SOLARIZE, 64 EFFECT_AQUA, 65 EFFECT_MAX, 66 }; 67 68 enum { 69 WB_AUTO, 70 WB_INCANDESCENT, 71 WB_FLUORESCENT, 72 WB_DAYLIGHT, 73 WB_CLOUDYDAYLIGHT, 74 WB_NIGHT, 75 WB_MAX, 76 }; 77 78 struct soc2030_regs { 79 __u8 op; 80 __u16 addr; 81 __u16 val; 82 }; 83 84 struct soc2030_mode { 85 int xres; 86 int yres; 87 int fps; 88 struct soc2030_regs *regset; 89 }; 90 91 #ifdef __KERNEL__ 92 struct soc2030_platform_data { 93 int (*power_on)(void); 94 int (*power_off)(void); 95 96 }; 97 #endif /* __KERNEL__ */ 98 99 #endif /* __SOC2030_H__ */ 100 101