6 * @brief Common functions and data for the Sonix SN9C20x webcam bridge chips.
8 * @note Copyright (C) Dave Neuer
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
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
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
37 #define SN9C20X_HSTART 0x10fb
38 #define SN9C20X_HSIZE 0x10fc
39 #define SN9C20X_VSTART 0x10fd
40 #define SN9C20X_VSIZE 0x10fe
41 #define SN9C20X_SHARPNESS 0x10f6
42 #define SN9C20X_RED_GAIN 0x118c
43 #define SN9C20X_GREEN1_GAIN 0x118d
44 #define SN9C20X_GREEN2_GAIN 0x118e
45 #define SN9C20X_BLUE_GAIN 0x118f
46 #define SN9C20X_SCALE 0x1189
48 #define SN9C20X_NO_SCALE 0x00
49 #define SN9C20X_1_2_SCALE 0x10
50 #define SN9C20X_1_4_SCALE 0x20
52 int sn9c20x_initialize(struct usb_microdia
*dev
);
53 int sn9c20x_i2c_initialize(struct usb_microdia
*dev
);
55 int sn9c20x_write_i2c_data(struct usb_microdia
*dev
, __u8 slave
, __u8 nbytes
,
56 __u8 address
, __u8 flags
, const __u8
[nbytes
]);
58 int sn9c20x_read_i2c_data(struct usb_microdia
*dev
, __u8 slave
, __u8 nbytes
,
59 __u8 address
, __u8 flags
, __u8
*result
);
61 int sn9c20x_write_i2c_data16(struct usb_microdia
*dev
, __u8 slave
, __u8 datalen
,
62 __u8 address
, __u8 flags
, const __u16
[datalen
]);
64 int sn9c20x_read_i2c_data16(struct usb_microdia
*dev
, __u8 slave
, __u8 datalen
,
65 __u8 address
, __u8 flags
, __u16
*result
);
67 int sn9c20x_set_contrast(struct usb_microdia
*dev
);
69 int sn9c20x_set_brightness(struct usb_microdia
*dev
);
71 int sn9c20x_set_gamma(struct usb_microdia
*dev
);
73 int sn9c20x_set_sharpness(struct usb_microdia
*dev
);
75 int sn9c20x_set_rgb_gain(struct usb_microdia
*dev
);
77 int sn9c20x_set_resolution(struct usb_microdia
*dev
,
78 int width
, int height
);
80 int sn9c20x_get_closest_resolution(int *width
, int *height
);
82 int sn9c20x_set_exposure(struct usb_microdia
*dev
);