18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/****************************************************************************
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Filename: cpia2registers.h
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *  Copyright 2001, STMicrolectronics, Inc.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  Description:
98c2ecf20Sopenharmony_ci *     Definitions for the CPia2 register set
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci ****************************************************************************/
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#ifndef CPIA2_REGISTER_HEADER
148c2ecf20Sopenharmony_ci#define CPIA2_REGISTER_HEADER
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/***
178c2ecf20Sopenharmony_ci * System register set (Bank 0)
188c2ecf20Sopenharmony_ci ***/
198c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DEVICE_HI                     0x00
208c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DEVICE_LO                     0x01
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SYSTEM_CONTROL                0x02
238c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_LOW_POWER       0x00
248c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_HIGH_POWER      0x01
258c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_SUSPEND         0x02
268c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_V2W_ERR         0x10
278c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_RB_ERR          0x10
288c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CONTROL_CLEAR_ERR       0x80
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_INT_PACKET_CTRL                0x04
318c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_INT_PACKET_CTRL_ENABLE_SW_XX 0x01
328c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_INT_PACKET_CTRL_ENABLE_EOF   0x02
338c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_INT_PACKET_CTRL_ENABLE_INT1  0x04
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CACHE_CTRL                     0x05
368c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CACHE_CTRL_CACHE_RESET      0x01
378c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CACHE_CTRL_CACHE_FLUSH      0x02
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL                    0x06
408c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_NULL_CMD        0x00
418c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_START_CMD       0x01
428c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_STOP_CMD        0x02
438c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_WRITE_CMD       0x03
448c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_READ_ACK_CMD    0x04
458c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_CTRL_READ_NACK_CMD   0x05
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SERIAL_DATA                     0x07
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_VP_SERIAL_ADDR                  0x08
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/***
528c2ecf20Sopenharmony_ci * I2C addresses for various devices in CPiA2
538c2ecf20Sopenharmony_ci ***/
548c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_VP_SERIAL_ADDR_SENSOR           0x20
558c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_VP_SERIAL_ADDR_VP               0x88
568c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_VP_SERIAL_ADDR_676_VP           0x8A
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SPARE_REG1                      0x09
598c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SPARE_REG2                      0x0A
608c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_SPARE_REG3                      0x0B
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_MC_PORT_0                       0x0C
638c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_MC_PORT_1                       0x0D
648c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_MC_PORT_2                       0x0E
658c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_MC_PORT_3                       0x0F
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_STATUS_PKT                      0x20
688c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_STATUS_PKT_END                  0x27
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DESCRIP_VID_HI                  0x30
718c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DESCRIP_VID_LO                  0x31
728c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DESCRIP_PID_HI                  0x32
738c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_DESCRIP_PID_LO                  0x33
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_FW_VERSION_HI                   0x34
768c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_FW_VERSION_LO                   0x35
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CACHE_START_INDEX               0x80
798c2ecf20Sopenharmony_ci#define CPIA2_SYSTEM_CACHE_MAX_WRITES                0x10
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/***
828c2ecf20Sopenharmony_ci * VC register set (Bank 1)
838c2ecf20Sopenharmony_ci ***/
848c2ecf20Sopenharmony_ci#define CPIA2_VC_ASIC_ID                 0x80
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define CPIA2_VC_ASIC_REV                0x81
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL                 0x82
898c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_COLDSTART      0x01
908c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_CP_CLK_EN      0x02
918c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_VP_RESET_N     0x04
928c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_VC_CLK_EN      0x08
938c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_VC_RESET_N     0x10
948c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_GOTO_SUSPEND   0x20
958c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_UDC_SUSPEND    0x40
968c2ecf20Sopenharmony_ci#define CPIA2_VC_PW_CTRL_PWR_DOWN       0x80
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define CPIA2_VC_WAKEUP                   0x83
998c2ecf20Sopenharmony_ci#define CPIA2_VC_WAKEUP_SW_ENABLE       0x01
1008c2ecf20Sopenharmony_ci#define CPIA2_VC_WAKEUP_XX_ENABLE       0x02
1018c2ecf20Sopenharmony_ci#define CPIA2_VC_WAKEUP_SW_ATWAKEUP     0x04
1028c2ecf20Sopenharmony_ci#define CPIA2_VC_WAKEUP_XX_ATWAKEUP     0x08
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define CPIA2_VC_CLOCK_CTRL               0x84
1058c2ecf20Sopenharmony_ci#define CPIA2_VC_CLOCK_CTRL_TESTUP72    0x01
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE                0x88
1088c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_XX_IE       0x01
1098c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_SW_IE       0x02
1108c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_VC_IE       0x04
1118c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBDATA_IE  0x08
1128c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBSETUP_IE 0x10
1138c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBCFG_IE   0x20
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_FLAG                  0x89
1168c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_XX_FLAG       0x01
1178c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_SW_FLAG       0x02
1188c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_VC_FLAG       0x04
1198c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBDATA_FLAG  0x08
1208c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBSETUP_FLAG 0x10
1218c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_USBCFG_FLAG   0x20
1228c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_ENABLE_SET_RESET_BIT 0x80
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_STATE                 0x8A
1258c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_STATE_XX_STATE     0x01
1268c2ecf20Sopenharmony_ci#define CPIA2_VC_INT_STATE_SW_STATE     0x02
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define CPIA2_VC_MP_DIR                    0x90
1298c2ecf20Sopenharmony_ci#define CPIA2_VC_MP_DIR_INPUT           0x00
1308c2ecf20Sopenharmony_ci#define CPIA2_VC_MP_DIR_OUTPUT          0x01
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define CPIA2_VC_MP_DATA                   0x91
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL                   0x98
1358c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL_MODE_0         0x00
1368c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL_MODE_A         0x01
1378c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL_MODE_B         0x02
1388c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL_MODE_C         0x03
1398c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_CTRL_FAKE_FST       0x04
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL                   0x99
1428c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL_SRC_0          0x00
1438c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL_SRC_DIGI_A     0x01
1448c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL_SRC_REG        0x02
1458c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL_DST_USB        0x00
1468c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_CTRL_DST_REG        0x04
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_TEST_IN                0x9B
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_TEST_OUT               0x9C
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_STATUS                 0x9D
1538c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_STATUS_EMPTY        0x01
1548c2ecf20Sopenharmony_ci#define CPIA2_VC_AD_STATUS_FULL         0x02
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define CPIA2_VC_DP_DATA                   0x9E
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL                   0xA0
1598c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_SRC_VC         0x00
1608c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_SRC_DP         0x01
1618c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_SRC_REG        0x02
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_RAW_SELECT     0x04
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_DST_USB        0x00
1668c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_DST_DP         0x08
1678c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_DST_REG        0x10
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_FIFO_ENABLE    0x20
1708c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_CTRL_EOF_DETECT     0x40
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST                   0xA1
1738c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_MODE_MANUAL    0x00
1748c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_MODE_INCREMENT 0x02
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_AUTO_FILL      0x08
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_REPEAT_FIFO    0x10
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_IN                0xA2
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_TEST_OUT               0xA3
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_STATUS                 0xA4
1858c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_STATUS_EMPTY        0x01
1868c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_STATUS_FULL         0x02
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_FRAME_DETECT_1         0xA5
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci#define CPIA2_VC_ST_FRAME_DETECT_2         0xA6
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL                    0xA8
1938c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_STALLED      0x01
1948c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_READY        0x02
1958c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_STATUS       0x04
1968c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_STATUS_DIR   0x08
1978c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_NO_CLASH     0x10
1988c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CTRL_CMD_MICRO_ACCESS 0x80
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STRM                  0xA9
2018c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STRM_ISO_ENABLE    0x01
2028c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STRM_BLK_ENABLE    0x02
2038c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STRM_INT_ENABLE    0x04
2048c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STRM_AUD_ENABLE    0x08
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS                   0xAA
2078c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CMD_IN_PROGRESS  0x01
2088c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CMD_STATUS_STALL 0x02
2098c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CMD_HANDSHAKE    0x04
2108c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CMD_OVERRIDE     0x08
2118c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CMD_FIFO_BUSY    0x10
2128c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_BULK_REPEAT_TXN  0x20
2138c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_CONFIG_DONE      0x40
2148c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_STATUS_USB_SUSPEND      0x80
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CMDW                   0xAB
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_DATARW                 0xAC
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_INFO                   0xAD
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_CONFIG                 0xAE
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_SETTINGS                  0xAF
2258c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_SETTINGS_CONFIG_MASK    0x03
2268c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_SETTINGS_INTERFACE_MASK 0x0C
2278c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_SETTINGS_ALTERNATE_MASK 0x70
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_ISOLIM                  0xB0
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_ISOFAILS                0xB1
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_ISOMAXPKTHI             0xB2
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci#define CPIA2_VC_USB_ISOMAXPKTLO             0xB3
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci#define CPIA2_VC_V2W_CTRL                    0xB8
2388c2ecf20Sopenharmony_ci#define CPIA2_VC_V2W_SELECT               0x01
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci#define CPIA2_VC_V2W_SCL                     0xB9
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci#define CPIA2_VC_V2W_SDA                     0xBA
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL                     0xC0
2458c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_RUN              0x01
2468c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_SINGLESHOT       0x02
2478c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_IDLING           0x04
2488c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_INHIBIT_H_TABLES 0x10
2498c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_INHIBIT_Q_TABLES 0x20
2508c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CTRL_INHIBIT_PRIVATE  0x40
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_RESTART_IVAL_HI          0xC1
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_RESTART_IVAL_LO          0xC2
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT                   0xC3
2578c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT_UFIRST         0x01
2588c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT_MONO           0x02
2598c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT_DECIMATING     0x04
2608c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT_SHORTLINE      0x08
2618c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_FORMAT_SELFTEST       0x10
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS                         0xC4
2648c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS_CLKDIV_MASK        0x03
2658c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_672_CLOCKS_CIF_DIV_BY_3   0x04
2668c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_672_CLOCKS_SCALING        0x08
2678c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS_LOGDIV0        0x00
2688c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS_LOGDIV1        0x01
2698c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS_LOGDIV2        0x02
2708c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CLOCKS_LOGDIV3        0x03
2718c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_676_CLOCKS_CIF_DIV_BY_3   0x08
2728c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_676_CLOCKS_SCALING	      0x10
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_IHSIZE_LO                0xC5
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_XLIM_HI                  0xC6
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_XLIM_LO                  0xC7
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_YLIM_HI                  0xC8
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_YLIM_LO                  0xC9
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_OHSIZE                   0xCA
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_OVSIZE                   0xCB
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HCROP                    0xCC
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VCROP                    0xCD
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HPHASE                   0xCE
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VPHASE                   0xCF
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HISPAN                   0xD0
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VISPAN                   0xD1
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HICROP                   0xD2
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VICROP                   0xD3
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HFRACT                   0xD4
3058c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HFRACT_DEN_MASK       0x0F
3068c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_HFRACT_NUM_MASK       0xF0
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VFRACT                   0xD5
3098c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VFRACT_DEN_MASK       0x0F
3108c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_VFRACT_NUM_MASK       0xF0
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_JPEG_OPT                      0xD6
3138c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_JPEG_OPT_DOUBLE_SQUEEZE     0x01
3148c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_JPEG_OPT_NO_DC_AUTO_SQUEEZE 0x02
3158c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_JPEG_OPT_AUTO_SQUEEZE       0x04
3168c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_JPEG_OPT_DEFAULT      (CPIA2_VC_VC_JPEG_OPT_DOUBLE_SQUEEZE|\
3178c2ecf20Sopenharmony_ci					   CPIA2_VC_VC_JPEG_OPT_AUTO_SQUEEZE)
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_CREEP_PERIOD             0xD7
3218c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_USER_SQUEEZE             0xD8
3228c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_TARGET_KB                0xD9
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci#define CPIA2_VC_VC_AUTO_SQUEEZE             0xE6
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci
3278c2ecf20Sopenharmony_ci/***
3288c2ecf20Sopenharmony_ci * VP register set (Bank 2)
3298c2ecf20Sopenharmony_ci ***/
3308c2ecf20Sopenharmony_ci#define CPIA2_VP_DEVICEH                             0
3318c2ecf20Sopenharmony_ci#define CPIA2_VP_DEVICEL                             1
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMSTATE                         0x02
3348c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMSTATE_HK_ALIVE             0x01
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL                          0x03
3378c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_REQ_CLEAR_ERROR       0x80
3388c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_POWER_DOWN_PLL        0x20
3398c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_REQ_SUSPEND_STATE     0x10
3408c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_REQ_SERIAL_WAKEUP     0x08
3418c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_REQ_AUTOLOAD          0x04
3428c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_HK_CONTROL            0x02
3438c2ecf20Sopenharmony_ci#define CPIA2_VP_SYSTEMCTRL_POWER_CONTROL         0x01
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS                        0x05
3468c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS_404                 0x01
3478c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS_407                 0x02
3488c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS_409                 0x04
3498c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS_410                 0x08
3508c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_FLAGS_500                 0x10
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ci#define CPIA2_VP_SENSOR_REV                          0x06
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci#define CPIA2_VP_DEVICE_CONFIG                       0x07
3558c2ecf20Sopenharmony_ci#define CPIA2_VP_DEVICE_CONFIG_SERIAL_BRIDGE      0x01
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci#define CPIA2_VP_GPIO_DIRECTION                      0x08
3588c2ecf20Sopenharmony_ci#define CPIA2_VP_GPIO_READ                        0xFF
3598c2ecf20Sopenharmony_ci#define CPIA2_VP_GPIO_WRITE                       0x00
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci#define CPIA2_VP_GPIO_DATA                           0x09
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci#define CPIA2_VP_RAM_ADDR_H                          0x0A
3648c2ecf20Sopenharmony_ci#define CPIA2_VP_RAM_ADDR_L                          0x0B
3658c2ecf20Sopenharmony_ci#define CPIA2_VP_RAM_DATA                            0x0C
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci#define CPIA2_VP_PATCH_REV                           0x0F
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci#define CPIA2_VP4_USER_MODE                           0x10
3708c2ecf20Sopenharmony_ci#define CPIA2_VP5_USER_MODE                           0x13
3718c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_CIF                    0x01
3728c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_QCIFDS                 0x02
3738c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_QCIFPTC                0x04
3748c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_QVGADS                 0x08
3758c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_QVGAPTC                0x10
3768c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_MODE_VGA                    0x20
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ci#define CPIA2_VP4_FRAMERATE_REQUEST                    0x11
3798c2ecf20Sopenharmony_ci#define CPIA2_VP5_FRAMERATE_REQUEST                    0x14
3808c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_60                     0x80
3818c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_50                     0x40
3828c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_30                     0x20
3838c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_25                     0x10
3848c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_15                     0x08
3858c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_12_5                   0x04
3868c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_7_5                    0x02
3878c2ecf20Sopenharmony_ci#define CPIA2_VP_FRAMERATE_6_25                   0x01
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci#define CPIA2_VP4_USER_EFFECTS                         0x12
3908c2ecf20Sopenharmony_ci#define CPIA2_VP5_USER_EFFECTS                         0x15
3918c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_EFFECTS_COLBARS             0x01
3928c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_EFFECTS_COLBARS_GRAD        0x02
3938c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_EFFECTS_MIRROR              0x04
3948c2ecf20Sopenharmony_ci#define CPIA2_VP_USER_EFFECTS_FLIP                0x40  // VP5 only
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci/* NOTE: CPIA2_VP_EXPOSURE_MODES shares the same register as VP5 User
3978c2ecf20Sopenharmony_ci * Effects */
3988c2ecf20Sopenharmony_ci#define CPIA2_VP_EXPOSURE_MODES                       0x15
3998c2ecf20Sopenharmony_ci#define CPIA2_VP_EXPOSURE_MODES_INHIBIT_FLICKER   0x20
4008c2ecf20Sopenharmony_ci#define CPIA2_VP_EXPOSURE_MODES_COMPILE_EXP       0x10
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci#define CPIA2_VP4_EXPOSURE_TARGET                     0x16    // VP4
4038c2ecf20Sopenharmony_ci#define CPIA2_VP5_EXPOSURE_TARGET		      0x20    // VP5
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES                        0x1B
4068c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_50HZ               0x80
4078c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_CUSTOM_FLT_FFREQ   0x40
4088c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_NEVER_FLICKER      0x20
4098c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_INHIBIT_RUB        0x10
4108c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_ADJUST_LINE_FREQ   0x08
4118c2ecf20Sopenharmony_ci#define CPIA2_VP_FLICKER_MODES_CUSTOM_INT_FFREQ   0x04
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC                                0x1D
4148c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_FORCE_MONO                 0x80
4158c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_FORCE_ID_MASK              0x40
4168c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_INHIBIT_AUTO_FGS           0x20
4178c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_INHIBIT_AUTO_DIMS          0x08
4188c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_OPT_FOR_SENSOR_DS          0x04
4198c2ecf20Sopenharmony_ci#define CPIA2_VP_UMISC_INHIBIT_AUTO_MODE_INT      0x02
4208c2ecf20Sopenharmony_ci
4218c2ecf20Sopenharmony_ci#define CPIA2_VP5_ANTIFLKRSETUP                       0x22  //34
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci#define CPIA2_VP_INTERPOLATION                        0x24
4248c2ecf20Sopenharmony_ci#define CPIA2_VP_INTERPOLATION_EVEN_FIRST         0x40
4258c2ecf20Sopenharmony_ci#define CPIA2_VP_INTERPOLATION_HJOG               0x20
4268c2ecf20Sopenharmony_ci#define CPIA2_VP_INTERPOLATION_VJOG               0x10
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci#define CPIA2_VP_GAMMA                                0x25
4298c2ecf20Sopenharmony_ci#define CPIA2_VP_DEFAULT_GAMMA                    0x10
4308c2ecf20Sopenharmony_ci
4318c2ecf20Sopenharmony_ci#define CPIA2_VP_YRANGE                               0x26
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci#define CPIA2_VP_SATURATION                           0x27
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci#define CPIA2_VP5_MYBLACK_LEVEL                       0x3A   //58
4368c2ecf20Sopenharmony_ci#define CPIA2_VP5_MCYRANGE                            0x3B   //59
4378c2ecf20Sopenharmony_ci#define CPIA2_VP5_MYCEILING                           0x3C   //60
4388c2ecf20Sopenharmony_ci#define CPIA2_VP5_MCUVSATURATION                      0x3D   //61
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci
4418c2ecf20Sopenharmony_ci#define CPIA2_VP_REHASH_VALUES                        0x60
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci/***
4458c2ecf20Sopenharmony_ci * Common sensor registers
4468c2ecf20Sopenharmony_ci ***/
4478c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_DEVICE_H                         0x00
4488c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_DEVICE_L                         0x01
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_DATA_FORMAT                      0x16
4518c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_DATA_FORMAT_HMIRROR      0x08
4528c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_DATA_FORMAT_VMIRROR      0x10
4538c2ecf20Sopenharmony_ci
4548c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1                              0x76
4558c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_STAND_BY             0x01
4568c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_RAMP_GEN        0x02
4578c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_COLUMN_ADC      0x04
4588c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_CAB_REGULATOR   0x08
4598c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_AUDIO_REGULATOR 0x10
4608c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_VRT_AMP         0x20
4618c2ecf20Sopenharmony_ci#define CPIA2_SENSOR_CR1_DOWN_BAND_GAP        0x40
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci#endif
464