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.h59
1 files changed, 53 insertions, 6 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 3a4bd3a3c68..aa19f5a32ba 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 */
216enum snd_soc_bias_level { 226enum 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
223struct snd_jack; 233struct 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
271enum snd_soc_pcm_subclass {
272 SND_SOC_PCM_CLASS_PCM = 0,
273 SND_SOC_PCM_CLASS_BE = 1,
274};
275
261int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, 276int 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);
263int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, 278int 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);
298int snd_soc_default_writable_register(struct snd_soc_codec *codec, 313int snd_soc_default_writable_register(struct snd_soc_codec *codec,
299 unsigned int reg); 314 unsigned int reg);
315int snd_soc_platform_read(struct snd_soc_platform *platform,
316 unsigned int reg);
317int 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 */
302int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 321int 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);
350int snd_soc_add_controls(struct snd_soc_codec *codec, 369int 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);
371int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
372 const struct snd_kcontrol_new *controls, int num_controls);
352int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 373int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
353 struct snd_ctl_elem_info *uinfo); 374 struct snd_ctl_elem_info *uinfo);
354int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, 375int 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
641struct snd_soc_platform { 681struct 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
655struct snd_soc_dai_link { 697struct 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;