diff options
Diffstat (limited to 'drivers/media/video/gspca/stv06xx/stv06xx_sensor.h')
-rw-r--r-- | drivers/media/video/gspca/stv06xx/stv06xx_sensor.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h b/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h new file mode 100644 index 000000000000..c726dacefa1f --- /dev/null +++ b/drivers/media/video/gspca/stv06xx/stv06xx_sensor.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher | ||
3 | * Mark Cave-Ayland, Carlo E Prelz, Dick Streefland | ||
4 | * Copyright (c) 2002, 2003 Tuukka Toivonen | ||
5 | * Copyright (c) 2008 Erik Andrén | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * P/N 861037: Sensor HDCS1000 ASIC STV0600 | ||
22 | * P/N 861050-0010: Sensor HDCS1000 ASIC STV0600 | ||
23 | * P/N 861050-0020: Sensor Photobit PB100 ASIC STV0600-1 - QuickCam Express | ||
24 | * P/N 861055: Sensor ST VV6410 ASIC STV0610 - LEGO cam | ||
25 | * P/N 861075-0040: Sensor HDCS1000 ASIC | ||
26 | * P/N 961179-0700: Sensor ST VV6410 ASIC STV0602 - Dexxa WebCam USB | ||
27 | * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web | ||
28 | */ | ||
29 | |||
30 | #ifndef STV06XX_SENSOR_H_ | ||
31 | #define STV06XX_SENSOR_H_ | ||
32 | |||
33 | #include "stv06xx.h" | ||
34 | |||
35 | #define IS_850(sd) ((sd)->gspca_dev.dev->descriptor.idProduct == 0x850) | ||
36 | #define IS_870(sd) ((sd)->gspca_dev.dev->descriptor.idProduct == 0x870) | ||
37 | #define IS_1020(sd) ((sd)->sensor == &stv06xx_sensor_hdcs1020) | ||
38 | |||
39 | extern const struct stv06xx_sensor stv06xx_sensor_vv6410; | ||
40 | extern const struct stv06xx_sensor stv06xx_sensor_hdcs1x00; | ||
41 | extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020; | ||
42 | extern const struct stv06xx_sensor stv06xx_sensor_pb0100; | ||
43 | |||
44 | #define STV06XX_MAX_CTRLS (V4L2_CID_LASTP1 - V4L2_CID_BASE + 10) | ||
45 | |||
46 | struct stv06xx_sensor { | ||
47 | /* Defines the name of a sensor */ | ||
48 | char name[32]; | ||
49 | |||
50 | /* Sensor i2c address */ | ||
51 | u8 i2c_addr; | ||
52 | |||
53 | /* Flush value*/ | ||
54 | u8 i2c_flush; | ||
55 | |||
56 | /* length of an i2c word */ | ||
57 | u8 i2c_len; | ||
58 | |||
59 | /* Probes if the sensor is connected */ | ||
60 | int (*probe)(struct sd *sd); | ||
61 | |||
62 | /* Performs a initialization sequence */ | ||
63 | int (*init)(struct sd *sd); | ||
64 | |||
65 | /* Executed at device disconnect */ | ||
66 | void (*disconnect)(struct sd *sd); | ||
67 | |||
68 | /* Reads a sensor register */ | ||
69 | int (*read_sensor)(struct sd *sd, const u8 address, | ||
70 | u8 *i2c_data, const u8 len); | ||
71 | |||
72 | /* Writes to a sensor register */ | ||
73 | int (*write_sensor)(struct sd *sd, const u8 address, | ||
74 | u8 *i2c_data, const u8 len); | ||
75 | |||
76 | /* Instructs the sensor to start streaming */ | ||
77 | int (*start)(struct sd *sd); | ||
78 | |||
79 | /* Instructs the sensor to stop streaming */ | ||
80 | int (*stop)(struct sd *sd); | ||
81 | |||
82 | /* Instructs the sensor to dump all its contents */ | ||
83 | int (*dump)(struct sd *sd); | ||
84 | |||
85 | int nctrls; | ||
86 | struct ctrl ctrls[STV06XX_MAX_CTRLS]; | ||
87 | |||
88 | char nmodes; | ||
89 | struct v4l2_pix_format modes[]; | ||
90 | }; | ||
91 | |||
92 | #endif | ||