diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-22 09:28:32 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-22 09:28:32 -0400 |
commit | 436f3562bb34061c578727bfa968f3566ace6ea0 (patch) | |
tree | 41c8759acc418c8fa325177a6e02b94b3a3538aa /include/sound | |
parent | 7c24d7d67b63b5508bd1875cc05dd2f98f9206d4 (diff) | |
parent | 69c2d346e8fa8dbed122e82f727332f35718ab86 (diff) |
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dapm.h | 199 | ||||
-rw-r--r-- | include/sound/soc-dpcm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 29 |
3 files changed, 135 insertions, 95 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 3e479f4e15f5..c728d28ae9a5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -70,121 +70,144 @@ struct device; | |||
70 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 70 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
71 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} | 71 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} |
72 | 72 | ||
73 | #define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \ | ||
74 | .reg = wreg, .mask = 1, .shift = wshift, \ | ||
75 | .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0 | ||
76 | |||
73 | /* path domain */ | 77 | /* path domain */ |
74 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ | 78 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ |
75 | wcontrols, wncontrols) \ | 79 | wcontrols, wncontrols) \ |
76 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 80 | { .id = snd_soc_dapm_pga, .name = wname, \ |
77 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 81 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
82 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
78 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ | 83 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ |
79 | wcontrols, wncontrols) \ | 84 | wcontrols, wncontrols) \ |
80 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 85 | { .id = snd_soc_dapm_out_drv, .name = wname, \ |
81 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 86 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
87 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
82 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ | 88 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ |
83 | wcontrols, wncontrols)\ | 89 | wcontrols, wncontrols)\ |
84 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 90 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
85 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 91 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
92 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
86 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ | 93 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ |
87 | wcontrols, wncontrols)\ | 94 | wcontrols, wncontrols)\ |
88 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 95 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ |
89 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 96 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
90 | .num_kcontrols = wncontrols} | 97 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
91 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ | 98 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ |
92 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 99 | { .id = snd_soc_dapm_micbias, .name = wname, \ |
93 | .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} | 100 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
101 | .kcontrol_news = NULL, .num_kcontrols = 0} | ||
94 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ | 102 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ |
95 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 103 | { .id = snd_soc_dapm_switch, .name = wname, \ |
96 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | ||
97 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
98 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ |
99 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
100 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
101 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
102 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 111 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
112 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | ||
103 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 113 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
104 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 114 | { .id = snd_soc_dapm_value_mux, .name = wname, \ |
105 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 115 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
106 | .num_kcontrols = 1} | 116 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
107 | 117 | ||
108 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 118 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
109 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ | 119 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ |
110 | wcontrols) \ | 120 | wcontrols) \ |
111 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 121 | { .id = snd_soc_dapm_pga, .name = wname, \ |
112 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 122 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
123 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
113 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ | 124 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ |
114 | wcontrols)\ | 125 | wcontrols)\ |
115 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 126 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
116 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 127 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
128 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
117 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ | 129 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ |
118 | wcontrols)\ | 130 | wcontrols)\ |
119 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 131 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ |
120 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 132 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
121 | .num_kcontrols = ARRAY_SIZE(wcontrols)} | 133 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} |
122 | 134 | ||
123 | /* path domain with event - event handler must return 0 for success */ | 135 | /* path domain with event - event handler must return 0 for success */ |
124 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ | 136 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ |
125 | wncontrols, wevent, wflags) \ | 137 | wncontrols, wevent, wflags) \ |
126 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 138 | { .id = snd_soc_dapm_pga, .name = wname, \ |
127 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 139 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
140 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
128 | .event = wevent, .event_flags = wflags} | 141 | .event = wevent, .event_flags = wflags} |
129 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ | 142 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ |
130 | wncontrols, wevent, wflags) \ | 143 | wncontrols, wevent, wflags) \ |
131 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 144 | { .id = snd_soc_dapm_out_drv, .name = wname, \ |
132 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 145 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
146 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
133 | .event = wevent, .event_flags = wflags} | 147 | .event = wevent, .event_flags = wflags} |
134 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ | 148 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ |
135 | wncontrols, wevent, wflags) \ | 149 | wncontrols, wevent, wflags) \ |
136 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 150 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
137 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 151 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
152 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
138 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
139 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ | 154 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ |
140 | wcontrols, wncontrols, wevent, wflags) \ | 155 | wcontrols, wncontrols, wevent, wflags) \ |
141 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 156 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
142 | .invert = winvert, .kcontrol_news = wcontrols, \ | 157 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
158 | .kcontrol_news = wcontrols, \ | ||
143 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} | 159 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} |
144 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ | 160 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ |
145 | wevent, wflags) \ | 161 | wevent, wflags) \ |
146 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 162 | { .id = snd_soc_dapm_switch, .name = wname, \ |
147 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 163 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
164 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
148 | .event = wevent, .event_flags = wflags} | 165 | .event = wevent, .event_flags = wflags} |
149 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 166 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
150 | wevent, wflags) \ | 167 | wevent, wflags) \ |
151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 168 | { .id = snd_soc_dapm_mux, .name = wname, \ |
152 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 169 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
170 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
153 | .event = wevent, .event_flags = wflags} | 171 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 172 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
155 | wevent, wflags) \ | 173 | wevent, wflags) \ |
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 174 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
157 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 175 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
176 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
158 | .event = wevent, .event_flags = wflags} | 177 | .event = wevent, .event_flags = wflags} |
159 | 178 | ||
160 | /* additional sequencing control within an event type */ | 179 | /* additional sequencing control within an event type */ |
161 | #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ | 180 | #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ |
162 | wevent, wflags) \ | 181 | wevent, wflags) \ |
163 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 182 | { .id = snd_soc_dapm_pga, .name = wname, \ |
164 | .invert = winvert, .event = wevent, .event_flags = wflags, \ | 183 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
184 | .event = wevent, .event_flags = wflags, \ | ||
165 | .subseq = wsubseq} | 185 | .subseq = wsubseq} |
166 | #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ | 186 | #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ |
167 | wflags) \ | 187 | wflags) \ |
168 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | 188 | { .id = snd_soc_dapm_supply, .name = wname, \ |
169 | .shift = wshift, .invert = winvert, .event = wevent, \ | 189 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
170 | .event_flags = wflags, .subseq = wsubseq} | 190 | .event = wevent, .event_flags = wflags, .subseq = wsubseq} |
171 | 191 | ||
172 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 192 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
173 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 193 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
174 | wevent, wflags) \ | 194 | wevent, wflags) \ |
175 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 195 | { .id = snd_soc_dapm_pga, .name = wname, \ |
176 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 196 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
197 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
177 | .event = wevent, .event_flags = wflags} | 198 | .event = wevent, .event_flags = wflags} |
178 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 199 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
179 | wevent, wflags) \ | 200 | wevent, wflags) \ |
180 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 201 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
181 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 202 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
203 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
182 | .event = wevent, .event_flags = wflags} | 204 | .event = wevent, .event_flags = wflags} |
183 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ | 205 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ |
184 | wcontrols, wevent, wflags) \ | 206 | wcontrols, wevent, wflags) \ |
185 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 207 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
186 | .invert = winvert, .kcontrol_news = wcontrols, \ | 208 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
187 | .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} | 209 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ |
210 | .event = wevent, .event_flags = wflags} | ||
188 | 211 | ||
189 | /* events that are pre and post DAPM */ | 212 | /* events that are pre and post DAPM */ |
190 | #define SND_SOC_DAPM_PRE(wname, wevent) \ | 213 | #define SND_SOC_DAPM_PRE(wname, wevent) \ |
@@ -199,35 +222,36 @@ struct device; | |||
199 | /* stream domain */ | 222 | /* stream domain */ |
200 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | 223 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ |
201 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | 224 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ |
202 | .reg = wreg, .shift = wshift, .invert = winvert } | 225 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
203 | #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ | 226 | #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ |
204 | wevent, wflags) \ | 227 | wevent, wflags) \ |
205 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | 228 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ |
206 | .reg = wreg, .shift = wshift, .invert = winvert, \ | 229 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
207 | .event = wevent, .event_flags = wflags } | 230 | .event = wevent, .event_flags = wflags } |
208 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | 231 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ |
209 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | 232 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ |
210 | .reg = wreg, .shift = wshift, .invert = winvert } | 233 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
211 | #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ | 234 | #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ |
212 | wevent, wflags) \ | 235 | wevent, wflags) \ |
213 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | 236 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ |
214 | .reg = wreg, .shift = wshift, .invert = winvert, \ | 237 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
215 | .event = wevent, .event_flags = wflags } | 238 | .event = wevent, .event_flags = wflags } |
216 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 239 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
217 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 240 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ |
218 | .shift = wshift, .invert = winvert} | 241 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) } |
219 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ | 242 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ |
220 | wevent, wflags) \ | 243 | wevent, wflags) \ |
221 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 244 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ |
222 | .shift = wshift, .invert = winvert, \ | 245 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
223 | .event = wevent, .event_flags = wflags} | 246 | .event = wevent, .event_flags = wflags} |
247 | |||
224 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ | 248 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ |
225 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 249 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ |
226 | .shift = wshift, .invert = winvert} | 250 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
227 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ | 251 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ |
228 | wevent, wflags) \ | 252 | wevent, wflags) \ |
229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 253 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ |
230 | .shift = wshift, .invert = winvert, \ | 254 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
231 | .event = wevent, .event_flags = wflags} | 255 | .event = wevent, .event_flags = wflags} |
232 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ | 256 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ |
233 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ | 257 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ |
@@ -241,14 +265,14 @@ struct device; | |||
241 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 265 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
242 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 266 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
243 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ | 267 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ |
244 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | 268 | { .id = snd_soc_dapm_supply, .name = wname, \ |
245 | .shift = wshift, .invert = winvert, .event = wevent, \ | 269 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
246 | .event_flags = wflags} | 270 | .event = wevent, .event_flags = wflags} |
247 | #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ | 271 | #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ |
248 | { .id = snd_soc_dapm_regulator_supply, .name = wname, \ | 272 | { .id = snd_soc_dapm_regulator_supply, .name = wname, \ |
249 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ | 273 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ |
250 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ | 274 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ |
251 | .invert = wflags} | 275 | .on_val = wflags} |
252 | 276 | ||
253 | 277 | ||
254 | /* dapm kcontrol types */ | 278 | /* dapm kcontrol types */ |
@@ -256,14 +280,26 @@ struct device; | |||
256 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 280 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
257 | .info = snd_soc_info_volsw, \ | 281 | .info = snd_soc_info_volsw, \ |
258 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 282 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
259 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 283 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
284 | #define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \ | ||
285 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
286 | .info = snd_soc_info_volsw, \ | ||
287 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
288 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } | ||
260 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 289 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
261 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 290 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
262 | .info = snd_soc_info_volsw, \ | 291 | .info = snd_soc_info_volsw, \ |
263 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 292 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
264 | .tlv.p = (tlv_array), \ | 293 | .tlv.p = (tlv_array), \ |
265 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 294 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
266 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 295 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
296 | #define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \ | ||
297 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
298 | .info = snd_soc_info_volsw, \ | ||
299 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
300 | .tlv.p = (tlv_array), \ | ||
301 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
302 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } | ||
267 | #define SOC_DAPM_ENUM(xname, xenum) \ | 303 | #define SOC_DAPM_ENUM(xname, xenum) \ |
268 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 304 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
269 | .info = snd_soc_info_enum_double, \ | 305 | .info = snd_soc_info_enum_double, \ |
@@ -333,6 +369,7 @@ struct snd_soc_dapm_route; | |||
333 | struct snd_soc_dapm_context; | 369 | struct snd_soc_dapm_context; |
334 | struct regulator; | 370 | struct regulator; |
335 | struct snd_soc_dapm_widget_list; | 371 | struct snd_soc_dapm_widget_list; |
372 | struct snd_soc_dapm_update; | ||
336 | 373 | ||
337 | int dapm_reg_event(struct snd_soc_dapm_widget *w, | 374 | int dapm_reg_event(struct snd_soc_dapm_widget *w, |
338 | struct snd_kcontrol *kcontrol, int event); | 375 | struct snd_kcontrol *kcontrol, int event); |
@@ -391,10 +428,12 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, | |||
391 | void snd_soc_dapm_shutdown(struct snd_soc_card *card); | 428 | void snd_soc_dapm_shutdown(struct snd_soc_card *card); |
392 | 429 | ||
393 | /* external DAPM widget events */ | 430 | /* external DAPM widget events */ |
394 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | 431 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, |
395 | struct snd_kcontrol *kcontrol, int connect); | 432 | struct snd_kcontrol *kcontrol, int connect, |
396 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | 433 | struct snd_soc_dapm_update *update); |
397 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e); | 434 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, |
435 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e, | ||
436 | struct snd_soc_dapm_update *update); | ||
398 | 437 | ||
399 | /* dapm sys fs - used by the core */ | 438 | /* dapm sys fs - used by the core */ |
400 | int snd_soc_dapm_sys_add(struct device *dev); | 439 | int snd_soc_dapm_sys_add(struct device *dev); |
@@ -424,6 +463,8 @@ void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); | |||
424 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, | 463 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, |
425 | struct snd_soc_dapm_widget_list **list); | 464 | struct snd_soc_dapm_widget_list **list); |
426 | 465 | ||
466 | struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol); | ||
467 | |||
427 | /* dapm widget types */ | 468 | /* dapm widget types */ |
428 | enum snd_soc_dapm_type { | 469 | enum snd_soc_dapm_type { |
429 | snd_soc_dapm_input = 0, /* input pin */ | 470 | snd_soc_dapm_input = 0, /* input pin */ |
@@ -455,6 +496,7 @@ enum snd_soc_dapm_type { | |||
455 | snd_soc_dapm_dai_in, /* link to DAI structure */ | 496 | snd_soc_dapm_dai_in, /* link to DAI structure */ |
456 | snd_soc_dapm_dai_out, | 497 | snd_soc_dapm_dai_out, |
457 | snd_soc_dapm_dai_link, /* link between two DAI structures */ | 498 | snd_soc_dapm_dai_link, /* link between two DAI structures */ |
499 | snd_soc_dapm_kcontrol, /* Auto-disabled kcontrol */ | ||
458 | }; | 500 | }; |
459 | 501 | ||
460 | enum snd_soc_dapm_subclass { | 502 | enum snd_soc_dapm_subclass { |
@@ -485,7 +527,6 @@ struct snd_soc_dapm_path { | |||
485 | /* source (input) and sink (output) widgets */ | 527 | /* source (input) and sink (output) widgets */ |
486 | struct snd_soc_dapm_widget *source; | 528 | struct snd_soc_dapm_widget *source; |
487 | struct snd_soc_dapm_widget *sink; | 529 | struct snd_soc_dapm_widget *sink; |
488 | struct snd_kcontrol *kcontrol; | ||
489 | 530 | ||
490 | /* status */ | 531 | /* status */ |
491 | u32 connect:1; /* source and sink widgets are connected */ | 532 | u32 connect:1; /* source and sink widgets are connected */ |
@@ -498,6 +539,7 @@ struct snd_soc_dapm_path { | |||
498 | 539 | ||
499 | struct list_head list_source; | 540 | struct list_head list_source; |
500 | struct list_head list_sink; | 541 | struct list_head list_sink; |
542 | struct list_head list_kcontrol; | ||
501 | struct list_head list; | 543 | struct list_head list; |
502 | }; | 544 | }; |
503 | 545 | ||
@@ -518,12 +560,10 @@ struct snd_soc_dapm_widget { | |||
518 | /* dapm control */ | 560 | /* dapm control */ |
519 | int reg; /* negative reg = no direct dapm */ | 561 | int reg; /* negative reg = no direct dapm */ |
520 | unsigned char shift; /* bits to shift */ | 562 | unsigned char shift; /* bits to shift */ |
521 | unsigned int value; /* widget current value */ | ||
522 | unsigned int mask; /* non-shifted mask */ | 563 | unsigned int mask; /* non-shifted mask */ |
523 | unsigned int on_val; /* on state value */ | 564 | unsigned int on_val; /* on state value */ |
524 | unsigned int off_val; /* off state value */ | 565 | unsigned int off_val; /* off state value */ |
525 | unsigned char power:1; /* block power status */ | 566 | unsigned char power:1; /* block power status */ |
526 | unsigned char invert:1; /* invert the power bit */ | ||
527 | unsigned char active:1; /* active stream on DAC, ADC's */ | 567 | unsigned char active:1; /* active stream on DAC, ADC's */ |
528 | unsigned char connected:1; /* connected codec pin */ | 568 | unsigned char connected:1; /* connected codec pin */ |
529 | unsigned char new:1; /* cnew complete */ | 569 | unsigned char new:1; /* cnew complete */ |
@@ -559,7 +599,6 @@ struct snd_soc_dapm_widget { | |||
559 | }; | 599 | }; |
560 | 600 | ||
561 | struct snd_soc_dapm_update { | 601 | struct snd_soc_dapm_update { |
562 | struct snd_soc_dapm_widget *widget; | ||
563 | struct snd_kcontrol *kcontrol; | 602 | struct snd_kcontrol *kcontrol; |
564 | int reg; | 603 | int reg; |
565 | int mask; | 604 | int mask; |
@@ -573,8 +612,6 @@ struct snd_soc_dapm_context { | |||
573 | struct delayed_work delayed_work; | 612 | struct delayed_work delayed_work; |
574 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | 613 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ |
575 | 614 | ||
576 | struct snd_soc_dapm_update *update; | ||
577 | |||
578 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 615 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
579 | enum snd_soc_dapm_type, int); | 616 | enum snd_soc_dapm_type, int); |
580 | 617 | ||
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 04598f1efd77..047d657c331c 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h | |||
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream, | |||
133 | /* internal use only */ | 133 | /* internal use only */ |
134 | int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); | 134 | int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); |
135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); | 135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); |
136 | int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *); | 136 | int soc_dpcm_runtime_update(struct snd_soc_card *); |
137 | 137 | ||
138 | #endif | 138 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 85a19effe813..8e2ad52078b6 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -30,13 +30,13 @@ | |||
30 | /* | 30 | /* |
31 | * Convenience kcontrol builders | 31 | * Convenience kcontrol builders |
32 | */ | 32 | */ |
33 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ | 33 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert, xautodisable) \ |
34 | ((unsigned long)&(struct soc_mixer_control) \ | 34 | ((unsigned long)&(struct soc_mixer_control) \ |
35 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ | 35 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
36 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ | 36 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
37 | .invert = xinvert}) | 37 | .invert = xinvert, .autodisable = xautodisable}) |
38 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 38 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ |
39 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) | 39 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable) |
40 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 40 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
41 | ((unsigned long)&(struct soc_mixer_control) \ | 41 | ((unsigned long)&(struct soc_mixer_control) \ |
42 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 42 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
@@ -52,7 +52,7 @@ | |||
52 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 52 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
53 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 53 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
54 | .put = snd_soc_put_volsw, \ | 54 | .put = snd_soc_put_volsw, \ |
55 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 55 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
56 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ | 56 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ |
57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
58 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ | 58 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ |
@@ -68,7 +68,7 @@ | |||
68 | .tlv.p = (tlv_array), \ | 68 | .tlv.p = (tlv_array), \ |
69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
70 | .put = snd_soc_put_volsw, \ | 70 | .put = snd_soc_put_volsw, \ |
71 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 71 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
72 | #define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ | 72 | #define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ |
73 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 73 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
74 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 74 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -97,7 +97,7 @@ | |||
97 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 97 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
98 | .put = snd_soc_put_volsw, \ | 98 | .put = snd_soc_put_volsw, \ |
99 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | 99 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
100 | max, invert) } | 100 | max, invert, 0) } |
101 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 101 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
102 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 102 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
103 | .info = snd_soc_info_volsw, \ | 103 | .info = snd_soc_info_volsw, \ |
@@ -119,7 +119,7 @@ | |||
119 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 119 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
120 | .put = snd_soc_put_volsw, \ | 120 | .put = snd_soc_put_volsw, \ |
121 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | 121 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
122 | max, invert) } | 122 | max, invert, 0) } |
123 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 123 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
124 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 124 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
125 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 125 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
@@ -190,14 +190,14 @@ | |||
190 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 190 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
191 | .info = snd_soc_info_volsw, \ | 191 | .info = snd_soc_info_volsw, \ |
192 | .get = xhandler_get, .put = xhandler_put, \ | 192 | .get = xhandler_get, .put = xhandler_put, \ |
193 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 193 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) } |
194 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ | 194 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ |
195 | xhandler_get, xhandler_put) \ | 195 | xhandler_get, xhandler_put) \ |
196 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 196 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
197 | .info = snd_soc_info_volsw, \ | 197 | .info = snd_soc_info_volsw, \ |
198 | .get = xhandler_get, .put = xhandler_put, \ | 198 | .get = xhandler_get, .put = xhandler_put, \ |
199 | .private_value = \ | 199 | .private_value = \ |
200 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } | 200 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert, 0) } |
201 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 201 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
202 | xhandler_get, xhandler_put, tlv_array) \ | 202 | xhandler_get, xhandler_put, tlv_array) \ |
203 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 203 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -206,7 +206,7 @@ | |||
206 | .tlv.p = (tlv_array), \ | 206 | .tlv.p = (tlv_array), \ |
207 | .info = snd_soc_info_volsw, \ | 207 | .info = snd_soc_info_volsw, \ |
208 | .get = xhandler_get, .put = xhandler_put, \ | 208 | .get = xhandler_get, .put = xhandler_put, \ |
209 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 209 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) } |
210 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | 210 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ |
211 | xhandler_get, xhandler_put, tlv_array) \ | 211 | xhandler_get, xhandler_put, tlv_array) \ |
212 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 212 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
@@ -216,7 +216,7 @@ | |||
216 | .info = snd_soc_info_volsw, \ | 216 | .info = snd_soc_info_volsw, \ |
217 | .get = xhandler_get, .put = xhandler_put, \ | 217 | .get = xhandler_get, .put = xhandler_put, \ |
218 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ | 218 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ |
219 | xmax, xinvert) } | 219 | xmax, xinvert, 0) } |
220 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 220 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
221 | xhandler_get, xhandler_put, tlv_array) \ | 221 | xhandler_get, xhandler_put, tlv_array) \ |
222 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 222 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
@@ -1042,6 +1042,7 @@ struct snd_soc_card { | |||
1042 | /* Generic DAPM context for the card */ | 1042 | /* Generic DAPM context for the card */ |
1043 | struct snd_soc_dapm_context dapm; | 1043 | struct snd_soc_dapm_context dapm; |
1044 | struct snd_soc_dapm_stats dapm_stats; | 1044 | struct snd_soc_dapm_stats dapm_stats; |
1045 | struct snd_soc_dapm_update *update; | ||
1045 | 1046 | ||
1046 | #ifdef CONFIG_DEBUG_FS | 1047 | #ifdef CONFIG_DEBUG_FS |
1047 | struct dentry *debugfs_card_root; | 1048 | struct dentry *debugfs_card_root; |
@@ -1087,7 +1088,9 @@ struct snd_soc_pcm_runtime { | |||
1087 | /* mixer control */ | 1088 | /* mixer control */ |
1088 | struct soc_mixer_control { | 1089 | struct soc_mixer_control { |
1089 | int min, max, platform_max; | 1090 | int min, max, platform_max; |
1090 | unsigned int reg, rreg, shift, rshift, invert; | 1091 | unsigned int reg, rreg, shift, rshift; |
1092 | unsigned int invert:1; | ||
1093 | unsigned int autodisable:1; | ||
1091 | }; | 1094 | }; |
1092 | 1095 | ||
1093 | struct soc_bytes { | 1096 | struct soc_bytes { |