]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - sound/arm/omap/omap-alsa-tsc2101-mixer.h
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / sound / arm / omap / omap-alsa-tsc2101-mixer.h
1 /*
2  * sound/arm/omap/omap-alsa-tsc2101-mixer.c
3  * 
4  * Alsa Driver for TSC2101 codec for OMAP platform boards.
5  *
6  * Copyright (C) 2005 Mika Laitio <lamikr@cc.jyu.fi> and 
7  *                   Everett Coleman II <gcc80x86@fuzzyneural.net>
8  *
9  * Based on the ideas in omap-aic23.c and sa11xx-uda1341.c
10  * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
11  * Copyright (C) 2002 Tomas Kasparek <tomas.kasparek@seznam.cz>
12  *
13  * This program is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU General Public License as published by the
15  * Free Software Foundation; either version 2 of the License, or (at your
16  * option) any later version.
17  *
18  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
21  * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
24  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  * You should have received a copy of the  GNU General Public License along
30  * with this program; if not, write  to the Free Software Foundation, Inc.,
31  * 675 Mass Ave, Cambridge, MA 02139, USA.
32  *
33  * History:
34  *
35  * 2006-03-01   Mika Laitio - Mixer for the tsc2101 driver used in omap boards.
36  *              Can switch between headset and loudspeaker playback, 
37  *              mute and unmute dgc, set dgc volume. Record source switch,
38  *              keyclick, buzzer and headset volume and handset volume control 
39  *              are still missing.
40  */
41
42 #ifndef OMAPALSATSC2101MIXER_H_
43 #define OMAPALSATSC2101MIXER_H_
44
45 #include <asm/hardware/tsc2101.h>
46 #include <../drivers/ssi/omap-tsc2101.h>
47 #include "omap-alsa-dma.h"
48
49 /* tsc2101 DAC gain control volume specific  */
50 #define OUTPUT_VOLUME_MIN               0x7F    // 1111111 = -63.5 DB
51 #define OUTPUT_VOLUME_MAX               0x32    // 110010
52 #define OUTPUT_VOLUME_RANGE             (OUTPUT_VOLUME_MIN - OUTPUT_VOLUME_MAX)
53
54 /* use input vol of 75 for 0dB gain */
55 #define INPUT_VOLUME_MIN                0x0
56 #define INPUT_VOLUME_MAX                0x7D
57 #define INPUT_VOLUME_RANGE              (INPUT_VOLUME_MAX - INPUT_VOLUME_MIN)
58
59 #define PLAYBACK_TARGET_COUNT           0x03
60 #define PLAYBACK_TARGET_LOUDSPEAKER     0x00
61 #define PLAYBACK_TARGET_HEADPHONE       0x01
62 #define PLAYBACK_TARGET_CELLPHONE       0x02
63
64 /* following are used for register 03h Mixer PGA control bits D7-D5 for selecting record source */
65 #define REC_SRC_TARGET_COUNT            0x08
66 #define REC_SRC_SINGLE_ENDED_MICIN_HED  0x00    // oss code referred to MIXER_LINE
67 #define REC_SRC_SINGLE_ENDED_MICIN_HND  0x01    // oss code referred to MIXER_MIC
68 #define REC_SRC_SINGLE_ENDED_AUX1       0x02
69 #define REC_SRC_SINGLE_ENDED_AUX2       0x03
70 #define REC_SRC_MICIN_HED_AND_AUX1      0x04
71 #define REC_SRC_MICIN_HED_AND_AUX2      0x05
72 #define REC_SRC_MICIN_HND_AND_AUX1      0x06
73 #define REC_SRC_MICIN_HND_AND_AUX2      0x07
74
75 #define DEFAULT_OUTPUT_VOLUME           90      // default output volume to dac dgc
76 #define DEFAULT_INPUT_VOLUME            20      // default record volume
77
78 #define TSC2101_AUDIO_CODEC_REGISTERS_PAGE2     (2)
79
80 #endif /*OMAPALSATSC2101MIXER_H_*/