linux/sound/soc/codecs/sta350.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Codec driver for ST STA350 2.1-channel high-efficiency digital audio system
 *
 * Copyright: 2011 Raumfeld GmbH
 * Author: Sven Brandau <[email protected]>
 *
 * based on code from:
 *      Raumfeld GmbH
 *        Johannes Stezenbach <[email protected]>
 *	Wolfson Microelectronics PLC.
 *	  Mark Brown <[email protected]>
 */
#ifndef _ASOC_STA_350_H
#define _ASOC_STA_350_H

/* STA350 register addresses */

#define STA350_REGISTER_COUNT
#define STA350_COEF_COUNT

#define STA350_CONFA
#define STA350_CONFB
#define STA350_CONFC
#define STA350_CONFD
#define STA350_CONFE
#define STA350_CONFF
#define STA350_MMUTE
#define STA350_MVOL
#define STA350_C1VOL
#define STA350_C2VOL
#define STA350_C3VOL
#define STA350_AUTO1
#define STA350_AUTO2
#define STA350_AUTO3
#define STA350_C1CFG
#define STA350_C2CFG
#define STA350_C3CFG
#define STA350_TONE
#define STA350_L1AR
#define STA350_L1ATRT
#define STA350_L2AR
#define STA350_L2ATRT
#define STA350_CFADDR2
#define STA350_B1CF1
#define STA350_B1CF2
#define STA350_B1CF3
#define STA350_B2CF1
#define STA350_B2CF2
#define STA350_B2CF3
#define STA350_A1CF1
#define STA350_A1CF2
#define STA350_A1CF3
#define STA350_A2CF1
#define STA350_A2CF2
#define STA350_A2CF3
#define STA350_B0CF1
#define STA350_B0CF2
#define STA350_B0CF3
#define STA350_CFUD
#define STA350_MPCC1
#define STA350_MPCC2
#define STA350_DCC1
#define STA350_DCC2
#define STA350_FDRC1
#define STA350_FDRC2
#define STA350_STATUS
/* reserved: 0x2d - 0x30 */
#define STA350_EQCFG
#define STA350_EATH1
#define STA350_ERTH1
#define STA350_EATH2
#define STA350_ERTH2
#define STA350_CONFX
#define STA350_SVCA
#define STA350_SVCB
#define STA350_RMS0A
#define STA350_RMS0B
#define STA350_RMS0C
#define STA350_RMS1A
#define STA350_RMS1B
#define STA350_RMS1C
#define STA350_EVOLRES
/* reserved: 0x40 - 0x47 */
#define STA350_NSHAPE
#define STA350_CTXB4B1
#define STA350_CTXB7B5
#define STA350_MISC1
#define STA350_MISC2

/* 0x00 CONFA */
#define STA350_CONFA_MCS_MASK
#define STA350_CONFA_MCS_SHIFT
#define STA350_CONFA_IR_MASK
#define STA350_CONFA_IR_SHIFT
#define STA350_CONFA_TWRB
#define STA350_CONFA_TWAB
#define STA350_CONFA_FDRB

/* 0x01 CONFB */
#define STA350_CONFB_SAI_MASK
#define STA350_CONFB_SAI_SHIFT
#define STA350_CONFB_SAIFB
#define STA350_CONFB_DSCKE
#define STA350_CONFB_C1IM
#define STA350_CONFB_C2IM

/* 0x02 CONFC */
#define STA350_CONFC_OM_MASK
#define STA350_CONFC_OM_SHIFT
#define STA350_CONFC_CSZ_MASK
#define STA350_CONFC_CSZ_SHIFT
#define STA350_CONFC_OCRB

/* 0x03 CONFD */
#define STA350_CONFD_HPB_SHIFT
#define STA350_CONFD_DEMP_SHIFT
#define STA350_CONFD_DSPB_SHIFT
#define STA350_CONFD_PSL_SHIFT
#define STA350_CONFD_BQL_SHIFT
#define STA350_CONFD_DRC_SHIFT
#define STA350_CONFD_ZDE_SHIFT
#define STA350_CONFD_SME_SHIFT

/* 0x04 CONFE */
#define STA350_CONFE_MPCV
#define STA350_CONFE_MPCV_SHIFT
#define STA350_CONFE_MPC
#define STA350_CONFE_MPC_SHIFT
#define STA350_CONFE_NSBW
#define STA350_CONFE_NSBW_SHIFT
#define STA350_CONFE_AME
#define STA350_CONFE_AME_SHIFT
#define STA350_CONFE_PWMS
#define STA350_CONFE_PWMS_SHIFT
#define STA350_CONFE_DCCV
#define STA350_CONFE_DCCV_SHIFT
#define STA350_CONFE_ZCE
#define STA350_CONFE_ZCE_SHIFT
#define STA350_CONFE_SVE
#define STA350_CONFE_SVE_SHIFT

/* 0x05 CONFF */
#define STA350_CONFF_OCFG_MASK
#define STA350_CONFF_OCFG_SHIFT
#define STA350_CONFF_IDE
#define STA350_CONFF_BCLE
#define STA350_CONFF_LDTE
#define STA350_CONFF_ECLE
#define STA350_CONFF_PWDN
#define STA350_CONFF_EAPD

/* 0x06 MMUTE */
#define STA350_MMUTE_MMUTE
#define STA350_MMUTE_MMUTE_SHIFT
#define STA350_MMUTE_C1M
#define STA350_MMUTE_C1M_SHIFT
#define STA350_MMUTE_C2M
#define STA350_MMUTE_C2M_SHIFT
#define STA350_MMUTE_C3M
#define STA350_MMUTE_C3M_SHIFT
#define STA350_MMUTE_LOC_MASK
#define STA350_MMUTE_LOC_SHIFT

/* 0x0b AUTO1 */
#define STA350_AUTO1_AMGC_MASK
#define STA350_AUTO1_AMGC_SHIFT

/* 0x0c AUTO2 */
#define STA350_AUTO2_AMAME
#define STA350_AUTO2_AMAM_MASK
#define STA350_AUTO2_AMAM_SHIFT
#define STA350_AUTO2_XO_MASK
#define STA350_AUTO2_XO_SHIFT

/* 0x0d AUTO3 */
#define STA350_AUTO3_PEQ_MASK
#define STA350_AUTO3_PEQ_SHIFT

/* 0x0e 0x0f 0x10 CxCFG */
#define STA350_CxCFG_TCB_SHIFT
#define STA350_CxCFG_EQBP_SHIFT
#define STA350_CxCFG_VBP_SHIFT
#define STA350_CxCFG_BO_SHIFT
#define STA350_CxCFG_LS_SHIFT
#define STA350_CxCFG_OM_MASK
#define STA350_CxCFG_OM_SHIFT

/* 0x11 TONE */
#define STA350_TONE_BTC_SHIFT
#define STA350_TONE_TTC_SHIFT

/* 0x12 0x13 0x14 0x15 limiter attack/release */
#define STA350_LxA_SHIFT
#define STA350_LxR_SHIFT

/* 0x26 CFUD */
#define STA350_CFUD_W1
#define STA350_CFUD_WA
#define STA350_CFUD_R1
#define STA350_CFUD_RA


/* biquad filter coefficient table offsets */
#define STA350_C1_BQ_BASE
#define STA350_C2_BQ_BASE
#define STA350_CH_BQ_NUM
#define STA350_BQ_NUM_COEF
#define STA350_XO_HP_BQ_BASE
#define STA350_XO_LP_BQ_BASE
#define STA350_C1_PRESCALE
#define STA350_C2_PRESCALE
#define STA350_C1_POSTSCALE
#define STA350_C2_POSTSCALE
#define STA350_C3_POSTSCALE
#define STA350_TW_POSTSCALE
#define STA350_C1_MIX1
#define STA350_C1_MIX2
#define STA350_C2_MIX1
#define STA350_C2_MIX2
#define STA350_C3_MIX1
#define STA350_C3_MIX2

/* miscellaneous register 1 */
#define STA350_MISC1_CPWMEN
#define STA350_MISC1_BRIDGOFF
#define STA350_MISC1_NSHHPEN
#define STA350_MISC1_RPDNEN

/* miscellaneous register 2 */
#define STA350_MISC2_PNDLSL_MASK
#define STA350_MISC2_PNDLSL_SHIFT

#endif /* _ASOC_STA_350_H */