linux/sound/soc/codecs/inno_rk3036.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Driver of Inno Codec for rk3036 by Rockchip Inc.
 *
 * Author: Zheng ShunQian<[email protected]>
 */

#ifndef _INNO_RK3036_CODEC_H
#define _INNO_RK3036_CODEC_H

/* codec registers */
#define INNO_R00
#define INNO_R01
#define INNO_R02
#define INNO_R03
#define INNO_R04
#define INNO_R05
#define INNO_R06
#define INNO_R07
#define INNO_R08
#define INNO_R09
#define INNO_R10

/* register bit filed */
#define INNO_R00_CSR_RESET
#define INNO_R00_CSR_WORK
#define INNO_R00_CDCR_RESET
#define INNO_R00_CDCR_WORK
#define INNO_R00_PRB_DISABLE
#define INNO_R00_PRB_ENABLE

#define INNO_R01_I2SMODE_MSK
#define INNO_R01_I2SMODE_SLAVE
#define INNO_R01_I2SMODE_MASTER
#define INNO_R01_PINDIR_MSK
#define INNO_R01_PINDIR_IN_SLAVE
#define INNO_R01_PINDIR_OUT_MASTER

#define INNO_R02_LRS_MSK
#define INNO_R02_LRS_NORMAL
#define INNO_R02_LRS_SWAP
#define INNO_R02_DACM_MSK
#define INNO_R02_DACM_PCM
#define INNO_R02_DACM_I2S
#define INNO_R02_DACM_LJM
#define INNO_R02_DACM_RJM
#define INNO_R02_VWL_MSK
#define INNO_R02_VWL_32BIT
#define INNO_R02_VWL_24BIT
#define INNO_R02_VWL_20BIT
#define INNO_R02_VWL_16BIT
#define INNO_R02_LRCP_MSK
#define INNO_R02_LRCP_NORMAL
#define INNO_R02_LRCP_REVERSAL

#define INNO_R03_BCP_MSK
#define INNO_R03_BCP_NORMAL
#define INNO_R03_BCP_REVERSAL
#define INNO_R03_DACR_MSK
#define INNO_R03_DACR_RESET
#define INNO_R03_DACR_WORK
#define INNO_R03_FWL_MSK
#define INNO_R03_FWL_32BIT
#define INNO_R03_FWL_24BIT
#define INNO_R03_FWL_20BIT
#define INNO_R03_FWL_16BIT

#define INNO_R04_DACR_SW_SHIFT
#define INNO_R04_DACL_SW_SHIFT
#define INNO_R04_DACR_CLK_SHIFT
#define INNO_R04_DACL_CLK_SHIFT
#define INNO_R04_DACR_VREF_SHIFT
#define INNO_R04_DACL_VREF_SHIFT

#define INNO_R05_HPR_EN_SHIFT
#define INNO_R05_HPL_EN_SHIFT
#define INNO_R05_HPR_WORK_SHIFT
#define INNO_R05_HPL_WORK_SHIFT

#define INNO_R06_VOUTR_CZ_SHIFT
#define INNO_R06_VOUTL_CZ_SHIFT
#define INNO_R06_DACR_HILO_VREF_SHIFT
#define INNO_R06_DACL_HILO_VREF_SHIFT
#define INNO_R06_DAC_EN_SHIFT

#define INNO_R06_DAC_PRECHARGE
#define INNO_R06_DAC_DISCHARGE

#define INNO_HP_GAIN_SHIFT
/* Gain of output, 1.5db step: -39db(0x0) ~ 0db(0x1a) ~ 6db(0x1f) */
#define INNO_HP_GAIN_0DB
#define INNO_HP_GAIN_N39DB

#define INNO_R09_HP_ANTIPOP_MSK
#define INNO_R09_HP_ANTIPOP_OFF
#define INNO_R09_HP_ANTIPOP_ON
#define INNO_R09_HPR_ANITPOP_SHIFT
#define INNO_R09_HPL_ANITPOP_SHIFT
#define INNO_R09_HPR_MUTE_SHIFT
#define INNO_R09_HPL_MUTE_SHIFT
#define INNO_R09_DACR_SWITCH_SHIFT
#define INNO_R09_DACL_SWITCH_SHIFT

#define INNO_R10_CHARGE_SEL_CUR_400I_YES
#define INNO_R10_CHARGE_SEL_CUR_400I_NO
#define INNO_R10_CHARGE_SEL_CUR_260I_YES
#define INNO_R10_CHARGE_SEL_CUR_260I_NO
#define INNO_R10_CHARGE_SEL_CUR_130I_YES
#define INNO_R10_CHARGE_SEL_CUR_130I_NO
#define INNO_R10_CHARGE_SEL_CUR_100I_YES
#define INNO_R10_CHARGE_SEL_CUR_100I_NO
#define INNO_R10_CHARGE_SEL_CUR_050I_YES
#define INNO_R10_CHARGE_SEL_CUR_050I_NO
#define INNO_R10_CHARGE_SEL_CUR_027I_YES
#define INNO_R10_CHARGE_SEL_CUR_027I_NO

#define INNO_R10_MAX_CUR

#endif