Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
0004  */
0005 
0006 #ifndef ML26124_H
0007 #define ML26124_H
0008 
0009 /* Clock Control Register */
0010 #define ML26124_SMPLING_RATE        0x00
0011 #define ML26124_PLLNL           0x02
0012 #define ML26124_PLLNH           0x04
0013 #define ML26124_PLLML           0x06
0014 #define ML26124_PLLMH           0x08
0015 #define ML26124_PLLDIV          0x0a
0016 #define ML26124_CLK_EN          0x0c
0017 #define ML26124_CLK_CTL         0x0e
0018 
0019 /* System Control Register */
0020 #define ML26124_SW_RST          0x10
0021 #define ML26124_REC_PLYBAK_RUN      0x12
0022 #define ML26124_MIC_TIM         0x14
0023 
0024 /* Power Mnagement Register */
0025 #define ML26124_PW_REF_PW_MNG       0x20
0026 #define ML26124_PW_IN_PW_MNG        0x22
0027 #define ML26124_PW_DAC_PW_MNG       0x24
0028 #define ML26124_PW_SPAMP_PW_MNG     0x26
0029 #define ML26124_PW_LOUT_PW_MNG      0x28
0030 #define ML26124_PW_VOUT_PW_MNG      0x2a
0031 #define ML26124_PW_ZCCMP_PW_MNG     0x2e
0032 
0033 /* Analog Reference Control Register */
0034 #define ML26124_PW_MICBIAS_VOL      0x30
0035 
0036 /* Input/Output Amplifier Control Register */
0037 #define ML26124_PW_MIC_IN_VOL       0x32
0038 #define ML26124_PW_MIC_BOST_VOL     0x38
0039 #define ML26124_PW_SPK_AMP_VOL      0x3a
0040 #define ML26124_PW_AMP_VOL_FUNC     0x48
0041 #define ML26124_PW_AMP_VOL_FADE     0x4a
0042 
0043 /* Analog Path Control Register */
0044 #define ML26124_SPK_AMP_OUT     0x54
0045 #define ML26124_MIC_IF_CTL      0x5a
0046 #define ML26124_MIC_SELECT      0xe8
0047 
0048 /* Audio Interface Control Register */
0049 #define ML26124_SAI_TRANS_CTL       0x60
0050 #define ML26124_SAI_RCV_CTL     0x62
0051 #define ML26124_SAI_MODE_SEL        0x64
0052 
0053 /* DSP Control Register */
0054 #define ML26124_FILTER_EN       0x66
0055 #define ML26124_DVOL_CTL        0x68
0056 #define ML26124_MIXER_VOL_CTL       0x6a
0057 #define ML26124_RECORD_DIG_VOL      0x6c
0058 #define ML26124_PLBAK_DIG_VOL       0x70
0059 #define ML26124_DIGI_BOOST_VOL      0x72
0060 #define ML26124_EQ_GAIN_BRAND0      0x74
0061 #define ML26124_EQ_GAIN_BRAND1      0x76
0062 #define ML26124_EQ_GAIN_BRAND2      0x78
0063 #define ML26124_EQ_GAIN_BRAND3      0x7a
0064 #define ML26124_EQ_GAIN_BRAND4      0x7c
0065 #define ML26124_HPF2_CUTOFF     0x7e
0066 #define ML26124_EQBRAND0_F0L        0x80
0067 #define ML26124_EQBRAND0_F0H        0x82
0068 #define ML26124_EQBRAND0_F1L        0x84
0069 #define ML26124_EQBRAND0_F1H        0x86
0070 #define ML26124_EQBRAND1_F0L        0x88
0071 #define ML26124_EQBRAND1_F0H        0x8a
0072 #define ML26124_EQBRAND1_F1L        0x8c
0073 #define ML26124_EQBRAND1_F1H        0x8e
0074 #define ML26124_EQBRAND2_F0L        0x90
0075 #define ML26124_EQBRAND2_F0H        0x92
0076 #define ML26124_EQBRAND2_F1L        0x94
0077 #define ML26124_EQBRAND2_F1H        0x96
0078 #define ML26124_EQBRAND3_F0L        0x98
0079 #define ML26124_EQBRAND3_F0H        0x9a
0080 #define ML26124_EQBRAND3_F1L        0x9c
0081 #define ML26124_EQBRAND3_F1H        0x9e
0082 #define ML26124_EQBRAND4_F0L        0xa0
0083 #define ML26124_EQBRAND4_F0H        0xa2
0084 #define ML26124_EQBRAND4_F1L        0xa4
0085 #define ML26124_EQBRAND4_F1H        0xa6
0086 
0087 /* ALC Control Register */
0088 #define ML26124_ALC_MODE        0xb0
0089 #define ML26124_ALC_ATTACK_TIM      0xb2
0090 #define ML26124_ALC_DECAY_TIM       0xb4
0091 #define ML26124_ALC_HOLD_TIM        0xb6
0092 #define ML26124_ALC_TARGET_LEV      0xb8
0093 #define ML26124_ALC_MAXMIN_GAIN     0xba
0094 #define ML26124_NOIS_GATE_THRSH     0xbc
0095 #define ML26124_ALC_ZERO_TIMOUT     0xbe
0096 
0097 /* Playback Limiter Control Register */
0098 #define ML26124_PL_ATTACKTIME       0xc0
0099 #define ML26124_PL_DECAYTIME        0xc2
0100 #define ML26124_PL_TARGETTIME       0xc4
0101 #define ML26124_PL_MAXMIN_GAIN      0xc6
0102 #define ML26124_PLYBAK_BOST_VOL     0xc8
0103 #define ML26124_PL_0CROSS_TIMOUT    0xca
0104 
0105 /* Video Amplifer Control Register */
0106 #define ML26124_VIDEO_AMP_GAIN_CTL  0xd0
0107 #define ML26124_VIDEO_AMP_SETUP1    0xd2
0108 #define ML26124_VIDEO_AMP_CTL2      0xd4
0109 
0110 /* Clock select for machine driver */
0111 #define ML26124_USE_PLL         0
0112 #define ML26124_USE_MCLKI_256FS     1
0113 #define ML26124_USE_MCLKI_512FS     2
0114 #define ML26124_USE_MCLKI_1024FS    3
0115 
0116 /* Register Mask */
0117 #define ML26124_R0_MASK 0xf
0118 #define ML26124_R2_MASK 0xff
0119 #define ML26124_R4_MASK 0x1
0120 #define ML26124_R6_MASK 0xf
0121 #define ML26124_R8_MASK 0x3f
0122 #define ML26124_Ra_MASK 0x1f
0123 #define ML26124_Rc_MASK 0x1f
0124 #define ML26124_Re_MASK 0x7
0125 #define ML26124_R10_MASK    0x1
0126 #define ML26124_R12_MASK    0x17
0127 #define ML26124_R14_MASK    0x3f
0128 #define ML26124_R20_MASK    0x47
0129 #define ML26124_R22_MASK    0xa
0130 #define ML26124_R24_MASK    0x2
0131 #define ML26124_R26_MASK    0x1f
0132 #define ML26124_R28_MASK    0x2
0133 #define ML26124_R2a_MASK    0x2
0134 #define ML26124_R2e_MASK    0x2
0135 #define ML26124_R30_MASK    0x7
0136 #define ML26124_R32_MASK    0x3f
0137 #define ML26124_R38_MASK    0x38
0138 #define ML26124_R3a_MASK    0x3f
0139 #define ML26124_R48_MASK    0x3
0140 #define ML26124_R4a_MASK    0x7
0141 #define ML26124_R54_MASK    0x2a
0142 #define ML26124_R5a_MASK    0x3
0143 #define ML26124_Re8_MASK    0x3
0144 #define ML26124_R60_MASK    0xff
0145 #define ML26124_R62_MASK    0xff
0146 #define ML26124_R64_MASK    0x1
0147 #define ML26124_R66_MASK    0xff
0148 #define ML26124_R68_MASK    0x3b
0149 #define ML26124_R6a_MASK    0xf3
0150 #define ML26124_R6c_MASK    0xff
0151 #define ML26124_R70_MASK    0xff
0152 
0153 #define ML26124_MCLKEN      BIT(0)
0154 #define ML26124_PLLEN       BIT(1)
0155 #define ML26124_PLLOE       BIT(2)
0156 #define ML26124_MCLKOE      BIT(3)
0157 
0158 #define ML26124_BLT_ALL_ON  0x1f
0159 #define ML26124_BLT_PREAMP_ON   0x13
0160 
0161 #define ML26124_MICBEN_ON   BIT(2)
0162 
0163 enum ml26124_regs {
0164     ML26124_MCLK = 0,
0165 };
0166 
0167 enum ml26124_clk_in {
0168     ML26124_USE_PLLOUT = 0,
0169     ML26124_USE_MCLKI,
0170 };
0171 
0172 #endif