Linux 2.6.20.13
[linux/fpc-iii.git] / include / media / ovcamchip.h
blob0f43451f8bb3599db431e12789cd498b71ecc168
1 /* OmniVision* camera chip driver API
3 * Copyright (c) 1999-2004 Mark McClelland
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied.
10 * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver
11 * is not sponsored or developed by them.
14 #ifndef __LINUX_OVCAMCHIP_H
15 #define __LINUX_OVCAMCHIP_H
17 #include <linux/videodev.h>
18 #include <media/v4l2-common.h>
19 #include <linux/i2c.h>
21 /* --------------------------------- */
22 /* ENUMERATIONS */
23 /* --------------------------------- */
25 /* Controls */
26 enum {
27 OVCAMCHIP_CID_CONT, /* Contrast */
28 OVCAMCHIP_CID_BRIGHT, /* Brightness */
29 OVCAMCHIP_CID_SAT, /* Saturation */
30 OVCAMCHIP_CID_HUE, /* Hue */
31 OVCAMCHIP_CID_EXP, /* Exposure */
32 OVCAMCHIP_CID_FREQ, /* Light frequency */
33 OVCAMCHIP_CID_BANDFILT, /* Banding filter */
34 OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */
35 OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */
36 OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */
37 OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */
40 /* Chip types */
41 #define NUM_CC_TYPES 9
42 enum {
43 CC_UNKNOWN,
44 CC_OV76BE,
45 CC_OV7610,
46 CC_OV7620,
47 CC_OV7620AE,
48 CC_OV6620,
49 CC_OV6630,
50 CC_OV6630AE,
51 CC_OV6630AF,
54 /* --------------------------------- */
55 /* I2C ADDRESSES */
56 /* --------------------------------- */
58 #define OV7xx0_SID (0x42 >> 1)
59 #define OV6xx0_SID (0xC0 >> 1)
61 /* --------------------------------- */
62 /* API */
63 /* --------------------------------- */
65 struct ovcamchip_control {
66 __u32 id;
67 __s32 value;
70 struct ovcamchip_window {
71 int x;
72 int y;
73 int width;
74 int height;
75 int format;
76 int quarter; /* Scale width and height down 2x */
78 /* This stuff will be removed eventually */
79 int clockdiv; /* Clock divisor setting */
82 /* Commands */
83 #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int)
84 #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int)
85 /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */
86 #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control)
87 #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control)
88 #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window)
89 #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f)
91 #endif