linux/sound/soc/codecs/sta32x.h

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

/* STA326 register addresses */

#define STA32X_REGISTER_COUNT
#define STA32X_COEF_COUNT

#define STA32X_CONFA
#define STA32X_CONFB
#define STA32X_CONFC
#define STA32X_CONFD
#define STA32X_CONFE
#define STA32X_CONFF
#define STA32X_MMUTE
#define STA32X_MVOL
#define STA32X_C1VOL
#define STA32X_C2VOL
#define STA32X_C3VOL
#define STA32X_AUTO1
#define STA32X_AUTO2
#define STA32X_AUTO3
#define STA32X_C1CFG
#define STA32X_C2CFG
#define STA32X_C3CFG
#define STA32X_TONE
#define STA32X_L1AR
#define STA32X_L1ATRT
#define STA32X_L2AR
#define STA32X_L2ATRT
#define STA32X_CFADDR2
#define STA32X_B1CF1
#define STA32X_B1CF2
#define STA32X_B1CF3
#define STA32X_B2CF1
#define STA32X_B2CF2
#define STA32X_B2CF3
#define STA32X_A1CF1
#define STA32X_A1CF2
#define STA32X_A1CF3
#define STA32X_A2CF1
#define STA32X_A2CF2
#define STA32X_A2CF3
#define STA32X_B0CF1
#define STA32X_B0CF2
#define STA32X_B0CF3
#define STA32X_CFUD
#define STA32X_MPCC1
#define STA32X_MPCC2
/* Reserved 0x29 */
/* Reserved 0x2a */
#define STA32X_Reserved
#define STA32X_FDRC1
#define STA32X_FDRC2
/* Reserved 0x2d */


/* STA326 register field definitions */

/* 0x00 CONFA */
#define STA32X_CONFA_MCS_MASK
#define STA32X_CONFA_MCS_SHIFT
#define STA32X_CONFA_IR_MASK
#define STA32X_CONFA_IR_SHIFT
#define STA32X_CONFA_TWRB
#define STA32X_CONFA_TWAB
#define STA32X_CONFA_FDRB

/* 0x01 CONFB */
#define STA32X_CONFB_SAI_MASK
#define STA32X_CONFB_SAI_SHIFT
#define STA32X_CONFB_SAIFB
#define STA32X_CONFB_DSCKE
#define STA32X_CONFB_C1IM
#define STA32X_CONFB_C2IM

/* 0x02 CONFC */
#define STA32X_CONFC_OM_MASK
#define STA32X_CONFC_OM_SHIFT
#define STA32X_CONFC_CSZ_MASK
#define STA32X_CONFC_CSZ_SHIFT

/* 0x03 CONFD */
#define STA32X_CONFD_HPB
#define STA32X_CONFD_HPB_SHIFT
#define STA32X_CONFD_DEMP
#define STA32X_CONFD_DEMP_SHIFT
#define STA32X_CONFD_DSPB
#define STA32X_CONFD_DSPB_SHIFT
#define STA32X_CONFD_PSL
#define STA32X_CONFD_PSL_SHIFT
#define STA32X_CONFD_BQL
#define STA32X_CONFD_BQL_SHIFT
#define STA32X_CONFD_DRC
#define STA32X_CONFD_DRC_SHIFT
#define STA32X_CONFD_ZDE
#define STA32X_CONFD_ZDE_SHIFT
#define STA32X_CONFD_MME
#define STA32X_CONFD_MME_SHIFT

/* 0x04 CONFE */
#define STA32X_CONFE_MPCV
#define STA32X_CONFE_MPCV_SHIFT
#define STA32X_CONFE_MPC
#define STA32X_CONFE_MPC_SHIFT
#define STA32X_CONFE_AME
#define STA32X_CONFE_AME_SHIFT
#define STA32X_CONFE_PWMS
#define STA32X_CONFE_PWMS_SHIFT
#define STA32X_CONFE_ZCE
#define STA32X_CONFE_ZCE_SHIFT
#define STA32X_CONFE_SVE
#define STA32X_CONFE_SVE_SHIFT

/* 0x05 CONFF */
#define STA32X_CONFF_OCFG_MASK
#define STA32X_CONFF_OCFG_SHIFT
#define STA32X_CONFF_IDE
#define STA32X_CONFF_IDE_SHIFT
#define STA32X_CONFF_BCLE
#define STA32X_CONFF_ECLE
#define STA32X_CONFF_PWDN
#define STA32X_CONFF_EAPD

/* 0x06 MMUTE */
#define STA32X_MMUTE_MMUTE

/* 0x0b AUTO1 */
#define STA32X_AUTO1_AMEQ_MASK
#define STA32X_AUTO1_AMEQ_SHIFT
#define STA32X_AUTO1_AMV_MASK
#define STA32X_AUTO1_AMV_SHIFT
#define STA32X_AUTO1_AMGC_MASK
#define STA32X_AUTO1_AMGC_SHIFT
#define STA32X_AUTO1_AMPS

/* 0x0c AUTO2 */
#define STA32X_AUTO2_AMAME
#define STA32X_AUTO2_AMAM_MASK
#define STA32X_AUTO2_AMAM_SHIFT
#define STA32X_AUTO2_XO_MASK
#define STA32X_AUTO2_XO_SHIFT

/* 0x0d AUTO3 */
#define STA32X_AUTO3_PEQ_MASK
#define STA32X_AUTO3_PEQ_SHIFT

/* 0x0e 0x0f 0x10 CxCFG */
#define STA32X_CxCFG_TCB
#define STA32X_CxCFG_TCB_SHIFT
#define STA32X_CxCFG_EQBP
#define STA32X_CxCFG_EQBP_SHIFT
#define STA32X_CxCFG_VBP
#define STA32X_CxCFG_VBP_SHIFT
#define STA32X_CxCFG_BO
#define STA32X_CxCFG_LS_MASK
#define STA32X_CxCFG_LS_SHIFT
#define STA32X_CxCFG_OM_MASK
#define STA32X_CxCFG_OM_SHIFT

/* 0x11 TONE */
#define STA32X_TONE_BTC_SHIFT
#define STA32X_TONE_TTC_SHIFT

/* 0x12 0x13 0x14 0x15 limiter attack/release */
#define STA32X_LxA_SHIFT
#define STA32X_LxR_SHIFT

/* 0x26 CFUD */
#define STA32X_CFUD_W1
#define STA32X_CFUD_WA
#define STA32X_CFUD_R1
#define STA32X_CFUD_RA


/* biquad filter coefficient table offsets */
#define STA32X_C1_BQ_BASE
#define STA32X_C2_BQ_BASE
#define STA32X_CH_BQ_NUM
#define STA32X_BQ_NUM_COEF
#define STA32X_XO_HP_BQ_BASE
#define STA32X_XO_LP_BQ_BASE
#define STA32X_C1_PRESCALE
#define STA32X_C2_PRESCALE
#define STA32X_C1_POSTSCALE
#define STA32X_C2_POSTSCALE
#define STA32X_C3_POSTSCALE
#define STA32X_TW_POSTSCALE
#define STA32X_C1_MIX1
#define STA32X_C1_MIX2
#define STA32X_C2_MIX1
#define STA32X_C2_MIX2
#define STA32X_C3_MIX1
#define STA32X_C3_MIX2

#endif /* _ASOC_STA_32X_H */