2 * sound/arm/omap/omap-alsa-tsc2101-mixer.h
4 * Alsa Driver for TSC2101 codec for OMAP platform boards.
6 * Copyright (C) 2005 Mika Laitio <lamikr@cc.jyu.fi> and
7 * Everett Coleman II <gcc80x86@fuzzyneural.net>
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>
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.
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.
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.
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
42 #ifndef OMAPALSATSC2101MIXER_H_
43 #define OMAPALSATSC2101MIXER_H_
45 #include <asm/hardware/tsc2101.h>
46 #include "omap-alsa-dma.h"
48 /* tsc2101 DAC gain control volume specific */
49 #define OUTPUT_VOLUME_MIN 0x7F // 1111111 = -63.5 DB
50 #define OUTPUT_VOLUME_MAX 0x32 // 110010
51 #define OUTPUT_VOLUME_RANGE (OUTPUT_VOLUME_MIN - OUTPUT_VOLUME_MAX)
53 /* use input vol of 75 for 0dB gain */
54 #define INPUT_VOLUME_MIN 0x0
55 #define INPUT_VOLUME_MAX 0x7D
56 #define INPUT_VOLUME_RANGE (INPUT_VOLUME_MAX - INPUT_VOLUME_MIN)
58 #define PLAYBACK_TARGET_COUNT 0x03
59 #define PLAYBACK_TARGET_LOUDSPEAKER 0x00
60 #define PLAYBACK_TARGET_HEADPHONE 0x01
61 #define PLAYBACK_TARGET_CELLPHONE 0x02
63 /* following are used for register 03h Mixer PGA control bits D7-D5 for selecting record source */
64 #define REC_SRC_TARGET_COUNT 0x08
65 #define REC_SRC_SINGLE_ENDED_MICIN_HED 0x00 // oss code referred to MIXER_LINE
66 #define REC_SRC_SINGLE_ENDED_MICIN_HND 0x01 // oss code referred to MIXER_MIC
67 #define REC_SRC_SINGLE_ENDED_AUX1 0x02
68 #define REC_SRC_SINGLE_ENDED_AUX2 0x03
69 #define REC_SRC_MICIN_HED_AND_AUX1 0x04
70 #define REC_SRC_MICIN_HED_AND_AUX2 0x05
71 #define REC_SRC_MICIN_HND_AND_AUX1 0x06
72 #define REC_SRC_MICIN_HND_AND_AUX2 0x07
74 #define DEFAULT_OUTPUT_VOLUME 90 // default output volume to dac dgc
75 #define DEFAULT_INPUT_VOLUME 20 // default record volume
77 #define TSC2101_AUDIO_CODEC_REGISTERS_PAGE2 (2)
79 #endif /*OMAPALSATSC2101MIXER_H_*/