linux/sound/soc/codecs/es8316.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright Everest Semiconductor Co.,Ltd
 *
 * Author: David Yang <[email protected]>
 */

#ifndef _ES8316_H
#define _ES8316_H

/*
 * ES8316 register space
 */

/* Reset Control */
#define ES8316_RESET

/* Clock Management */
#define ES8316_CLKMGR_CLKSW
#define ES8316_CLKMGR_CLKSEL
#define ES8316_CLKMGR_ADCOSR
#define ES8316_CLKMGR_ADCDIV1
#define ES8316_CLKMGR_ADCDIV2
#define ES8316_CLKMGR_DACDIV1
#define ES8316_CLKMGR_DACDIV2
#define ES8316_CLKMGR_CPDIV

/* Serial Data Port Control */
#define ES8316_SERDATA1
#define ES8316_SERDATA_ADC
#define ES8316_SERDATA_DAC

/* System Control */
#define ES8316_SYS_VMIDSEL
#define ES8316_SYS_PDN
#define ES8316_SYS_LP1
#define ES8316_SYS_LP2
#define ES8316_SYS_VMIDLOW
#define ES8316_SYS_VSEL
#define ES8316_SYS_REF

/* Headphone Mixer */
#define ES8316_HPMIX_SEL
#define ES8316_HPMIX_SWITCH
#define ES8316_HPMIX_PDN
#define ES8316_HPMIX_VOL

/* Charge Pump Headphone driver */
#define ES8316_CPHP_OUTEN
#define ES8316_CPHP_ICAL_VOL
#define ES8316_CPHP_PDN1
#define ES8316_CPHP_PDN2
#define ES8316_CPHP_LDOCTL

/* Calibration */
#define ES8316_CAL_TYPE
#define ES8316_CAL_SET
#define ES8316_CAL_HPLIV
#define ES8316_CAL_HPRIV
#define ES8316_CAL_HPLMV
#define ES8316_CAL_HPRMV

/* ADC Control */
#define ES8316_ADC_PDN_LINSEL
#define ES8316_ADC_PGAGAIN
#define ES8316_ADC_D2SEPGA
#define ES8316_ADC_DMIC
#define ES8316_ADC_MUTE
#define ES8316_ADC_VOLUME
#define ES8316_ADC_ALC1
#define ES8316_ADC_ALC2
#define ES8316_ADC_ALC3
#define ES8316_ADC_ALC4
#define ES8316_ADC_ALC5
#define ES8316_ADC_ALC_NG

/* DAC Control */
#define ES8316_DAC_PDN
#define ES8316_DAC_SET1
#define ES8316_DAC_SET2
#define ES8316_DAC_SET3
#define ES8316_DAC_VOLL
#define ES8316_DAC_VOLR

/* GPIO */
#define ES8316_GPIO_SEL
#define ES8316_GPIO_DEBOUNCE
#define ES8316_GPIO_FLAG

/* Test mode */
#define ES8316_TESTMODE
#define ES8316_TEST1
#define ES8316_TEST2
#define ES8316_TEST3

/*
 * Field definitions
 */

/* ES8316_RESET */
#define ES8316_RESET_CSM_ON

/* ES8316_CLKMGR_CLKSW */
#define ES8316_CLKMGR_CLKSW_MCLK_ON
#define ES8316_CLKMGR_CLKSW_BCLK_ON

/* ES8316_SERDATA1 */
#define ES8316_SERDATA1_MASTER
#define ES8316_SERDATA1_BCLK_INV

/* ES8316_SERDATA_ADC and _DAC */
#define ES8316_SERDATA2_FMT_MASK
#define ES8316_SERDATA2_FMT_I2S
#define ES8316_SERDATA2_FMT_LEFTJ
#define ES8316_SERDATA2_FMT_RIGHTJ
#define ES8316_SERDATA2_FMT_PCM
#define ES8316_SERDATA2_ADCLRP
#define ES8316_SERDATA2_LEN_MASK
#define ES8316_SERDATA2_LEN_24
#define ES8316_SERDATA2_LEN_20
#define ES8316_SERDATA2_LEN_18
#define ES8316_SERDATA2_LEN_16
#define ES8316_SERDATA2_LEN_32

/* ES8316_GPIO_DEBOUNCE	*/
#define ES8316_GPIO_ENABLE_INTERRUPT

/* ES8316_GPIO_FLAG */
#define ES8316_GPIO_FLAG_GM_NOT_SHORTED
#define ES8316_GPIO_FLAG_HP_NOT_INSERTED

/* ES8316_CLKMGR_CLKSW */
#define ES8316_CLKMGR_CLKSW_MCLK_DIV

#endif