blob: 06ad3a10099cfc3ab832d8a085a1b870c4ae1b0b [file] [log] [blame]
Vinod Koulfffa1cc2010-10-05 16:25:17 +01001#ifndef __INTELMID_SND_CTRL_H__
2#define __INTELMID_SND_CTRL_H__
3/*
4 * intelmid_snd_control.h - Intel Sound card driver for MID
5 *
6 * Copyright (C) 2008-10 Intel Corporation
7 * Authors: Vinod Koul <vinod.koul@intel.com>
8 * Harsha Priya <priya.harsha@intel.com>
9 * Dharageswari R <dharageswari.r@intel.com>
10 * KP Jeeja <jeeja.kp@intel.com>
11 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; version 2 of the License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 *
26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 *
28 * This file defines all snd control functions
29 */
30
31/*
32Mask bits
33*/
34#define MASK0 0x01 /* 0000 0001 */
35#define MASK1 0x02 /* 0000 0010 */
36#define MASK2 0x04 /* 0000 0100 */
37#define MASK3 0x08 /* 0000 1000 */
38#define MASK4 0x10 /* 0001 0000 */
39#define MASK5 0x20 /* 0010 0000 */
40#define MASK6 0x40 /* 0100 0000 */
41#define MASK7 0x80 /* 1000 0000 */
42/*
43value bits
44*/
45#define VALUE0 0x01 /* 0000 0001 */
46#define VALUE1 0x02 /* 0000 0010 */
47#define VALUE2 0x04 /* 0000 0100 */
48#define VALUE3 0x08 /* 0000 1000 */
49#define VALUE4 0x10 /* 0001 0000 */
50#define VALUE5 0x20 /* 0010 0000 */
51#define VALUE6 0x40 /* 0100 0000 */
52#define VALUE7 0x80 /* 1000 0000 */
53
54#define MUTE 0 /* ALSA Passes 0 for mute */
55#define UNMUTE 1 /* ALSA Passes 1 for unmute */
56
57#define MAX_VOL_PMIC_VENDOR0 0x3f /* max vol in dB for stereo & voice DAC */
58#define MIN_VOL_PMIC_VENDOR0 0 /* min vol in dB for stereo & voice DAC */
59/* Head phone volume control */
60#define MAX_HP_VOL_PMIC_VENDOR1 6 /* max volume in dB for HP */
61#define MIN_HP_VOL_PMIC_VENDOR1 (-84) /* min volume in dB for HP */
62#define MAX_HP_VOL_INDX_PMIC_VENDOR1 40 /* Number of HP volume control values */
63
64/* Mono Earpiece Volume control */
65#define MAX_EP_VOL_PMIC_VENDOR1 0 /* max volume in dB for EP */
66#define MIN_EP_VOL_PMIC_VENDOR1 (-75) /* min volume in dB for EP */
67#define MAX_EP_VOL_INDX_PMIC_VENDOR1 32 /* Number of EP volume control values */
68
69int sst_sc_reg_access(struct sc_reg_access *sc_access,
70 int type, int num_val);
71extern struct snd_pmic_ops snd_pmic_ops_fs;
72extern struct snd_pmic_ops snd_pmic_ops_mx;
73extern struct snd_pmic_ops snd_pmic_ops_nc;
74extern struct snd_pmic_ops snd_msic_ops;
75
76/* device */
77enum SND_INPUT_DEVICE {
78 AMIC,
79 DMIC,
80 HS_MIC,
81 IN_UNDEFINED
82};
Dharageswari R5572a442011-05-03 17:32:38 +010083enum SND_LINE_OUT_DEVICE {
84 HEADSET,
85 IHF,
86 VIBRA1,
87 VIBRA2,
88 NONE,
89};
Vinod Koulfffa1cc2010-10-05 16:25:17 +010090
91enum SND_OUTPUT_DEVICE {
92 STEREO_HEADPHONE,
93 MONO_EARPIECE,
94
95 INTERNAL_SPKR,
96 RECEIVER,
97 OUT_UNDEFINED
98};
99
100enum pmic_controls {
101 PMIC_SND_HP_MIC_MUTE = 0x0001,
102 PMIC_SND_AMIC_MUTE = 0x0002,
103 PMIC_SND_DMIC_MUTE = 0x0003,
104 PMIC_SND_CAPTURE_VOL = 0x0004,
105/* Output controls */
106 PMIC_SND_LEFT_PB_VOL = 0x0010,
107 PMIC_SND_RIGHT_PB_VOL = 0x0011,
108 PMIC_SND_LEFT_HP_MUTE = 0x0012,
109 PMIC_SND_RIGHT_HP_MUTE = 0x0013,
110 PMIC_SND_LEFT_SPEAKER_MUTE = 0x0014,
111 PMIC_SND_RIGHT_SPEAKER_MUTE = 0x0015,
112 PMIC_SND_RECEIVER_VOL = 0x0016,
113 PMIC_SND_RECEIVER_MUTE = 0x0017,
Lu Guanqunb8df15b2011-05-03 17:38:18 +0100114 PMIC_SND_LEFT_MASTER_VOL = 0x0018,
115 PMIC_SND_RIGHT_MASTER_VOL = 0x0019,
Vinod Koulfffa1cc2010-10-05 16:25:17 +0100116/* Other controls */
117 PMIC_SND_MUTE_ALL = 0x0020,
118 PMIC_MAX_CONTROLS = 0x0020,
119};
120
121#endif /* __INTELMID_SND_CTRL_H__ */
122
123