/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2001 Jean-Fredric Clere, Nikolas Zimmermann, Georg Acher
* Mark Cave-Ayland, Carlo E Prelz, Dick Streefland
* Copyright (c) 2002, 2003 Tuukka Toivonen
* Copyright (c) 2008 Erik Andrén
*
* P/N 861037: Sensor HDCS1000 ASIC STV0600
* P/N 861050-0010: Sensor HDCS1000 ASIC STV0600
* P/N 861050-0020: Sensor Photobit PB100 ASIC STV0600-1 - QuickCam Express
* P/N 861055: Sensor ST VV6410 ASIC STV0610 - LEGO cam
* P/N 861075-0040: Sensor HDCS1000 ASIC
* P/N 961179-0700: Sensor ST VV6410 ASIC STV0602 - Dexxa WebCam USB
* P/N 861040-0000: Sensor ST VV6410 ASIC STV0610 - QuickCam Web
*/
#ifndef STV06XX_VV6410_H_
#define STV06XX_VV6410_H_
#include "stv06xx_sensor.h"
#define VV6410_COLS 416
#define VV6410_ROWS 320
/* Status registers */
/* Chip identification number including revision indicator */
#define VV6410_DEVICEH 0 x00
#define VV6410_DEVICEL 0 x01
/* User can determine whether timed I2C data
has been consumed by interrogating flag states */
#define VV6410_STATUS0 0 x02
/* Current line counter value */
#define VV6410_LINECOUNTH 0 x03
#define VV6410_LINECOUNTL 0 x04
/* End x coordinate of image size */
#define VV6410_XENDH 0 x05
#define VV6410_XENDL 0 x06
/* End y coordinate of image size */
#define VV6410_YENDH 0 x07
#define VV6410_YENDL 0 x08
/* This is the average pixel value returned from the
dark line offset cancellation algorithm */
#define VV6410_DARKAVGH 0 x09
#define VV6410_DARKAVGL 0 x0a
/* This is the average pixel value returned from the
black line offset cancellation algorithm */
#define VV6410_BLACKAVGH 0 x0b
#define VV6410_BLACKAVGL 0 x0c
/* Flags to indicate whether the x or y image coordinates have been clipped */
#define VV6410_STATUS1 0 x0d
/* Setup registers */
/* Low-power/sleep modes & video timing */
#define VV6410_SETUP0 0 x10
/* Various parameters */
#define VV6410_SETUP1 0 x11
/* Contains pixel counter reset value used by external sync */
#define VV6410_SYNCVALUE 0 x12
/* Frame grabbing modes (FST, LST and QCK) */
#define VV6410_FGMODES 0 x14
/* FST and QCK mapping modes. */
#define VV6410_PINMAPPING 0 x15
/* Data resolution */
#define VV6410_DATAFORMAT 0 x16
/* Output coding formats */
#define VV6410_OPFORMAT 0 x17
/* Various mode select bits */
#define VV6410_MODESELECT 0 x18
/* Exposure registers */
/* Fine exposure. */
#define VV6410_FINEH 0 x20
#define VV6410_FINEL 0 x21
/* Coarse exposure */
#define VV6410_COARSEH 0 x22
#define VV6410_COARSEL 0 x23
/* Analog gain setting */
#define VV6410_ANALOGGAIN 0 x24
/* Clock division */
#define VV6410_CLKDIV 0 x25
/* Dark line offset cancellation value */
#define VV6410_DARKOFFSETH 0 x2c
#define VV6410_DARKOFFSETL 0 x2d
/* Dark line offset cancellation enable */
#define VV6410_DARKOFFSETSETUP 0 x2e
/* Video timing registers */
/* Line Length (Pixel Clocks) */
#define VV6410_LINELENGTHH 0 x52
#define VV6410_LINELENGTHL 0 x53
/* X-co-ordinate of top left corner of region of interest (x-offset) */
#define VV6410_XOFFSETH 0 x57
#define VV6410_XOFFSETL 0 x58
/* Y-coordinate of top left corner of region of interest (y-offset) */
#define VV6410_YOFFSETH 0 x59
#define VV6410_YOFFSETL 0 x5a
/* Field length (Lines) */
#define VV6410_FIELDLENGTHH 0 x61
#define VV6410_FIELDLENGTHL 0 x62
/* System registers */
/* Black offset cancellation default value */
#define VV6410_BLACKOFFSETH 0 x70
#define VV6410_BLACKOFFSETL 0 x71
/* Black offset cancellation setup */
#define VV6410_BLACKOFFSETSETUP 0 x72
/* Analog Control Register 0 */
#define VV6410_CR0 0 x75
/* Analog Control Register 1 */
#define VV6410_CR1 0 x76
/* ADC Setup Register */
#define VV6410_AS0 0 x77
/* Analog Test Register */
#define VV6410_AT0 0 x78
/* Audio Amplifier Setup Register */
#define VV6410_AT1 0 x79
#define VV6410_HFLIP (1 << 3 )
#define VV6410_VFLIP (1 << 4 )
#define VV6410_LOW_POWER_MODE (1 << 0 )
#define VV6410_SOFT_RESET (1 << 2 )
#define VV6410_PAL_25_FPS (0 << 3 )
#define VV6410_CLK_DIV_2 (1 << 1 )
#define VV6410_FINE_EXPOSURE 320
#define VV6410_COARSE_EXPOSURE 192
#define VV6410_DEFAULT_GAIN 5
#define VV6410_SUBSAMPLE 0 x01
#define VV6410_CROP_TO_QVGA 0 x02
#define VV6410_CIF_LINELENGTH 415
static int vv6410_probe(struct sd *sd);
static int vv6410_start(struct sd *sd);
static int vv6410_init(struct sd *sd);
static int vv6410_init_controls(struct sd *sd);
static int vv6410_stop(struct sd *sd);
static int vv6410_dump(struct sd *sd);
/* V4L2 controls supported by the driver */
static int vv6410_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
static int vv6410_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
static int vv6410_set_analog_gain(struct gspca_dev *gspca_dev, __s32 val);
static int vv6410_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
const struct stv06xx_sensor stv06xx_sensor_vv6410 = {
.name = "ST VV6410" ,
.i2c_flush = 5 ,
.i2c_addr = 0 x20,
.i2c_len = 1 ,
/* FIXME (see if we can lower packet_size-s, needs testing, and also
adjusting framerate when the bandwidth gets lower) */
.min_packet_size = { 1023 },
.max_packet_size = { 1023 },
.init = vv6410_init,
.init_controls = vv6410_init_controls,
.probe = vv6410_probe,
.start = vv6410_start,
.stop = vv6410_stop,
.dump = vv6410_dump,
};
/* If NULL, only single value to write, stored in len */
struct stv_init {
u16 addr;
u8 data;
};
static const struct stv_init stv_bridge_init[] = {
/* This reg is written twice. Some kind of reset? */
{STV_RESET, 0 x80},
{STV_RESET, 0 x00},
{STV_SCAN_RATE, 0 x00},
{STV_I2C_FLUSH, 0 x04},
{STV_REG00, 0 x0b},
{STV_REG01, 0 xa7},
{STV_REG02, 0 xb7},
{STV_REG03, 0 x00},
{STV_REG04, 0 x00},
{0 x1536, 0 x02},
{0 x1537, 0 x00},
{0 x1538, 0 x60},
{0 x1539, 0 x01},
{0 x153a, 0 x20},
{0 x153b, 0 x01},
};
static const u8 vv6410_sensor_init[][2 ] = {
/* Setup registers */
{VV6410_SETUP0, VV6410_SOFT_RESET},
{VV6410_SETUP0, VV6410_LOW_POWER_MODE},
/* Use shuffled read-out mode */
{VV6410_SETUP1, BIT(6 )},
/* All modes to 1, FST, Fast QCK, Free running QCK, Free running LST, FST will qualify visible pixels */
{VV6410_FGMODES, BIT(6 ) | BIT(4 ) | BIT(2 ) | BIT(0 )},
{VV6410_PINMAPPING, 0 x00},
/* Pre-clock generator divide off */
{VV6410_DATAFORMAT, BIT(7 ) | BIT(0 )},
{VV6410_CLKDIV, VV6410_CLK_DIV_2},
/* System registers */
/* Enable voltage doubler */
{VV6410_AS0, BIT(6 ) | BIT(4 ) | BIT(3 ) | BIT(2 ) | BIT(1 )},
{VV6410_AT0, 0 x00},
/* Power up audio, differential */
{VV6410_AT1, BIT(4 ) | BIT(0 )},
};
#endif
Messung V0.5 in Prozent C=94 H=93 G=93
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-06-07)
¤
*© Formatika GbR, Deutschland