linux/drivers/media/usb/gspca/zc3xx-reg.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * zc030x registers
 *
 * Copyright (c) 2008 Mauro Carvalho Chehab <[email protected]>
 *
 * The register aliases used here came from this driver:
 *	http://zc0302.sourceforge.net/zc0302.php
 */

/* Define the register map */
#define ZC3XX_R000_SYSTEMCONTROL
#define ZC3XX_R001_SYSTEMOPERATING

/* Picture size */
#define ZC3XX_R002_CLOCKSELECT
#define ZC3XX_R003_FRAMEWIDTHHIGH
#define ZC3XX_R004_FRAMEWIDTHLOW
#define ZC3XX_R005_FRAMEHEIGHTHIGH
#define ZC3XX_R006_FRAMEHEIGHTLOW

/* JPEG control */
#define ZC3XX_R008_CLOCKSETTING

/* Test mode */
#define ZC3XX_R00B_TESTMODECONTROL

/* Frame retrieving */
#define ZC3XX_R00C_LASTACQTIME
#define ZC3XX_R00D_MONITORRES
#define ZC3XX_R00E_TIMESTAMPHIGH
#define ZC3XX_R00F_TIMESTAMPLOW
#define ZC3XX_R018_FRAMELOST
#define ZC3XX_R019_AUTOADJUSTFPS
#define ZC3XX_R01A_LASTFRAMESTATE
#define ZC3XX_R025_DATACOUNTER

/* Stream and sensor specific */
#define ZC3XX_R010_CMOSSENSORSELECT
#define ZC3XX_R011_VIDEOSTATUS
#define ZC3XX_R012_VIDEOCONTROLFUNC

/* Horizontal and vertical synchros */
#define ZC3XX_R01D_HSYNC_0
#define ZC3XX_R01E_HSYNC_1
#define ZC3XX_R01F_HSYNC_2
#define ZC3XX_R020_HSYNC_3

/* Target picture size in byte */
#define ZC3XX_R022_TARGETPICTSIZE_0
#define ZC3XX_R023_TARGETPICTSIZE_1
#define ZC3XX_R024_TARGETPICTSIZE_2

/* Audio registers */
#define ZC3XX_R030_AUDIOADC
#define ZC3XX_R031_AUDIOSTREAMSTATUS
#define ZC3XX_R032_AUDIOSTATUS

/* Sensor interface */
#define ZC3XX_R080_HBLANKHIGH
#define ZC3XX_R081_HBLANKLOW
#define ZC3XX_R082_RESETLEVELADDR
#define ZC3XX_R083_RGAINADDR
#define ZC3XX_R084_GGAINADDR
#define ZC3XX_R085_BGAINADDR
#define ZC3XX_R086_EXPTIMEHIGH
#define ZC3XX_R087_EXPTIMEMID
#define ZC3XX_R088_EXPTIMELOW
#define ZC3XX_R089_RESETBLACKHIGH
#define ZC3XX_R08A_RESETWHITEHIGH
#define ZC3XX_R08B_I2CDEVICEADDR
#define ZC3XX_R08C_I2CIDLEANDNACK
#define ZC3XX_R08D_COMPABILITYMODE
#define ZC3XX_R08E_COMPABILITYMODE2

/* I2C control */
#define ZC3XX_R090_I2CCOMMAND
#define ZC3XX_R091_I2CSTATUS
#define ZC3XX_R092_I2CADDRESSSELECT
#define ZC3XX_R093_I2CSETVALUE
#define ZC3XX_R094_I2CWRITEACK
#define ZC3XX_R095_I2CREAD
#define ZC3XX_R096_I2CREADACK

/* Window inside the sensor array */
#define ZC3XX_R097_WINYSTARTHIGH
#define ZC3XX_R098_WINYSTARTLOW
#define ZC3XX_R099_WINXSTARTHIGH
#define ZC3XX_R09A_WINXSTARTLOW
#define ZC3XX_R09B_WINHEIGHTHIGH
#define ZC3XX_R09C_WINHEIGHTLOW
#define ZC3XX_R09D_WINWIDTHHIGH
#define ZC3XX_R09E_WINWIDTHLOW
#define ZC3XX_R119_FIRSTYHIGH
#define ZC3XX_R11A_FIRSTYLOW
#define ZC3XX_R11B_FIRSTXHIGH
#define ZC3XX_R11C_FIRSTXLOW

/* Max sensor array size */
#define ZC3XX_R09F_MAXXHIGH
#define ZC3XX_R0A0_MAXXLOW
#define ZC3XX_R0A1_MAXYHIGH
#define ZC3XX_R0A2_MAXYLOW
#define ZC3XX_R0A3_EXPOSURETIMEHIGH
#define ZC3XX_R0A4_EXPOSURETIMELOW
#define ZC3XX_R0A5_EXPOSUREGAIN
#define ZC3XX_R0A6_EXPOSUREBLACKLVL

/* Other registers */
#define ZC3XX_R100_OPERATIONMODE
#define ZC3XX_R101_SENSORCORRECTION

/* Gains */
#define ZC3XX_R116_RGAIN
#define ZC3XX_R117_GGAIN
#define ZC3XX_R118_BGAIN
#define ZC3XX_R11D_GLOBALGAIN
#define ZC3XX_R1A8_DIGITALGAIN
#define ZC3XX_R1A9_DIGITALLIMITDIFF
#define ZC3XX_R1AA_DIGITALGAINSTEP

/* Auto correction */
#define ZC3XX_R180_AUTOCORRECTENABLE
#define ZC3XX_R181_WINXSTART
#define ZC3XX_R182_WINXWIDTH
#define ZC3XX_R183_WINXCENTER
#define ZC3XX_R184_WINYSTART
#define ZC3XX_R185_WINYWIDTH
#define ZC3XX_R186_WINYCENTER

/* Gain range */
#define ZC3XX_R187_MAXGAIN
#define ZC3XX_R188_MINGAIN

/* Auto exposure and white balance */
#define ZC3XX_R189_AWBSTATUS
#define ZC3XX_R18A_AWBFREEZE
#define ZC3XX_R18B_AESTATUS
#define ZC3XX_R18C_AEFREEZE
#define ZC3XX_R18F_AEUNFREEZE
#define ZC3XX_R190_EXPOSURELIMITHIGH
#define ZC3XX_R191_EXPOSURELIMITMID
#define ZC3XX_R192_EXPOSURELIMITLOW
#define ZC3XX_R195_ANTIFLICKERHIGH
#define ZC3XX_R196_ANTIFLICKERMID
#define ZC3XX_R197_ANTIFLICKERLOW

/* What is this ? */
#define ZC3XX_R18D_YTARGET
#define ZC3XX_R18E_RESETLVL

/* Color */
#define ZC3XX_R1A0_REDMEANAFTERAGC
#define ZC3XX_R1A1_GREENMEANAFTERAGC
#define ZC3XX_R1A2_BLUEMEANAFTERAGC
#define ZC3XX_R1A3_REDMEANAFTERAWB
#define ZC3XX_R1A4_GREENMEANAFTERAWB
#define ZC3XX_R1A5_BLUEMEANAFTERAWB
#define ZC3XX_R1A6_YMEANAFTERAE
#define ZC3XX_R1A7_CALCGLOBALMEAN

/* Matrixes */

/* Color matrix is like :
   R' = R * RGB00 + G * RGB01 + B * RGB02 + RGB03
   G' = R * RGB10 + G * RGB11 + B * RGB22 + RGB13
   B' = R * RGB20 + G * RGB21 + B * RGB12 + RGB23
 */
#define ZC3XX_R10A_RGB00
#define ZC3XX_R10B_RGB01
#define ZC3XX_R10C_RGB02
#define ZC3XX_R113_RGB03
#define ZC3XX_R10D_RGB10
#define ZC3XX_R10E_RGB11
#define ZC3XX_R10F_RGB12
#define ZC3XX_R114_RGB13
#define ZC3XX_R110_RGB20
#define ZC3XX_R111_RGB21
#define ZC3XX_R112_RGB22
#define ZC3XX_R115_RGB23

/* Gamma matrix */
#define ZC3XX_R120_GAMMA00
#define ZC3XX_R121_GAMMA01
#define ZC3XX_R122_GAMMA02
#define ZC3XX_R123_GAMMA03
#define ZC3XX_R124_GAMMA04
#define ZC3XX_R125_GAMMA05
#define ZC3XX_R126_GAMMA06
#define ZC3XX_R127_GAMMA07
#define ZC3XX_R128_GAMMA08
#define ZC3XX_R129_GAMMA09
#define ZC3XX_R12A_GAMMA0A
#define ZC3XX_R12B_GAMMA0B
#define ZC3XX_R12C_GAMMA0C
#define ZC3XX_R12D_GAMMA0D
#define ZC3XX_R12E_GAMMA0E
#define ZC3XX_R12F_GAMMA0F
#define ZC3XX_R130_GAMMA10
#define ZC3XX_R131_GAMMA11
#define ZC3XX_R132_GAMMA12
#define ZC3XX_R133_GAMMA13
#define ZC3XX_R134_GAMMA14
#define ZC3XX_R135_GAMMA15
#define ZC3XX_R136_GAMMA16
#define ZC3XX_R137_GAMMA17
#define ZC3XX_R138_GAMMA18
#define ZC3XX_R139_GAMMA19
#define ZC3XX_R13A_GAMMA1A
#define ZC3XX_R13B_GAMMA1B
#define ZC3XX_R13C_GAMMA1C
#define ZC3XX_R13D_GAMMA1D
#define ZC3XX_R13E_GAMMA1E
#define ZC3XX_R13F_GAMMA1F

/* Luminance gamma */
#define ZC3XX_R140_YGAMMA00
#define ZC3XX_R141_YGAMMA01
#define ZC3XX_R142_YGAMMA02
#define ZC3XX_R143_YGAMMA03
#define ZC3XX_R144_YGAMMA04
#define ZC3XX_R145_YGAMMA05
#define ZC3XX_R146_YGAMMA06
#define ZC3XX_R147_YGAMMA07
#define ZC3XX_R148_YGAMMA08
#define ZC3XX_R149_YGAMMA09
#define ZC3XX_R14A_YGAMMA0A
#define ZC3XX_R14B_YGAMMA0B
#define ZC3XX_R14C_YGAMMA0C
#define ZC3XX_R14D_YGAMMA0D
#define ZC3XX_R14E_YGAMMA0E
#define ZC3XX_R14F_YGAMMA0F
#define ZC3XX_R150_YGAMMA10
#define ZC3XX_R151_YGAMMA11

#define ZC3XX_R1C5_SHARPNESSMODE
#define ZC3XX_R1C6_SHARPNESS00
#define ZC3XX_R1C7_SHARPNESS01
#define ZC3XX_R1C8_SHARPNESS02
#define ZC3XX_R1C9_SHARPNESS03
#define ZC3XX_R1CA_SHARPNESS04
#define ZC3XX_R1CB_SHARPNESS05

/* Dead pixels */
#define ZC3XX_R250_DEADPIXELSMODE

/* EEPROM */
#define ZC3XX_R300_EEPROMCONFIG
#define ZC3XX_R301_EEPROMACCESS
#define ZC3XX_R302_EEPROMSTATUS