Stop sensor_init from being executed twice
[microdia.git] / sn9c20x.h
blobffd4c39eda312065dae39262212b1e816e0518a1
1 /**
2 * @file sn9c20x.h
3 * @author Dave Neuer
4 * @date 2008-03-02
6 * @brief Common functions and data for the Sonix SN9C20x webcam bridge chips.
8 * @note Copyright (C) Dave Neuer
10 * @par Licences
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef SN9C20X_H
28 #define SN9C20X_H
30 #define SN9C20X_I2C_400KHZ 0x01
31 #define SN9C20X_I2C_READ 0x02
32 #define SN9C20X_I2C_READY 0x04
33 #define SN9C20X_I2C_ERROR 0x08
34 #define SN9C20X_I2C_2WIRE 0x80
36 /* registers */
37 #define SN9C20X_SHARPNESS 0x10f6
38 #define SN9C20X_RED_GAIN 0x118c
39 #define SN9C20X_GREEN1_GAIN 0x118d
40 #define SN9C20X_GREEN2_GAIN 0x118e
41 #define SN9C20X_BLUE_GAIN 0x118f
42 #define SN9C20X_SCALE 0x1189
44 #define SN9C20X_NO_SCALE 0x00
45 #define SN9C20X_1_2_SCALE 0x10
46 #define SN9C20X_1_4_SCALE 0x20
48 int sn9c20x_initialize(struct usb_microdia *dev);
49 int sn9c20x_set_LEDs(struct usb_microdia *dev, int enable);
50 int sn9c20x_enable_video(struct usb_microdia *dev, int enable);
51 int sn9c20x_i2c_initialize(struct usb_microdia *dev);
53 int sn9c20x_write_i2c_data(struct usb_microdia *dev, __u8 nbytes,
54 __u8 address, const __u8 [nbytes]);
56 int sn9c20x_read_i2c_data(struct usb_microdia *dev, __u8 nbytes,
57 __u8 address, __u8 *result);
59 int sn9c20x_write_i2c_data16(struct usb_microdia *dev, __u8 datalen,
60 __u8 address, const __u16 [datalen]);
62 int sn9c20x_read_i2c_data16(struct usb_microdia *dev, __u8 datalen,
63 __u8 address, __u16 *result);
65 int sn9c20x_set_contrast(struct usb_microdia *dev);
67 int sn9c20x_set_brightness(struct usb_microdia *dev);
69 int sn9c20x_set_gamma(struct usb_microdia *dev);
71 int sn9c20x_set_sharpness(struct usb_microdia *dev);
73 int sn9c20x_set_rgb_gain(struct usb_microdia *dev);
75 int sn9c20x_set_resolution(struct usb_microdia *dev,
76 int width, int height);
78 int sn9c20x_get_closest_resolution(struct usb_microdia *, int *, int *);
79 int sn9c20x_set_raw(struct usb_microdia *);
80 int sn9c20x_set_jpeg(struct usb_microdia *);
81 int sn9c20x_set_exposure(struct usb_microdia *);
83 #endif