1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher
4 * Mark Cave-Ayland, Carlo E Prelz, Dick Streefland
5 * Copyright (c) 2002, 2003 Tuukka Toivonen
6 * Copyright (c) 2008 Erik Andrén
8 * P/N 861037: Sensor HDCS1000 ASIC STV0600
9 * P/N 861050-0010: Sensor HDCS1000 ASIC STV0600
10 * P/N 861050-0020: Sensor Photobit PB100 ASIC STV0600-1 - QuickCam Express
11 * P/N 861055: Sensor ST VV6410 ASIC STV0610 - LEGO cam
12 * P/N 861075-0040: Sensor HDCS1000 ASIC
13 * P/N 961179-0700: Sensor ST VV6410 ASIC STV0602 - Dexxa WebCam USB
14 * P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web
17 #ifndef STV06XX_SENSOR_H_
18 #define STV06XX_SENSOR_H_
22 #define IS_1020(sd) ((sd)->sensor == &stv06xx_sensor_hdcs1020)
24 extern const struct stv06xx_sensor stv06xx_sensor_vv6410
;
25 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1x00
;
26 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020
;
27 extern const struct stv06xx_sensor stv06xx_sensor_pb0100
;
28 extern const struct stv06xx_sensor stv06xx_sensor_st6422
;
30 struct stv06xx_sensor
{
31 /* Defines the name of a sensor */
34 /* Sensor i2c address */
40 /* length of an i2c word */
43 /* Isoc packet size (per mode) */
44 int min_packet_size
[4];
45 int max_packet_size
[4];
47 /* Probes if the sensor is connected */
48 int (*probe
)(struct sd
*sd
);
50 /* Performs a initialization sequence */
51 int (*init
)(struct sd
*sd
);
53 /* Initializes the controls */
54 int (*init_controls
)(struct sd
*sd
);
56 /* Reads a sensor register */
57 int (*read_sensor
)(struct sd
*sd
, const u8 address
,
58 u8
*i2c_data
, const u8 len
);
60 /* Writes to a sensor register */
61 int (*write_sensor
)(struct sd
*sd
, const u8 address
,
62 u8
*i2c_data
, const u8 len
);
64 /* Instructs the sensor to start streaming */
65 int (*start
)(struct sd
*sd
);
67 /* Instructs the sensor to stop streaming */
68 int (*stop
)(struct sd
*sd
);
70 /* Instructs the sensor to dump all its contents */
71 int (*dump
)(struct sd
*sd
);