aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/sound/soc.h94
2 files changed, 59 insertions, 36 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index aac04ff84eea..d60c61b4b341 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -593,7 +593,6 @@ struct snd_soc_dapm_context {
593 593
594 struct device *dev; /* from parent - for debug */ 594 struct device *dev; /* from parent - for debug */
595 struct snd_soc_component *component; /* parent component */ 595 struct snd_soc_component *component; /* parent component */
596 struct snd_soc_codec *codec; /* parent codec */
597 struct snd_soc_card *card; /* parent card */ 596 struct snd_soc_card *card; /* parent card */
598 597
599 /* used during DAPM updates */ 598 /* used during DAPM updates */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index c83a334dd00f..f1366ebca9c5 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -690,6 +690,17 @@ struct snd_soc_compr_ops {
690struct snd_soc_component_driver { 690struct snd_soc_component_driver {
691 const char *name; 691 const char *name;
692 692
693 /* Default control and setup, added after probe() is run */
694 const struct snd_kcontrol_new *controls;
695 unsigned int num_controls;
696 const struct snd_soc_dapm_widget *dapm_widgets;
697 unsigned int num_dapm_widgets;
698 const struct snd_soc_dapm_route *dapm_routes;
699 unsigned int num_dapm_routes;
700
701 int (*probe)(struct snd_soc_component *);
702 void (*remove)(struct snd_soc_component *);
703
693 /* DT */ 704 /* DT */
694 int (*of_xlate_dai_name)(struct snd_soc_component *component, 705 int (*of_xlate_dai_name)(struct snd_soc_component *component,
695 struct of_phandle_args *args, 706 struct of_phandle_args *args,
@@ -697,6 +708,10 @@ struct snd_soc_component_driver {
697 void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type, 708 void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type,
698 int subseq); 709 int subseq);
699 int (*stream_event)(struct snd_soc_component *, int event); 710 int (*stream_event)(struct snd_soc_component *, int event);
711
712 /* probe ordering - for components with runtime dependencies */
713 int probe_order;
714 int remove_order;
700}; 715};
701 716
702struct snd_soc_component { 717struct snd_soc_component {
@@ -710,6 +725,7 @@ struct snd_soc_component {
710 725
711 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ 726 unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
712 unsigned int registered_as_component:1; 727 unsigned int registered_as_component:1;
728 unsigned int probed:1;
713 729
714 struct list_head list; 730 struct list_head list;
715 731
@@ -728,9 +744,35 @@ struct snd_soc_component {
728 744
729 struct mutex io_mutex; 745 struct mutex io_mutex;
730 746
747#ifdef CONFIG_DEBUG_FS
748 struct dentry *debugfs_root;
749#endif
750
751 /*
752 * DO NOT use any of the fields below in drivers, they are temporary and
753 * are going to be removed again soon. If you use them in driver code the
754 * driver will be marked as BROKEN when these fields are removed.
755 */
756
731 /* Don't use these, use snd_soc_component_get_dapm() */ 757 /* Don't use these, use snd_soc_component_get_dapm() */
732 struct snd_soc_dapm_context dapm; 758 struct snd_soc_dapm_context dapm;
733 struct snd_soc_dapm_context *dapm_ptr; 759 struct snd_soc_dapm_context *dapm_ptr;
760
761 const struct snd_kcontrol_new *controls;
762 unsigned int num_controls;
763 const struct snd_soc_dapm_widget *dapm_widgets;
764 unsigned int num_dapm_widgets;
765 const struct snd_soc_dapm_route *dapm_routes;
766 unsigned int num_dapm_routes;
767 struct snd_soc_codec *codec;
768
769 int (*probe)(struct snd_soc_component *);
770 void (*remove)(struct snd_soc_component *);
771
772#ifdef CONFIG_DEBUG_FS
773 void (*init_debugfs)(struct snd_soc_component *component);
774 const char *debugfs_prefix;
775#endif
734}; 776};
735 777
736/* SoC Audio Codec device */ 778/* SoC Audio Codec device */
@@ -746,11 +788,9 @@ struct snd_soc_codec {
746 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 788 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
747 unsigned int cache_bypass:1; /* Suppress access to the cache */ 789 unsigned int cache_bypass:1; /* Suppress access to the cache */
748 unsigned int suspended:1; /* Codec is in suspend PM state */ 790 unsigned int suspended:1; /* Codec is in suspend PM state */
749 unsigned int probed:1; /* Codec has been probed */
750 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 791 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
751 unsigned int ac97_created:1; /* Codec has been created by SoC */ 792 unsigned int ac97_created:1; /* Codec has been created by SoC */
752 unsigned int cache_init:1; /* codec cache has been initialized */ 793 unsigned int cache_init:1; /* codec cache has been initialized */
753 u32 cache_only; /* Suppress writes to hardware */
754 u32 cache_sync; /* Cache needs to be synced to hardware */ 794 u32 cache_sync; /* Cache needs to be synced to hardware */
755 795
756 /* codec IO */ 796 /* codec IO */
@@ -766,7 +806,6 @@ struct snd_soc_codec {
766 struct snd_soc_dapm_context dapm; 806 struct snd_soc_dapm_context dapm;
767 807
768#ifdef CONFIG_DEBUG_FS 808#ifdef CONFIG_DEBUG_FS
769 struct dentry *debugfs_codec_root;
770 struct dentry *debugfs_reg; 809 struct dentry *debugfs_reg;
771#endif 810#endif
772}; 811};
@@ -813,10 +852,6 @@ struct snd_soc_codec_driver {
813 enum snd_soc_dapm_type, int); 852 enum snd_soc_dapm_type, int);
814 853
815 bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */ 854 bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */
816
817 /* probe ordering - for components with runtime dependencies */
818 int probe_order;
819 int remove_order;
820}; 855};
821 856
822/* SoC platform interface */ 857/* SoC platform interface */
@@ -832,14 +867,6 @@ struct snd_soc_platform_driver {
832 int (*pcm_new)(struct snd_soc_pcm_runtime *); 867 int (*pcm_new)(struct snd_soc_pcm_runtime *);
833 void (*pcm_free)(struct snd_pcm *); 868 void (*pcm_free)(struct snd_pcm *);
834 869
835 /* Default control and setup, added after probe() is run */
836 const struct snd_kcontrol_new *controls;
837 int num_controls;
838 const struct snd_soc_dapm_widget *dapm_widgets;
839 int num_dapm_widgets;
840 const struct snd_soc_dapm_route *dapm_routes;
841 int num_dapm_routes;
842
843 /* 870 /*
844 * For platform caused delay reporting. 871 * For platform caused delay reporting.
845 * Optional. 872 * Optional.
@@ -853,13 +880,6 @@ struct snd_soc_platform_driver {
853 /* platform stream compress ops */ 880 /* platform stream compress ops */
854 const struct snd_compr_ops *compr_ops; 881 const struct snd_compr_ops *compr_ops;
855 882
856 /* probe ordering - for components with runtime dependencies */
857 int probe_order;
858 int remove_order;
859
860 /* platform IO - used for platform DAPM */
861 unsigned int (*read)(struct snd_soc_platform *, unsigned int);
862 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
863 int (*bespoke_trigger)(struct snd_pcm_substream *, int); 883 int (*bespoke_trigger)(struct snd_pcm_substream *, int);
864}; 884};
865 885
@@ -874,15 +894,10 @@ struct snd_soc_platform {
874 const struct snd_soc_platform_driver *driver; 894 const struct snd_soc_platform_driver *driver;
875 895
876 unsigned int suspended:1; /* platform is suspended */ 896 unsigned int suspended:1; /* platform is suspended */
877 unsigned int probed:1;
878 897
879 struct list_head list; 898 struct list_head list;
880 899
881 struct snd_soc_component component; 900 struct snd_soc_component component;
882
883#ifdef CONFIG_DEBUG_FS
884 struct dentry *debugfs_platform_root;
885#endif
886}; 901};
887 902
888struct snd_soc_dai_link { 903struct snd_soc_dai_link {
@@ -994,7 +1009,7 @@ struct snd_soc_aux_dev {
994 const struct device_node *codec_of_node; 1009 const struct device_node *codec_of_node;
995 1010
996 /* codec/machine specific init - e.g. add machine controls */ 1011 /* codec/machine specific init - e.g. add machine controls */
997 int (*init)(struct snd_soc_dapm_context *dapm); 1012 int (*init)(struct snd_soc_component *component);
998}; 1013};
999