aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-09-04 22:39:03 -0400
committerMark Brown <broonie@linaro.org>2013-09-17 08:07:13 -0400
commitd191bd8de8c61619563f2b19f1fdcc0944ff1a72 (patch)
treebc77d6f8573b03f9f2e938d22bc2d6f3ec0b4f86 /include/sound/soc.h
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
ASoC: snd_soc_codec includes snd_soc_component
Codec includes component by this patch, and component moved to upside of codec to avoid extra declaration. Codec dai will be registered via component by this patch. Current component register function is used for cpu, and it is using dai/dais functions properly to keep existing cpu dai name. And now, it will be used from codec also. But codec driver had been used dais function only even though it was single dai. This patch adds new flag which can selects dai/dais function on component register function to keep existing codec dai name. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index d22cb0a06feb..9a81e2e7d661 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -670,6 +670,21 @@ struct snd_soc_cache_ops {
670 int (*sync)(struct snd_soc_codec *codec); 670 int (*sync)(struct snd_soc_codec *codec);
671}; 671};
672 672
673/* component interface */
674struct snd_soc_component_driver {
675 const char *name;
676};
677
678struct snd_soc_component {
679 const char *name;
680 int id;
681 int num_dai;
682 struct device *dev;
683 struct list_head list;
684
685 const struct snd_soc_component_driver *driver;
686};
687
673/* SoC Audio Codec device */ 688/* SoC Audio Codec device */
674struct snd_soc_codec { 689struct snd_soc_codec {
675 const char *name; 690 const char *name;
@@ -715,6 +730,9 @@ struct snd_soc_codec {
715 struct mutex cache_rw_mutex; 730 struct mutex cache_rw_mutex;
716 int val_bytes; 731 int val_bytes;
717 732
733 /* component */
734 struct snd_soc_component component;
735
718 /* dapm */ 736 /* dapm */
719 struct snd_soc_dapm_context dapm; 737 struct snd_soc_dapm_context dapm;
720 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ 738 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
@@ -733,6 +751,7 @@ struct snd_soc_codec_driver {
733 int (*remove)(struct snd_soc_codec *); 751 int (*remove)(struct snd_soc_codec *);
734 int (*suspend)(struct snd_soc_codec *); 752 int (*suspend)(struct snd_soc_codec *);
735 int (*resume)(struct snd_soc_codec *); 753 int (*resume)(struct snd_soc_codec *);
754 struct snd_soc_component_driver component_driver;
736 755
737 /* Default control and setup, added after probe() is run */ 756 /* Default control and setup, added after probe() is run */
738 const struct snd_kcontrol_new *controls; 757 const struct snd_kcontrol_new *controls;
@@ -849,20 +868,6 @@ struct snd_soc_platform {
849#endif 868#endif
850}; 869};
851 870
852struct snd_soc_component_driver {
853 const char *name;
854};
855
856struct snd_soc_component {
857 const char *name;
858 int id;
859 int num_dai;
860 struct device *dev;
861 struct list_head list;
862
863 const struct snd_soc_component_driver *driver;
864};
865
866struct snd_soc_dai_link { 871struct snd_soc_dai_link {
867 /* config - must be set by machine driver */ 872 /* config - must be set by machine driver */
868 const char *name; /* Codec name */ 873 const char *name; /* Codec name */