2 * Copyright Everest Semiconductor Co.,Ltd
4 * Author: David Yang <yangxiaohua@everest-semi.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
17 /* ES8316 register space */
21 #define ES8316_RESET_REG00 0x00
25 #define ES8316_CLKMGR_CLKSW_REG01 0x01
26 #define ES8316_CLKMGR_CLKSEL_REG02 0x02
27 #define ES8316_CLKMGR_ADCOSR_REG03 0x03
28 #define ES8316_CLKMGR_ADCDIV1_REG04 0x04
29 #define ES8316_CLKMGR_ADCDIV2_REG05 0x05
30 #define ES8316_CLKMGR_DACDIV1_REG06 0x06
31 #define ES8316_CLKMGR_DACDIV2_REG07 0x07
32 #define ES8316_CLKMGR_CPDIV_REG08 0x08
36 #define ES8316_SDP_MS_BCKDIV_REG09 0x09
37 #define ES8316_SDP_ADCFMT_REG0A 0x0a
38 #define ES8316_SDP_DACFMT_REG0B 0x0b
42 #define ES8316_SYS_VMIDSEL_REG0C 0x0c
43 #define ES8316_SYS_PDN_REG0D 0x0d
44 #define ES8316_SYS_LP1_REG0E 0x0e
45 #define ES8316_SYS_LP2_REG0F 0x0f
46 #define ES8316_SYS_VMIDLOW_REG10 0x10
47 #define ES8316_SYS_VSEL_REG11 0x11
48 #define ES8316_SYS_REF_REG12 0x12
52 #define ES8316_HPMIX_SEL_REG13 0x13
53 #define ES8316_HPMIX_SWITCH_REG14 0x14
54 #define ES8316_HPMIX_PDN_REG15 0x15
55 #define ES8316_HPMIX_VOL_REG16 0x16
57 * Charge Pump Headphone driver
59 #define ES8316_CPHP_OUTEN_REG17 0x17
60 #define ES8316_CPHP_ICAL_VOL_REG18 0x18
61 #define ES8316_CPHP_PDN1_REG19 0x19
62 #define ES8316_CPHP_PDN2_REG1A 0x1a
63 #define ES8316_CPHP_LDOCTL_REG1B 0x1b
67 #define ES8316_CAL_TYPE_REG1C 0x1c
68 #define ES8316_CAL_SET_REG1D 0x1d
69 #define ES8316_CAL_HPLIV_REG1E 0x1e
70 #define ES8316_CAL_HPRIV_REG1F 0x1f
71 #define ES8316_CAL_HPLMV_REG20 0x20
72 #define ES8316_CAL_HPRMV_REG21 0x21
76 #define ES8316_ADC_PDN_LINSEL_REG22 0x22
77 #define ES8316_ADC_PGAGAIN_REG23 0x23
78 #define ES8316_ADC_D2SEPGA_REG24 0x24
79 #define ES8316_ADC_DMIC_REG25 0x25
80 #define ES8316_ADC_MUTE_REG26 0x26
81 #define ES8316_ADC_VOLUME_REG27 0x27
82 #define ES8316_ADC_ALC1_REG29 0x29
83 #define ES8316_ADC_ALC2_REG2A 0x2a
84 #define ES8316_ADC_ALC3_REG2B 0x2b
85 #define ES8316_ADC_ALC4_REG2C 0x2c
86 #define ES8316_ADC_ALC5_REG2D 0x2d
87 #define ES8316_ADC_ALC6_REG2E 0x2e
91 #define ES8316_DAC_PDN_REG2F 0x2f
92 #define ES8316_DAC_SET1_REG30 0x30
93 #define ES8316_DAC_SET2_REG31 0x31
94 #define ES8316_DAC_SET3_REG32 0x32
95 #define ES8316_DAC_VOLL_REG33 0x33
96 #define ES8316_DAC_VOLR_REG34 0x34
100 #define ES8316_GPIO_SEL_REG4D 0x4D
101 #define ES8316_GPIO_DEBUNCE_INT_REG4E 0x4E
102 #define ES8316_GPIO_FLAG 0x4F
106 #define ES8316_TESTMODE_REG50 0x50
107 #define ES8316_TEST1_REG51 0x51
108 #define ES8316_TEST2_REG52 0x52
109 #define ES8316_TEST3_REG53 0x53
111 #define ES8316_IFACE ES8316_SDP_MS_BCKDIV_REG09
112 #define ES8316_ADC_IFACE ES8316_SDP_ADCFMT_REG0A
113 #define ES8316_DAC_IFACE ES8316_SDP_DACFMT_REG0B
115 #define ES8316_REGNUM 84
117 /* REGISTER 0X01 CLOCK MANAGER */
118 #define ES8316_CLKMGR_MCLK_DIV_MASK (0X1<<7)
119 #define ES8316_CLKMGR_MCLK_DIV_NML (0X0<<7)
120 #define ES8316_CLKMGR_MCLK_DIV_1 (0X1<<7)
121 #define ES8316_CLKMGR_ADC_MCLK_MASK (0X1<<3)
122 #define ES8316_CLKMGR_ADC_MCLK_EN (0X1<<3)
123 #define ES8316_CLKMGR_ADC_MCLK_DIS (0X0<<3)
124 #define ES8316_CLKMGR_DAC_MCLK_MASK (0X1<<2)
125 #define ES8316_CLKMGR_DAC_MCLK_EN (0X1<<2)
126 #define ES8316_CLKMGR_DAC_MCLK_DIS (0X0<<2)
127 #define ES8316_CLKMGR_ADC_ANALOG_MASK (0X1<<1)
128 #define ES8316_CLKMGR_ADC_ANALOG_EN (0X1<<1)
129 #define ES8316_CLKMGR_ADC_ANALOG_DIS (0X0<<1)
130 #define ES8316_CLKMGR_DAC_ANALOG_MASK (0X1<<0)
131 #define ES8316_CLKMGR_DAC_ANALOG_EN (0X1<<0)
132 #define ES8316_CLKMGR_DAC_ANALOG_DIS (0X0<<0)
135 #define ES8316_ADCWL_MASK (0x7 << 2)
136 #define ES8316_ADCWL_32 (0x4 << 2)
137 #define ES8316_ADCWL_24 (0x0 << 2)
138 #define ES8316_ADCWL_20 (0x1 << 2)
139 #define ES8316_ADCWL_18 (0x2 << 2)
140 #define ES8316_ADCWL_16 (0x3 << 2)
141 #define ES8316_ADCFMT_MASK (0x3 << 0)
142 #define ES8316_ADCFMT_I2S (0x0 << 0)
143 #define ES8316_ADCWL_LEFT (0x1 << 0)
144 #define ES8316_ADCWL_RIGHT (0x2 << 0)
145 #define ES8316_ADCWL_PCM (0x3 << 0)
148 #define ES8316_DACWL_MASK (0x7 << 2)
149 #define ES8316_DACWL_32 (0x4 << 2)
150 #define ES8316_DACWL_24 (0x0 << 2)
151 #define ES8316_DACWL_20 (0x1 << 2)
152 #define ES8316_DACWL_18 (0x2 << 2)
153 #define ES8316_DACWL_16 (0x3 << 2)
154 #define ES8316_DACFMT_MASK (0x3 << 0)
155 #define ES8316_DACFMT_I2S (0x0 << 0)
156 #define ES8316_DACWL_LEFT (0x1 << 0)
157 #define ES8316_DACWL_RIGHT (0x2 << 0)
158 #define ES8316_DACWL_PCM (0x3 << 0)