Change enum codecs in apps/codecs/librm/rm.h to follow the coding guidelines.
[kugel-rb.git] / firmware / export / wm8751.h
blob15170b76bcd99f7fc216954c1023e68aa60eb5f2
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Dave Chapman
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef _WM8751_H
22 #define _WM8751_H
24 /* volume/balance/treble/bass interdependency */
25 #define VOLUME_MIN -730
26 #define VOLUME_MAX 60
28 #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP)
30 extern int tenthdb2master(int db);
32 extern void audiohw_set_master_vol(int vol_l, int vol_r);
33 extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
35 /* Register addresses and bits */
36 #define OUTPUT_MUTED 0x2f
37 #define OUTPUT_0DB 0x79
39 #define LOUT1 0x02
40 #define LOUT1_LOUT1VOL_MASK (0x07f << 0)
41 #define LOUT1_LOUT1VOL(x) ((x) & 0x7f)
42 #define LOUT1_LO1ZC (1 << 7)
43 #define LOUT1_LO1VU (1 << 8)
45 #define ROUT1 0x03
46 #define ROUT1_ROUT1VOL(x) ((x) & 0x7f)
47 #define ROUT1_RO1ZC (1 << 7)
48 #define ROUT1_RO1VU (1 << 8)
50 #define DACCTRL 0x05
51 #define DACCTRL_DEEMPH_NONE (0 << 1)
52 #define DACCTRL_DEEMPH_32 (1 << 1)
53 #define DACCTRL_DEEMPH_44 (2 << 1)
54 #define DACCTRL_DEEMPH_48 (3 << 1)
55 #define DACCTRL_DEEMPH(x) ((x) & (0x3 << 1))
56 #define DACCTRL_DACMU (1 << 3)
57 #define DACCTRL_DAT (1 << 7)
59 #define AINTFCE 0x07
60 #define AINTFCE_FORMAT_RJUST (0 << 0)
61 #define AINTFCE_FORMAT_LJUST (1 << 0)
62 #define AINTFCE_FORMAT_I2S (2 << 0)
63 #define AINTFCE_FORMAT_DSP (3 << 0)
64 #define AINTFCE_FORMAT(x) ((x) & 0x3)
65 #define AINTFCE_WL_16 (0 << 2)
66 #define AINTFCE_WL_20 (1 << 2)
67 #define AINTFCE_WL_24 (2 << 2)
68 #define AINTFCE_WL_32 (3 << 2)
69 #define AINTFCE_WL(x) ((x) & (0x3 << 2))
70 #define AINTFCE_LRP (1 << 4)
71 #define AINTFCE_LRSWAP (1 << 5)
72 #define AINTFCE_MS (1 << 6)
73 #define AINTFCE_BCLKINV (1 << 7)
75 #define CLOCKING 0x08
76 #define CLOCKING_SR_USB (1 << 0)
77 #define CLOCKING_SR(x) ((x) & (0x1f << 1))
78 #define CLOCKING_MCLK_DIV2 (1 << 6)
79 #define CLOCKING_BCLK_DIV2 (1 << 7)
81 #define LEFTGAIN 0x0a
82 #define LEFTGAIN_LDACVOL(x) ((x) & 0xff)
83 #define LEFTGAIN_LDVU (1 << 8)
85 #define RIGHTGAIN 0x0b
86 #define RIGHTGAIN_LDACVOL(x) ((x) & 0xff)
87 #define RIGHTGAIN_LDVU (1 << 8)
89 #define BASSCTRL 0x0c
90 #define BASSCTRL_BASS(x) ((x) & 0xf)
91 #define BASSCTRL_BC (1 << 6)
92 #define BASSCTRL_BB (1 << 7)
94 #define TREBCTRL 0x0d
95 #define TREBCTRL_TREB(x) ((x) & 0xf)
96 #define TREBCTRL_TC (1 << 6)
98 #define RESET 0x0f
99 #define RESET_RESET 0x000
101 #define ADDITIONAL1 0x17
102 #define ADDITIONAL1_TOEN (1 << 0)
103 #define ADDITIONAL1_DACINV (1 << 1)
104 #define ADDITIONAL1_DMONOMIX_LLRR (0 << 4)
105 #define ADDITIONAL1_DMONOMIX_ML0R (1 << 4)
106 #define ADDITIONAL1_DMONOMIX_0LMR (2 << 4)
107 #define ADDITIONAL1_DMONOMIX_MLMR (3 << 4)
108 #define ADDITIONAL1_DMONOMIX(x) ((x) & (0x03 << 4))
109 #define ADDITIONAL1_VSEL_LOWEST (0 << 6)
110 #define ADDITIONAL1_VSEL_LOW (1 << 6)
111 #define ADDITIONAL1_VSEL_DEFAULT2 (2 << 6)
112 #define ADDITIONAL1_VSEL_DEFAULT (3 << 6)
113 #define ADDITIONAL1_VSEL(x) ((x) & (0x3 << 6))
114 #define ADDITIONAL1_TSDEN (1 << 8)
116 #define ADDITIONAL2 0x18
117 #define ADDITIONAL2_DACOSR (1 << 0)
118 #define ADDITIONAL2_HPSWZC (1 << 3)
119 #define ADDITIONAL2_ROUT2INV (1 << 4)
120 #define ADDITIONAL2_HPSWPOL (1 << 5)
121 #define ADDITIONAL2_HPSWEN (1 << 6)
122 #define ADDITIONAL2_OUT3SW_VREF (0 << 7)
123 #define ADDITIONAL2_OUT3SW_ROUT1 (1 << 7)
124 #define ADDITIONAL2_OUT3SW_MONOOUT (2 << 7)
125 #define ADDITIONAL2_OUT3SW_R_MIX_OUT (3 << 7)
126 #define ADDITIONAL2_OUT3SW(x) ((x) & (0x3 << 7))
128 #define PWRMGMT1 0x19
129 #define PWRMGMT1_DIGENB (1 << 0)
130 #define PWRMGMT1_VREF (1 << 6)
131 #define PWRMGMT1_VMIDSEL_DISABLED (0 << 7)
132 #define PWRMGMT1_VMIDSEL_50K (1 << 7)
133 #define PWRMGMT1_VMIDSEL_500K (2 << 7)
134 #define PWRMGMT1_VMIDSEL_5K (3 << 7)
135 #define PWRMGMT1_VMIDSEL(x) ((x) & (0x3 << 7))
137 #define PWRMGMT2 0x1a
138 #define PWRMGMT2_OUT3 (1 << 1)
139 #define PWRMGMT2_MOUT (1 << 2)
140 #define PWRMGMT2_ROUT2 (1 << 3)
141 #define PWRMGMT2_LOUT2 (1 << 4)
142 #define PWRMGMT2_ROUT1 (1 << 5)
143 #define PWRMGMT2_LOUT1 (1 << 6)
144 #define PWRMGMT2_DACR (1 << 7)
145 #define PWRMGMT2_DACL (1 << 8)
147 #define ADDITIONAL3 0x1b
148 #define ADDITIONAL3_ADCLRM ((x) & (0x3 << 7))
149 #define ADDITIONAL3_HPFLREN (1 << 5)
150 #define ADDITIONAL3_VROI (1 << 6)
152 #define LEFTMIX1 0x22
153 #define LEFTMIX1_LI2LO_DEFAULT (5 << 4)
154 #define LEFTMIX1_LI2LOVOL(x) ((x) & (0x7 << 4))
155 #define LEFTMIX1_LI2LO (1 << 7)
156 #define LEFTMIX1_LD2LO (1 << 8)
158 #define LEFTMIX2 0x23
159 #define LEFTMIX2_MI2LO_DEFAULT (5 << 4)
160 #define LEFTMIX2_MI2LOVOL(x) ((x) & (0x7 << 4))
161 #define LEFTMIX2_MI2LO (1 << 7)
162 #define LEFTMIX2_RD2LO (1 << 8)
164 #define RIGHTMIX1 0x24
165 #define RIGHTMIX1_MI2RO_DEFAULT (5 << 4)
166 #define RIGHTMIX1_MI2ROVOL(x) ((x) & (0x7 << 4))
167 #define RIGHTMIX1_MI2RO (1 << 7)
168 #define RIGHTMIX1_LD2RO (1 << 8)
170 #define RIGHTMIX2 0x25
171 #define RIGHTMIX2_RI2RO_DEFAULT (5 << 4)
172 #define RIGHTMIX2_RI2ROVOL(x) ((x) & (0x7 << 4))
173 #define RIGHTMIX2_RI2RO (1 << 7)
174 #define RIGHTMIX2_RD2RO (1 << 8)
176 #define MONOMIX1 0x26
177 #define MONOMIX1_DMEN (1 << 0)
178 #define MONOMIX1_LI2MOVOL(x) ((x) & (0x7 << 4))
179 #define MONOMIX1_LI2MO (1 << 7)
180 #define MONOMIX1_LD2MO (1 << 8)
182 #define MONOMIX2 0x27
183 #define MONOMIX2_RI2MOVOL(x) ((x) & (0x7 << 4))
184 #define MONOMIX2_RI2MO (1 << 7)
185 #define MONOMIX2_RD2MO (1 << 8)
187 #define LOUT2 0x28
188 #define LOUT2_LOUT2VOL(x) ((x) & 0x7f)
189 #define LOUT2_LO2ZC (1 << 7)
190 #define LOUT2_LO2VU (1 << 8)
192 #define ROUT2 0x29
193 #define ROUT2_ROUT2VOL(x) ((x) & 0x7f)
194 #define ROUT2_RO2ZC (1 << 7)
195 #define ROUT2_RO2VU (1 << 8)
197 #define MONOOUT 0x2a
198 #define MONOOUT_MOZC (1 << 7)
200 #endif /* _WM8751_H */