diff options
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 0992dff5595..2ebf7877c14 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -185,6 +185,20 @@ | |||
185 | .rreg = xreg_right, .shift = xshift, \ | 185 | .rreg = xreg_right, .shift = xshift, \ |
186 | .min = xmin, .max = xmax} } | 186 | .min = xmin, .max = xmax} } |
187 | 187 | ||
188 | #define SND_SOC_BYTES(xname, xbase, xregs) \ | ||
189 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
190 | .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \ | ||
191 | .put = snd_soc_bytes_put, .private_value = \ | ||
192 | ((unsigned long)&(struct soc_bytes) \ | ||
193 | {.base = xbase, .num_regs = xregs }) } | ||
194 | |||
195 | #define SND_SOC_BYTES_MASK(xname, xbase, xregs, xmask) \ | ||
196 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
197 | .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \ | ||
198 | .put = snd_soc_bytes_put, .private_value = \ | ||
199 | ((unsigned long)&(struct soc_bytes) \ | ||
200 | {.base = xbase, .num_regs = xregs, \ | ||
201 | .mask = xmask }) } | ||
188 | 202 | ||
189 | /* | 203 | /* |
190 | * Simplified versions of above macros, declaring a struct and calculating | 204 | * Simplified versions of above macros, declaring a struct and calculating |
@@ -366,12 +380,16 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | |||
366 | *Controls | 380 | *Controls |
367 | */ | 381 | */ |
368 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | 382 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, |
369 | void *data, char *long_name, | 383 | void *data, const char *long_name, |
370 | const char *prefix); | 384 | const char *prefix); |
371 | int snd_soc_add_controls(struct snd_soc_codec *codec, | 385 | int snd_soc_add_codec_controls(struct snd_soc_codec *codec, |
372 | const struct snd_kcontrol_new *controls, int num_controls); | 386 | const struct snd_kcontrol_new *controls, int num_controls); |
373 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, | 387 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, |
374 | const struct snd_kcontrol_new *controls, int num_controls); | 388 | const struct snd_kcontrol_new *controls, int num_controls); |
389 | int snd_soc_add_card_controls(struct snd_soc_card *soc_card, | ||
390 | const struct snd_kcontrol_new *controls, int num_controls); | ||
391 | int snd_soc_add_dai_controls(struct snd_soc_dai *dai, | ||
392 | const struct snd_kcontrol_new *controls, int num_controls); | ||
375 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | 393 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, |
376 | struct snd_ctl_elem_info *uinfo); | 394 | struct snd_ctl_elem_info *uinfo); |
377 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, | 395 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, |
@@ -409,6 +427,13 @@ int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol, | |||
409 | struct snd_ctl_elem_value *ucontrol); | 427 | struct snd_ctl_elem_value *ucontrol); |
410 | int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, | 428 | int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, |
411 | struct snd_ctl_elem_value *ucontrol); | 429 | struct snd_ctl_elem_value *ucontrol); |
430 | int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, | ||
431 | struct snd_ctl_elem_info *uinfo); | ||
432 | int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, | ||
433 | struct snd_ctl_elem_value *ucontrol); | ||
434 | int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, | ||
435 | struct snd_ctl_elem_value *ucontrol); | ||
436 | |||
412 | 437 | ||
413 | /** | 438 | /** |
414 | * struct snd_soc_reg_access - Describes whether a given register is | 439 | * struct snd_soc_reg_access - Describes whether a given register is |
@@ -505,6 +530,7 @@ struct snd_soc_pcm_stream { | |||
505 | unsigned int rate_max; /* max rate */ | 530 | unsigned int rate_max; /* max rate */ |
506 | unsigned int channels_min; /* min channels */ | 531 | unsigned int channels_min; /* min channels */ |
507 | unsigned int channels_max; /* max channels */ | 532 | unsigned int channels_max; /* max channels */ |
533 | unsigned int sig_bits; /* number of bits of content */ | ||
508 | }; | 534 | }; |
509 | 535 | ||
510 | /* SoC audio ops */ | 536 | /* SoC audio ops */ |
@@ -559,6 +585,7 @@ struct snd_soc_codec { | |||
559 | unsigned int ac97_created:1; /* Codec has been created by SoC */ | 585 | unsigned int ac97_created:1; /* Codec has been created by SoC */ |
560 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ | 586 | unsigned int sysfs_registered:1; /* codec has been sysfs registered */ |
561 | unsigned int cache_init:1; /* codec cache has been initialized */ | 587 | unsigned int cache_init:1; /* codec cache has been initialized */ |
588 | unsigned int using_regmap:1; /* using regmap access */ | ||
562 | u32 cache_only; /* Suppress writes to hardware */ | 589 | u32 cache_only; /* Suppress writes to hardware */ |
563 | u32 cache_sync; /* Cache needs to be synced to hardware */ | 590 | u32 cache_sync; /* Cache needs to be synced to hardware */ |
564 | 591 | ||
@@ -637,6 +664,8 @@ struct snd_soc_codec_driver { | |||
637 | /* codec stream completion event */ | 664 | /* codec stream completion event */ |
638 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | 665 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); |
639 | 666 | ||
667 | bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */ | ||
668 | |||
640 | /* probe ordering - for components with runtime dependencies */ | 669 | /* probe ordering - for components with runtime dependencies */ |
641 | int probe_order; | 670 | int probe_order; |
642 | int remove_order; | 671 | int remove_order; |
@@ -689,6 +718,7 @@ struct snd_soc_platform { | |||
689 | int id; | 718 | int id; |
690 | struct device *dev; | 719 | struct device *dev; |
691 | struct snd_soc_platform_driver *driver; | 720 | struct snd_soc_platform_driver *driver; |
721 | struct mutex mutex; | ||
692 | 722 | ||
693 | unsigned int suspended:1; /* platform is suspended */ | 723 | unsigned int suspended:1; /* platform is suspended */ |
694 | unsigned int probed:1; | 724 | unsigned int probed:1; |
@@ -698,6 +728,11 @@ struct snd_soc_platform { | |||
698 | struct list_head card_list; | 728 | struct list_head card_list; |
699 | 729 | ||
700 | struct snd_soc_dapm_context dapm; | 730 | struct snd_soc_dapm_context dapm; |
731 | |||
732 | #ifdef CONFIG_DEBUG_FS | ||
733 | struct dentry *debugfs_platform_root; | ||
734 | struct dentry *debugfs_dapm; | ||
735 | #endif | ||
701 | }; | 736 | }; |
702 | 737 | ||
703 | struct snd_soc_dai_link { | 738 | struct snd_soc_dai_link { |
@@ -875,6 +910,12 @@ struct soc_mixer_control { | |||
875 | unsigned int reg, rreg, shift, rshift, invert; | 910 | unsigned int reg, rreg, shift, rshift, invert; |
876 | }; | 911 | }; |
877 | 912 | ||
913 | struct soc_bytes { | ||
914 | int base; | ||
915 | int num_regs; | ||
916 | u32 mask; | ||
917 | }; | ||
918 | |||
878 | /* enumerated kcontrol */ | 919 | /* enumerated kcontrol */ |
879 | struct soc_enum { | 920 | struct soc_enum { |
880 | unsigned short reg; | 921 | unsigned short reg; |