Fix warnings and errors when compiled under rt kernel
[microdia.git] / sn9c20x.h
blob6f6da143fa24469a9a1c73fb2e19856595ae910c
1 /**
2 * @file sn9c20x.h
3 * @author Dave Neuer
4 * @date 2008-03-02
5 * @version v0.0.0
7 * @brief Common functions and data for the Sonix SN9C20x webcam bridge chips.
9 * @note Copyright (C) Dave Neuer
11 * @par Licences
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef SN9C20X_H
29 #define SN9C20X_H
31 #define SN9C20X_I2C_400KHZ 0x01
32 #define SN9C20X_I2C_READ 0x02
33 #define SN9C20X_I2C_READY 0x04
34 #define SN9C20X_I2C_ERROR 0x08
35 #define SN9C20X_I2C_2WIRE 0x80
37 /* registers */
38 #define SN9C20X_SHARPNESS 0x10f6
39 #define SN9C20X_RED_GAIN 0x118c
40 #define SN9C20X_GREEN1_GAIN 0x118d
41 #define SN9C20X_GREEN2_GAIN 0x118e
42 #define SN9C20X_BLUE_GAIN 0x118f
44 int sn9c20x_initialize_i2c(struct usb_microdia * dev, __u8 flags, __u8 slave);
46 int sn9c20x_write_i2c_data(struct usb_microdia * dev, __u8 slave, __u8 nbytes,
47 __u8 address, __u8 flags, const __u8 [nbytes]);
49 int sn9c20x_read_i2c_data(struct usb_microdia * dev, __u8 slave, __u8 nbytes,
50 __u8 address, __u8 flags, __u8 * result);
52 int sn9c20x_write_i2c_data16(struct usb_microdia * dev, __u8 slave, __u8 datalen,
53 __u8 address, __u8 flags, const __u16 [datalen]);
55 int sn9c20x_read_i2c_data16(struct usb_microdia * dev, __u8 slave, __u8 datalen,
56 __u8 address, __u8 flags, __u16 * result);
58 int sn9c20x_set_contrast(struct usb_microdia *dev);
60 int sn9c20x_set_brightness(struct usb_microdia *dev);
62 int sn9c20x_set_gamma(struct usb_microdia *dev);
64 int sn9c20x_set_sharpness(struct usb_microdia *dev);
66 int sn9c20x_set_rgb_gain(struct usb_microdia *dev);
68 #endif