Path: blob/master/drivers/media/video/gspca/stv06xx/stv06xx.h
17980 views
/*1* Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher2* Mark Cave-Ayland, Carlo E Prelz, Dick Streefland3* Copyright (c) 2002, 2003 Tuukka Toivonen4* Copyright (c) 2008 Erik Andrén5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License as published by8* the Free Software Foundation; either version 2 of the License, or9* (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19*20* P/N 861037: Sensor HDCS1000 ASIC STV060021* P/N 861050-0010: Sensor HDCS1000 ASIC STV060022* P/N 861050-0020: Sensor Photobit PB100 ASIC STV0600-1 - QuickCam Express23* P/N 861055: Sensor ST VV6410 ASIC STV0610 - LEGO cam24* P/N 861075-0040: Sensor HDCS1000 ASIC25* P/N 961179-0700: Sensor ST VV6410 ASIC STV0602 - Dexxa WebCam USB26* P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web27*/2829#ifndef STV06XX_H_30#define STV06XX_H_3132#include <linux/slab.h>33#include "gspca.h"3435#define MODULE_NAME "STV06xx"3637#define STV_ISOC_ENDPOINT_ADDR 0x813839#define STV_REG23 0x04234041/* Control registers of the STV0600 ASIC */42#define STV_I2C_PARTNER 0x142043#define STV_I2C_VAL_REG_VAL_PAIRS_MIN1 0x142144#define STV_I2C_READ_WRITE_TOGGLE 0x142245#define STV_I2C_FLUSH 0x142346#define STV_I2C_SUCC_READ_REG_VALS 0x14244748#define STV_ISO_ENABLE 0x144049#define STV_SCAN_RATE 0x144350#define STV_LED_CTRL 0x144551#define STV_STV0600_EMULATION 0x144652#define STV_REG00 0x150053#define STV_REG01 0x150154#define STV_REG02 0x150255#define STV_REG03 0x150356#define STV_REG04 0x15045758#define STV_ISO_SIZE_L 0x15c159#define STV_ISO_SIZE_H 0x15c26061/* Refers to the CIF 352x288 and QCIF 176x144 */62/* 1: 288 lines, 2: 144 lines */63#define STV_Y_CTRL 0x15c36465/* 0xa: 352 columns, 0x6: 176 columns */66#define STV_X_CTRL 0x16806768#define STV06XX_URB_MSG_TIMEOUT 50006970#define I2C_MAX_BYTES 1671#define I2C_MAX_WORDS 87273#define I2C_BUFFER_LENGTH 0x2374#define I2C_READ_CMD 375#define I2C_WRITE_CMD 17677#define LED_ON 178#define LED_OFF 07980/* STV06xx device descriptor */81struct sd {82struct gspca_dev gspca_dev;8384/* A pointer to the currently connected sensor */85const struct stv06xx_sensor *sensor;8687/* A pointer to the sd_desc struct */88struct sd_desc desc;8990/* Sensor private data */91void *sensor_priv;9293/* The first 4 lines produced by the stv6422 are no good, this keeps94track of how many bytes we still need to skip during a frame */95int to_skip;9697/* Bridge / Camera type */98u8 bridge;99#define BRIDGE_STV600 0100#define BRIDGE_STV602 1101#define BRIDGE_STV610 2102#define BRIDGE_ST6422 3 /* With integrated sensor */103};104105int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data);106int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data);107108int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len);109int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len);110111int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value);112int stv06xx_write_sensor(struct sd *sd, u8 address, u16 value);113114#endif115116117