/* Common OmniVision image sensor definitions */

#ifndef __LINUX_OVSENSOR_H
#define __LINUX_OVSENSOR_H

/* Commands */
enum {
	OVSENSOR_CMD_S_CTRL,
	OVSENSOR_CMD_G_CTRL,
};

/* Controls */
enum {
	OVSENSOR_CID_CONT,		/* Contrast */
	OVSENSOR_CID_BRIGHT,		/* Brightness */
	OVSENSOR_CID_SAT,		/* Saturation */
	OVSENSOR_CID_HUE,		/* Hue */
	OVSENSOR_CID_EXP,		/* Exposure */
	OVSENSOR_CID_FREQ,		/* Light frequency */
	OVSENSOR_CID_BANDFILT,		/* Banding filter */
	OVSENSOR_CID_AUTOBRIGHT,	/* Auto brightness */
	OVSENSOR_CID_AUTOEXP,		/* Auto exposure */
	OVSENSOR_CID_BACKLIGHT,		/* Back light compensation */
	OVSENSOR_CID_MIRROR,		/* Mirror horizontally */

};

/* Sensor types */
enum {
	SEN_UNKNOWN,
	SEN_OV76BE,
	SEN_OV7610,
	SEN_OV7620,
	SEN_OV7620AE,
	SEN_OV6620,
	SEN_OV6630,
	SEN_OV6630AE,
	SEN_OV6630AF,
	SEN_OV8600,
	SEN_KS0127,
	SEN_KS0127B,
	SEN_SAA7111A,
};

/* Forward declaration */
struct usb_ov511;

struct ovsensor_regvals {
	unsigned char reg;
	unsigned char val;
};

struct ovsensor_control {
	__u32 id;
	int value;
};

struct ov_i2c {
	int (*r)(struct usb_ov511 *, unsigned char, unsigned char *);
	int (*w)(struct usb_ov511 *, unsigned char, unsigned char);
	int (*w_mask)(struct usb_ov511 *, unsigned char, unsigned char,
		      unsigned char);
};

struct ovsensor_ops {
	int (*configure)(struct usb_ov511 *);
	int (*set_window)(struct usb_ov511 *, int, int, int, int);
	int (*mode_init)(struct usb_ov511 *, int, int, int, int, int);
	int (*command)(struct usb_ov511 *, unsigned int, void *);
};

/* Functions in ovsensor.c */
extern int
ovsensor_write_regvals(struct usb_ov511 *ov, struct ovsensor_regvals *rvals);

#endif
