Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher
0004  *            Mark Cave-Ayland, Carlo E Prelz, Dick Streefland
0005  * Copyright (c) 2002, 2003 Tuukka Toivonen
0006  * Copyright (c) 2008 Erik Andrén
0007  *
0008  * P/N 861037:      Sensor HDCS1000        ASIC STV0600
0009  * P/N 861050-0010: Sensor HDCS1000        ASIC STV0600
0010  * P/N 861050-0020: Sensor Photobit PB100  ASIC STV0600-1 - QuickCam Express
0011  * P/N 861055:      Sensor ST VV6410       ASIC STV0610   - LEGO cam
0012  * P/N 861075-0040: Sensor HDCS1000        ASIC
0013  * P/N 961179-0700: Sensor ST VV6410       ASIC STV0602   - Dexxa WebCam USB
0014  * P/N 861040-0000: Sensor ST VV6410       ASIC STV0610   - QuickCam Web
0015  */
0016 
0017 #ifndef STV06XX_SENSOR_H_
0018 #define STV06XX_SENSOR_H_
0019 
0020 #include "stv06xx.h"
0021 
0022 #define IS_1020(sd) ((sd)->sensor == &stv06xx_sensor_hdcs1020)
0023 
0024 extern const struct stv06xx_sensor stv06xx_sensor_vv6410;
0025 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1x00;
0026 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020;
0027 extern const struct stv06xx_sensor stv06xx_sensor_pb0100;
0028 extern const struct stv06xx_sensor stv06xx_sensor_st6422;
0029 
0030 struct stv06xx_sensor {
0031     /* Defines the name of a sensor */
0032     char name[32];
0033 
0034     /* Sensor i2c address */
0035     u8 i2c_addr;
0036 
0037     /* Flush value*/
0038     u8 i2c_flush;
0039 
0040     /* length of an i2c word */
0041     u8 i2c_len;
0042 
0043     /* Isoc packet size (per mode) */
0044     int min_packet_size[4];
0045     int max_packet_size[4];
0046 
0047     /* Probes if the sensor is connected */
0048     int (*probe)(struct sd *sd);
0049 
0050     /* Performs a initialization sequence */
0051     int (*init)(struct sd *sd);
0052 
0053     /* Initializes the controls */
0054     int (*init_controls)(struct sd *sd);
0055 
0056     /* Reads a sensor register */
0057     int (*read_sensor)(struct sd *sd, const u8 address,
0058           u8 *i2c_data, const u8 len);
0059 
0060     /* Writes to a sensor register */
0061     int (*write_sensor)(struct sd *sd, const u8 address,
0062           u8 *i2c_data, const u8 len);
0063 
0064     /* Instructs the sensor to start streaming */
0065     int (*start)(struct sd *sd);
0066 
0067     /* Instructs the sensor to stop streaming */
0068     int (*stop)(struct sd *sd);
0069 
0070     /* Instructs the sensor to dump all its contents */
0071     int (*dump)(struct sd *sd);
0072 };
0073 
0074 #endif