aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dai.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-06-06ASoC: soc-dai: Remove set_fmt_new callbackCharles Keepax1-1/+0
Now the behaviour of the core and all drivers is updated to the new direct clock specification the temporary set_fmt_new callback can be completely removed. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-56-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: core: Add set_fmt_new callback that directly specifies providerCharles Keepax1-0/+7
The original set_fmt callback always passes clock provider/consumer with respect to the CODEC. This made sense when the framework was directly broken down into platforms and CODECs. Now everything is componentised it simplifies things if each side of the link is just told if it is provider or consumer of the clocks. To start this migration add a new callback that can be used to receive a direct specification of clocking. As there are more CODEC drivers than platform drivers, we make the new flags identical to the old CODEC flags meaning CODEC drivers will not require an update. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-24ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWirePierre-Louis Bossart1-16/+16
The HDAudio ASoC support relies on the set_tdm_slots() helper to store the HDaudio stream tag in the tx_mask. This only works because of the pre-existing order in soc-pcm.c, where the hw_params() is handled for codec_dais *before* cpu_dais. When the order is reversed, the stream_tag is used as a mask in the codec fixup functions: /* fixup params based on TDM slot masks */ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && codec_dai->tx_mask) soc_pcm_codec_params_fixup(&codec_params, codec_dai->tx_mask); As a result of this confusion, the codec_params_fixup() ends-up generating bad channel masks, depending on what stream_tag was allocated. We could add a flag to state that the tx_mask is really not a mask, but it would be quite ugly to persist in overloading concepts. Instead, this patch suggests a more generic get/set 'stream' API based on the existing model for SoundWire. We can expand the concept to store 'stream' opaque information that is specific to different DAI types. In the case of HDAudio DAIs, we only need to store a stream tag as an unsigned char pointer. The TDM rx_ and tx_masks should really only be used to store masks. Rename get_sdw_stream/set_sdw_stream callbacks and helpers as get_stream/set_stream. No functionality change beyond the rename. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Acked-By: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20211224021034.26635-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay()Kuninori Morimoto1-2/+2
Current soc_pcm_pointer() is manually calculating both CPU-DAI's max delay (= A) and Codec-DAI's max delay (= B). static snd_pcm_uframes_t soc_pcm_pointer(...) { ... ^ for_each_rtd_cpu_dais(rtd, i, cpu_dai) (A) cpu_delay = max(cpu_delay, ...); v delay += cpu_delay; ^ for_each_rtd_codec_dais(rtd, i, codec_dai) (B) codec_delay = max(codec_delay, ...); v delay += codec_delay; runtime->delay = delay; ... } Current soc_pcm_pointer() and the total delay calculating is not readable / difficult to understand. This patch update snd_soc_dai_delay() to snd_soc_pcm_dai_delay(), and calcule both CPU/Codec delay in one function. Link: https://lore.kernel.org/r/87fszl4yrq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875yssy25z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07ASoC: soc-core: add snd_soc_runtime_get_dai_fmt()Kuninori Morimoto1-0/+55
ASoC is using dai_link which specify DAI format (= dai_link->dai_fmt), and it is selected by "Sound Card" driver in corrent implementation. In other words, Sound Card *needs* to setup it. But, it should be possible to automatically selected from CPU and Codec driver settings. This patch adds new .auto_selectable_formats support at snd_soc_dai_ops. By this patch, dai_fmt can be automatically selected from each driver if both CPU / Codec driver had it. Automatically selectable *field* is depends on each drivers. For example, some driver want to select format "automatically", but want to select other fields "manually", because of complex limitation. Or other example, in case of both CPU and Codec are possible to be clock provider, but the quality was different. In these case, user need/want to *manually* select each fields from Sound Card driver. This .auto_selectable_formats can set priority. For example, no limitaion format can be HI priority, supported but has picky limitation format can be next priority, etc. It uses Sound Card specified fields preferentially, and try to select non-specific fields from CPU and Codec driver automatically if all drivers have .auto_selectable_formats. In other words, we can select all dai_fmt via Sound Card driver same as before. Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87h7ionc8s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12ASoC: soc-dai.h: Align the word of comment for SND_SOC_DAIFMT_CBC_CFCKuninori Morimoto1-1/+1
Let's use "consumer" instead of "follower". Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/8735usc1gr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: soc-dai.h: remove symmetric_rates/samplebitsKuninori Morimoto1-2/+0
All drivers are using new name. Let's remove old one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bldqn6sr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: sync parameter naming : rate / sample_bitsKuninori Morimoto1-2/+4
snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link have related parameter which is similar but not same naming. struct snd_pcm_runtime { ... (A) unsigned int rate; ... (B) unsigned int sample_bits; ... }; struct snd_soc_dai { ... (A) unsigned int rate; (B) unsigned int sample_bits; ... }; struct snd_soc_dai_driver { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; struct snd_soc_dai_link { ... (A) unsigned int symmetric_rates:1; (B) unsigned int symmetric_samplebits:1; ... }; Because it is similar but not same naming rule, code can be verbose / can't share macro. This patch sync naming rule for framework. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; old name will be removed if all drivers were switched to new naming rule. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wnweolj6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09ASoC: soc-pcm: care trigger rollbackKuninori Morimoto1-1/+3
soc_pcm_trigger() calls DAI/Component/Link trigger, but some of them might be failed. static int soc_pcm_trigger(...) { ... switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = snd_soc_link_trigger(substream, cmd); if (ret < 0) break; (*) ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_pcm_dai_trigger(substream, cmd); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ret = snd_soc_pcm_dai_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_pcm_component_trigger(substream, cmd); if (ret < 0) break; ret = snd_soc_link_trigger(substream, cmd); break; } ... } For example, if soc_pcm_trigger() failed at (*) point, we need to rollback previous succeeded trigger. This patch adds trigger mark for DAI/Component/Link, and do STOP if START/RESUME/PAUSE_RELEASE were failed. Because it need to use new rollback parameter, we need to modify DAI/Component/Link trigger functions in the same time. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-26ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()Kuninori Morimoto1-1/+3
soc_compr_open() does rollback when failed (A), but, it is almost same as soc_compr_free(). static int soc_compr_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ machine_err: | ... | out: (A) ... | pm_err: | ... v return ret; } The difference is soc_compr_free() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_compr_free() and rollback. => 1) snd_soc_dai_compr_startup/shutdown() 2) snd_soc_component_compr_open/free() 3) snd_soc_link_compr_startup/shutdown() This patch is for 1) snd_soc_dai_compr_startup/shutdown(), and adds new cstream mark. It will mark cstream when startup() was suceeded. If rollback happen *after* that, it will check rollback flag and marked cstream. It cares *previous* startup() only now, but we might want to check *whole* marked cstream in the future. This patch is using macro so that it can be easily adjust to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87mtze5iwp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-13ASoC: topology: use inclusive language for bclk and fsyncPierre-Louis Bossart1-12/+20
Mirror suggested changes in alsa-lib. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20201112163100.5081-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-26ASoC: soc-dai: add mark for snd_soc_dai_hw_params/free()Kuninori Morimoto1-1/+3
soc_pcm_hw_params() does rollback when failed (A), but, it is almost same as soc_pcm_hw_free(). static int soc_pcm_hw_params(xxx) { ... if (ret < 0) goto xxx_err; ... return ret; ^ component_err: | ... | interface_err: (A) ... | codec_err: | ... v return ret; } The difference is soc_pcm_hw_free() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_hw_free() and rollback. Now, soc_pcm_hw_params/free() are handling 1) snd_soc_link_hw_params/free() 2) snd_soc_pcm_component_hw_params/free() => 3) snd_soc_dai_hw_params/free() This patch is for 3) snd_soc_dai_hw_params/free(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when hw_params() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *previous* hw_params() only now, but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87imbxgqai.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-28ASoC: soc-dai: add mark for snd_soc_dai_startup/shutdown()Kuninori Morimoto1-1/+4
soc_pcm_open() does rollback when failed (A), but, it is almost same as soc_pcm_close(). static int soc_pcm_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ config_err: | ... | rtd_startup_err: (A) ... | component_err: | ... v return ret; } The difference is soc_pcm_close() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_close() and rollback. Now, soc_pcm_open/close() are handling => 1) snd_soc_dai_startup/shutdown() 2) snd_soc_link_startup/shutdown() 3) snd_soc_component_module_get/put() 4) snd_soc_component_open/close() 5) pm_runtime_put/get() This patch is for 1) snd_soc_dai_startup/shutdown(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when startup() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *current* startup() only now. but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lfgubwoc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: soc-dai: clarify return value for get_sdw_stream()Pierre-Louis Bossart1-1/+2
Previous changes move to use ERR_PTR(-ENOTSUPP), but it's not clear what implementations can return in case of errors. Explicitly document that NULL is not a possible return value, only ERR_PTR with a negative error code is valid. Fixes: 308811a327c38 ('ASoC: soc-dai: return proper error for get_sdw_stream()') Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reported-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20200904182854.3944-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-20Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:Mark Brown1-0/+1
Small patchset to harden the SoundWire machine driver, change bad HIDs, update PLL settings and avoid memory leaks. Given that the SoundWire core parts are not upstream it's probably not necessary to provide the patches to stable branches. Bard Liao (1): ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name Kai Vehmanen (2): ASoC: Intel: sof_sdw: add support for systems without i915 audio ASoC: Intel: sof_sdw: avoid crash if invalid DSP topology loaded Libin Yang (1): ASoC: Intel: common: change match table ehl-rt5660 Pierre-Louis Bossart (1): ASoC: Intel: sof_sdw_rt711: remove properties in card remove Yong Zhi (1): ASoC: intel: board: sof_rt5682: Update rt1015 pll input clk freq sound/soc/intel/boards/sof_rt5682.c | 9 +++++- sound/soc/intel/boards/sof_sdw.c | 31 +++++++++++++------ sound/soc/intel/boards/sof_sdw_common.h | 2 ++ sound/soc/intel/boards/sof_sdw_hdmi.c | 6 ++++ sound/soc/intel/boards/sof_sdw_rt711.c | 17 +++++++++- .../intel/common/soc-acpi-intel-ehl-match.c | 2 +- 6 files changed, 54 insertions(+), 13 deletions(-) base-commit: 22e9b54307987787efa0ee534aa9e31982ec1161 -- 2.25.1
2020-07-20ASoC: soc-dai.h: drop a duplicated wordRandy Dunlap1-1/+1
Drop the repeated word "be" in a comment. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20200719003307.21403-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-20ASoC: soc-dai: remove .digital_muteKuninori Morimoto1-1/+0
All drivers are now using .mute_stream. Let's remove .digital_mute. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87h7u72dqz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-17ASoC: soc-dai.h: don't use discriminatory terms for commentKuninori Morimoto1-4/+4
soc-dai is using discriminatory terms for comment. This patch renames "slave" to "secondary", thus we can keep M/S initials. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zam3bmk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: soc-dai.c: add .no_capture_mute supportKuninori Morimoto1-0/+3
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling "direction". We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } To prepare merging mute_stream()/digital_mute(), this patch adds .no_capture_mute support to emulate .digital_mute(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87eeplxxj7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08ASoC: soc-dai: set dai_link dpcm_ flags with a helperPierre-Louis Bossart1-0/+1
Add a helper to walk through all the DAIs and set dpcm_playback and dpcm_capture flags based on the DAIs capabilities, and use this helper to avoid setting these flags arbitrarily in generic cards. The commit referenced in the Fixes tag did not introduce the configuration issue but will prevent the card from probing when detecting invalid configurations. Fixes: b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20200707210439.115300-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: cleanup dai / component active codeKuninori Morimoto1-2/+0
No one is using dai->active, snd_soc_component_is_active(). Let's remove these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87imgy58hp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: soc-dai: add snd_soc_dai_stream_active()Kuninori Morimoto1-0/+6
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/874ksi6n48.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: soc-dai: add snd_soc_dai_active()Kuninori Morimoto1-0/+1
Current snd_soc_dai_action() is updating dai->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. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/877dxe6n4i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: soc-dai: add snd_soc_dai_action()Kuninori Morimoto1-0/+12
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. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87a72a6n4s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_get_metadata()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_get_metadata(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87eesdssi8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_set_metadata()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_set_metadata(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87ftctssid.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_pointer()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_pointer(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_ack()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_ack(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87imhpssim.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_get_params()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_get_params(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87k125ssir.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_set_params()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_set_params(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87lfmlssiv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_trigger()Kuninori Morimoto1-0/+2
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_trigger(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87mu71ssiz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_shutdown()Kuninori Morimoto1-0/+2
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_shutdown(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87o8rhssj3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_dai_compr_start()Kuninori Morimoto1-0/+3
dai related function should be implemented at soc-dai.c. This patch adds snd_soc_dai_compr_start(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87pnbxssj7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_remove()Kuninori Morimoto1-1/+1
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_remove() to snd_soc_pcm_dai_remove(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87r1wdssjc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_probe()Kuninori Morimoto1-1/+1
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_probe() to snd_soc_pcm_dai_probe(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87sggtssjg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger()Kuninori Morimoto1-2/+2
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update soc_pcm_bespoke_trigger() to snd_soc_pcm_dai_bespoke_trigger(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87tv19ssjm.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_trigger()Kuninori Morimoto1-2/+1
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_trigger() to snd_soc_pcm_dai_trigger(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87v9lpssjr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_prepare()Kuninori Morimoto1-2/+1
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_prepare() to snd_soc_pcm_dai_prepare(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87wo65ssk2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: soc-dai: add snd_soc_pcm_dai_new()Kuninori Morimoto1-0/+2
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update soc_dai_pcm_new() to snd_soc_pcm_dai_new(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87y2qlssk7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-15ASoC: soc-dai: revert all changes to DAI startup/shutdown sequencePierre-Louis Bossart1-1/+0
On Baytrail/Cherrytrail, the Atom/SST driver fails miserably: [ 9.741953] intel_sst_acpi 80860F28:00: FW Version 01.0c.00.01 [ 9.832992] intel_sst_acpi 80860F28:00: FW sent error response 0x40034 [ 9.833019] intel_sst_acpi 80860F28:00: FW alloc failed ret -4 [ 9.833028] intel_sst_acpi 80860F28:00: sst_get_stream returned err -5 [ 9.833033] sst-mfld-platform sst-mfld-platform: ASoC: DAI prepare error: -5 [ 9.833037] Baytrail Audio Port: ASoC: prepare FE Baytrail Audio Port failed [ 9.853942] intel_sst_acpi 80860F28:00: FW sent error response 0x40034 [ 9.853974] intel_sst_acpi 80860F28:00: FW alloc failed ret -4 [ 9.853984] intel_sst_acpi 80860F28:00: sst_get_stream returned err -5 [ 9.853990] sst-mfld-platform sst-mfld-platform: ASoC: DAI prepare error: -5 [ 9.853994] Baytrail Audio Port: ASoC: prepare FE Baytrail Audio Port failed Commit b56be800f1292 ("ASoC: soc-pcm: call snd_soc_dai_startup()/shutdown() once") was the initial problematic commit. Commit 1ba616bd1a6d5e ("ASoC: soc-dai: fix DAI startup/shutdown sequence") was an attempt to fix things but it does not work on Baytrail, reverting all changes seems necessary for now. Fixes: 1ba616bd1a6d5e ("ASoC: soc-dai: fix DAI startup/shutdown sequence") Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200415030437.23803-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-30ASoC: soc-dai: fix DAI startup/shutdown sequencePierre-Louis Bossart1-1/+1
The addition of a single flag to track the DAI status prevents the DAI startup sequence from being called on capture if the DAI is already used for playback. Fix by extending the existing code with one flag per direction. Fixes: b56be800f1292 ("ASoC: soc-pcm: call snd_soc_dai_startup()/shutdown() once") Reported-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20200330160602.10180-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16ASoC: soc-dai: return proper error for get_sdw_stream()Srinivas Kandagatla1-2/+2
snd_soc_dai_get_sdw_stream() returns null if dai does not support this callback, this is no very useful for the caller to differentiate if this is an error or unsupported call for the dai. return -ENOTSUPP in cases where this callback is not supported. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200316151110.2580-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-26ASoC: soc-dai: add get_sdw_stream() callbackPierre-Louis Bossart1-0/+21
We only have a set() operation, provide the dual get() operation to retrieve the stream information. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200225170041.23644-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-24ASoC: soc-pcm: add snd_soc_dai_get_widget()Kuninori Morimoto1-0/+8
soc-pcm.c has dai_get_widget(), but it can be more generic. This patch renames it to snd_soc_dai_get_widget(), and use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d0abjca1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-24ASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()Kuninori Morimoto1-0/+7
DAI driver has playback/capture stream. OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE. Because of this kind of implementation, ALSA SoC needs to have many verbose code. To solve this issue, this patch adds snd_soc_dai_get_pcm_stream() macro to get playback/capture stream pointer from stream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ftf7jcab.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18ASoC: soc-pcm: merge playback/cature_active into stream_activeKuninori Morimoto1-2/+1
DAI has playback_active and capture_active to care usage count. OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE. But because of this kind of implementation mismatch, ALSA SoC has many verbose code. To solve this issue, this patch merge playback_active/capture_active into stream_active[2]; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/875zg5botu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: soc-pcm: call snd_soc_dai_startup()/shutdown() onceKuninori Morimoto1-1/+4
Current soc_pcm_open() calls snd_soc_dai_startup() under loop. Thus, it needs to care about started/not-yet-started codec DAI. But, if soc-dai.c is handling it, soc-pcm.c don't need to care about it. This patch adds started flag to soc-dai.h, and simplify soc-pcm.c. This is one of prepare for cleanup soc-pcm-open() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zgfcey5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: soc-core: remove bus_controlKuninori Morimoto1-1/+0
Now, snd_soc_dai_driver::bus_control is used for how to resume. But, no driver which has bus_control has DAI driver suspend/resume support. This patch removes pointless bus_control from ALSA SoC. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pnffx7i4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: soc-core: remove DAI suspend/resumeKuninori Morimoto1-2/+0
Historically, CPU and Codec were implemented different, but now it is merged as Component. ALSA SoC is supporting suspend/resume at DAI and Component level. The method is like below. 1) Suspend/Resume all CPU DAI if bus-control was 0 2) Suspend/Resume all Component 3) Suspend/Resume all CPU DAI if bus-control was 1 Historically 2) was Codec special operation. Because CPU and Codec were merged into Component, CPU suspend/resume has 3 chance to suspend(= 1/2/3), but Codec suspend/resume has 1 chance (= 2). Here, DAI side suspend/resume is caring bus-control, but no driver which is supporting suspend/resume is setting bus-control. This means 3) was never used. Here, used parameter for suspend/resume component->dev and dai->dev are same pointer. For that reason, we can merge DAI and Component suspend/resume. One note is that we should use 2), because it is caring BIAS level. This patch removes 1) and 3). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87r1zvx7i8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-22ASoC: soc-dai: use bit field for bus_controlKuninori Morimoto1-2/+1
.bus_control can be bit field. this patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87v9uszazh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>