Fix include problem
[kugel-rb.git] / firmware / export / mas35xx.h
blob1c50b7f02be86ed69be9f281f5bfe0fdbea68351
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 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
24 #ifndef _MAS35XX_H
25 #define _MAS35XX_H
27 #include "config.h"
29 #if CONFIG_CODEC == MAS3507D
31 #define VOLUME_MIN -780
32 #define VOLUME_MAX 180
33 #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
35 #else /* CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F */
37 /* MAS3587F and MAS3539F handle clipping prevention internally so we do not need
38 * the prescaler -> CLIPPING_CAP
41 #define VOLUME_MIN -400
42 #define VOLUME_MAX 600
43 #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP)
45 #endif
48 #if CONFIG_CODEC == MAS3507D
50 static const unsigned int bass_table[] =
52 0x9e400, /* -15dB */
53 0xa2800, /* -14dB */
54 0xa7400, /* -13dB */
55 0xac400, /* -12dB */
56 0xb1800, /* -11dB */
57 0xb7400, /* -10dB */
58 0xbd400, /* -9dB */
59 0xc3c00, /* -8dB */
60 0xca400, /* -7dB */
61 0xd1800, /* -6dB */
62 0xd8c00, /* -5dB */
63 0xe0400, /* -4dB */
64 0xe8000, /* -3dB */
65 0xefc00, /* -2dB */
66 0xf7c00, /* -1dB */
68 0x800, /* 1dB */
69 0x10000, /* 2dB */
70 0x17c00, /* 3dB */
71 0x1f800, /* 4dB */
72 0x27000, /* 5dB */
73 0x2e400, /* 6dB */
74 0x35800, /* 7dB */
75 0x3c000, /* 8dB */
76 0x42800, /* 9dB */
77 0x48800, /* 10dB */
78 0x4e400, /* 11dB */
79 0x53800, /* 12dB */
80 0x58800, /* 13dB */
81 0x5d400, /* 14dB */
82 0x61800 /* 15dB */
85 static const unsigned int treble_table[] =
87 0xb2c00, /* -15dB */
88 0xbb400, /* -14dB */
89 0xc1800, /* -13dB */
90 0xc6c00, /* -12dB */
91 0xcbc00, /* -11dB */
92 0xd0400, /* -10dB */
93 0xd5000, /* -9dB */
94 0xd9800, /* -8dB */
95 0xde000, /* -7dB */
96 0xe2800, /* -6dB */
97 0xe7e00, /* -5dB */
98 0xec000, /* -4dB */
99 0xf0c00, /* -3dB */
100 0xf5c00, /* -2dB */
101 0xfac00, /* -1dB */
103 0x5400, /* 1dB */
104 0xac00, /* 2dB */
105 0x10400, /* 3dB */
106 0x16000, /* 4dB */
107 0x1c000, /* 5dB */
108 0x22400, /* 6dB */
109 0x28400, /* 7dB */
110 0x2ec00, /* 8dB */
111 0x35400, /* 9dB */
112 0x3c000, /* 10dB */
113 0x42c00, /* 11dB */
114 0x49c00, /* 12dB */
115 0x51800, /* 13dB */
116 0x58400, /* 14dB */
117 0x5f800 /* 15dB */
120 static const unsigned int prescale_table[] =
122 0x80000, /* 0db */
123 0x8e000, /* 1dB */
124 0x9a400, /* 2dB */
125 0xa5800, /* 3dB */
126 0xaf400, /* 4dB */
127 0xb8000, /* 5dB */
128 0xbfc00, /* 6dB */
129 0xc6c00, /* 7dB */
130 0xcd000, /* 8dB */
131 0xd25c0, /* 9dB */
132 0xd7800, /* 10dB */
133 0xdc000, /* 11dB */
134 0xdfc00, /* 12dB */
135 0xe3400, /* 13dB */
136 0xe6800, /* 14dB */
137 0xe9400 /* 15dB */
139 #endif /*CONFIG_CODEC == MAS3507D*/
141 #endif /* _MAS35XX_H */