/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 */

#ifndef WSA881X_REGISTERS_H
#define WSA881X_REGISTERS_H

#define WSA881X_DIGITAL_BASE		0x3000
#define WSA881X_ANALOG_BASE		0x3100

/* Digital register address space */
#define WSA881X_CHIP_ID0			(WSA881X_DIGITAL_BASE+0x0000)
#define WSA881X_CHIP_ID1			(WSA881X_DIGITAL_BASE+0x0001)
#define WSA881X_CHIP_ID2			(WSA881X_DIGITAL_BASE+0x0002)
#define WSA881X_CHIP_ID3			(WSA881X_DIGITAL_BASE+0x0003)
#define WSA881X_BUS_ID				(WSA881X_DIGITAL_BASE+0x0004)
#define WSA881X_CDC_RST_CTL			(WSA881X_DIGITAL_BASE+0x0005)
#define WSA881X_CDC_TOP_CLK_CTL			(WSA881X_DIGITAL_BASE+0x0006)
#define WSA881X_CDC_ANA_CLK_CTL			(WSA881X_DIGITAL_BASE+0x0007)
#define WSA881X_CDC_DIG_CLK_CTL			(WSA881X_DIGITAL_BASE+0x0008)
#define WSA881X_CLOCK_CONFIG			(WSA881X_DIGITAL_BASE+0x0009)
#define WSA881X_ANA_CTL				(WSA881X_DIGITAL_BASE+0x000A)
#define WSA881X_SWR_RESET_EN			(WSA881X_DIGITAL_BASE+0x000B)
#define WSA881X_RESET_CTL			(WSA881X_DIGITAL_BASE+0x000C)
#define WSA881X_TADC_VALUE_CTL			(WSA881X_DIGITAL_BASE+0x000F)
#define WSA881X_TEMP_DETECT_CTL			(WSA881X_DIGITAL_BASE+0x0010)
#define WSA881X_TEMP_MSB			(WSA881X_DIGITAL_BASE+0x0011)
#define WSA881X_TEMP_LSB			(WSA881X_DIGITAL_BASE+0x0012)
#define WSA881X_TEMP_CONFIG0			(WSA881X_DIGITAL_BASE+0x0013)
#define WSA881X_TEMP_CONFIG1			(WSA881X_DIGITAL_BASE+0x0014)
#define WSA881X_CDC_CLIP_CTL			(WSA881X_DIGITAL_BASE+0x0015)
#define WSA881X_SDM_PDM9_LSB			(WSA881X_DIGITAL_BASE+0x0016)
#define WSA881X_SDM_PDM9_MSB			(WSA881X_DIGITAL_BASE+0x0017)
#define WSA881X_CDC_RX_CTL			(WSA881X_DIGITAL_BASE+0x0018)
#define WSA881X_DEM_BYPASS_DATA0		(WSA881X_DIGITAL_BASE+0x0019)
#define WSA881X_DEM_BYPASS_DATA1		(WSA881X_DIGITAL_BASE+0x001A)
#define WSA881X_DEM_BYPASS_DATA2		(WSA881X_DIGITAL_BASE+0x001B)
#define WSA881X_DEM_BYPASS_DATA3		(WSA881X_DIGITAL_BASE+0x001C)
#define WSA881X_OTP_CTRL0			(WSA881X_DIGITAL_BASE+0x001D)
#define WSA881X_OTP_CTRL1			(WSA881X_DIGITAL_BASE+0x001E)
#define WSA881X_HDRIVE_CTL_GROUP1		(WSA881X_DIGITAL_BASE+0x001F)
#define WSA881X_INTR_MODE			(WSA881X_DIGITAL_BASE+0x0020)
#define WSA881X_INTR_MASK			(WSA881X_DIGITAL_BASE+0x0021)
#define WSA881X_INTR_STATUS			(WSA881X_DIGITAL_BASE+0x0022)
#define WSA881X_INTR_CLEAR			(WSA881X_DIGITAL_BASE+0x0023)
#define WSA881X_INTR_LEVEL			(WSA881X_DIGITAL_BASE+0x0024)
#define WSA881X_INTR_SET			(WSA881X_DIGITAL_BASE+0x0025)
#define WSA881X_INTR_TEST			(WSA881X_DIGITAL_BASE+0x0026)
#define WSA881X_PDM_TEST_MODE			(WSA881X_DIGITAL_BASE+0x0030)
#define WSA881X_ATE_TEST_MODE			(WSA881X_DIGITAL_BASE+0x0031)
#define WSA881X_PIN_CTL_MODE			(WSA881X_DIGITAL_BASE+0x0032)
#define WSA881X_PIN_CTL_OE			(WSA881X_DIGITAL_BASE+0x0033)
#define WSA881X_PIN_WDATA_IOPAD			(WSA881X_DIGITAL_BASE+0x0034)
#define WSA881X_PIN_STATUS			(WSA881X_DIGITAL_BASE+0x0035)
#define WSA881X_DIG_DEBUG_MODE			(WSA881X_DIGITAL_BASE+0x0037)
#define WSA881X_DIG_DEBUG_SEL			(WSA881X_DIGITAL_BASE+0x0038)
#define WSA881X_DIG_DEBUG_EN			(WSA881X_DIGITAL_BASE+0x0039)
#define WSA881X_SWR_HM_TEST1			(WSA881X_DIGITAL_BASE+0x003B)
#define WSA881X_SWR_HM_TEST2			(WSA881X_DIGITAL_BASE+0x003C)
#define WSA881X_TEMP_DETECT_DBG_CTL		(WSA881X_DIGITAL_BASE+0x003D)
#define WSA881X_TEMP_DEBUG_MSB			(WSA881X_DIGITAL_BASE+0x003E)
#define WSA881X_TEMP_DEBUG_LSB			(WSA881X_DIGITAL_BASE+0x003F)
#define WSA881X_SAMPLE_EDGE_SEL			(WSA881X_DIGITAL_BASE+0x0044)
#define WSA881X_IOPAD_CTL			(WSA881X_DIGITAL_BASE+0x0045)
#define WSA881X_SPARE_0				(WSA881X_DIGITAL_BASE+0x0050)
#define WSA881X_SPARE_1				(WSA881X_DIGITAL_BASE+0x0051)
#define WSA881X_SPARE_2				(WSA881X_DIGITAL_BASE+0x0052)
#define WSA881X_OTP_REG_0			(WSA881X_DIGITAL_BASE+0x0080)
#define WSA881X_OTP_REG_1			(WSA881X_DIGITAL_BASE+0x0081)
#define WSA881X_OTP_REG_2			(WSA881X_DIGITAL_BASE+0x0082)
#define WSA881X_OTP_REG_3			(WSA881X_DIGITAL_BASE+0x0083)
#define WSA881X_OTP_REG_4			(WSA881X_DIGITAL_BASE+0x0084)
#define WSA881X_OTP_REG_5			(WSA881X_DIGITAL_BASE+0x0085)
#define WSA881X_OTP_REG_6			(WSA881X_DIGITAL_BASE+0x0086)
#define WSA881X_OTP_REG_7			(WSA881X_DIGITAL_BASE+0x0087)
#define WSA881X_OTP_REG_8			(WSA881X_DIGITAL_BASE+0x0088)
#define WSA881X_OTP_REG_9			(WSA881X_DIGITAL_BASE+0x0089)
#define WSA881X_OTP_REG_10			(WSA881X_DIGITAL_BASE+0x008A)
#define WSA881X_OTP_REG_11			(WSA881X_DIGITAL_BASE+0x008B)
#define WSA881X_OTP_REG_12			(WSA881X_DIGITAL_BASE+0x008C)
#define WSA881X_OTP_REG_13			(WSA881X_DIGITAL_BASE+0x008D)
#define WSA881X_OTP_REG_14			(WSA881X_DIGITAL_BASE+0x008E)
#define WSA881X_OTP_REG_15			(WSA881X_DIGITAL_BASE+0x008F)
#define WSA881X_OTP_REG_16			(WSA881X_DIGITAL_BASE+0x0090)
#define WSA881X_OTP_REG_17			(WSA881X_DIGITAL_BASE+0x0091)
#define WSA881X_OTP_REG_18			(WSA881X_DIGITAL_BASE+0x0092)
#define WSA881X_OTP_REG_19			(WSA881X_DIGITAL_BASE+0x0093)
#define WSA881X_OTP_REG_20			(WSA881X_DIGITAL_BASE+0x0094)
#define WSA881X_OTP_REG_21			(WSA881X_DIGITAL_BASE+0x0095)
#define WSA881X_OTP_REG_22			(WSA881X_DIGITAL_BASE+0x0096)
#define WSA881X_OTP_REG_23			(WSA881X_DIGITAL_BASE+0x0097)
#define WSA881X_OTP_REG_24			(WSA881X_DIGITAL_BASE+0x0098)
#define WSA881X_OTP_REG_25			(WSA881X_DIGITAL_BASE+0x0099)
#define WSA881X_OTP_REG_26			(WSA881X_DIGITAL_BASE+0x009A)
#define WSA881X_OTP_REG_27			(WSA881X_DIGITAL_BASE+0x009B)
#define WSA881X_OTP_REG_28			(WSA881X_DIGITAL_BASE+0x009C)
#define WSA881X_OTP_REG_29			(WSA881X_DIGITAL_BASE+0x009D)
#define WSA881X_OTP_REG_30			(WSA881X_DIGITAL_BASE+0x009E)
#define WSA881X_OTP_REG_31			(WSA881X_DIGITAL_BASE+0x009F)
#define WSA881X_OTP_REG_63			(WSA881X_DIGITAL_BASE+0x00BF)

/* Analog Register address space */
#define WSA881X_BIAS_REF_CTRL			(WSA881X_ANALOG_BASE+0x0000)
#define WSA881X_BIAS_TEST			(WSA881X_ANALOG_BASE+0x0001)
#define WSA881X_BIAS_BIAS			(WSA881X_ANALOG_BASE+0x0002)
#define WSA881X_TEMP_OP				(WSA881X_ANALOG_BASE+0x0003)
#define WSA881X_TEMP_IREF_CTRL			(WSA881X_ANALOG_BASE+0x0004)
#define WSA881X_TEMP_ISENS_CTRL			(WSA881X_ANALOG_BASE+0x0005)
#define WSA881X_TEMP_CLK_CTRL			(WSA881X_ANALOG_BASE+0x0006)
#define WSA881X_TEMP_TEST			(WSA881X_ANALOG_BASE+0x0007)
#define WSA881X_TEMP_BIAS			(WSA881X_ANALOG_BASE+0x0008)
#define WSA881X_TEMP_ADC_CTRL			(WSA881X_ANALOG_BASE+0x0009)
#define WSA881X_TEMP_DOUT_MSB			(WSA881X_ANALOG_BASE+0x000A)
#define WSA881X_TEMP_DOUT_LSB			(WSA881X_ANALOG_BASE+0x000B)
#define WSA881X_ADC_EN_MODU_V			(WSA881X_ANALOG_BASE+0x0010)
#define WSA881X_ADC_EN_MODU_I			(WSA881X_ANALOG_BASE+0x0011)
#define WSA881X_ADC_EN_DET_TEST_V		(WSA881X_ANALOG_BASE+0x0012)
#define WSA881X_ADC_EN_DET_TEST_I		(WSA881X_ANALOG_BASE+0x0013)
#define WSA881X_ADC_SEL_IBIAS			(WSA881X_ANALOG_BASE+0x0014)
#define WSA881X_ADC_EN_SEL_IBAIS		(WSA881X_ANALOG_BASE+0x0015)
#define WSA881X_SPKR_DRV_EN			(WSA881X_ANALOG_BASE+0x001A)
#define WSA881X_SPKR_DRV_GAIN			(WSA881X_ANALOG_BASE+0x001B)
#define WSA881X_SPKR_DAC_CTL			(WSA881X_ANALOG_BASE+0x001C)
#define WSA881X_SPKR_DRV_DBG			(WSA881X_ANALOG_BASE+0x001D)
#define WSA881X_SPKR_PWRSTG_DBG			(WSA881X_ANALOG_BASE+0x001E)
#define WSA881X_SPKR_OCP_CTL			(WSA881X_ANALOG_BASE+0x001F)
#define WSA881X_SPKR_CLIP_CTL			(WSA881X_ANALOG_BASE+0x0020)
#define WSA881X_SPKR_BBM_CTL			(WSA881X_ANALOG_BASE+0x0021)
#define WSA881X_SPKR_MISC_CTL1			(WSA881X_ANALOG_BASE+0x0022)
#define WSA881X_SPKR_MISC_CTL2			(WSA881X_ANALOG_BASE+0x0023)
#define WSA881X_SPKR_BIAS_INT			(WSA881X_ANALOG_BASE+0x0024)
#define WSA881X_SPKR_PA_INT			(WSA881X_ANALOG_BASE+0x0025)
#define WSA881X_SPKR_BIAS_CAL			(WSA881X_ANALOG_BASE+0x0026)
#define WSA881X_SPKR_BIAS_PSRR			(WSA881X_ANALOG_BASE+0x0027)
#define WSA881X_SPKR_STATUS1			(WSA881X_ANALOG_BASE+0x0028)
#define WSA881X_SPKR_STATUS2			(WSA881X_ANALOG_BASE+0x0029)
#define WSA881X_BOOST_EN_CTL			(WSA881X_ANALOG_BASE+0x002A)
#define WSA881X_BOOST_CURRENT_LIMIT		(WSA881X_ANALOG_BASE+0x002B)
#define WSA881X_BOOST_PS_CTL			(WSA881X_ANALOG_BASE+0x002C)
#define WSA881X_BOOST_PRESET_OUT1		(WSA881X_ANALOG_BASE+0x002D)
#define WSA881X_BOOST_PRESET_OUT2		(WSA881X_ANALOG_BASE+0x002E)
#define WSA881X_BOOST_FORCE_OUT			(WSA881X_ANALOG_BASE+0x002F)
#define WSA881X_BOOST_LDO_PROG			(WSA881X_ANALOG_BASE+0x0030)
#define WSA881X_BOOST_SLOPE_COMP_ISENSE_FB	(WSA881X_ANALOG_BASE+0x0031)
#define WSA881X_BOOST_RON_CTL			(WSA881X_ANALOG_BASE+0x0032)
#define WSA881X_BOOST_LOOP_STABILITY		(WSA881X_ANALOG_BASE+0x0033)
#define WSA881X_BOOST_ZX_CTL			(WSA881X_ANALOG_BASE+0x0034)
#define WSA881X_BOOST_START_CTL			(WSA881X_ANALOG_BASE+0x0035)
#define WSA881X_BOOST_MISC1_CTL			(WSA881X_ANALOG_BASE+0x0036)
#define WSA881X_BOOST_MISC2_CTL			(WSA881X_ANALOG_BASE+0x0037)
#define WSA881X_BOOST_MISC3_CTL			(WSA881X_ANALOG_BASE+0x0038)
#define WSA881X_BOOST_ATEST_CTL			(WSA881X_ANALOG_BASE+0x0039)
#define WSA881X_SPKR_PROT_FE_GAIN		(WSA881X_ANALOG_BASE+0x003A)
#define WSA881X_SPKR_PROT_FE_CM_LDO_SET		(WSA881X_ANALOG_BASE+0x003B)
#define WSA881X_SPKR_PROT_FE_ISENSE_BIAS_SET1	(WSA881X_ANALOG_BASE+0x003C)
#define WSA881X_SPKR_PROT_FE_ISENSE_BIAS_SET2	(WSA881X_ANALOG_BASE+0x003D)
#define WSA881X_SPKR_PROT_ATEST1		(WSA881X_ANALOG_BASE+0x003E)
#define WSA881X_SPKR_PROT_ATEST2		(WSA881X_ANALOG_BASE+0x003F)
#define WSA881X_SPKR_PROT_FE_VSENSE_VCM		(WSA881X_ANALOG_BASE+0x0040)
#define WSA881X_SPKR_PROT_FE_VSENSE_BIAS_SET1	(WSA881X_ANALOG_BASE+0x0041)
#define WSA881X_BONGO_RESRV_REG1		(WSA881X_ANALOG_BASE+0x0042)
#define WSA881X_BONGO_RESRV_REG2		(WSA881X_ANALOG_BASE+0x0043)
#define WSA881X_SPKR_PROT_SAR			(WSA881X_ANALOG_BASE+0x0044)
#define WSA881X_SPKR_STATUS3			(WSA881X_ANALOG_BASE+0x0045)

#define WSA881X_NUM_REGISTERS			(WSA881X_SPKR_STATUS3+1)
#define WSA881X_MAX_REGISTER			(WSA881X_NUM_REGISTERS-1)
#define WSA881X_CACHE_SIZE			WSA881X_NUM_REGISTERS

#endif /* WSA881X_REGISTERS_H */
