162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 262306a36Sopenharmony_ci// 362306a36Sopenharmony_ci// aw88395_reg.h -- AW88395 chip register file 462306a36Sopenharmony_ci// 562306a36Sopenharmony_ci// Copyright (c) 2022-2023 AWINIC Technology CO., LTD 662306a36Sopenharmony_ci// 762306a36Sopenharmony_ci// Author: Bruce zhao <zhaolei@awinic.com> 862306a36Sopenharmony_ci// 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef __AW88395_REG_H__ 1162306a36Sopenharmony_ci#define __AW88395_REG_H__ 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#define AW88395_ID_REG (0x00) 1462306a36Sopenharmony_ci#define AW88395_SYSST_REG (0x01) 1562306a36Sopenharmony_ci#define AW88395_SYSINT_REG (0x02) 1662306a36Sopenharmony_ci#define AW88395_SYSINTM_REG (0x03) 1762306a36Sopenharmony_ci#define AW88395_SYSCTRL_REG (0x04) 1862306a36Sopenharmony_ci#define AW88395_SYSCTRL2_REG (0x05) 1962306a36Sopenharmony_ci#define AW88395_I2SCTRL_REG (0x06) 2062306a36Sopenharmony_ci#define AW88395_I2SCFG1_REG (0x07) 2162306a36Sopenharmony_ci#define AW88395_I2SCFG2_REG (0x08) 2262306a36Sopenharmony_ci#define AW88395_HAGCCFG1_REG (0x09) 2362306a36Sopenharmony_ci#define AW88395_HAGCCFG2_REG (0x0A) 2462306a36Sopenharmony_ci#define AW88395_HAGCCFG3_REG (0x0B) 2562306a36Sopenharmony_ci#define AW88395_HAGCCFG4_REG (0x0C) 2662306a36Sopenharmony_ci#define AW88395_HAGCCFG5_REG (0x0D) 2762306a36Sopenharmony_ci#define AW88395_HAGCCFG6_REG (0x0E) 2862306a36Sopenharmony_ci#define AW88395_HAGCCFG7_REG (0x0F) 2962306a36Sopenharmony_ci#define AW88395_MPDCFG_REG (0x10) 3062306a36Sopenharmony_ci#define AW88395_PWMCTRL_REG (0x11) 3162306a36Sopenharmony_ci#define AW88395_I2SCFG3_REG (0x12) 3262306a36Sopenharmony_ci#define AW88395_DBGCTRL_REG (0x13) 3362306a36Sopenharmony_ci#define AW88395_HAGCST_REG (0x20) 3462306a36Sopenharmony_ci#define AW88395_VBAT_REG (0x21) 3562306a36Sopenharmony_ci#define AW88395_TEMP_REG (0x22) 3662306a36Sopenharmony_ci#define AW88395_PVDD_REG (0x23) 3762306a36Sopenharmony_ci#define AW88395_ISNDAT_REG (0x24) 3862306a36Sopenharmony_ci#define AW88395_VSNDAT_REG (0x25) 3962306a36Sopenharmony_ci#define AW88395_I2SINT_REG (0x26) 4062306a36Sopenharmony_ci#define AW88395_I2SCAPCNT_REG (0x27) 4162306a36Sopenharmony_ci#define AW88395_ANASTA1_REG (0x28) 4262306a36Sopenharmony_ci#define AW88395_ANASTA2_REG (0x29) 4362306a36Sopenharmony_ci#define AW88395_ANASTA3_REG (0x2A) 4462306a36Sopenharmony_ci#define AW88395_ANASTA4_REG (0x2B) 4562306a36Sopenharmony_ci#define AW88395_TESTDET_REG (0x2C) 4662306a36Sopenharmony_ci#define AW88395_TESTIN_REG (0x38) 4762306a36Sopenharmony_ci#define AW88395_TESTOUT_REG (0x39) 4862306a36Sopenharmony_ci#define AW88395_DSPMADD_REG (0x40) 4962306a36Sopenharmony_ci#define AW88395_DSPMDAT_REG (0x41) 5062306a36Sopenharmony_ci#define AW88395_WDT_REG (0x42) 5162306a36Sopenharmony_ci#define AW88395_ACR1_REG (0x43) 5262306a36Sopenharmony_ci#define AW88395_ACR2_REG (0x44) 5362306a36Sopenharmony_ci#define AW88395_ASR1_REG (0x45) 5462306a36Sopenharmony_ci#define AW88395_ASR2_REG (0x46) 5562306a36Sopenharmony_ci#define AW88395_DSPCFG_REG (0x47) 5662306a36Sopenharmony_ci#define AW88395_ASR3_REG (0x48) 5762306a36Sopenharmony_ci#define AW88395_ASR4_REG (0x49) 5862306a36Sopenharmony_ci#define AW88395_VSNCTRL1_REG (0x50) 5962306a36Sopenharmony_ci#define AW88395_ISNCTRL1_REG (0x51) 6062306a36Sopenharmony_ci#define AW88395_PLLCTRL1_REG (0x52) 6162306a36Sopenharmony_ci#define AW88395_PLLCTRL2_REG (0x53) 6262306a36Sopenharmony_ci#define AW88395_PLLCTRL3_REG (0x54) 6362306a36Sopenharmony_ci#define AW88395_CDACTRL1_REG (0x55) 6462306a36Sopenharmony_ci#define AW88395_CDACTRL2_REG (0x56) 6562306a36Sopenharmony_ci#define AW88395_SADCCTRL1_REG (0x57) 6662306a36Sopenharmony_ci#define AW88395_SADCCTRL2_REG (0x58) 6762306a36Sopenharmony_ci#define AW88395_CPCTRL1_REG (0x59) 6862306a36Sopenharmony_ci#define AW88395_BSTCTRL1_REG (0x60) 6962306a36Sopenharmony_ci#define AW88395_BSTCTRL2_REG (0x61) 7062306a36Sopenharmony_ci#define AW88395_BSTCTRL3_REG (0x62) 7162306a36Sopenharmony_ci#define AW88395_BSTCTRL4_REG (0x63) 7262306a36Sopenharmony_ci#define AW88395_BSTCTRL5_REG (0x64) 7362306a36Sopenharmony_ci#define AW88395_BSTCTRL6_REG (0x65) 7462306a36Sopenharmony_ci#define AW88395_BSTCTRL7_REG (0x66) 7562306a36Sopenharmony_ci#define AW88395_DSMCFG1_REG (0x67) 7662306a36Sopenharmony_ci#define AW88395_DSMCFG2_REG (0x68) 7762306a36Sopenharmony_ci#define AW88395_DSMCFG3_REG (0x69) 7862306a36Sopenharmony_ci#define AW88395_DSMCFG4_REG (0x6A) 7962306a36Sopenharmony_ci#define AW88395_DSMCFG5_REG (0x6B) 8062306a36Sopenharmony_ci#define AW88395_DSMCFG6_REG (0x6C) 8162306a36Sopenharmony_ci#define AW88395_DSMCFG7_REG (0x6D) 8262306a36Sopenharmony_ci#define AW88395_DSMCFG8_REG (0x6E) 8362306a36Sopenharmony_ci#define AW88395_TESTCTRL1_REG (0x70) 8462306a36Sopenharmony_ci#define AW88395_TESTCTRL2_REG (0x71) 8562306a36Sopenharmony_ci#define AW88395_EFCTRL1_REG (0x72) 8662306a36Sopenharmony_ci#define AW88395_EFCTRL2_REG (0x73) 8762306a36Sopenharmony_ci#define AW88395_EFWH_REG (0x74) 8862306a36Sopenharmony_ci#define AW88395_EFWM2_REG (0x75) 8962306a36Sopenharmony_ci#define AW88395_EFWM1_REG (0x76) 9062306a36Sopenharmony_ci#define AW88395_EFWL_REG (0x77) 9162306a36Sopenharmony_ci#define AW88395_EFRH_REG (0x78) 9262306a36Sopenharmony_ci#define AW88395_EFRM2_REG (0x79) 9362306a36Sopenharmony_ci#define AW88395_EFRM1_REG (0x7A) 9462306a36Sopenharmony_ci#define AW88395_EFRL_REG (0x7B) 9562306a36Sopenharmony_ci#define AW88395_TM_REG (0x7C) 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_cienum aw88395_id { 9862306a36Sopenharmony_ci AW88395_CHIP_ID = 0x2049, 9962306a36Sopenharmony_ci AW88261_CHIP_ID = 0x2113, 10062306a36Sopenharmony_ci}; 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci#define AW88395_REG_MAX (0x7D) 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define AW88395_VOLUME_STEP_DB (6 * 8) 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ci#define AW88395_UVLS_START_BIT (14) 10762306a36Sopenharmony_ci#define AW88395_UVLS_NORMAL (0) 10862306a36Sopenharmony_ci#define AW88395_UVLS_NORMAL_VALUE \ 10962306a36Sopenharmony_ci (AW88395_UVLS_NORMAL << AW88395_UVLS_START_BIT) 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci#define AW88395_DSPS_START_BIT (12) 11262306a36Sopenharmony_ci#define AW88395_DSPS_BITS_LEN (1) 11362306a36Sopenharmony_ci#define AW88395_DSPS_MASK \ 11462306a36Sopenharmony_ci (~(((1<<AW88395_DSPS_BITS_LEN)-1) << AW88395_DSPS_START_BIT)) 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci#define AW88395_DSPS_NORMAL (0) 11762306a36Sopenharmony_ci#define AW88395_DSPS_NORMAL_VALUE \ 11862306a36Sopenharmony_ci (AW88395_DSPS_NORMAL << AW88395_DSPS_START_BIT) 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci#define AW88395_BSTOCS_START_BIT (11) 12162306a36Sopenharmony_ci#define AW88395_BSTOCS_OVER_CURRENT (1) 12262306a36Sopenharmony_ci#define AW88395_BSTOCS_OVER_CURRENT_VALUE \ 12362306a36Sopenharmony_ci (AW88395_BSTOCS_OVER_CURRENT << AW88395_BSTOCS_START_BIT) 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci#define AW88395_BSTS_START_BIT (9) 12662306a36Sopenharmony_ci#define AW88395_BSTS_FINISHED (1) 12762306a36Sopenharmony_ci#define AW88395_BSTS_FINISHED_VALUE \ 12862306a36Sopenharmony_ci (AW88395_BSTS_FINISHED << AW88395_BSTS_START_BIT) 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci#define AW88395_SWS_START_BIT (8) 13162306a36Sopenharmony_ci#define AW88395_SWS_SWITCHING (1) 13262306a36Sopenharmony_ci#define AW88395_SWS_SWITCHING_VALUE \ 13362306a36Sopenharmony_ci (AW88395_SWS_SWITCHING << AW88395_SWS_START_BIT) 13462306a36Sopenharmony_ci 13562306a36Sopenharmony_ci#define AW88395_NOCLKS_START_BIT (5) 13662306a36Sopenharmony_ci#define AW88395_NOCLKS_NO_CLOCK (1) 13762306a36Sopenharmony_ci#define AW88395_NOCLKS_NO_CLOCK_VALUE \ 13862306a36Sopenharmony_ci (AW88395_NOCLKS_NO_CLOCK << AW88395_NOCLKS_START_BIT) 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define AW88395_CLKS_START_BIT (4) 14162306a36Sopenharmony_ci#define AW88395_CLKS_STABLE (1) 14262306a36Sopenharmony_ci#define AW88395_CLKS_STABLE_VALUE \ 14362306a36Sopenharmony_ci (AW88395_CLKS_STABLE << AW88395_CLKS_START_BIT) 14462306a36Sopenharmony_ci 14562306a36Sopenharmony_ci#define AW88395_OCDS_START_BIT (3) 14662306a36Sopenharmony_ci#define AW88395_OCDS_OC (1) 14762306a36Sopenharmony_ci#define AW88395_OCDS_OC_VALUE \ 14862306a36Sopenharmony_ci (AW88395_OCDS_OC << AW88395_OCDS_START_BIT) 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci#define AW88395_OTHS_START_BIT (1) 15162306a36Sopenharmony_ci#define AW88395_OTHS_OT (1) 15262306a36Sopenharmony_ci#define AW88395_OTHS_OT_VALUE \ 15362306a36Sopenharmony_ci (AW88395_OTHS_OT << AW88395_OTHS_START_BIT) 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_ci#define AW88395_PLLS_START_BIT (0) 15662306a36Sopenharmony_ci#define AW88395_PLLS_LOCKED (1) 15762306a36Sopenharmony_ci#define AW88395_PLLS_LOCKED_VALUE \ 15862306a36Sopenharmony_ci (AW88395_PLLS_LOCKED << AW88395_PLLS_START_BIT) 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci#define AW88395_BIT_PLL_CHECK \ 16162306a36Sopenharmony_ci (AW88395_CLKS_STABLE_VALUE | \ 16262306a36Sopenharmony_ci AW88395_PLLS_LOCKED_VALUE) 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci#define AW88395_BIT_SYSST_CHECK_MASK \ 16562306a36Sopenharmony_ci (~(AW88395_UVLS_NORMAL_VALUE | \ 16662306a36Sopenharmony_ci AW88395_BSTOCS_OVER_CURRENT_VALUE | \ 16762306a36Sopenharmony_ci AW88395_BSTS_FINISHED_VALUE | \ 16862306a36Sopenharmony_ci AW88395_SWS_SWITCHING_VALUE | \ 16962306a36Sopenharmony_ci AW88395_NOCLKS_NO_CLOCK_VALUE | \ 17062306a36Sopenharmony_ci AW88395_CLKS_STABLE_VALUE | \ 17162306a36Sopenharmony_ci AW88395_OCDS_OC_VALUE | \ 17262306a36Sopenharmony_ci AW88395_OTHS_OT_VALUE | \ 17362306a36Sopenharmony_ci AW88395_PLLS_LOCKED_VALUE)) 17462306a36Sopenharmony_ci 17562306a36Sopenharmony_ci#define AW88395_BIT_SYSST_CHECK \ 17662306a36Sopenharmony_ci (AW88395_BSTS_FINISHED_VALUE | \ 17762306a36Sopenharmony_ci AW88395_SWS_SWITCHING_VALUE | \ 17862306a36Sopenharmony_ci AW88395_CLKS_STABLE_VALUE | \ 17962306a36Sopenharmony_ci AW88395_PLLS_LOCKED_VALUE) 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci#define AW88395_WDI_START_BIT (6) 18262306a36Sopenharmony_ci#define AW88395_WDI_INT_VALUE (1) 18362306a36Sopenharmony_ci#define AW88395_WDI_INTERRUPT \ 18462306a36Sopenharmony_ci (AW88395_WDI_INT_VALUE << AW88395_WDI_START_BIT) 18562306a36Sopenharmony_ci 18662306a36Sopenharmony_ci#define AW88395_NOCLKI_START_BIT (5) 18762306a36Sopenharmony_ci#define AW88395_NOCLKI_INT_VALUE (1) 18862306a36Sopenharmony_ci#define AW88395_NOCLKI_INTERRUPT \ 18962306a36Sopenharmony_ci (AW88395_NOCLKI_INT_VALUE << AW88395_NOCLKI_START_BIT) 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#define AW88395_CLKI_START_BIT (4) 19262306a36Sopenharmony_ci#define AW88395_CLKI_INT_VALUE (1) 19362306a36Sopenharmony_ci#define AW88395_CLKI_INTERRUPT \ 19462306a36Sopenharmony_ci (AW88395_CLKI_INT_VALUE << AW88395_CLKI_START_BIT) 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci#define AW88395_PLLI_START_BIT (0) 19762306a36Sopenharmony_ci#define AW88395_PLLI_INT_VALUE (1) 19862306a36Sopenharmony_ci#define AW88395_PLLI_INTERRUPT \ 19962306a36Sopenharmony_ci (AW88395_PLLI_INT_VALUE << AW88395_PLLI_START_BIT) 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci#define AW88395_BIT_SYSINT_CHECK \ 20262306a36Sopenharmony_ci (AW88395_WDI_INTERRUPT | \ 20362306a36Sopenharmony_ci AW88395_CLKI_INTERRUPT | \ 20462306a36Sopenharmony_ci AW88395_NOCLKI_INTERRUPT | \ 20562306a36Sopenharmony_ci AW88395_PLLI_INTERRUPT) 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci#define AW88395_HMUTE_START_BIT (8) 20862306a36Sopenharmony_ci#define AW88395_HMUTE_BITS_LEN (1) 20962306a36Sopenharmony_ci#define AW88395_HMUTE_MASK \ 21062306a36Sopenharmony_ci (~(((1<<AW88395_HMUTE_BITS_LEN)-1) << AW88395_HMUTE_START_BIT)) 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_ci#define AW88395_HMUTE_DISABLE (0) 21362306a36Sopenharmony_ci#define AW88395_HMUTE_DISABLE_VALUE \ 21462306a36Sopenharmony_ci (AW88395_HMUTE_DISABLE << AW88395_HMUTE_START_BIT) 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci#define AW88395_HMUTE_ENABLE (1) 21762306a36Sopenharmony_ci#define AW88395_HMUTE_ENABLE_VALUE \ 21862306a36Sopenharmony_ci (AW88395_HMUTE_ENABLE << AW88395_HMUTE_START_BIT) 21962306a36Sopenharmony_ci 22062306a36Sopenharmony_ci#define AW88395_RCV_MODE_START_BIT (7) 22162306a36Sopenharmony_ci#define AW88395_RCV_MODE_BITS_LEN (1) 22262306a36Sopenharmony_ci#define AW88395_RCV_MODE_MASK \ 22362306a36Sopenharmony_ci (~(((1<<AW88395_RCV_MODE_BITS_LEN)-1) << AW88395_RCV_MODE_START_BIT)) 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci#define AW88395_RCV_MODE_RECEIVER (1) 22662306a36Sopenharmony_ci#define AW88395_RCV_MODE_RECEIVER_VALUE \ 22762306a36Sopenharmony_ci (AW88395_RCV_MODE_RECEIVER << AW88395_RCV_MODE_START_BIT) 22862306a36Sopenharmony_ci 22962306a36Sopenharmony_ci#define AW88395_DSPBY_START_BIT (2) 23062306a36Sopenharmony_ci#define AW88395_DSPBY_BITS_LEN (1) 23162306a36Sopenharmony_ci#define AW88395_DSPBY_MASK \ 23262306a36Sopenharmony_ci (~(((1<<AW88395_DSPBY_BITS_LEN)-1) << AW88395_DSPBY_START_BIT)) 23362306a36Sopenharmony_ci 23462306a36Sopenharmony_ci#define AW88395_DSPBY_WORKING (0) 23562306a36Sopenharmony_ci#define AW88395_DSPBY_WORKING_VALUE \ 23662306a36Sopenharmony_ci (AW88395_DSPBY_WORKING << AW88395_DSPBY_START_BIT) 23762306a36Sopenharmony_ci 23862306a36Sopenharmony_ci#define AW88395_DSPBY_BYPASS (1) 23962306a36Sopenharmony_ci#define AW88395_DSPBY_BYPASS_VALUE \ 24062306a36Sopenharmony_ci (AW88395_DSPBY_BYPASS << AW88395_DSPBY_START_BIT) 24162306a36Sopenharmony_ci 24262306a36Sopenharmony_ci#define AW88395_AMPPD_START_BIT (1) 24362306a36Sopenharmony_ci#define AW88395_AMPPD_BITS_LEN (1) 24462306a36Sopenharmony_ci#define AW88395_AMPPD_MASK \ 24562306a36Sopenharmony_ci (~(((1<<AW88395_AMPPD_BITS_LEN)-1) << AW88395_AMPPD_START_BIT)) 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ci#define AW88395_AMPPD_WORKING (0) 24862306a36Sopenharmony_ci#define AW88395_AMPPD_WORKING_VALUE \ 24962306a36Sopenharmony_ci (AW88395_AMPPD_WORKING << AW88395_AMPPD_START_BIT) 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_ci#define AW88395_AMPPD_POWER_DOWN (1) 25262306a36Sopenharmony_ci#define AW88395_AMPPD_POWER_DOWN_VALUE \ 25362306a36Sopenharmony_ci (AW88395_AMPPD_POWER_DOWN << AW88395_AMPPD_START_BIT) 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_ci#define AW88395_PWDN_START_BIT (0) 25662306a36Sopenharmony_ci#define AW88395_PWDN_BITS_LEN (1) 25762306a36Sopenharmony_ci#define AW88395_PWDN_MASK \ 25862306a36Sopenharmony_ci (~(((1<<AW88395_PWDN_BITS_LEN)-1) << AW88395_PWDN_START_BIT)) 25962306a36Sopenharmony_ci 26062306a36Sopenharmony_ci#define AW88395_PWDN_WORKING (0) 26162306a36Sopenharmony_ci#define AW88395_PWDN_WORKING_VALUE \ 26262306a36Sopenharmony_ci (AW88395_PWDN_WORKING << AW88395_PWDN_START_BIT) 26362306a36Sopenharmony_ci 26462306a36Sopenharmony_ci#define AW88395_PWDN_POWER_DOWN (1) 26562306a36Sopenharmony_ci#define AW88395_PWDN_POWER_DOWN_VALUE \ 26662306a36Sopenharmony_ci (AW88395_PWDN_POWER_DOWN << AW88395_PWDN_START_BIT) 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci#define AW88395_MUTE_VOL (90 * 8) 26962306a36Sopenharmony_ci#define AW88395_VOLUME_STEP_DB (6 * 8) 27062306a36Sopenharmony_ci 27162306a36Sopenharmony_ci#define AW88395_VOL_6DB_START (6) 27262306a36Sopenharmony_ci#define AW88395_VOL_START_BIT (6) 27362306a36Sopenharmony_ci#define AW88395_VOL_BITS_LEN (10) 27462306a36Sopenharmony_ci#define AW88395_VOL_MASK \ 27562306a36Sopenharmony_ci (~(((1<<AW88395_VOL_BITS_LEN)-1) << AW88395_VOL_START_BIT)) 27662306a36Sopenharmony_ci 27762306a36Sopenharmony_ci#define AW88395_VOL_DEFAULT_VALUE (0) 27862306a36Sopenharmony_ci 27962306a36Sopenharmony_ci#define AW88395_I2STXEN_START_BIT (0) 28062306a36Sopenharmony_ci#define AW88395_I2STXEN_BITS_LEN (1) 28162306a36Sopenharmony_ci#define AW88395_I2STXEN_MASK \ 28262306a36Sopenharmony_ci (~(((1<<AW88395_I2STXEN_BITS_LEN)-1) << AW88395_I2STXEN_START_BIT)) 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_ci#define AW88395_I2STXEN_DISABLE (0) 28562306a36Sopenharmony_ci#define AW88395_I2STXEN_DISABLE_VALUE \ 28662306a36Sopenharmony_ci (AW88395_I2STXEN_DISABLE << AW88395_I2STXEN_START_BIT) 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci#define AW88395_I2STXEN_ENABLE (1) 28962306a36Sopenharmony_ci#define AW88395_I2STXEN_ENABLE_VALUE \ 29062306a36Sopenharmony_ci (AW88395_I2STXEN_ENABLE << AW88395_I2STXEN_START_BIT) 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_START_BIT (15) 29362306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_BITS_LEN (1) 29462306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_MASK \ 29562306a36Sopenharmony_ci (~(((1<<AW88395_AGC_DSP_CTL_BITS_LEN)-1) << AW88395_AGC_DSP_CTL_START_BIT)) 29662306a36Sopenharmony_ci 29762306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_DISABLE (0) 29862306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_DISABLE_VALUE \ 29962306a36Sopenharmony_ci (AW88395_AGC_DSP_CTL_DISABLE << AW88395_AGC_DSP_CTL_START_BIT) 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_ENABLE (1) 30262306a36Sopenharmony_ci#define AW88395_AGC_DSP_CTL_ENABLE_VALUE \ 30362306a36Sopenharmony_ci (AW88395_AGC_DSP_CTL_ENABLE << AW88395_AGC_DSP_CTL_START_BIT) 30462306a36Sopenharmony_ci 30562306a36Sopenharmony_ci#define AW88395_VDSEL_START_BIT (0) 30662306a36Sopenharmony_ci#define AW88395_VDSEL_BITS_LEN (1) 30762306a36Sopenharmony_ci#define AW88395_VDSEL_MASK \ 30862306a36Sopenharmony_ci (~(((1<<AW88395_VDSEL_BITS_LEN)-1) << AW88395_VDSEL_START_BIT)) 30962306a36Sopenharmony_ci 31062306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_START_BIT (3) 31162306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_BITS_LEN (1) 31262306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_MASK \ 31362306a36Sopenharmony_ci (~(((1<<AW88395_MEM_CLKSEL_BITS_LEN)-1) << AW88395_MEM_CLKSEL_START_BIT)) 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_OSC_CLK (0) 31662306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_OSC_CLK_VALUE \ 31762306a36Sopenharmony_ci (AW88395_MEM_CLKSEL_OSC_CLK << AW88395_MEM_CLKSEL_START_BIT) 31862306a36Sopenharmony_ci 31962306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_DAP_HCLK (1) 32062306a36Sopenharmony_ci#define AW88395_MEM_CLKSEL_DAP_HCLK_VALUE \ 32162306a36Sopenharmony_ci (AW88395_MEM_CLKSEL_DAP_HCLK << AW88395_MEM_CLKSEL_START_BIT) 32262306a36Sopenharmony_ci 32362306a36Sopenharmony_ci#define AW88395_CCO_MUX_START_BIT (14) 32462306a36Sopenharmony_ci#define AW88395_CCO_MUX_BITS_LEN (1) 32562306a36Sopenharmony_ci#define AW88395_CCO_MUX_MASK \ 32662306a36Sopenharmony_ci (~(((1<<AW88395_CCO_MUX_BITS_LEN)-1) << AW88395_CCO_MUX_START_BIT)) 32762306a36Sopenharmony_ci 32862306a36Sopenharmony_ci#define AW88395_CCO_MUX_DIVIDED (0) 32962306a36Sopenharmony_ci#define AW88395_CCO_MUX_DIVIDED_VALUE \ 33062306a36Sopenharmony_ci (AW88395_CCO_MUX_DIVIDED << AW88395_CCO_MUX_START_BIT) 33162306a36Sopenharmony_ci 33262306a36Sopenharmony_ci#define AW88395_CCO_MUX_BYPASS (1) 33362306a36Sopenharmony_ci#define AW88395_CCO_MUX_BYPASS_VALUE \ 33462306a36Sopenharmony_ci (AW88395_CCO_MUX_BYPASS << AW88395_CCO_MUX_START_BIT) 33562306a36Sopenharmony_ci 33662306a36Sopenharmony_ci#define AW88395_EF_VSN_GESLP_START_BIT (0) 33762306a36Sopenharmony_ci#define AW88395_EF_VSN_GESLP_BITS_LEN (10) 33862306a36Sopenharmony_ci#define AW88395_EF_VSN_GESLP_MASK \ 33962306a36Sopenharmony_ci (~(((1<<AW88395_EF_VSN_GESLP_BITS_LEN)-1) << AW88395_EF_VSN_GESLP_START_BIT)) 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_ci#define AW88395_EF_VSN_GESLP_SIGN_MASK (~(1 << 9)) 34262306a36Sopenharmony_ci#define AW88395_EF_VSN_GESLP_SIGN_NEG (0xfe00) 34362306a36Sopenharmony_ci 34462306a36Sopenharmony_ci#define AW88395_EF_ISN_GESLP_START_BIT (0) 34562306a36Sopenharmony_ci#define AW88395_EF_ISN_GESLP_BITS_LEN (10) 34662306a36Sopenharmony_ci#define AW88395_EF_ISN_GESLP_MASK \ 34762306a36Sopenharmony_ci (~(((1<<AW88395_EF_ISN_GESLP_BITS_LEN)-1) << AW88395_EF_ISN_GESLP_START_BIT)) 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ci#define AW88395_EF_ISN_GESLP_SIGN_MASK (~(1 << 9)) 35062306a36Sopenharmony_ci#define AW88395_EF_ISN_GESLP_SIGN_NEG (0xfe00) 35162306a36Sopenharmony_ci 35262306a36Sopenharmony_ci#define AW88395_CABL_BASE_VALUE (1000) 35362306a36Sopenharmony_ci#define AW88395_ICABLK_FACTOR (1) 35462306a36Sopenharmony_ci#define AW88395_VCABLK_FACTOR (1) 35562306a36Sopenharmony_ci#define AW88395_VCAL_FACTOR (1 << 12) 35662306a36Sopenharmony_ci#define AW88395_VSCAL_FACTOR (16500) 35762306a36Sopenharmony_ci#define AW88395_ISCAL_FACTOR (3667) 35862306a36Sopenharmony_ci#define AW88395_EF_VSENSE_GAIN_SHIFT (0) 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_ci#define AW88395_VCABLK_FACTOR_DAC (2) 36162306a36Sopenharmony_ci#define AW88395_VSCAL_FACTOR_DAC (11790) 36262306a36Sopenharmony_ci#define AW88395_EF_DAC_GESLP_SHIFT (10) 36362306a36Sopenharmony_ci#define AW88395_EF_DAC_GESLP_SIGN_MASK (1 << 5) 36462306a36Sopenharmony_ci#define AW88395_EF_DAC_GESLP_SIGN_NEG (0xffc0) 36562306a36Sopenharmony_ci 36662306a36Sopenharmony_ci#define AW88395_VCALB_ADJ_FACTOR (12) 36762306a36Sopenharmony_ci 36862306a36Sopenharmony_ci#define AW88395_WDT_CNT_START_BIT (0) 36962306a36Sopenharmony_ci#define AW88395_WDT_CNT_BITS_LEN (8) 37062306a36Sopenharmony_ci#define AW88395_WDT_CNT_MASK \ 37162306a36Sopenharmony_ci (~(((1<<AW88395_WDT_CNT_BITS_LEN)-1) << AW88395_WDT_CNT_START_BIT)) 37262306a36Sopenharmony_ci 37362306a36Sopenharmony_ci#define AW88395_DSP_CFG_ADDR (0x9C80) 37462306a36Sopenharmony_ci#define AW88395_DSP_FW_ADDR (0x8C00) 37562306a36Sopenharmony_ci#define AW88395_DSP_REG_VMAX (0x9C94) 37662306a36Sopenharmony_ci#define AW88395_DSP_REG_CFG_ADPZ_RE (0x9D00) 37762306a36Sopenharmony_ci#define AW88395_DSP_REG_VCALB (0x9CF7) 37862306a36Sopenharmony_ci#define AW88395_DSP_RE_SHIFT (12) 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_ci#define AW88395_DSP_REG_CFG_ADPZ_RA (0x9D02) 38162306a36Sopenharmony_ci#define AW88395_DSP_REG_CRC_ADDR (0x9F42) 38262306a36Sopenharmony_ci#define AW88395_DSP_CALI_F0_DELAY (0x9CFD) 38362306a36Sopenharmony_ci 38462306a36Sopenharmony_ci#endif 385