@@ -38,141 +38,143 @@ struct aic31xx_pdata {
38
38
int micbias_vg ;
39
39
};
40
40
41
+ #define AIC31XX_REG (page , reg ) ((page * 128) + reg)
42
+
41
43
/* Page Control Register */
42
- #define AIC31XX_PAGECTL 0x00
44
+ #define AIC31XX_PAGECTL AIC31XX_REG(0, 0)
43
45
44
46
/* Page 0 Registers */
45
47
/* Software reset register */
46
- #define AIC31XX_RESET 0x01
48
+ #define AIC31XX_RESET AIC31XX_REG(0, 1)
47
49
/* OT FLAG register */
48
- #define AIC31XX_OT_FLAG 0x03
50
+ #define AIC31XX_OT_FLAG AIC31XX_REG(0, 3)
49
51
/* Clock clock Gen muxing, Multiplexers*/
50
- #define AIC31XX_CLKMUX 0x04
52
+ #define AIC31XX_CLKMUX AIC31XX_REG(0, 4)
51
53
/* PLL P and R-VAL register */
52
- #define AIC31XX_PLLPR 0x05
54
+ #define AIC31XX_PLLPR AIC31XX_REG(0, 5)
53
55
/* PLL J-VAL register */
54
- #define AIC31XX_PLLJ 0x06
56
+ #define AIC31XX_PLLJ AIC31XX_REG(0, 6)
55
57
/* PLL D-VAL MSB register */
56
- #define AIC31XX_PLLDMSB 0x07
58
+ #define AIC31XX_PLLDMSB AIC31XX_REG(0, 7)
57
59
/* PLL D-VAL LSB register */
58
- #define AIC31XX_PLLDLSB 0x08
60
+ #define AIC31XX_PLLDLSB AIC31XX_REG(0, 8)
59
61
/* DAC NDAC_VAL register*/
60
- #define AIC31XX_NDAC 0x0B
62
+ #define AIC31XX_NDAC AIC31XX_REG(0, 11)
61
63
/* DAC MDAC_VAL register */
62
- #define AIC31XX_MDAC 0x0C
64
+ #define AIC31XX_MDAC AIC31XX_REG(0, 12)
63
65
/* DAC OSR setting register 1, MSB value */
64
- #define AIC31XX_DOSRMSB 0x0D
66
+ #define AIC31XX_DOSRMSB AIC31XX_REG(0, 13)
65
67
/* DAC OSR setting register 2, LSB value */
66
- #define AIC31XX_DOSRLSB 0x0E
67
- #define AIC31XX_MINI_DSP_INPOL 0x10
68
+ #define AIC31XX_DOSRLSB AIC31XX_REG(0, 14)
69
+ #define AIC31XX_MINI_DSP_INPOL AIC31XX_REG(0, 16)
68
70
/* Clock setting register 8, PLL */
69
- #define AIC31XX_NADC 0x12
71
+ #define AIC31XX_NADC AIC31XX_REG(0, 18)
70
72
/* Clock setting register 9, PLL */
71
- #define AIC31XX_MADC 0x13
73
+ #define AIC31XX_MADC AIC31XX_REG(0, 19)
72
74
/* ADC Oversampling (AOSR) Register */
73
- #define AIC31XX_AOSR 0x14
75
+ #define AIC31XX_AOSR AIC31XX_REG(0, 20)
74
76
/* Clock setting register 9, Multiplexers */
75
- #define AIC31XX_CLKOUTMUX 0x19
77
+ #define AIC31XX_CLKOUTMUX AIC31XX_REG(0, 25)
76
78
/* Clock setting register 10, CLOCKOUT M divider value */
77
- #define AIC31XX_CLKOUTMVAL 0x1A
79
+ #define AIC31XX_CLKOUTMVAL AIC31XX_REG(0, 26)
78
80
/* Audio Interface Setting Register 1 */
79
- #define AIC31XX_IFACE1 0x1B
81
+ #define AIC31XX_IFACE1 AIC31XX_REG(0, 27)
80
82
/* Audio Data Slot Offset Programming */
81
- #define AIC31XX_DATA_OFFSET 0x1C
83
+ #define AIC31XX_DATA_OFFSET AIC31XX_REG(0, 28)
82
84
/* Audio Interface Setting Register 2 */
83
- #define AIC31XX_IFACE2 0x1D
85
+ #define AIC31XX_IFACE2 AIC31XX_REG(0, 29)
84
86
/* Clock setting register 11, BCLK N Divider */
85
- #define AIC31XX_BCLKN 0x1E
87
+ #define AIC31XX_BCLKN AIC31XX_REG(0, 30)
86
88
/* Audio Interface Setting Register 3, Secondary Audio Interface */
87
- #define AIC31XX_IFACESEC1 0x1F
89
+ #define AIC31XX_IFACESEC1 AIC31XX_REG(0, 31)
88
90
/* Audio Interface Setting Register 4 */
89
- #define AIC31XX_IFACESEC2 0x20
91
+ #define AIC31XX_IFACESEC2 AIC31XX_REG(0, 32)
90
92
/* Audio Interface Setting Register 5 */
91
- #define AIC31XX_IFACESEC3 0x21
93
+ #define AIC31XX_IFACESEC3 AIC31XX_REG(0, 33)
92
94
/* I2C Bus Condition */
93
- #define AIC31XX_I2C 0x22
95
+ #define AIC31XX_I2C AIC31XX_REG(0, 34)
94
96
/* ADC FLAG */
95
- #define AIC31XX_ADCFLAG 0x24
97
+ #define AIC31XX_ADCFLAG AIC31XX_REG(0, 36)
96
98
/* DAC Flag Registers */
97
- #define AIC31XX_DACFLAG1 0x25
98
- #define AIC31XX_DACFLAG2 0x26
99
+ #define AIC31XX_DACFLAG1 AIC31XX_REG(0, 37)
100
+ #define AIC31XX_DACFLAG2 AIC31XX_REG(0, 38)
99
101
/* Sticky Interrupt flag (overflow) */
100
- #define AIC31XX_OFFLAG 0x27
102
+ #define AIC31XX_OFFLAG AIC31XX_REG(0, 39)
101
103
/* Sticy DAC Interrupt flags */
102
- #define AIC31XX_INTRDACFLAG 0x2C
104
+ #define AIC31XX_INTRDACFLAG AIC31XX_REG(0, 44)
103
105
/* Sticy ADC Interrupt flags */
104
- #define AIC31XX_INTRADCFLAG 0x2D
106
+ #define AIC31XX_INTRADCFLAG AIC31XX_REG(0, 45)
105
107
/* DAC Interrupt flags 2 */
106
- #define AIC31XX_INTRDACFLAG2 0x2E
108
+ #define AIC31XX_INTRDACFLAG2 AIC31XX_REG(0, 46)
107
109
/* ADC Interrupt flags 2 */
108
- #define AIC31XX_INTRADCFLAG2 0x2F
110
+ #define AIC31XX_INTRADCFLAG2 AIC31XX_REG(0, 47)
109
111
/* INT1 interrupt control */
110
- #define AIC31XX_INT1CTRL 0x30
112
+ #define AIC31XX_INT1CTRL AIC31XX_REG(0, 48)
111
113
/* INT2 interrupt control */
112
- #define AIC31XX_INT2CTRL 0x31
114
+ #define AIC31XX_INT2CTRL AIC31XX_REG(0, 49)
113
115
/* GPIO1 control */
114
- #define AIC31XX_GPIO1 0x33
116
+ #define AIC31XX_GPIO1 AIC31XX_REG(0, 50)
115
117
116
- #define AIC31XX_DACPRB 0x3C
118
+ #define AIC31XX_DACPRB AIC31XX_REG(0, 60)
117
119
/* ADC Instruction Set Register */
118
- #define AIC31XX_ADCPRB 0x3D
120
+ #define AIC31XX_ADCPRB AIC31XX_REG(0, 61)
119
121
/* DAC channel setup register */
120
- #define AIC31XX_DACSETUP 0x3F
122
+ #define AIC31XX_DACSETUP AIC31XX_REG(0, 63)
121
123
/* DAC Mute and volume control register */
122
- #define AIC31XX_DACMUTE 0x40
124
+ #define AIC31XX_DACMUTE AIC31XX_REG(0, 64)
123
125
/* Left DAC channel digital volume control */
124
- #define AIC31XX_LDACVOL 0x41
126
+ #define AIC31XX_LDACVOL AIC31XX_REG(0, 65)
125
127
/* Right DAC channel digital volume control */
126
- #define AIC31XX_RDACVOL 0x42
128
+ #define AIC31XX_RDACVOL AIC31XX_REG(0, 66)
127
129
/* Headset detection */
128
- #define AIC31XX_HSDETECT 0x43
130
+ #define AIC31XX_HSDETECT AIC31XX_REG(0, 67)
129
131
/* ADC Digital Mic */
130
- #define AIC31XX_ADCSETUP 0x51
132
+ #define AIC31XX_ADCSETUP AIC31XX_REG(0, 81)
131
133
/* ADC Digital Volume Control Fine Adjust */
132
- #define AIC31XX_ADCFGA 0x52
134
+ #define AIC31XX_ADCFGA AIC31XX_REG(0, 82)
133
135
/* ADC Digital Volume Control Coarse Adjust */
134
- #define AIC31XX_ADCVOL 0x53
136
+ #define AIC31XX_ADCVOL AIC31XX_REG(0, 83)
135
137
136
138
137
139
/* Page 1 Registers */
138
140
/* Headphone drivers */
139
- #define AIC31XX_HPDRIVER 0x9F
141
+ #define AIC31XX_HPDRIVER AIC31XX_REG(1, 31)
140
142
/* Class-D Speakear Amplifier */
141
- #define AIC31XX_SPKAMP 0xA0
143
+ #define AIC31XX_SPKAMP AIC31XX_REG(1, 32)
142
144
/* HP Output Drivers POP Removal Settings */
143
- #define AIC31XX_HPPOP 0xA1
145
+ #define AIC31XX_HPPOP AIC31XX_REG(1, 33)
144
146
/* Output Driver PGA Ramp-Down Period Control */
145
- #define AIC31XX_SPPGARAMP 0xA2
147
+ #define AIC31XX_SPPGARAMP AIC31XX_REG(1, 34)
146
148
/* DAC_L and DAC_R Output Mixer Routing */
147
- #define AIC31XX_DACMIXERROUTE 0xA3
149
+ #define AIC31XX_DACMIXERROUTE AIC31XX_REG(1, 35)
148
150
/* Left Analog Vol to HPL */
149
- #define AIC31XX_LANALOGHPL 0xA4
151
+ #define AIC31XX_LANALOGHPL AIC31XX_REG(1, 36)
150
152
/* Right Analog Vol to HPR */
151
- #define AIC31XX_RANALOGHPR 0xA5
153
+ #define AIC31XX_RANALOGHPR AIC31XX_REG(1, 37)
152
154
/* Left Analog Vol to SPL */
153
- #define AIC31XX_LANALOGSPL 0xA6
155
+ #define AIC31XX_LANALOGSPL AIC31XX_REG(1, 38)
154
156
/* Right Analog Vol to SPR */
155
- #define AIC31XX_RANALOGSPR 0xA7
157
+ #define AIC31XX_RANALOGSPR AIC31XX_REG(1, 39)
156
158
/* HPL Driver */
157
- #define AIC31XX_HPLGAIN 0xA8
159
+ #define AIC31XX_HPLGAIN AIC31XX_REG(1, 40)
158
160
/* HPR Driver */
159
- #define AIC31XX_HPRGAIN 0xA9
161
+ #define AIC31XX_HPRGAIN AIC31XX_REG(1, 41)
160
162
/* SPL Driver */
161
- #define AIC31XX_SPLGAIN 0xAA
163
+ #define AIC31XX_SPLGAIN AIC31XX_REG(1, 42)
162
164
/* SPR Driver */
163
- #define AIC31XX_SPRGAIN 0xAB
165
+ #define AIC31XX_SPRGAIN AIC31XX_REG(1, 43)
164
166
/* HP Driver Control */
165
- #define AIC31XX_HPCONTROL 0xAC
167
+ #define AIC31XX_HPCONTROL AIC31XX_REG(1, 44)
166
168
/* MIC Bias Control */
167
- #define AIC31XX_MICBIAS 0xAE
169
+ #define AIC31XX_MICBIAS AIC31XX_REG(1, 46)
168
170
/* MIC PGA*/
169
- #define AIC31XX_MICPGA 0xAF
171
+ #define AIC31XX_MICPGA AIC31XX_REG(1, 47)
170
172
/* Delta-Sigma Mono ADC Channel Fine-Gain Input Selection for P-Terminal */
171
- #define AIC31XX_MICPGAPI 0xB0
173
+ #define AIC31XX_MICPGAPI AIC31XX_REG(1, 48)
172
174
/* ADC Input Selection for M-Terminal */
173
- #define AIC31XX_MICPGAMI 0xB1
175
+ #define AIC31XX_MICPGAMI AIC31XX_REG(1, 49)
174
176
/* Input CM Settings */
175
- #define AIC31XX_MICPGACM 0xB2
177
+ #define AIC31XX_MICPGACM AIC31XX_REG(1, 50)
176
178
177
179
/* Bits, masks and shifts */
178
180
0 commit comments