summaryrefslogtreecommitdiff
path: root/firmware/export/wm8751.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/wm8751.h')
-rw-r--r--firmware/export/wm8751.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h
index a7c28a9855..3bbf744463 100644
--- a/firmware/export/wm8751.h
+++ b/firmware/export/wm8751.h
@@ -25,13 +25,15 @@
25#define VOLUME_MIN -730 25#define VOLUME_MIN -730
26#define VOLUME_MAX 60 26#define VOLUME_MAX 60
27 27
28/* turn off 3D Enchance feature of WM8750 for now
29#if defined(HAVE_WM8750) 28#if defined(HAVE_WM8750)
30#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | DEPTH_3D_CAP) 29#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
30 BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \
31 DEPTH_3D_CAP)
31#else 32#else
32*/ 33
33#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP) 34#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
34/* #endif */ 35 BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP)
36#endif
35 37
36extern int tenthdb2master(int db); 38extern int tenthdb2master(int db);
37 39
@@ -60,12 +62,13 @@ void audiohw_set_recsrc(int source, bool recording);
60#endif 62#endif
61 63
62#define LOUT1 0x02 64#define LOUT1 0x02
63#define LOUT1_LOUT1VOL_MASK (0x07f << 0) 65#define LOUT1_LOUT1VOL_MASK 0x07f
64#define LOUT1_LOUT1VOL(x) ((x) & 0x7f) 66#define LOUT1_LOUT1VOL(x) ((x) & 0x7f)
65#define LOUT1_LO1ZC (1 << 7) 67#define LOUT1_LO1ZC (1 << 7)
66#define LOUT1_LO1VU (1 << 8) 68#define LOUT1_LO1VU (1 << 8)
67 69
68#define ROUT1 0x03 70#define ROUT1 0x03
71#define ROUT1_ROUT1VOL_MASK 0x17f
69#define ROUT1_ROUT1VOL(x) ((x) & 0x7f) 72#define ROUT1_ROUT1VOL(x) ((x) & 0x7f)
70#define ROUT1_RO1ZC (1 << 7) 73#define ROUT1_RO1ZC (1 << 7)
71#define ROUT1_RO1VU (1 << 8) 74#define ROUT1_RO1VU (1 << 8)
@@ -110,11 +113,13 @@ void audiohw_set_recsrc(int source, bool recording);
110#define RIGHTGAIN_RDVU (1 << 8) 113#define RIGHTGAIN_RDVU (1 << 8)
111 114
112#define BASSCTRL 0x0c 115#define BASSCTRL 0x0c
116#define BASSCTRL_BASS_MASK 0x0f
113#define BASSCTRL_BASS(x) ((x) & 0xf) 117#define BASSCTRL_BASS(x) ((x) & 0xf)
114#define BASSCTRL_BC (1 << 6) 118#define BASSCTRL_BC (1 << 6)
115#define BASSCTRL_BB (1 << 7) 119#define BASSCTRL_BB (1 << 7)
116 120
117#define TREBCTRL 0x0d 121#define TREBCTRL 0x0d
122#define TREBCTRL_TREB_MASK 0x0f
118#define TREBCTRL_TREB(x) ((x) & 0xf) 123#define TREBCTRL_TREB(x) ((x) & 0xf)
119#define TREBCTRL_TC (1 << 6) 124#define TREBCTRL_TC (1 << 6)
120 125
@@ -125,6 +130,7 @@ void audiohw_set_recsrc(int source, bool recording);
125#define ENHANCE_3D 0x10 130#define ENHANCE_3D 0x10
126#define ENHANCE_3D_3DEN (1 << 0) 131#define ENHANCE_3D_3DEN (1 << 0)
127#define ENHANCE_3D_DEPTH(x) (((x) & 0xf) << 1) 132#define ENHANCE_3D_DEPTH(x) (((x) & 0xf) << 1)
133#define ENHANCE_3D_DEPTH_MASK (0x0f << 1)
128#define ENHANCE_3D_3DLC (1 << 5) 134#define ENHANCE_3D_3DLC (1 << 5)
129#define ENHANCE_3D_3DUC (1 << 6) 135#define ENHANCE_3D_3DUC (1 << 6)
130#define ENHANCE_3D_MODE3D_PLAYBACK (1 << 7) 136#define ENHANCE_3D_MODE3D_PLAYBACK (1 << 7)
@@ -137,6 +143,7 @@ void audiohw_set_recsrc(int source, bool recording);
137#define ALC1_ALCSEL_RIGHT (1 << 7) 143#define ALC1_ALCSEL_RIGHT (1 << 7)
138#define ALC1_ALCSEL_LEFT (2 << 7) 144#define ALC1_ALCSEL_LEFT (2 << 7)
139#define ALC1_ALCSEL_STEREO (3 << 7) 145#define ALC1_ALCSEL_STEREO (3 << 7)
146#define ALC1_ALCSEL_MASK (3 << 7)
140 147
141#define ALC2 0x12 148#define ALC2 0x12
142#define ALC2_HLD(x) ((x) & 0x0f) 149#define ALC2_HLD(x) ((x) & 0x0f)
@@ -152,6 +159,14 @@ void audiohw_set_recsrc(int source, bool recording);
152#define NGAT_NGG_MUTEADC (1 << 1) 159#define NGAT_NGG_MUTEADC (1 << 1)
153#define NGAT_NGG(x) (((x) & 0x3) << 1) 160#define NGAT_NGG(x) (((x) & 0x3) << 1)
154#define NGAT_NGTH(x) (((x) & 0x1f) << 3) 161#define NGAT_NGTH(x) (((x) & 0x1f) << 3)
162
163#define LADCVOL 0x15
164#define LADCVOL_LADCVOL(x) ((x) & 0xff)
165#define LADCVOL_LAVU (1 << 8)
166
167#define RADCVOL 0x16
168#define RADCVOL_RADCVOL(x) ((x) & 0xff)
169#define RADCVOL_RAVU (1 << 8)
155#endif 170#endif
156 171
157#define ADDITIONAL1 0x17 172#define ADDITIONAL1 0x17
@@ -167,6 +182,7 @@ void audiohw_set_recsrc(int source, bool recording);
167#define ADDITIONAL1_VSEL_DEFAULT2 (2 << 6) 182#define ADDITIONAL1_VSEL_DEFAULT2 (2 << 6)
168#define ADDITIONAL1_VSEL_DEFAULT (3 << 6) 183#define ADDITIONAL1_VSEL_DEFAULT (3 << 6)
169#define ADDITIONAL1_VSEL(x) ((x) & (0x3 << 6)) 184#define ADDITIONAL1_VSEL(x) ((x) & (0x3 << 6))
185#define ADDITIONAL1_VSEL_MASK (3 << 6)
170#define ADDITIONAL1_TSDEN (1 << 8) 186#define ADDITIONAL1_TSDEN (1 << 8)
171 187
172#define ADDITIONAL2 0x18 188#define ADDITIONAL2 0x18
@@ -196,6 +212,7 @@ void audiohw_set_recsrc(int source, bool recording);
196#define PWRMGMT1_VMIDSEL_500K (2 << 7) 212#define PWRMGMT1_VMIDSEL_500K (2 << 7)
197#define PWRMGMT1_VMIDSEL_5K (3 << 7) 213#define PWRMGMT1_VMIDSEL_5K (3 << 7)
198#define PWRMGMT1_VMIDSEL(x) ((x) & (0x3 << 7)) 214#define PWRMGMT1_VMIDSEL(x) ((x) & (0x3 << 7))
215#define PWRMGMT1_VMIDSEL_MASK ((1<<8)|(1<<7))
199 216
200#define PWRMGMT2 0x1a 217#define PWRMGMT2 0x1a
201#define PWRMGMT2_OUT3 (1 << 1) 218#define PWRMGMT2_OUT3 (1 << 1)
@@ -232,7 +249,8 @@ void audiohw_set_recsrc(int source, bool recording);
232#define ADCL_LINSEL_LINPUT1 (0 << 6) 249#define ADCL_LINSEL_LINPUT1 (0 << 6)
233#define ADCL_LINSEL_LINPUT2 (1 << 6) 250#define ADCL_LINSEL_LINPUT2 (1 << 6)
234#define ADCL_LINSEL_LINPUT3 (2 << 6) 251#define ADCL_LINSEL_LINPUT3 (2 << 6)
235#define ADCL_LINSEL_DIFF (3 << 6) 252#define ADCL_LINSEL_DIFF (3 << 6)
253#define ADCL_LINSEL_MASK (3 << 6)
236 254
237#define ADCR 0x21 255#define ADCR 0x21
238#define ADCR_RMICBOOST_DISABLED (0 << 4) 256#define ADCR_RMICBOOST_DISABLED (0 << 4)
@@ -244,6 +262,7 @@ void audiohw_set_recsrc(int source, bool recording);
244#define ADCR_RINSEL_RINPUT2 (1 << 6) 262#define ADCR_RINSEL_RINPUT2 (1 << 6)
245#define ADCR_RINSEL_RINPUT3 (2 << 6) 263#define ADCR_RINSEL_RINPUT3 (2 << 6)
246#define ADCR_RINSEL_DIFF (3 << 6) 264#define ADCR_RINSEL_DIFF (3 << 6)
265#define ADCR_RINSEL_MASK (3 << 6)
247#endif 266#endif
248 267
249#define LEFTMIX1 0x22 268#define LEFTMIX1 0x22
@@ -256,6 +275,7 @@ void audiohw_set_recsrc(int source, bool recording);
256#endif 275#endif
257#define LEFTMIX1_LI2LO_DEFAULT (5 << 4) 276#define LEFTMIX1_LI2LO_DEFAULT (5 << 4)
258#define LEFTMIX1_LI2LOVOL(x) ((x) & (0x7 << 4)) 277#define LEFTMIX1_LI2LOVOL(x) ((x) & (0x7 << 4))
278#define LEFTMIX1_LI2LOVOL_MASK (0x7 << 4)
259#define LEFTMIX1_LI2LO (1 << 7) 279#define LEFTMIX1_LI2LO (1 << 7)
260#define LEFTMIX1_LD2LO (1 << 8) 280#define LEFTMIX1_LD2LO (1 << 8)
261 281
@@ -297,6 +317,7 @@ void audiohw_set_recsrc(int source, bool recording);
297#endif 317#endif
298#define RIGHTMIX2_RI2RO_DEFAULT (5 << 4) 318#define RIGHTMIX2_RI2RO_DEFAULT (5 << 4)
299#define RIGHTMIX2_RI2ROVOL(x) ((x) & (0x7 << 4)) 319#define RIGHTMIX2_RI2ROVOL(x) ((x) & (0x7 << 4))
320#define RIGHTMIX2_RI2ROVOL_MASK (0x7 << 4)
300#define RIGHTMIX2_RI2RO (1 << 7) 321#define RIGHTMIX2_RI2RO (1 << 7)
301#define RIGHTMIX2_RD2RO (1 << 8) 322#define RIGHTMIX2_RD2RO (1 << 8)
302 323
@@ -312,11 +333,13 @@ void audiohw_set_recsrc(int source, bool recording);
312#define MONOMIX2_RD2MO (1 << 8) 333#define MONOMIX2_RD2MO (1 << 8)
313 334
314#define LOUT2 0x28 335#define LOUT2 0x28
336#define LOUT2_LOUT2VOL_MASK 0x7f
315#define LOUT2_LOUT2VOL(x) ((x) & 0x7f) 337#define LOUT2_LOUT2VOL(x) ((x) & 0x7f)
316#define LOUT2_LO2ZC (1 << 7) 338#define LOUT2_LO2ZC (1 << 7)
317#define LOUT2_LO2VU (1 << 8) 339#define LOUT2_LO2VU (1 << 8)
318 340
319#define ROUT2 0x29 341#define ROUT2 0x29
342#define ROUT2_ROUT2VOL_MASK 0x17f
320#define ROUT2_ROUT2VOL(x) ((x) & 0x7f) 343#define ROUT2_ROUT2VOL(x) ((x) & 0x7f)
321#define ROUT2_RO2ZC (1 << 7) 344#define ROUT2_RO2ZC (1 << 7)
322#define ROUT2_RO2VU (1 << 8) 345#define ROUT2_RO2VU (1 << 8)
@@ -324,4 +347,5 @@ void audiohw_set_recsrc(int source, bool recording);
324#define MONOOUT 0x2a 347#define MONOOUT 0x2a
325#define MONOOUT_MOZC (1 << 7) 348#define MONOOUT_MOZC (1 << 7)
326 349
350#define WM_NUM_REGS 0x2b
327#endif /* _WM8751_H */ 351#endif /* _WM8751_H */