Another forgotten file.
[Rockbox.git] / firmware / export / mas35xx.h
bloba0da03d0a4647db41328298dbe7cdc37d200f46e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Implementation of MAS35xx audiohw api driver.
12 * Copyright (C) 2007 by Christian Gmeiner
14 * All files in this archive are subject to the GNU General Public License.
15 * See the file COPYING in the source tree root for full license agreement.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _MAS35XX_H
23 #define _MAS35XX_H
25 #include "config.h"
27 #if CONFIG_CODEC == MAS3507D
29 #define VOLUME_MIN -780
30 #define VOLUME_MAX 180
31 #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
33 #else /* CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F */
35 /* MAS3587F and MAS3539F handle clipping prevention internally so we do not need
36 * the prescaler -> CLIPPING_CAP
39 #define VOLUME_MIN -400
40 #define VOLUME_MAX 600
41 #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP)
43 #endif
46 #if CONFIG_CODEC == MAS3507D
48 static const unsigned int bass_table[] =
50 0x9e400, /* -15dB */
51 0xa2800, /* -14dB */
52 0xa7400, /* -13dB */
53 0xac400, /* -12dB */
54 0xb1800, /* -11dB */
55 0xb7400, /* -10dB */
56 0xbd400, /* -9dB */
57 0xc3c00, /* -8dB */
58 0xca400, /* -7dB */
59 0xd1800, /* -6dB */
60 0xd8c00, /* -5dB */
61 0xe0400, /* -4dB */
62 0xe8000, /* -3dB */
63 0xefc00, /* -2dB */
64 0xf7c00, /* -1dB */
66 0x800, /* 1dB */
67 0x10000, /* 2dB */
68 0x17c00, /* 3dB */
69 0x1f800, /* 4dB */
70 0x27000, /* 5dB */
71 0x2e400, /* 6dB */
72 0x35800, /* 7dB */
73 0x3c000, /* 8dB */
74 0x42800, /* 9dB */
75 0x48800, /* 10dB */
76 0x4e400, /* 11dB */
77 0x53800, /* 12dB */
78 0x58800, /* 13dB */
79 0x5d400, /* 14dB */
80 0x61800 /* 15dB */
83 static const unsigned int treble_table[] =
85 0xb2c00, /* -15dB */
86 0xbb400, /* -14dB */
87 0xc1800, /* -13dB */
88 0xc6c00, /* -12dB */
89 0xcbc00, /* -11dB */
90 0xd0400, /* -10dB */
91 0xd5000, /* -9dB */
92 0xd9800, /* -8dB */
93 0xde000, /* -7dB */
94 0xe2800, /* -6dB */
95 0xe7e00, /* -5dB */
96 0xec000, /* -4dB */
97 0xf0c00, /* -3dB */
98 0xf5c00, /* -2dB */
99 0xfac00, /* -1dB */
101 0x5400, /* 1dB */
102 0xac00, /* 2dB */
103 0x10400, /* 3dB */
104 0x16000, /* 4dB */
105 0x1c000, /* 5dB */
106 0x22400, /* 6dB */
107 0x28400, /* 7dB */
108 0x2ec00, /* 8dB */
109 0x35400, /* 9dB */
110 0x3c000, /* 10dB */
111 0x42c00, /* 11dB */
112 0x49c00, /* 12dB */
113 0x51800, /* 13dB */
114 0x58400, /* 14dB */
115 0x5f800 /* 15dB */
118 static const unsigned int prescale_table[] =
120 0x80000, /* 0db */
121 0x8e000, /* 1dB */
122 0x9a400, /* 2dB */
123 0xa5800, /* 3dB */
124 0xaf400, /* 4dB */
125 0xb8000, /* 5dB */
126 0xbfc00, /* 6dB */
127 0xc6c00, /* 7dB */
128 0xcd000, /* 8dB */
129 0xd25c0, /* 9dB */
130 0xd7800, /* 10dB */
131 0xdc000, /* 11dB */
132 0xdfc00, /* 12dB */
133 0xe3400, /* 13dB */
134 0xe6800, /* 14dB */
135 0xe9400 /* 15dB */
137 #endif /*CONFIG_CODEC == MAS3507D*/
139 #endif /* _MAS35XX_H */