Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
[pandora-kernel.git] / drivers / staging / intel_sst / intelmid_snd_control.h
1 #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 /*
32 Mask 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 /*
43 value 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
69 int sst_sc_reg_access(struct sc_reg_access *sc_access,
70                                         int type, int num_val);
71 extern struct snd_pmic_ops snd_pmic_ops_fs;
72 extern struct snd_pmic_ops snd_pmic_ops_mx;
73 extern struct snd_pmic_ops snd_pmic_ops_nc;
74 extern struct snd_pmic_ops snd_msic_ops;
75
76 /* device */
77 enum SND_INPUT_DEVICE {
78         AMIC,
79         DMIC,
80         HS_MIC,
81         IN_UNDEFINED
82 };
83
84 enum SND_OUTPUT_DEVICE {
85         STEREO_HEADPHONE,
86         MONO_EARPIECE,
87
88         INTERNAL_SPKR,
89         RECEIVER,
90         OUT_UNDEFINED
91 };
92
93 enum pmic_controls {
94         PMIC_SND_HP_MIC_MUTE =                  0x0001,
95         PMIC_SND_AMIC_MUTE =                    0x0002,
96         PMIC_SND_DMIC_MUTE =                    0x0003,
97         PMIC_SND_CAPTURE_VOL =                  0x0004,
98 /* Output controls */
99         PMIC_SND_LEFT_PB_VOL =                  0x0010,
100         PMIC_SND_RIGHT_PB_VOL =                 0x0011,
101         PMIC_SND_LEFT_HP_MUTE =                 0x0012,
102         PMIC_SND_RIGHT_HP_MUTE =                0x0013,
103         PMIC_SND_LEFT_SPEAKER_MUTE =            0x0014,
104         PMIC_SND_RIGHT_SPEAKER_MUTE =           0x0015,
105         PMIC_SND_RECEIVER_VOL =                 0x0016,
106         PMIC_SND_RECEIVER_MUTE =                0x0017,
107 /* Other controls */
108         PMIC_SND_MUTE_ALL =                     0x0020,
109         PMIC_MAX_CONTROLS =                     0x0020,
110 };
111
112 #endif /* __INTELMID_SND_CTRL_H__ */
113
114