diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dapm.h | 19 | ||||
-rw-r--r-- | include/sound/soc.h | 34 |
2 files changed, 49 insertions, 4 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 93a4edb148b5..0accdba211f9 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -76,6 +76,11 @@ | |||
76 | wcontrols, wncontrols)\ | 76 | wcontrols, wncontrols)\ |
77 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 77 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
78 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 78 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} |
79 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ | ||
80 | wcontrols, wncontrols)\ | ||
81 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | ||
82 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | ||
83 | .num_kcontrols = wncontrols} | ||
79 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ | 84 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ |
80 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 85 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ |
81 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0} | 86 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0} |
@@ -101,6 +106,11 @@ | |||
101 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 106 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
102 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 107 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ |
103 | .event = wevent, .event_flags = wflags} | 108 | .event = wevent, .event_flags = wflags} |
109 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ | ||
110 | wcontrols, wncontrols, wevent, wflags) \ | ||
111 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | ||
112 | .invert = winvert, .kcontrols = wcontrols, \ | ||
113 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} | ||
104 | #define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ | 114 | #define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ |
105 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 115 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ |
106 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \ | 116 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \ |
@@ -250,10 +260,10 @@ int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev, | |||
250 | int snd_soc_dapm_sys_add(struct device *dev); | 260 | int snd_soc_dapm_sys_add(struct device *dev); |
251 | 261 | ||
252 | /* dapm audio pin control and status */ | 262 | /* dapm audio pin control and status */ |
253 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin); | 263 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); |
254 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin); | 264 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); |
255 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, char *pin); | 265 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); |
256 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin); | 266 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); |
257 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 267 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); |
258 | 268 | ||
259 | /* dapm widget types */ | 269 | /* dapm widget types */ |
@@ -263,6 +273,7 @@ enum snd_soc_dapm_type { | |||
263 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ | 273 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ |
264 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ | 274 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ |
265 | snd_soc_dapm_mixer, /* mixes several analog signals together */ | 275 | snd_soc_dapm_mixer, /* mixes several analog signals together */ |
276 | snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ | ||
266 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ | 277 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ |
267 | snd_soc_dapm_adc, /* analog to digital converter */ | 278 | snd_soc_dapm_adc, /* analog to digital converter */ |
268 | snd_soc_dapm_dac, /* digital to analog converter */ | 279 | snd_soc_dapm_dac, /* digital to analog converter */ |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 24593ac3ea19..7039343e8a78 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -154,6 +154,8 @@ enum snd_soc_bias_level { | |||
154 | SND_SOC_BIAS_OFF, | 154 | SND_SOC_BIAS_OFF, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct snd_jack; | ||
158 | struct snd_soc_card; | ||
157 | struct snd_soc_device; | 159 | struct snd_soc_device; |
158 | struct snd_soc_pcm_stream; | 160 | struct snd_soc_pcm_stream; |
159 | struct snd_soc_ops; | 161 | struct snd_soc_ops; |
@@ -164,6 +166,8 @@ struct snd_soc_platform; | |||
164 | struct snd_soc_codec; | 166 | struct snd_soc_codec; |
165 | struct soc_enum; | 167 | struct soc_enum; |
166 | struct snd_soc_ac97_ops; | 168 | struct snd_soc_ac97_ops; |
169 | struct snd_soc_jack; | ||
170 | struct snd_soc_jack_pin; | ||
167 | 171 | ||
168 | typedef int (*hw_write_t)(void *,const char* ,int); | 172 | typedef int (*hw_write_t)(void *,const char* ,int); |
169 | typedef int (*hw_read_t)(void *,char* ,int); | 173 | typedef int (*hw_read_t)(void *,char* ,int); |
@@ -184,6 +188,13 @@ int snd_soc_init_card(struct snd_soc_device *socdev); | |||
184 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 188 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
185 | const struct snd_pcm_hardware *hw); | 189 | const struct snd_pcm_hardware *hw); |
186 | 190 | ||
191 | /* Jack reporting */ | ||
192 | int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, | ||
193 | struct snd_soc_jack *jack); | ||
194 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); | ||
195 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, | ||
196 | struct snd_soc_jack_pin *pins); | ||
197 | |||
187 | /* codec IO */ | 198 | /* codec IO */ |
188 | #define snd_soc_read(codec, reg) codec->read(codec, reg) | 199 | #define snd_soc_read(codec, reg) codec->read(codec, reg) |
189 | #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value) | 200 | #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value) |
@@ -203,6 +214,8 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | |||
203 | */ | 214 | */ |
204 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | 215 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, |
205 | void *data, char *long_name); | 216 | void *data, char *long_name); |
217 | int snd_soc_add_controls(struct snd_soc_codec *codec, | ||
218 | const struct snd_kcontrol_new *controls, int num_controls); | ||
206 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | 219 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, |
207 | struct snd_ctl_elem_info *uinfo); | 220 | struct snd_ctl_elem_info *uinfo); |
208 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, | 221 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, |
@@ -237,6 +250,27 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | |||
237 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | 250 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, |
238 | struct snd_ctl_elem_value *ucontrol); | 251 | struct snd_ctl_elem_value *ucontrol); |
239 | 252 | ||
253 | /** | ||
254 | * struct snd_soc_jack_pin - Describes a pin to update based on jack detection | ||
255 | * | ||
256 | * @pin: name of the pin to update | ||
257 | * @mask: bits to check for in reported jack status | ||
258 | * @invert: if non-zero then pin is enabled when status is not reported | ||
259 | */ | ||
260 | struct snd_soc_jack_pin { | ||
261 | struct list_head list; | ||
262 | const char *pin; | ||
263 | int mask; | ||
264 | bool invert; | ||
265 | }; | ||
266 | |||
267 | struct snd_soc_jack { | ||
268 | struct snd_jack *jack; | ||
269 | struct snd_soc_card *card; | ||
270 | struct list_head pins; | ||
271 | int status; | ||
272 | }; | ||
273 | |||
240 | /* SoC PCM stream information */ | 274 | /* SoC PCM stream information */ |
241 | struct snd_soc_pcm_stream { | 275 | struct snd_soc_pcm_stream { |
242 | char *stream_name; | 276 | char *stream_name; |