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 __OV5650_H__ 20#define __OV5650_H__ 21 22#include <linux/ioctl.h> /* For IOCTL macros */ 23 24#define OV5650_IOCTL_SET_MODE _IOW('o', 1, struct ov5650_mode) 25#define OV5650_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) 26#define OV5650_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) 27#define OV5650_IOCTL_SET_GAIN _IOW('o', 4, __u16) 28#define OV5650_IOCTL_GET_STATUS _IOR('o', 5, __u8) 29#define OV5650_IOCTL_GET_OTP _IOR('o', 6, struct ov5650_otp_data) 30#define OV5650_IOCTL_TEST_PATTERN _IOW('o', 7, enum ov5650_test_pattern) 31 32enum ov5650_test_pattern { 33 TEST_PATTERN_NONE, 34 TEST_PATTERN_COLORBARS, 35 TEST_PATTERN_CHECKERBOARD 36}; 37 38struct ov5650_otp_data { 39 /* Only the first 5 bytes are actually used. */ 40 __u8 sensor_serial_num[6]; 41 __u8 part_num[8]; 42 __u8 lens_id[1]; 43 __u8 manufacture_id[2]; 44 __u8 factory_id[2]; 45 __u8 manufacture_date[9]; 46 __u8 manufacture_line[2]; 47 48 __u32 module_serial_num; 49 __u8 focuser_liftoff[2]; 50 __u8 focuser_macro[2]; 51 __u8 reserved1[12]; 52 __u8 shutter_cal[16]; 53 __u8 reserved2[183]; 54 55 /* Big-endian. CRC16 over 0x00-0x41 (inclusive) */ 56 __u16 crc; 57 __u8 reserved3[3]; 58 __u8 auto_load[2]; 59} __attribute__ ((packed)); 60 61struct ov5650_mode { 62 int xres; 63 int yres; 64 __u32 frame_length; 65 __u32 coarse_time; 66 __u16 gain; 67}; 68#ifdef __KERNEL__ 69struct ov5650_platform_data { 70 int (*power_on)(void); 71 int (*power_off)(void); 72 73}; 74#endif /* __KERNEL__ */ 75 76#endif /* __OV5650_H__ */ 77 78