From 888df395ebc5c88cde45478660197ca46665efe2 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 16 Feb 2012 19:37:51 -0800 Subject: ASoC: dapm: Implement and instantiate DAI widgets In order to allow us to do smarter things with DAI links create DAPM widgets which directly represent the DAIs in the DAPM graph. These are automatically created from the DAIs as we probe the card with references held in both directions between the widget and the DAI. The widgets are not made available for direct instantiation by drivers, they are created automatically from the DAIs. Drivers should be updated to create stream routes using DAPM maps rather than by annotating AIF and DAC widgets with streams. In order to ease transition to this model from existing drivers we automatically create DAPM routes between the DAI widgets and the existing stream widgets which are started and stopped by the DAI widgets, though the old stream handling mechanism is still in place. This also has the nice effect of removing non-DAPM devices as any device with a DAI acquires a widget automatically which will allow future simplifications to the core DAPM logic. The intention is that in future the AIF and DAI widgets will gain the ability to interact such that we are able to manage activity on individual channels independantly rather than powering up and down the entire AIF as we do currently. Currently we only generate these for CODECs, mostly as I have no systems with non-CODEC DAPM to integrate with. It should be a simple matter of programming to add the additional hookup for these. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/soc-dai.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sound/soc-dai.h') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 2413acc54883..adb07fcd712c 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -17,6 +17,7 @@ #include struct snd_pcm_substream; +struct snd_soc_dapm_widget; /* * DAI hardware audio formats. @@ -238,6 +239,9 @@ struct snd_soc_dai { unsigned char pop_wait:1; unsigned char probed:1; + struct snd_soc_dapm_widget *playback_widget; + struct snd_soc_dapm_widget *capture_widget; + /* DAI DMA data */ void *playback_dma_data; void *capture_dma_data; -- cgit v1.2.3 From 2466ab9709bf7375ef8b8ad16f39008ce6e6bc8a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 2 Mar 2012 16:18:30 +0000 Subject: ASoC: core: Split the union for CODEC/platform in the DAI There's now core code which falls back to global CODEC operations for DAI calls that needs to be able to tell if it's dealing with a CPU or CODEC DAI and given the small number of DAIs in a typical system and overall memory usage pattern saving a pointer per DAI is really not worth the effort. Reported-by: Ian Lartey Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/sound/soc-dai.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/sound/soc-dai.h') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index adb07fcd712c..c429f248cf4e 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -250,10 +250,9 @@ struct snd_soc_dai { unsigned int rate; /* parent platform/codec */ - union { - struct snd_soc_platform *platform; - struct snd_soc_codec *codec; - }; + struct snd_soc_platform *platform; + struct snd_soc_codec *codec; + struct snd_soc_card *card; struct list_head list; -- cgit v1.2.3