diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/audiohw.h | 6 | ||||
-rw-r--r-- | firmware/export/wm8731.h | 141 | ||||
-rw-r--r-- | firmware/export/wm8731l.h | 65 |
3 files changed, 145 insertions, 67 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index ec0177d091..9da1a3875f 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h | |||
@@ -31,8 +31,10 @@ | |||
31 | #include "wm8975.h" | 31 | #include "wm8975.h" |
32 | #elif defined(HAVE_WM8758) | 32 | #elif defined(HAVE_WM8758) |
33 | #include "wm8758.h" | 33 | #include "wm8758.h" |
34 | #elif defined(HAVE_WM8731) || defined(HAVE_WM8721) | 34 | #elif defined(HAVE_WM8721) |
35 | #include "wm8731l.h" | 35 | #include "wm8721.h" |
36 | #elif defined(HAVE_WM8731) | ||
37 | #include "wm8731.h" | ||
36 | #elif defined(HAVE_TLV320) | 38 | #elif defined(HAVE_TLV320) |
37 | #include "tlv320.h" | 39 | #include "tlv320.h" |
38 | #elif defined(HAVE_AS3514) | 40 | #elif defined(HAVE_AS3514) |
diff --git a/firmware/export/wm8731.h b/firmware/export/wm8731.h new file mode 100644 index 0000000000..3fc6bc7a5a --- /dev/null +++ b/firmware/export/wm8731.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Dave Chapman | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _WM8731_H | ||
21 | #define _WM8731_H | ||
22 | |||
23 | /* volume/balance/treble/bass interdependency */ | ||
24 | #define VOLUME_MIN -730 | ||
25 | #define VOLUME_MAX 60 | ||
26 | |||
27 | extern int tenthdb2master(int db); | ||
28 | extern int tenthdb2mixer(int db); | ||
29 | |||
30 | extern void audiohw_reset(void); | ||
31 | extern void audiohw_preinit(void); | ||
32 | extern void audiohw_postinit(void); | ||
33 | extern int audiohw_set_master_vol(int vol_l, int vol_r); | ||
34 | extern void audiohw_set_nsorder(int order); | ||
35 | extern void audiohw_set_sample_rate(int sampling_control); | ||
36 | |||
37 | extern void audiohw_enable_recording(bool source_mic); | ||
38 | extern void audiohw_disable_recording(void); | ||
39 | extern void audiohw_set_recvol(int left, int right, int type); | ||
40 | extern void audiohw_set_monitor(int enable); | ||
41 | |||
42 | /* Register addresses and bits */ | ||
43 | #define LINVOL 0x00 | ||
44 | #define LINVOL_MASK 0x1f | ||
45 | #define LINVOL_LRINBOTH (1 << 8) | ||
46 | #define LINVOL_LINMUTE (1 << 7) | ||
47 | |||
48 | #define RINVOL 0x01 | ||
49 | #define RINVOL_MASK 0x1f | ||
50 | #define RINVOL_RINMUTE (1 << 7) | ||
51 | #define RINVOL_RLINBOTH (1 << 8) | ||
52 | |||
53 | #define LOUTVOL 0x02 | ||
54 | #define LOUTVOL_LHPVOL_MASK 0x7f | ||
55 | #define LOUTVOL_LZCEN (1 << 7) | ||
56 | #define LOUTVOL_LRHP_BOTH (1 << 8) | ||
57 | |||
58 | #define ROUTVOL 0x03 | ||
59 | #define ROUTVOL_RHPVOL_MASK 0x7f | ||
60 | #define ROUTVOL_RZCEN (1 << 7) | ||
61 | #define ROUTVOL_RLHP_BOTH (1 << 8) | ||
62 | |||
63 | #define AAPCTRL 0x04 /* Analog audio path control */ | ||
64 | #define AAPCTRL_MIC_BOOST (1 << 0) | ||
65 | #define AAPCTRL_MUTEMIC (1 << 1) | ||
66 | #define AAPCTRL_INSEL (1 << 2) | ||
67 | #define AAPCTRL_BYPASS (1 << 3) | ||
68 | #define AAPCTRL_DACSEL (1 << 4) | ||
69 | #define AAPCTRL_SIDETONE (1 << 5) | ||
70 | #define AAPCTRL_SIDEATT_6dB (3 << 6) | ||
71 | #define AAPCTRL_SIDEATT_9dB (1 << 6) | ||
72 | #define AAPCTRL_SIDEATT_12dB (2 << 6) | ||
73 | #define AAPCTRL_SIDEATT_15dB (3 << 6) | ||
74 | |||
75 | #define DAPCTRL 0x05 /* Digital audio path control */ | ||
76 | #define DAPCTRL_ADCHPD (1 << 0) | ||
77 | #define DAPCTRL_DEEMP_DISABLE (0 << 2) | ||
78 | #define DAPCTRL_DEEMP_32KHz (1 << 2) | ||
79 | #define DAPCTRL_DEEMP_44KHz (2 << 2) | ||
80 | #define DAPCTRL_DEEMP_48KHz (3 << 2) | ||
81 | #define DAPCTRL_DEEMP_MASK (3 << 2) | ||
82 | #define DAPCTRL_DACMU (1 << 3) | ||
83 | #define DAPCTRL_HPOR (1 << 4) | ||
84 | |||
85 | #define PDCTRL 0x06 | ||
86 | #define PDCTRL_LINEINPD (1 << 0) | ||
87 | #define PDCTRL_MICPD (1 << 1) | ||
88 | #define PDCTRL_ADCPD (1 << 2) | ||
89 | #define PDCTRL_DACPD (1 << 3) | ||
90 | #define PDCTRL_OUTPD (1 << 4) | ||
91 | #define PDCTRL_OSCPD (1 << 5) | ||
92 | #define PDCTRL_CLKOUTPD (1 << 6) | ||
93 | #define PDCTRL_POWEROFF (1 << 7) | ||
94 | |||
95 | #define AINTFCE 0x07 | ||
96 | #define AINTFCE_FORMAT_MSB_RJUST (0 << 0) | ||
97 | #define AINTFCE_FORMAT_MSB_LJUST (1 << 0) | ||
98 | #define AINTFCE_FORMAT_I2S (2 << 0) | ||
99 | #define AINTFCE_FORMAT_DSP (3 << 0) | ||
100 | #define AINTFCE_FORMAT_MASK (3 << 0) | ||
101 | #define AINTFCE_IWL_16BIT (0 << 2) | ||
102 | #define AINTFCE_IWL_20BIT (1 << 2) | ||
103 | #define AINTFCE_IWL_24BIT (2 << 2) | ||
104 | #define AINTFCE_IWL_32BIT (3 << 2) | ||
105 | #define AINTFCE_IWL_MASK (3 << 2) | ||
106 | #define AINTFCE_LRP_I2S_RLO (0 << 4) | ||
107 | #define AINTFCE_LRP_I2S_RHI (1 << 4) | ||
108 | #define AINTFCE_DSP_MODE_A (0 << 4) | ||
109 | #define AINTFCE_DSP_MODE_B (1 << 4) | ||
110 | #define AINTFCE_LRSWAP (1 << 5) | ||
111 | #define AINTFCE_MS (1 << 6) | ||
112 | #define AINTFCE_BCLKINV (1 << 7) | ||
113 | |||
114 | #define SAMPCTRL 0x08 | ||
115 | #define SAMPCTRL_USB (1 << 0) | ||
116 | #define SAMPCTRL_BOSR_NOR_256fs (0 << 1) | ||
117 | #define SAMPCTRL_BOSR_NOR_384fs (1 << 1) | ||
118 | #define SAMPCTRL_BOSR_USB_250fs (0 << 1) | ||
119 | #define SAMPCTRL_BOSR_USB_272fs (1 << 1) | ||
120 | /* Bits 2-5: | ||
121 | * Sample rate setting are device-specific. See WM8731(L) datasheet | ||
122 | * for proper settings for the device's clocking */ | ||
123 | #define SAMPCTRL_SR_MASK (0xf << 2) | ||
124 | #define SAMPCTRL_CLKIDIV2 (1 << 6) | ||
125 | #define SAMPCTRL_CLKODIV2 (1 << 7) | ||
126 | |||
127 | #define ACTIVECTRL 0x09 | ||
128 | #define ACTIVECTRL_ACTIVE (1 << 0) | ||
129 | |||
130 | #define RESET 0x0f | ||
131 | #define RESET_RESET 0x0 | ||
132 | |||
133 | /* SAMPCTRL values for the supported samplerates (24MHz MCLK/USB): */ | ||
134 | #define WM8731_USB24_8000HZ 0x4d | ||
135 | #define WM8731_USB24_32000HZ 0x59 | ||
136 | #define WM8731_USB24_44100HZ 0x63 | ||
137 | #define WM8731_USB24_48000HZ 0x41 | ||
138 | #define WM8731_USB24_88200HZ 0x7f | ||
139 | #define WM8731_USB24_96000HZ 0x5d | ||
140 | |||
141 | #endif /* _WM8731_H */ | ||
diff --git a/firmware/export/wm8731l.h b/firmware/export/wm8731l.h deleted file mode 100644 index f0f63c909a..0000000000 --- a/firmware/export/wm8731l.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Dave Chapman | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _WM8731L_H | ||
21 | #define _WM8731L_H | ||
22 | |||
23 | /* volume/balance/treble/bass interdependency */ | ||
24 | #define VOLUME_MIN -730 | ||
25 | #define VOLUME_MAX 60 | ||
26 | |||
27 | extern int tenthdb2master(int db); | ||
28 | extern int tenthdb2mixer(int db); | ||
29 | |||
30 | extern void audiohw_reset(void); | ||
31 | extern void audiohw_enable_output(bool enable); | ||
32 | extern int audiohw_set_master_vol(int vol_l, int vol_r); | ||
33 | extern int audiohw_set_mixer_vol(int channel1, int channel2); | ||
34 | extern void audiohw_set_bass(int value); | ||
35 | extern void audiohw_set_treble(int value); | ||
36 | extern void audiohw_set_nsorder(int order); | ||
37 | extern void audiohw_set_sample_rate(int sampling_control); | ||
38 | |||
39 | extern void audiohw_enable_recording(bool source_mic); | ||
40 | extern void audiohw_disable_recording(void); | ||
41 | extern void audiohw_set_recvol(int left, int right, int type); | ||
42 | extern void audiohw_set_monitor(int enable); | ||
43 | |||
44 | /* Register addresses */ | ||
45 | #define LINVOL 0x00 | ||
46 | #define RINVOL 0x01 | ||
47 | #define LOUTVOL 0x02 | ||
48 | #define ROUTVOL 0x03 | ||
49 | #define AAPCTRL 0x04 /* Analog audio path control */ | ||
50 | #define DACCTRL 0x05 | ||
51 | #define PWRMGMT 0x06 | ||
52 | #define AINTFCE 0x07 | ||
53 | #define SAMPCTRL 0x08 | ||
54 | #define ACTIVECTRL 0x09 | ||
55 | #define RESET 0x0f | ||
56 | |||
57 | /* Register settings for the supported samplerates: */ | ||
58 | #define WM8731L_8000HZ 0x4d | ||
59 | #define WM8731L_32000HZ 0x59 | ||
60 | #define WM8731L_44100HZ 0x63 | ||
61 | #define WM8731L_48000HZ 0x41 | ||
62 | #define WM8731L_88200HZ 0x7f | ||
63 | #define WM8731L_96000HZ 0x5d | ||
64 | |||
65 | #endif /* _WM8975_H */ | ||