diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-22 02:43:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-22 02:43:19 -0400 |
commit | 13b137ef0367237909bb2dc38babfb8305154676 (patch) | |
tree | a5d756fcc6603da970ef8c5e263244c6166a2fba /include/sound/soc.h | |
parent | e8fd86efaa09445ca1afc1aea08d4666c966ed03 (diff) | |
parent | 440085598672c0e3fde8a48495f61fea418b06d1 (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 3a4bd3a3c68d..aa19f5a32ba8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -203,6 +203,16 @@ | |||
203 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) | 203 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) |
204 | 204 | ||
205 | /* | 205 | /* |
206 | * Component probe and remove ordering levels for components with runtime | ||
207 | * dependencies. | ||
208 | */ | ||
209 | #define SND_SOC_COMP_ORDER_FIRST -2 | ||
210 | #define SND_SOC_COMP_ORDER_EARLY -1 | ||
211 | #define SND_SOC_COMP_ORDER_NORMAL 0 | ||
212 | #define SND_SOC_COMP_ORDER_LATE 1 | ||
213 | #define SND_SOC_COMP_ORDER_LAST 2 | ||
214 | |||
215 | /* | ||
206 | * Bias levels | 216 | * Bias levels |
207 | * | 217 | * |
208 | * @ON: Bias is fully on for audio playback and capture operations. | 218 | * @ON: Bias is fully on for audio playback and capture operations. |
@@ -214,10 +224,10 @@ | |||
214 | * @OFF: Power Off. No restrictions on transition times. | 224 | * @OFF: Power Off. No restrictions on transition times. |
215 | */ | 225 | */ |
216 | enum snd_soc_bias_level { | 226 | enum snd_soc_bias_level { |
217 | SND_SOC_BIAS_OFF, | 227 | SND_SOC_BIAS_OFF = 0, |
218 | SND_SOC_BIAS_STANDBY, | 228 | SND_SOC_BIAS_STANDBY = 1, |
219 | SND_SOC_BIAS_PREPARE, | 229 | SND_SOC_BIAS_PREPARE = 2, |
220 | SND_SOC_BIAS_ON, | 230 | SND_SOC_BIAS_ON = 3, |
221 | }; | 231 | }; |
222 | 232 | ||
223 | struct snd_jack; | 233 | struct snd_jack; |
@@ -258,6 +268,11 @@ enum snd_soc_compress_type { | |||
258 | SND_SOC_RBTREE_COMPRESSION | 268 | SND_SOC_RBTREE_COMPRESSION |
259 | }; | 269 | }; |
260 | 270 | ||
271 | enum snd_soc_pcm_subclass { | ||
272 | SND_SOC_PCM_CLASS_PCM = 0, | ||
273 | SND_SOC_PCM_CLASS_BE = 1, | ||
274 | }; | ||
275 | |||
261 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, | 276 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, |
262 | unsigned int freq, int dir); | 277 | unsigned int freq, int dir); |
263 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, | 278 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, |
@@ -297,6 +312,10 @@ int snd_soc_default_readable_register(struct snd_soc_codec *codec, | |||
297 | unsigned int reg); | 312 | unsigned int reg); |
298 | int snd_soc_default_writable_register(struct snd_soc_codec *codec, | 313 | int snd_soc_default_writable_register(struct snd_soc_codec *codec, |
299 | unsigned int reg); | 314 | unsigned int reg); |
315 | int snd_soc_platform_read(struct snd_soc_platform *platform, | ||
316 | unsigned int reg); | ||
317 | int snd_soc_platform_write(struct snd_soc_platform *platform, | ||
318 | unsigned int reg, unsigned int val); | ||
300 | 319 | ||
301 | /* Utility functions to get clock rates from various things */ | 320 | /* Utility functions to get clock rates from various things */ |
302 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 321 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -349,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | |||
349 | const char *prefix); | 368 | const char *prefix); |
350 | int snd_soc_add_controls(struct snd_soc_codec *codec, | 369 | int snd_soc_add_controls(struct snd_soc_codec *codec, |
351 | const struct snd_kcontrol_new *controls, int num_controls); | 370 | const struct snd_kcontrol_new *controls, int num_controls); |
371 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, | ||
372 | const struct snd_kcontrol_new *controls, int num_controls); | ||
352 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | 373 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, |
353 | struct snd_ctl_elem_info *uinfo); | 374 | struct snd_ctl_elem_info *uinfo); |
354 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, | 375 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, |
@@ -612,6 +633,10 @@ struct snd_soc_codec_driver { | |||
612 | 633 | ||
613 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 634 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
614 | enum snd_soc_dapm_type, int); | 635 | enum snd_soc_dapm_type, int); |
636 | |||
637 | /* probe ordering - for components with runtime dependencies */ | ||
638 | int probe_order; | ||
639 | int remove_order; | ||
615 | }; | 640 | }; |
616 | 641 | ||
617 | /* SoC platform interface */ | 642 | /* SoC platform interface */ |
@@ -623,10 +648,17 @@ struct snd_soc_platform_driver { | |||
623 | int (*resume)(struct snd_soc_dai *dai); | 648 | int (*resume)(struct snd_soc_dai *dai); |
624 | 649 | ||
625 | /* pcm creation and destruction */ | 650 | /* pcm creation and destruction */ |
626 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 651 | int (*pcm_new)(struct snd_soc_pcm_runtime *); |
627 | struct snd_pcm *); | ||
628 | void (*pcm_free)(struct snd_pcm *); | 652 | void (*pcm_free)(struct snd_pcm *); |
629 | 653 | ||
654 | /* Default control and setup, added after probe() is run */ | ||
655 | const struct snd_kcontrol_new *controls; | ||
656 | int num_controls; | ||
657 | const struct snd_soc_dapm_widget *dapm_widgets; | ||
658 | int num_dapm_widgets; | ||
659 | const struct snd_soc_dapm_route *dapm_routes; | ||
660 | int num_dapm_routes; | ||
661 | |||
630 | /* | 662 | /* |
631 | * For platform caused delay reporting. | 663 | * For platform caused delay reporting. |
632 | * Optional. | 664 | * Optional. |
@@ -636,6 +668,14 @@ struct snd_soc_platform_driver { | |||
636 | 668 | ||
637 | /* platform stream ops */ | 669 | /* platform stream ops */ |
638 | struct snd_pcm_ops *ops; | 670 | struct snd_pcm_ops *ops; |
671 | |||
672 | /* probe ordering - for components with runtime dependencies */ | ||
673 | int probe_order; | ||
674 | int remove_order; | ||
675 | |||
676 | /* platform IO - used for platform DAPM */ | ||
677 | unsigned int (*read)(struct snd_soc_platform *, unsigned int); | ||
678 | int (*write)(struct snd_soc_platform *, unsigned int, unsigned int); | ||
639 | }; | 679 | }; |
640 | 680 | ||
641 | struct snd_soc_platform { | 681 | struct snd_soc_platform { |
@@ -650,6 +690,8 @@ struct snd_soc_platform { | |||
650 | struct snd_soc_card *card; | 690 | struct snd_soc_card *card; |
651 | struct list_head list; | 691 | struct list_head list; |
652 | struct list_head card_list; | 692 | struct list_head card_list; |
693 | |||
694 | struct snd_soc_dapm_context dapm; | ||
653 | }; | 695 | }; |
654 | 696 | ||
655 | struct snd_soc_dai_link { | 697 | struct snd_soc_dai_link { |
@@ -725,8 +767,10 @@ struct snd_soc_card { | |||
725 | 767 | ||
726 | /* callbacks */ | 768 | /* callbacks */ |
727 | int (*set_bias_level)(struct snd_soc_card *, | 769 | int (*set_bias_level)(struct snd_soc_card *, |
770 | struct snd_soc_dapm_context *dapm, | ||
728 | enum snd_soc_bias_level level); | 771 | enum snd_soc_bias_level level); |
729 | int (*set_bias_level_post)(struct snd_soc_card *, | 772 | int (*set_bias_level_post)(struct snd_soc_card *, |
773 | struct snd_soc_dapm_context *dapm, | ||
730 | enum snd_soc_bias_level level); | 774 | enum snd_soc_bias_level level); |
731 | 775 | ||
732 | long pmdown_time; | 776 | long pmdown_time; |
@@ -789,6 +833,9 @@ struct snd_soc_pcm_runtime { | |||
789 | struct device dev; | 833 | struct device dev; |
790 | struct snd_soc_card *card; | 834 | struct snd_soc_card *card; |
791 | struct snd_soc_dai_link *dai_link; | 835 | struct snd_soc_dai_link *dai_link; |
836 | struct mutex pcm_mutex; | ||
837 | enum snd_soc_pcm_subclass pcm_subclass; | ||
838 | struct snd_pcm_ops ops; | ||
792 | 839 | ||
793 | unsigned int complete:1; | 840 | unsigned int complete:1; |
794 | unsigned int dev_registered:1; | 841 | unsigned int dev_registered:1; |