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 | |
parent | e8fd86efaa09445ca1afc1aea08d4666c966ed03 (diff) | |
parent | 440085598672c0e3fde8a48495f61fea418b06d1 (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/soc-dai.h | 4 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 7 | ||||
-rw-r--r-- | include/sound/soc.h | 59 | ||||
-rw-r--r-- | include/trace/events/asoc.h | 45 |
4 files changed, 108 insertions, 7 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 1bafe95dcf41..5ad5f3a50c68 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -209,6 +209,10 @@ struct snd_soc_dai_driver { | |||
209 | struct snd_soc_pcm_stream capture; | 209 | struct snd_soc_pcm_stream capture; |
210 | struct snd_soc_pcm_stream playback; | 210 | struct snd_soc_pcm_stream playback; |
211 | unsigned int symmetric_rates:1; | 211 | unsigned int symmetric_rates:1; |
212 | |||
213 | /* probe ordering - for components with runtime dependencies */ | ||
214 | int probe_order; | ||
215 | int remove_order; | ||
212 | }; | 216 | }; |
213 | 217 | ||
214 | /* | 218 | /* |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c46e7d89561d..e09505c5a490 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -348,6 +348,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); | |||
348 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); | 348 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); |
349 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, | 349 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, |
350 | const struct snd_soc_dapm_route *route, int num); | 350 | const struct snd_soc_dapm_route *route, int num); |
351 | int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, | ||
352 | const struct snd_soc_dapm_route *route, int num); | ||
351 | 353 | ||
352 | /* dapm events */ | 354 | /* dapm events */ |
353 | int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, | 355 | int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, |
@@ -429,6 +431,7 @@ struct snd_soc_dapm_path { | |||
429 | /* status */ | 431 | /* status */ |
430 | u32 connect:1; /* source and sink widgets are connected */ | 432 | u32 connect:1; /* source and sink widgets are connected */ |
431 | u32 walked:1; /* path has been walked */ | 433 | u32 walked:1; /* path has been walked */ |
434 | u32 weak:1; /* path ignored for power management */ | ||
432 | 435 | ||
433 | int (*connected)(struct snd_soc_dapm_widget *source, | 436 | int (*connected)(struct snd_soc_dapm_widget *source, |
434 | struct snd_soc_dapm_widget *sink); | 437 | struct snd_soc_dapm_widget *sink); |
@@ -444,6 +447,7 @@ struct snd_soc_dapm_widget { | |||
444 | char *name; /* widget name */ | 447 | char *name; /* widget name */ |
445 | char *sname; /* stream name */ | 448 | char *sname; /* stream name */ |
446 | struct snd_soc_codec *codec; | 449 | struct snd_soc_codec *codec; |
450 | struct snd_soc_platform *platform; | ||
447 | struct list_head list; | 451 | struct list_head list; |
448 | struct snd_soc_dapm_context *dapm; | 452 | struct snd_soc_dapm_context *dapm; |
449 | 453 | ||
@@ -507,10 +511,11 @@ struct snd_soc_dapm_context { | |||
507 | 511 | ||
508 | struct device *dev; /* from parent - for debug */ | 512 | struct device *dev; /* from parent - for debug */ |
509 | struct snd_soc_codec *codec; /* parent codec */ | 513 | struct snd_soc_codec *codec; /* parent codec */ |
514 | struct snd_soc_platform *platform; /* parent platform */ | ||
510 | struct snd_soc_card *card; /* parent card */ | 515 | struct snd_soc_card *card; /* parent card */ |
511 | 516 | ||
512 | /* used during DAPM updates */ | 517 | /* used during DAPM updates */ |
513 | int dev_power; | 518 | enum snd_soc_bias_level target_bias_level; |
514 | struct list_head list; | 519 | struct list_head list; |
515 | 520 | ||
516 | #ifdef CONFIG_DEBUG_FS | 521 | #ifdef CONFIG_DEBUG_FS |
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; |
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index ae973d2e27a1..603f5a0f0365 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | struct snd_soc_jack; | 10 | struct snd_soc_jack; |
11 | struct snd_soc_codec; | 11 | struct snd_soc_codec; |
12 | struct snd_soc_platform; | ||
12 | struct snd_soc_card; | 13 | struct snd_soc_card; |
13 | struct snd_soc_dapm_widget; | 14 | struct snd_soc_dapm_widget; |
14 | 15 | ||
@@ -59,6 +60,50 @@ DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | |||
59 | 60 | ||
60 | ); | 61 | ); |
61 | 62 | ||
63 | DECLARE_EVENT_CLASS(snd_soc_preg, | ||
64 | |||
65 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
66 | unsigned int val), | ||
67 | |||
68 | TP_ARGS(platform, reg, val), | ||
69 | |||
70 | TP_STRUCT__entry( | ||
71 | __string( name, platform->name ) | ||
72 | __field( int, id ) | ||
73 | __field( unsigned int, reg ) | ||
74 | __field( unsigned int, val ) | ||
75 | ), | ||
76 | |||
77 | TP_fast_assign( | ||
78 | __assign_str(name, platform->name); | ||
79 | __entry->id = platform->id; | ||
80 | __entry->reg = reg; | ||
81 | __entry->val = val; | ||
82 | ), | ||
83 | |||
84 | TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name), | ||
85 | (int)__entry->id, (unsigned int)__entry->reg, | ||
86 | (unsigned int)__entry->val) | ||
87 | ); | ||
88 | |||
89 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write, | ||
90 | |||
91 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
92 | unsigned int val), | ||
93 | |||
94 | TP_ARGS(platform, reg, val) | ||
95 | |||
96 | ); | ||
97 | |||
98 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read, | ||
99 | |||
100 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
101 | unsigned int val), | ||
102 | |||
103 | TP_ARGS(platform, reg, val) | ||
104 | |||
105 | ); | ||
106 | |||
62 | DECLARE_EVENT_CLASS(snd_soc_card, | 107 | DECLARE_EVENT_CLASS(snd_soc_card, |
63 | 108 | ||
64 | TP_PROTO(struct snd_soc_card *card, int val), | 109 | TP_PROTO(struct snd_soc_card *card, int val), |