linux/drivers/media/usb/gspca/stv06xx/stv06xx.h

/* 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_H_
#define STV06XX_H_

#include <linux/slab.h>
#include "gspca.h"

#define MODULE_NAME

#define STV_ISOC_ENDPOINT_ADDR

#define STV_R

#define STV_REG23

/* Control registers of the STV0600 ASIC */
#define STV_I2C_PARTNER
#define STV_I2C_VAL_REG_VAL_PAIRS_MIN1
#define STV_I2C_READ_WRITE_TOGGLE
#define STV_I2C_FLUSH
#define STV_I2C_SUCC_READ_REG_VALS

#define STV_ISO_ENABLE
#define STV_SCAN_RATE
#define STV_LED_CTRL
#define STV_STV0600_EMULATION
#define STV_REG00
#define STV_REG01
#define STV_REG02
#define STV_REG03
#define STV_REG04

#define STV_ISO_SIZE_L
#define STV_ISO_SIZE_H

/* Refers to the CIF 352x288 and QCIF 176x144 */
/* 1: 288 lines, 2: 144 lines */
#define STV_Y_CTRL

#define STV_RESET

/* 0xa: 352 columns, 0x6: 176 columns */
#define STV_X_CTRL

#define STV06XX_URB_MSG_TIMEOUT

#define I2C_MAX_BYTES
#define I2C_MAX_WORDS

#define I2C_BUFFER_LENGTH
#define I2C_READ_CMD
#define I2C_WRITE_CMD

#define LED_ON
#define LED_OFF

/* STV06xx device descriptor */
struct sd {};

int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data);
int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data);

int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len);
int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len);

int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value);
int stv06xx_write_sensor(struct sd *sd, u8 address, u16 value);

#endif