aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h34
1 files changed, 34 insertions, 0 deletions
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
157struct snd_jack;
158struct snd_soc_card;
157struct snd_soc_device; 159struct snd_soc_device;
158struct snd_soc_pcm_stream; 160struct snd_soc_pcm_stream;
159struct snd_soc_ops; 161struct snd_soc_ops;
@@ -164,6 +166,8 @@ struct snd_soc_platform;
164struct snd_soc_codec; 166struct snd_soc_codec;
165struct soc_enum; 167struct soc_enum;
166struct snd_soc_ac97_ops; 168struct snd_soc_ac97_ops;
169struct snd_soc_jack;
170struct snd_soc_jack_pin;
167 171
168typedef int (*hw_write_t)(void *,const char* ,int); 172typedef int (*hw_write_t)(void *,const char* ,int);
169typedef int (*hw_read_t)(void *,char* ,int); 173typedef int (*hw_read_t)(void *,char* ,int);
@@ -184,6 +188,13 @@ int snd_soc_init_card(struct snd_soc_device *socdev);
184int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, 188int 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 */
192int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type,
193 struct snd_soc_jack *jack);
194void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
195int 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 */
204struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 215struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
205 void *data, char *long_name); 216 void *data, char *long_name);
217int snd_soc_add_controls(struct snd_soc_codec *codec,
218 const struct snd_kcontrol_new *controls, int num_controls);
206int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 219int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
207 struct snd_ctl_elem_info *uinfo); 220 struct snd_ctl_elem_info *uinfo);
208int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, 221int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -237,6 +250,27 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
237int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, 250int 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 */
260struct snd_soc_jack_pin {
261 struct list_head list;
262 const char *pin;
263 int mask;
264 bool invert;
265};
266
267struct 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 */
241struct snd_soc_pcm_stream { 275struct snd_soc_pcm_stream {
242 char *stream_name; 276 char *stream_name;