ASoC: cleanup DAI/Component activity
Subsystems (24)
v3 cover ASoC: cleanup DAI/Component activity
Hi Mark
These are v3 of DAI/Component activity cleanup.
This patch-set exchanges soc-dapm.c :: snd_soc_dai_link_event_xxx() behavior which updates dai->active but not cares other actives. But I think original code was wrong.
So, I believe these works correctly, but maybe need some tests or deep review.
v1 -> v2
- function naming "activity" -> "active"
v2 -> v3
- macro -> inline function
- added Reviewed-by from Ranjani, Acked-by from Peter
Kuninori Morimoto (21):
ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro
ASoC: soc-dai: add snd_soc_dai_action()
ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate()
ASoC: soc-dai: add snd_soc_dai_active()
ASoC: soc-component: add snd_soc_component_active()
ASoC: soc-dai: add snd_soc_dai_stream_active()
ASoC: use snd_soc_xxx_active()
ASoC: atomel: use snd_soc_xxx_active()
ASoC: bcm: use snd_soc_xxx_active()
ASoC: cirrus: use snd_soc_xxx_active()
ASoC: codecs: use snd_soc_xxx_active()
ASoC: fsl: use snd_soc_xxx_active()
ASoC: intel: use snd_soc_xxx_active()
ASoC: jz4740: use snd_soc_xxx_active()
ASoC: mediatek: use snd_soc_xxx_active()
ASoC: meson: use snd_soc_xxx_active()
ASoC: pxa: use snd_soc_xxx_active()
ASoC: ti: use snd_soc_xxx_active()
ASoC: uniphier: use snd_soc_xxx_active()
ASoC: dwc: use snd_soc_xxx_active()
ASoC: cleanup dai / component active code
include/sound/soc-component.h | 6 +- include/sound/soc-dai.h | 21 +++++- include/sound/soc.h | 15 ++++- sound/soc/atmel/atmel_ssc_dai.c | 4 +- sound/soc/bcm/bcm2835-i2s.c | 6 +- sound/soc/bcm/cygnus-ssp.c | 4 +- sound/soc/cirrus/ep93xx-i2s.c | 4 +- sound/soc/codecs/adav80x.c | 4 +- sound/soc/codecs/arizona.c | 2 +- sound/soc/codecs/cs4271.c | 4 +- sound/soc/codecs/madera.c | 2 +- sound/soc/codecs/max98090.c | 6 +- sound/soc/codecs/tlv320aic23.c | 2 +- sound/soc/codecs/tlv320dac33.c | 2 +- sound/soc/codecs/uda1380.c | 2 +- sound/soc/codecs/wl1273.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8753.c | 4 +- sound/soc/dwc/dwc-i2s.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_spdif.c | 4 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 ++-- sound/soc/jz4740/jz4740-i2s.c | 8 +-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 8 +-- sound/soc/meson/axg-tdm-interface.c | 2 +- sound/soc/pxa/pxa-ssp.c | 8 +-- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/soc-compress.c | 4 +- sound/soc/soc-core.c | 11 +-- sound/soc/soc-dai.c | 23 +++++++ sound/soc/soc-dapm.c | 8 +-- sound/soc/soc-pcm.c | 70 +++++++------------- sound/soc/ti/davinci-mcasp.c | 2 +- sound/soc/ti/omap-dmic.c | 4 +- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/ti/omap-mcpdm.c | 8 +-- sound/soc/uniphier/aio-cpu.c | 4 +- 37 files changed, 155 insertions(+), 125 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/21 ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro
From: Kuninori Morimoto <[email protected]>
snd_soc_runtime_activate()/deactivate() are implemented by global function which are just calling snd_soc_runtime_action().
We can replace it to macro, and this patch do it.
This patch is prepare for xxx_active cleanup.
--- include/sound/soc.h | 15 ++++++++++++-- sound/soc/soc-pcm.c | 49 ++++++++++++++------------------------------- 2 files changed, 28 insertions(+), 36 deletions(-)
include/sound/soc.h +13 -2
@@ -468,8 +468,19 @@ struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);bool snd_soc_runtime_ignore_pmdown_time (struct snd_soc_pcm_runtime *rtd); -void snd_soc_runtime_activate (struct snd_soc_pcm_runtime *rtd,int stream); -void snd_soc_runtime_deactivate (struct snd_soc_pcm_runtime *rtd,int stream); + +void snd_soc_runtime_action (struct snd_soc_pcm_runtime *rtd, +int stream,int action); +static inline void snd_soc_runtime_activate (struct snd_soc_pcm_runtime *rtd, +int stream) +{ +snd_soc_runtime_action (rtd, stream,1 ); +} +static inline void snd_soc_runtime_deactivate (struct snd_soc_pcm_runtime *rtd, +int stream) +{ +snd_soc_runtime_action (rtd, stream,-1 ); +}int snd_soc_runtime_calc_hw (struct snd_soc_pcm_runtime *rtd,struct snd_pcm_hardware *hw,int stream);
sound/soc/soc-pcm.c +15 -34
61 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 2/21 ASoC: soc-dai: add snd_soc_dai_action()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
snd_soc_runtime_action() updates DAI's xxx_active. We should update these in the same time, and it can be implemented at soc-dai.c.
This patch adds snd_soc_dai_action() for it. This is prepare for xxx_active cleanup.
--- include/sound/soc-dai.h | 12 ++++++++++++ sound/soc/soc-dai.c | 9 +++++++++ sound/soc/soc-pcm.c | 7 ++----- 3 files changed, 23 insertions(+), 5 deletions(-)
include/sound/soc-dai.h +12 -0
@@ -161,6 +161,18 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);int snd_soc_dai_compress_new (struct snd_soc_dai *dai,struct snd_soc_pcm_runtime *rtd,int num);bool snd_soc_dai_stream_valid (struct snd_soc_dai *dai,int stream); +void snd_soc_dai_action (struct snd_soc_dai *dai, +int stream,int action); +static inline void snd_soc_dai_activate (struct snd_soc_dai *dai, +int stream) +{ +snd_soc_dai_action (dai, stream,1 ); +} +static inline void snd_soc_dai_deactivate (struct snd_soc_dai *dai, +int stream) +{ +snd_soc_dai_action (dai, stream,-1 ); +}int snd_soc_pcm_dai_probe (struct snd_soc_pcm_runtime *rtd,int order);int snd_soc_pcm_dai_remove (struct snd_soc_pcm_runtime *rtd,int order);
sound/soc/soc-dai.c +9 -0
@@ -388,6 +388,15 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)return stream->channels_min; } +void snd_soc_dai_action (struct snd_soc_dai *dai, +int stream,int action) +{ + dai->stream_active[stream] += action; + dai->active += action; + dai->component->active += action; +} +EXPORT_SYMBOL_GPL (snd_soc_dai_action); +int snd_soc_pcm_dai_probe (struct snd_soc_pcm_runtime *rtd,int order) {struct snd_soc_dai *dai;
sound/soc/soc-pcm.c +2 -5
@@ -276,11 +276,8 @@ void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,lockdep_assert_held (&rtd->card->pcm_mutex); -for_each_rtd_dais (rtd, i, dai) { - dai->stream_active[stream] += action; - dai->active += action; - dai->component->active += action; - } +for_each_rtd_dais (rtd, i, dai) +snd_soc_dai_action (dai, stream, action); }EXPORT_SYMBOL_GPL (snd_soc_runtime_action);
Signature · 1 line
2.17.1
PATCH v3 3/21 ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
soc-dapm.c :: snd_soc_dai_link_event_pre_pmu() / snd_soc_dai_link_event() are directly updating dai->active without caring about stream_active / component->active.
It is breaking xxx_active count balance.
This patch uses snd_soc_dai_action() for it.
--- sound/soc/soc-dapm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/soc-dapm.c +4 -4
@@ -3835,7 +3835,7 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, "ASoC: startup() failed: %d\n", ret); goto out; } - source->active++; +snd_soc_dai_activate (source, substream->stream); } substream->stream =SNDRV_PCM_STREAM_PLAYBACK ;
@@ -3848,7 +3848,7 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w, "ASoC: startup() failed: %d\n", ret); goto out; } - sink->active++; +snd_soc_dai_activate (sink, substream->stream); } substream->hw_opened =1 ;
@@ -3978,14 +3978,14 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, substream->stream =SNDRV_PCM_STREAM_CAPTURE ;snd_soc_dapm_widget_for_each_source_path (w, path) { source = path->source->priv; - source->active--; +snd_soc_dai_deactivate (source, substream->stream);snd_soc_dai_shutdown (source, substream); } substream->stream =SNDRV_PCM_STREAM_PLAYBACK ;snd_soc_dapm_widget_for_each_sink_path (w, path) { sink = path->sink->priv; - sink->active--; +snd_soc_dai_deactivate (sink, substream->stream);snd_soc_dai_shutdown (sink, substream); }break ;
Signature · 1 line
2.17.1
PATCH v3 4/21 ASoC: soc-dai: add snd_soc_dai_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Current snd_soc_dai_action() is updatingdai->stream_active for Playback/Capture (A),dai->active for DAI (B)
void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action)
{
(A) dai->stream_active[stream] += action;
(B) dai->active += action;
dai->component->active += action;
}But, these are very verbose, because we can calculate DAI active from stream_active.
This patch adds snd_soc_dai_active() which calculate DAI active from DAI stream_active.
--- include/sound/soc-dai.h | 1 + sound/soc/soc-dai.c | 12 ++++++++++++ 2 files changed, 13 insertions(+)
include/sound/soc-dai.h +1 -0
@@ -173,6 +173,7 @@ static inline void snd_soc_dai_deactivate(struct snd_soc_dai *dai, {snd_soc_dai_action (dai, stream,-1 ); } +int snd_soc_dai_active (struct snd_soc_dai *dai);int snd_soc_pcm_dai_probe (struct snd_soc_pcm_runtime *rtd,int order);int snd_soc_pcm_dai_remove (struct snd_soc_pcm_runtime *rtd,int order);
sound/soc/soc-dai.c +12 -0
@@ -397,6 +397,18 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, }EXPORT_SYMBOL_GPL (snd_soc_dai_action); +int snd_soc_dai_active (struct snd_soc_dai *dai) +{ +int stream, active; + + active =0 ; +for_each_pcm_streams (stream) + active += dai->stream_active[stream]; + +return active; +} +EXPORT_SYMBOL_GPL (snd_soc_dai_active); +int snd_soc_pcm_dai_probe (struct snd_soc_pcm_runtime *rtd,int order) {struct snd_soc_dai *dai;
Signature · 1 line
2.17.1
PATCH v3 5/21 ASoC: soc-component: add snd_soc_component_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- include/sound/soc-component.h | 6 ++++++ sound/soc/soc-dai.c | 1 + 2 files changed, 7 insertions(+)
include/sound/soc-component.h +6 -0
@@ -395,6 +395,12 @@ static inline bool snd_soc_component_is_active(return component->active !=0 ; } +static inline unsigned int +snd_soc_component_active (struct snd_soc_component *component) +{ +return component->active; +} +/* component pin */ int snd_soc_component_enable_pin (struct snd_soc_component *component,const char *pin);
sound/soc/soc-dai.c +1 -0
@@ -393,6 +393,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, { dai->stream_active[stream] += action; dai->active += action; +/* see snd_soc_component_active() */ dai->component->active += action; }EXPORT_SYMBOL_GPL (snd_soc_dai_action);
Signature · 1 line
2.17.1
PATCH v3 6/21 ASoC: soc-dai: add snd_soc_dai_stream_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- include/sound/soc-dai.h | 6 ++++++ sound/soc/soc-dai.c | 1 + 2 files changed, 7 insertions(+)
include/sound/soc-dai.h +6 -0
@@ -481,4 +481,10 @@ static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai, return ERR_PTR(-ENOTSUPP); } +static inline unsigned int +snd_soc_dai_stream_active (struct snd_soc_dai *dai,int stream) +{ +return dai->stream_active[stream]; +} +#endif
sound/soc/soc-dai.c +1 -0
@@ -391,6 +391,7 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)void snd_soc_dai_action (struct snd_soc_dai *dai,int stream,int action) { +/* see snd_soc_dai_stream_active() */ dai->stream_active[stream] += action; dai->active += action;/* see snd_soc_component_active() */
Signature · 1 line
2.17.1
PATCH v3 7/21 ASoC: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/soc-compress.c | 4 ++-- sound/soc/soc-core.c | 11 ++++++----- sound/soc/soc-pcm.c | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 17 deletions(-)
sound/soc/soc-compress.c +2 -2
@@ -231,10 +231,10 @@ static int soc_compr_free(struct snd_compr_stream *cstream)snd_soc_dai_digital_mute (codec_dai,1 , cstream->direction); -if (!cpu_dai->active) +if (!snd_soc_dai_active (cpu_dai)) cpu_dai->rate =0 ; -if (!codec_dai->active) +if (!snd_soc_dai_active (codec_dai)) codec_dai->rate =0 ;if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->shutdown)
sound/soc/soc-core.c +6 -5
@@ -372,7 +372,8 @@ void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd)dev_dbg (rtd->dev,"ASoC: pop wq checking: %s status: %s waiting: %s\n" , codec_dai->driver->playback.stream_name, - codec_dai->stream_active[playback] ?"active" :"inactive" , +snd_soc_dai_stream_active (codec_dai, playback) ? +"active" :"inactive" , rtd->pop_wait ?"yes" :"no" );/* are we waiting on this codec DAI stream */
@@ -546,7 +547,7 @@ int snd_soc_suspend(struct device *dev)continue ;for_each_rtd_codec_dais (rtd, i, dai) { -if (dai->stream_active[playback]) +if (snd_soc_dai_stream_active (dai, playback))snd_soc_dai_digital_mute (dai,1 , playback); } }
@@ -688,7 +689,7 @@ static void soc_resume_deferred(struct work_struct *work)continue ;for_each_rtd_codec_dais (rtd, i, dai) { -if (dai->stream_active[playback]) +if (snd_soc_dai_stream_active (dai, playback))snd_soc_dai_digital_mute (dai,0 , playback); } }
@@ -718,7 +719,7 @@ int snd_soc_resume(struct device *dev)/* activate pins from sleep state */ for_each_card_components (card, component) -if (component->active) +if (snd_soc_component_active (component))pinctrl_pm_select_default_state (component->dev);dev_dbg (dev,"ASoC: Scheduling resume work\n" );
@@ -1943,7 +1944,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)/* deactivate pins to sleep state */ for_each_card_components (card, component) -if (!component->active) +if (!snd_soc_component_active (component))pinctrl_pm_select_sleep_state (component->dev); probe_end:
sound/soc/soc-pcm.c +10 -10
@@ -750,7 +750,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) }for_each_rtd_components (rtd, i, component) -if (!component->active) +if (!snd_soc_component_active (component))pinctrl_pm_select_sleep_state (component->dev);return 0 ;
@@ -844,7 +844,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)/* Symmetry only applies if we've already got an active stream. */ for_each_rtd_dais (rtd, i, dai) { -if (dai->active) { +if (snd_soc_dai_active (dai)) { ret =soc_pcm_apply_symmetry (substream, dai);if (ret !=0 ) goto config_err;
@@ -882,7 +882,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) }for_each_rtd_components (rtd, i, component) -if (!component->active) +if (!snd_soc_component_active (component))pinctrl_pm_select_sleep_state (component->dev);return ret;
@@ -1136,9 +1136,9 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)/* clear the corresponding DAIs parameters when going to be inactive */ for_each_rtd_dais (rtd, i, dai) { -int active = dai->stream_active[substream->stream]; +int active =snd_soc_dai_stream_active (dai, substream->stream); -if (dai->active ==1 ) { +if (snd_soc_dai_active (dai) ==1 ) { dai->rate =0 ; dai->channels =0 ; dai->sample_bits =0 ;
@@ -1907,7 +1907,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream, for_each_rtd_cpu_dais (fe, i, fe_cpu_dai) {/* Symmetry only applies if we've got an active stream. */ -if (fe_cpu_dai->active) { +if (snd_soc_dai_active (fe_cpu_dai)) { err =soc_pcm_apply_symmetry (fe_substream, fe_cpu_dai);if (err <0 )return err;
@@ -1936,7 +1936,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,/* Symmetry only applies if we've got an active stream. */ for_each_rtd_dais (rtd, i, dai) { -if (dai->active) { +if (snd_soc_dai_active (dai)) { err =soc_pcm_apply_symmetry (fe_substream, dai);if (err <0 )return err;
@@ -2709,7 +2709,7 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)return 0 ;/* only check active links */ -if (!asoc_rtd_to_cpu (fe,0 )->active) +if (!snd_soc_dai_active (asoc_rtd_to_cpu (fe,0 )))return 0 ;/* DAPM sync will call this to update DSP paths */
@@ -2724,8 +2724,8 @@ static int soc_dpcm_fe_runtime_update(struct snd_soc_pcm_runtime *fe, int new)continue ;/* skip if FE isn't currently playing/capturing */ -if (!asoc_rtd_to_cpu (fe,0 )->stream_active[stream] || - !asoc_rtd_to_codec (fe,0 )->stream_active[stream]) +if (!snd_soc_dai_stream_active (asoc_rtd_to_cpu (fe,0 ), stream) || + !snd_soc_dai_stream_active (asoc_rtd_to_codec (fe,0 ), stream))continue ; paths =dpcm_path_get (fe, stream, &list);
Signature · 1 line
2.17.1
PATCH v3 8/21 ASoC: atomel: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/atmel/atmel_ssc_dai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/atmel/atmel_ssc_dai.c +2 -2
@@ -765,7 +765,7 @@ static int atmel_ssc_suspend(struct snd_soc_component *component)struct atmel_ssc_info *ssc_p;struct platform_device *pdev =to_platform_device (component->dev); -if (!component->active) +if (!snd_soc_component_active (component))return 0 ; ssc_p = &ssc_info[pdev->id];
@@ -793,7 +793,7 @@ static int atmel_ssc_resume(struct snd_soc_component *component)struct platform_device *pdev =to_platform_device (component->dev);u32 cr; -if (!component->active) +if (!snd_soc_component_active (component))return 0 ; ssc_p = &ssc_info[pdev->id];
Signature · 1 line
2.17.1
PATCH v3 9/21 ASoC: bcm: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/bcm/bcm2835-i2s.c | 6 +++--- sound/soc/bcm/cygnus-ssp.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/bcm/bcm2835-i2s.c +3 -3
@@ -653,7 +653,7 @@ static void bcm2835_i2s_stop(struct bcm2835_i2s_dev *dev, BCM2835_I2S_CS_A_REG, mask, 0);/* Stop also the clock when not SND_SOC_DAIFMT_CONT */ -if (!dai->active && !(dev->fmt &SND_SOC_DAIFMT_CONT )) +if (!snd_soc_dai_active (dai) && !(dev->fmt &SND_SOC_DAIFMT_CONT ))bcm2835_i2s_stop_clock (dev); }
@@ -695,7 +695,7 @@ static int bcm2835_i2s_startup(struct snd_pcm_substream *substream, {struct bcm2835_i2s_dev *dev =snd_soc_dai_get_drvdata (dai); -if (dai->active) +if (snd_soc_dai_active (dai))return 0 ;/* Should this still be running stop it */
@@ -723,7 +723,7 @@ static void bcm2835_i2s_shutdown(struct snd_pcm_substream *substream,bcm2835_i2s_stop (dev, substream, dai);/* If both streams are stopped, disable module and clock */ -if (dai->active) +if (snd_soc_dai_active (dai))return ;/* Disable the module */
sound/soc/bcm/cygnus-ssp.c +2 -2
@@ -1056,7 +1056,7 @@ static int __cygnus_ssp_suspend(struct snd_soc_dai *cpu_dai) {struct cygnus_aio_port *aio =cygnus_dai_get_portinfo (cpu_dai); -if (!cpu_dai->active) +if (!snd_soc_dai_active (cpu_dai))return 0 ;if (!aio->is_slave) {
@@ -1097,7 +1097,7 @@ static int __cygnus_ssp_resume(struct snd_soc_dai *cpu_dai)struct cygnus_aio_port *aio =cygnus_dai_get_portinfo (cpu_dai);int error; -if (!cpu_dai->active) +if (!snd_soc_dai_active (cpu_dai))return 0 ;if (!aio->is_slave) {
Signature · 1 line
2.17.1
PATCH v3 10/21 ASoC: cirrus: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/cirrus/ep93xx-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/cirrus/ep93xx-i2s.c +2 -2
@@ -368,7 +368,7 @@ static int ep93xx_i2s_suspend(struct snd_soc_component *component) {struct ep93xx_i2s_info *info =snd_soc_component_get_drvdata (component); -if (!component->active) +if (!snd_soc_component_active (component))return 0 ;ep93xx_i2s_disable (info,SNDRV_PCM_STREAM_PLAYBACK );
@@ -381,7 +381,7 @@ static int ep93xx_i2s_resume(struct snd_soc_component *component) {struct ep93xx_i2s_info *info =snd_soc_component_get_drvdata (component); -if (!component->active) +if (!snd_soc_component_active (component))return 0 ;ep93xx_i2s_enable (info,SNDRV_PCM_STREAM_PLAYBACK );
Signature · 1 line
2.17.1
PATCH v3 11/21 ASoC: codecs: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/codecs/adav80x.c | 4 ++-- sound/soc/codecs/arizona.c | 2 +- sound/soc/codecs/cs4271.c | 4 ++-- sound/soc/codecs/madera.c | 2 +- sound/soc/codecs/max98090.c | 6 +++--- sound/soc/codecs/tlv320aic23.c | 2 +- sound/soc/codecs/tlv320dac33.c | 2 +- sound/soc/codecs/uda1380.c | 2 +- sound/soc/codecs/wl1273.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8753.c | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-)
sound/soc/codecs/adav80x.c +2 -2
@@ -725,7 +725,7 @@ static int adav80x_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct adav80x *adav80x =snd_soc_component_get_drvdata (component); -if (!snd_soc_component_is_active (component) || !adav80x->rate) +if (!snd_soc_component_active (component) || !adav80x->rate)return 0 ; return snd_pcm_hw_constraint_single(substream->runtime,
@@ -738,7 +738,7 @@ static void adav80x_dai_shutdown(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct adav80x *adav80x =snd_soc_component_get_drvdata (component); -if (!snd_soc_component_is_active (component)) +if (!snd_soc_component_active (component)) adav80x->rate =0 ; }
sound/soc/codecs/arizona.c +1 -1
@@ -1926,7 +1926,7 @@ static int arizona_dai_set_sysclk(struct snd_soc_dai *dai,if (clk_id == dai_priv->clk)return 0 ; -if (dai->active) { +if (snd_soc_dai_active (dai)) {dev_err (component->dev,"Can't change clock on active DAI %d\n" , dai->id);return -EBUSY ;
sound/soc/codecs/cs4271.c +2 -2
@@ -356,9 +356,9 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream,*/ if ((substream->stream ==SNDRV_PCM_STREAM_PLAYBACK && - !dai->stream_active[SNDRV_PCM_STREAM_CAPTURE ]) || + !snd_soc_dai_stream_active (dai,SNDRV_PCM_STREAM_CAPTURE )) || (substream->stream ==SNDRV_PCM_STREAM_CAPTURE && - !dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK ])) { + !snd_soc_dai_stream_active (dai,SNDRV_PCM_STREAM_PLAYBACK ))) { ret =regmap_update_bits (cs4271->regmap,CS4271_MODE2 ,CS4271_MODE2_PDN ,CS4271_MODE2_PDN );
sound/soc/codecs/madera.c +1 -1
@@ -3279,7 +3279,7 @@ static int madera_dai_set_sysclk(struct snd_soc_dai *dai,if (is_sync ==madera_is_syncclk (dai_priv->clk))return 0 ; -if (dai->active) { +if (snd_soc_dai_active (dai)) {dev_err (component->dev,"Can't change clock on active DAI %d\n" , dai->id);return -EBUSY ;
sound/soc/codecs/max98090.c +3 -3
@@ -2039,7 +2039,7 @@ static int max98090_dai_trigger(struct snd_pcm_substream *substream, int cmd,case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : -if (!max98090->master && dai->active ==1 ) +if (!max98090->master &&snd_soc_dai_active (dai) ==1 )queue_delayed_work (system_power_efficient_wq, &max98090->pll_det_enable_work,msecs_to_jiffies (10 ));
@@ -2047,7 +2047,7 @@ static int max98090_dai_trigger(struct snd_pcm_substream *substream, int cmd,case SNDRV_PCM_TRIGGER_STOP :case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_PAUSE_PUSH : -if (!max98090->master && dai->active ==1 ) +if (!max98090->master &&snd_soc_dai_active (dai) ==1 )schedule_work (&max98090->pll_det_disable_work);break ;default :
@@ -2109,7 +2109,7 @@ static void max98090_pll_work(struct max98090_priv *max98090)unsigned int pll;int i; -if (!snd_soc_component_is_active (component)) +if (!snd_soc_component_active (component))return ;dev_info_ratelimited (component->dev,"PLL unlocked\n" );
sound/soc/codecs/tlv320aic23.c +1 -1
@@ -394,7 +394,7 @@ static void tlv320aic23_shutdown(struct snd_pcm_substream *substream,struct aic23 *aic23 =snd_soc_component_get_drvdata (component);/* deactivate */ -if (!snd_soc_component_is_active (component)) { +if (!snd_soc_component_active (component)) {udelay (50 );snd_soc_component_write (component,TLV320AIC23_ACTIVE ,0x0 ); }
sound/soc/codecs/tlv320dac33.c +1 -1
@@ -449,7 +449,7 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,if (dac33->fifo_mode == ucontrol->value.enumerated.item[0 ])return 0 ;/* Do not allow changes while stream is running*/ -if (snd_soc_component_is_active (component)) +if (snd_soc_component_active (component))return -EPERM ;if (ucontrol->value.enumerated.item[0 ] >=DAC33_FIFO_LAST_MODE )
sound/soc/codecs/uda1380.c +1 -1
@@ -110,7 +110,7 @@ static int uda1380_write(struct snd_soc_component *component, unsigned int reg,/* the interpolator & decimator regs must only be written when the * codec DAI is active. */ -if (!snd_soc_component_is_active (component) && (reg >=UDA1380_MVOL )) +if (!snd_soc_component_active (component) && (reg >=UDA1380_MVOL ))return 0 ;pr_debug ("uda1380: hw write %x val %x\n" , reg, value);if (i2c_master_send (uda1380->i2c, data,3 ) ==3 ) {
sound/soc/codecs/wl1273.c +1 -1
@@ -183,7 +183,7 @@ static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol,return 0 ;/* Do not allow changes while stream is running */ -if (snd_soc_component_is_active (component)) +if (snd_soc_component_active (component))return -EPERM ;if (ucontrol->value.enumerated.item[0 ] >=ARRAY_SIZE (wl1273_audio_route))
sound/soc/codecs/wm8711.c +1 -1
@@ -198,7 +198,7 @@ static void wm8711_shutdown(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;/* deactivate */ -if (!snd_soc_component_is_active (component)) { +if (!snd_soc_component_active (component)) {udelay (50 );snd_soc_component_write (component,WM8711_ACTIVE ,0x0 ); }
sound/soc/codecs/wm8753.c +2 -2
@@ -241,7 +241,7 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,if (wm8753->dai_func == ucontrol->value.enumerated.item[0 ])return 0 ; -if (snd_soc_component_is_active (component)) +if (snd_soc_component_active (component))return -EBUSY ; ioctl =snd_soc_component_read32 (component,WM8753_IOCTL );
@@ -1304,7 +1304,7 @@ static int wm8753_mute(struct snd_soc_dai *dai, int mute)/* the digital mute covers the HiFi and Voice DAC's on the WM8753. * make sure we check if they are not both active when we mute */ if (mute && wm8753->dai_func ==1 ) { -if (!snd_soc_component_is_active (component)) +if (!snd_soc_component_active (component))snd_soc_component_write (component,WM8753_DAC , mute_reg |0x8 ); }else {if (mute)
Signature · 1 line
2.17.1
PATCH v3 12/21 ASoC: fsl: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_spdif.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_esai.c +1 -1
@@ -488,7 +488,7 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, {struct fsl_esai *esai_priv =snd_soc_dai_get_drvdata (dai); -if (!dai->active) { +if (!snd_soc_dai_active (dai)) {/* Set synchronous mode */ regmap_update_bits(esai_priv->regmap, REG_ESAI_SAICR, ESAI_SAICR_SYNC, esai_priv->synchronous ?
sound/soc/fsl/fsl_spdif.c +2 -2
@@ -466,7 +466,7 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream,int ret;/* Reset module and interrupts only for first initialization */ -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) { ret =clk_prepare_enable (spdif_priv->coreclk);if (ret) {dev_err (&pdev->dev,"failed to enable core clock\n" );
@@ -554,7 +554,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream,regmap_update_bits (regmap,REG_SPDIF_SCR , mask, scr);/* Power down SPDIF module only if tx&rx are both inactive */ -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) {spdif_intr_status_clear (spdif_priv);regmap_update_bits (regmap,REG_SPDIF_SCR ,SCR_LOW_POWER ,SCR_LOW_POWER );
Signature · 1 line
2.17.1
PATCH v3 13/21 ASoC: intel: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/intel/atom/sst-mfld-platform-pcm.c +7 -7
@@ -392,7 +392,7 @@ static int sst_enable_ssp(struct snd_pcm_substream *substream, {int ret =0 ; -if (!dai->active) { +if (!snd_soc_dai_active (dai)) { ret =sst_handle_vb_timer (dai, true);sst_fill_ssp_defaults (dai); }
@@ -405,7 +405,7 @@ static int sst_be_hw_params(struct snd_pcm_substream *substream, {int ret =0 ; -if (dai->active ==1 ) +if (snd_soc_dai_active (dai) ==1 ) ret =send_ssp_cmd (dai, dai->name,1 );return ret; }
@@ -414,7 +414,7 @@ static int sst_set_format(struct snd_soc_dai *dai, unsigned int fmt) {int ret =0 ; -if (!dai->active) +if (!snd_soc_dai_active (dai))return 0 ; ret =sst_fill_ssp_config (dai, fmt);
@@ -429,7 +429,7 @@ static int sst_platform_set_ssp_slot(struct snd_soc_dai *dai, int slots, int slot_width) { int ret = 0; -if (!dai->active) +if (!snd_soc_dai_active (dai))return ret; ret =sst_fill_ssp_slot (dai, tx_mask, rx_mask, slots, slot_width);
@@ -442,7 +442,7 @@ static int sst_platform_set_ssp_slot(struct snd_soc_dai *dai,static void sst_disable_ssp (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) { -if (!dai->active) { +if (!snd_soc_dai_active (dai)) {send_ssp_cmd (dai, dai->name,0 );sst_handle_vb_timer (dai, false); }
@@ -743,7 +743,7 @@ static int sst_soc_prepare(struct device *dev)for_each_card_rtds (drv->soc_card, rtd) {struct snd_soc_dai *dai =asoc_rtd_to_cpu (rtd,0 ); -if (dai->active) { +if (snd_soc_dai_active (dai)) {send_ssp_cmd (dai, dai->name,0 );sst_handle_vb_timer (dai, false); }
@@ -764,7 +764,7 @@ static void sst_soc_complete(struct device *dev)for_each_card_rtds (drv->soc_card, rtd) {struct snd_soc_dai *dai =asoc_rtd_to_cpu (rtd,0 ); -if (dai->active) { +if (snd_soc_dai_active (dai)) {sst_handle_vb_timer (dai, true);send_ssp_cmd (dai, dai->name,1 ); }
Signature · 1 line
2.17.1
PATCH v3 14/21 ASoC: jz4740: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/jz4740/jz4740-i2s.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/jz4740/jz4740-i2s.c +4 -4
@@ -129,7 +129,7 @@ static int jz4740_i2s_startup(struct snd_pcm_substream *substream,uint32_t conf, ctrl;int ret; -if (dai->active) +if (snd_soc_dai_active (dai))return 0 ; ctrl =jz4740_i2s_read (i2s,JZ_REG_AIC_CTRL );
@@ -153,7 +153,7 @@ static void jz4740_i2s_shutdown(struct snd_pcm_substream *substream,struct jz4740_i2s *i2s =snd_soc_dai_get_drvdata (dai);uint32_t conf; -if (dai->active) +if (snd_soc_dai_active (dai))return ; conf =jz4740_i2s_read (i2s,JZ_REG_AIC_CONF );
@@ -332,7 +332,7 @@ static int jz4740_i2s_suspend(struct snd_soc_component *component)struct jz4740_i2s *i2s =snd_soc_component_get_drvdata (component);uint32_t conf; -if (component->active) { +if (snd_soc_component_active (component)) { conf =jz4740_i2s_read (i2s,JZ_REG_AIC_CONF ); conf &= ~JZ_AIC_CONF_ENABLE ;jz4740_i2s_write (i2s,JZ_REG_AIC_CONF , conf);
@@ -355,7 +355,7 @@ static int jz4740_i2s_resume(struct snd_soc_component *component)if (ret)return ret; -if (component->active) { +if (snd_soc_component_active (component)) { ret =clk_prepare_enable (i2s->clk_i2s);if (ret) {clk_disable_unprepare (i2s->clk_aic);
Signature · 1 line
2.17.1
PATCH v3 15/21 ASoC: mediatek: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +4 -4
@@ -297,7 +297,7 @@ static int mt8173_afe_i2s_startup(struct snd_pcm_substream *substream, {struct mtk_base_afe *afe =snd_soc_dai_get_drvdata (dai); -if (dai->active) +if (snd_soc_dai_active (dai))return 0 ; regmap_update_bits(afe->regmap, AUDIO_TOP_CON0,
@@ -310,7 +310,7 @@ static void mt8173_afe_i2s_shutdown(struct snd_pcm_substream *substream, {struct mtk_base_afe *afe =snd_soc_dai_get_drvdata (dai); -if (dai->active) +if (snd_soc_dai_active (dai))return ;mt8173_afe_set_i2s_enable (afe, false);
@@ -347,7 +347,7 @@ static int mt8173_afe_hdmi_startup(struct snd_pcm_substream *substream,struct mtk_base_afe *afe =snd_soc_dai_get_drvdata (dai);struct mt8173_afe_private *afe_priv = afe->platform_priv; -if (dai->active) +if (snd_soc_dai_active (dai))return 0 ; mt8173_afe_dais_enable_clks(afe, afe_priv->clocks[MT8173_CLK_I2S3_M],
@@ -361,7 +361,7 @@ static void mt8173_afe_hdmi_shutdown(struct snd_pcm_substream *substream,struct mtk_base_afe *afe =snd_soc_dai_get_drvdata (dai);struct mt8173_afe_private *afe_priv = afe->platform_priv; -if (dai->active) +if (snd_soc_dai_active (dai))return ; mt8173_afe_dais_disable_clks(afe, afe_priv->clocks[MT8173_CLK_I2S3_M],
Signature · 1 line
2.17.1
PATCH v3 16/21 ASoC: meson: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/meson/axg-tdm-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/axg-tdm-interface.c +1 -1
@@ -149,7 +149,7 @@ static int axg_tdm_iface_startup(struct snd_pcm_substream *substream, }/* Apply component wide rate symmetry */ -if (dai->component->active) { +if (snd_soc_component_active (dai->component)) { ret =snd_pcm_hw_constraint_single (substream->runtime,SNDRV_PCM_HW_PARAM_RATE , iface->rate);
Signature · 1 line
2.17.1
PATCH v3 17/21 ASoC: pxa: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/pxa/pxa-ssp.c | 8 ++++---- sound/soc/pxa/pxa2xx-i2s.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/pxa/pxa-ssp.c +4 -4
@@ -94,7 +94,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,struct snd_dmaengine_dai_dma_data *dma;int ret =0 ; -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) {clk_prepare_enable (ssp->clk);pxa_ssp_disable (ssp); }
@@ -119,7 +119,7 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,struct ssp_priv *priv =snd_soc_dai_get_drvdata (cpu_dai);struct ssp_device *ssp = priv->ssp; -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) {pxa_ssp_disable (ssp);clk_disable_unprepare (ssp->clk); }
@@ -138,7 +138,7 @@ static int pxa_ssp_suspend(struct snd_soc_component *component)struct ssp_priv *priv =snd_soc_component_get_drvdata (component);struct ssp_device *ssp = priv->ssp; -if (!component->active) +if (!snd_soc_component_active (component))clk_prepare_enable (ssp->clk); priv->cr0 =__raw_readl (ssp->mmio_base +SSCR0 );
@@ -165,7 +165,7 @@ static int pxa_ssp_resume(struct snd_soc_component *component)__raw_writel (priv->to, ssp->mmio_base +SSTO );__raw_writel (priv->psp, ssp->mmio_base +SSPSP ); -if (component->active) +if (snd_soc_component_active (component))pxa_ssp_enable (ssp);else clk_disable_unprepare (ssp->clk);
sound/soc/pxa/pxa2xx-i2s.c +1 -1
@@ -101,7 +101,7 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,if (IS_ERR (clk_i2s))return PTR_ERR (clk_i2s); -if (!cpu_dai->active) +if (!snd_soc_dai_active (cpu_dai))SACR0 =0 ;return 0 ;
Signature · 1 line
2.17.1
PATCH v3 18/21 ASoC: ti: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/ti/davinci-mcasp.c | 2 +- sound/soc/ti/omap-dmic.c | 4 ++-- sound/soc/ti/omap-mcbsp.c | 4 ++-- sound/soc/ti/omap-mcpdm.c | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-)
sound/soc/ti/davinci-mcasp.c +1 -1
@@ -1577,7 +1577,7 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream,if (mcasp->op_mode ==DAVINCI_MCASP_DIT_MODE )return ; -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) { mcasp->channels =0 ; mcasp->max_format_width =0 ; }
sound/soc/ti/omap-dmic.c +2 -2
@@ -95,7 +95,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,mutex_lock (&dmic->mutex); -if (!dai->active) +if (!snd_soc_dai_active (dai)) dmic->active =1 ;else ret = -EBUSY ;
@@ -114,7 +114,7 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream,cpu_latency_qos_remove_request (&dmic->pm_qos_req); -if (!dai->active) +if (!snd_soc_dai_active (dai)) dmic->active =0 ;mutex_unlock (&dmic->mutex);
sound/soc/ti/omap-mcbsp.c +2 -2
@@ -788,7 +788,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,struct omap_mcbsp *mcbsp =snd_soc_dai_get_drvdata (cpu_dai);int err =0 ; -if (!cpu_dai->active) +if (!snd_soc_dai_active (cpu_dai)) err =omap_mcbsp_request (mcbsp);/*
@@ -843,7 +843,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream, mcbsp->latency[stream1] =0 ; -if (!cpu_dai->active) { +if (!snd_soc_dai_active (cpu_dai)) {omap_mcbsp_free (mcbsp); mcbsp->configured =0 ; }
sound/soc/ti/omap-mcpdm.c +4 -4
@@ -253,7 +253,7 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,mutex_lock (&mcpdm->mutex); -if (!dai->active) +if (!snd_soc_dai_active (dai))omap_mcpdm_open_streams (mcpdm);mutex_unlock (&mcpdm->mutex);
@@ -271,7 +271,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream,mutex_lock (&mcpdm->mutex); -if (!dai->active) { +if (!snd_soc_dai_active (dai)) {if (omap_mcpdm_active (mcpdm)) {omap_mcpdm_stop (mcpdm);omap_mcpdm_close_streams (mcpdm);
@@ -462,7 +462,7 @@ static int omap_mcpdm_suspend(struct snd_soc_component *component) {struct omap_mcpdm *mcpdm =snd_soc_component_get_drvdata (component); -if (component->active) { +if (snd_soc_component_active (component)) {omap_mcpdm_stop (mcpdm);omap_mcpdm_close_streams (mcpdm); }
@@ -484,7 +484,7 @@ static int omap_mcpdm_resume(struct snd_soc_component *component)while (mcpdm->pm_active_count--)pm_runtime_get_sync (mcpdm->dev); -if (component->active) { +if (snd_soc_component_active (component)) {omap_mcpdm_open_streams (mcpdm);omap_mcpdm_start (mcpdm); }
Signature · 1 line
2.17.1
PATCH v3 19/21 ASoC: uniphier: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/uniphier/aio-cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/uniphier/aio-cpu.c +2 -2
@@ -424,7 +424,7 @@ static void uniphier_aio_dai_suspend(struct snd_soc_dai *dai) {struct uniphier_aio *aio =uniphier_priv (dai); -if (!dai->active) +if (!snd_soc_dai_active (dai))return ; aio->chip->num_wup_aios--;
@@ -448,7 +448,7 @@ static int uniphier_aio_dai_resume(struct snd_soc_dai *dai)struct uniphier_aio *aio =uniphier_priv (dai);int ret, i; -if (!dai->active) +if (!snd_soc_dai_active (dai))return 0 ;if (!aio->chip->active)
Signature · 1 line
2.17.1
PATCH v3 20/21 ASoC: dwc: use snd_soc_xxx_active()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it.
--- sound/soc/dwc/dwc-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/dwc/dwc-i2s.c +1 -1
@@ -429,7 +429,7 @@ static int dw_i2s_resume(struct snd_soc_component *component)for_each_component_dais (component, dai) {for_each_pcm_streams (stream) -if (dai->stream_active[stream]) +if (snd_soc_dai_stream_active (dai, stream))dw_i2s_config (dev, stream); }
Signature · 1 line
2.17.1
PATCH v3 21/21 ASoC: cleanup dai / component active code
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
No one is using dai->active, snd_soc_component_is_active(). Let's remove these.
--- include/sound/soc-component.h | 6 ------ include/sound/soc-dai.h | 2 -- sound/soc/soc-dai.c | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-)
include/sound/soc-component.h +0 -6
@@ -389,12 +389,6 @@ static inline void *snd_soc_component_get_drvdata(struct snd_soc_component *c)return dev_get_drvdata (c->dev); } -static inline bool snd_soc_component_is_active ( -struct snd_soc_component *component) -{ -return component->active !=0 ; -} -static inline unsigned int snd_soc_component_active (struct snd_soc_component *component) {
include/sound/soc-dai.h +0 -2
@@ -364,8 +364,6 @@ struct snd_soc_dai {/* DAI runtime info */ unsigned int stream_active[SNDRV_PCM_STREAM_LAST +1 ];/* usage count */ -unsigned int active; -struct snd_soc_dapm_widget *playback_widget;struct snd_soc_dapm_widget *capture_widget;
sound/soc/soc-dai.c +1 -1
@@ -393,7 +393,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, {/* see snd_soc_dai_stream_active() */ dai->stream_active[stream] += action; - dai->active += action; +/* see snd_soc_component_active() */ dai->component->active += action; }
Signature · 1 line
2.17.1
Mark Brown
maintainerQuoted 8 lines · Kuninori Morimoto
These are v3 of DAI/Component activity cleanup.
This patch-set exchanges
soc-dapm.c::snd_soc_dai_link_event_xxx()behavior which updatesdai->activebut not cares other actives. But I think original code was wrong.
So, I believe these works correctly, but maybe need some tests or deep review.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8
Thanks!
[01/21] ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro
commit: d9051d86ad30ca1ef1fc99e29854daeeb3944f8f
[02/21] ASoC: soc-dai: add snd_soc_dai_action()
commit: dc82910682ef06d5e5a81b4b359945b6f669ee3b
[03/21] ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate()
commit: 45eb8666e52d2d1733fda7353e48906d34a71e5d
[04/21] ASoC: soc-dai: add snd_soc_dai_active()
commit: efffd9b344adbf813e3ae6f6136df80000bf2833
[05/21] ASoC: soc-component: add snd_soc_component_active()
commit: 488b2ca599f96d46d4a4d730845a247328cb6a28
[06/21] ASoC: soc-dai: add snd_soc_dai_stream_active()
commit: 5552f8d72893cea29a0074a3ea0a1a5766858fcd
[07/21] ASoC: use snd_soc_xxx_active()
commit: b3dea624b52e8b18cd49f804ce70fe50374aa5db
[08/21] ASoC: atomel: use snd_soc_xxx_active()
commit: e1c7e1faa404df564e64785c0b5cb7f1ee2d785d
[09/21] ASoC: bcm: use snd_soc_xxx_active()
commit: 8ca4602d38c5140ae2cbeec9f1dd7803b0c4d61d
[10/21] ASoC: cirrus: use snd_soc_xxx_active()
commit: 90a61a549df10082463c1ec37bc378799febe8a9
[11/21] ASoC: codecs: use snd_soc_xxx_active()
commit: 5e518eddd11e8f71aaffc954dc7ee9572fc59808
[12/21] ASoC: fsl: use snd_soc_xxx_active()
commit: 1d9fb19d8f644bfa17c79660b823b7ad07b0b046
[13/21] ASoC: intel: use snd_soc_xxx_active()
commit: 846d0a17a8042ea753387b7571731d8265b87868
[14/21] ASoC: jz4740: use snd_soc_xxx_active()
commit: 48afb287853effb07253bb2ccad2123f37770a8f
[15/21] ASoC: mediatek: use snd_soc_xxx_active()
commit: 7995981bcfbc150902395af4191a77c9f4b842cd
[16/21] ASoC: meson: use snd_soc_xxx_active()
commit: 1f79aab5a44871286d414eb2a289aaeea4236fd1
[17/21] ASoC: pxa: use snd_soc_xxx_active()
commit: aaeb5fb59965217789258486080105337483a9e7
[18/21] ASoC: ti: use snd_soc_xxx_active()
commit: 36ad1a87104e4a54f6acaffbe2d9533f80179e74
[19/21] ASoC: uniphier: use snd_soc_xxx_active()
commit: 25d6755213f42ecf0c89f8619747be45e71382ac
[20/21] ASoC: dwc: use snd_soc_xxx_active()
commit: 8db4f94fb3088528a8a64e2c39c8bf764a9433b0
[21/21] ASoC: cleanup dai / component active code
commit: 0812a08ac8d054efc6cf2895d3b0e82c8731f8e9All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark