- 28 Oct, 2022 15 commits
-
-
Mark Brown authored
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>: Goal of the series is implementation of suspend/resume operations for a PCM stream along with all the collaterals connected to the subject. Start with splitting avs_dai_fe_hw_free() as ideally we would like to reuse as much of existing code as possible but snd_pcm_lib_free_pages() is not desired part of the function when speaking of suspend operation. The actual implementation of suspend/resume() for component drivers follows. For most scenarios, the PM flow is similar to standard streaming one, except for the part where the position register are being saved and the lack of PCM pages freeing. To reduce code duplication, all avs_dai_suspend_XXX() and avs_dai_resume_XXX() functions reuse their non-PM equivalents. Order of operations is affected by the fact that path binding/unbinding happens only in FE part of the stream. Above essentially unlocks SX+streaming scenarios i.e.: power transitions with an ongoing stream. As some streams are allowed to run in low power state, support is provided for S0iX state. The handlers check ACPI capabilities and the number of active low-power paths before deciding between SX and S0iX flows. The last portion of the patchset is addition of power/clock gating overrides. There is no single set of registers that ensures AudioDSP firmware loads 100% of time on every single configuration. By having them exposed, user can have the loading procedure behavior adjusted for their configuration without having to recompile the kernel.
-
Mark Brown authored
Merge series from Chancel Liu <chancel.liu@nxp.com>: This patchset supports SAI on i.MX93 platform.
-
Cezary Rojewski authored
Update all firmware loading functions to also account for the power gating policy. As module loading routine is missing the chicken bits manipulation entirely, add the entire set there. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-10-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Provide pgctl/cgctl_mask module parameters for overriding power and clock gating policies respectively. These help deal with rare firmware loading failures on some configurations. There're no golden masks that cover all known problems so leave the defaults as is. While at it, update avs_hda_l1sen_enable()'s definition so it aligns with its power/clock friends. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-9-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Piotr Maziarz authored
Introduce avs_suspend_standby() and avs_resume_standby() to support S0IX streaming. The AudioDSP is not shutdown during such scenario and the PCI device is armed for possible wake operation through an audio event. As capability for a stream to be active during low power S0 is based off of ->ignore_suspend, adjust the field's value according to platform capabilities if needed. Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-8-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Streaming in S0iX differs from SX scenarios. Store the number of so-called low-power streams to be able to differentiate between the two. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-7-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Resuming of capture streams for HD-Audio is unsupported so remove the relevant flag from the hardware params when assigning them during avs_component_hda_open(). Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-6-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Amadeusz Sławiński authored
With power management operations added, service SUSPEND and RESUME trigger commands for running streams. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-5-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Allow for waiting for DRSM bit for specified stream to be cleared from HDAudio library level. Drivers may utilize this optional step during the stream resume procedure. Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20221027124702.1761002-4-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Implement suspend/resume() operations for component drivers. For most scenarios, the PM flow is similar to standard streaming one, except for the part where the position register are being saved and the lack of PCM pages freeing. To reduce code duplication, all avs_dai_suspend_XXX() and avs_dai_resume_XXX() functions reuse their non-PM equivalents. Given that path binding/unbinding happens only in FE part of the stream, the order of suspend() goes: 1. hw_free() all FE DAIs, paths are unbound here 2. hw_free() all BE DAIs Consequently, for resume() its: 1. hw_params() all BE DAIs 2. hw_params() all FE DAIs, paths are bound here 3. prepare() all BE DAIs 4. prepare() all FE DAIs As component->suspend/resume() do not provide substream pointer, store it ourselves so that the PM flow has all the necessary information to proceed. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-3-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Cezary Rojewski authored
Prepare for introduction of PCM power management support. As freeing pages during the suspend operation is not desired, separate snd_pcm_lib_free_pages() from existing avs_dai_fe_hw_free() so that majority of the code found within it can be reused for standard and PM flows both. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20221027124702.1761002-2-cezary.rojewski@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Shengjiu Wang authored
These counter registers are part of register list, add them to complete the register map - DMAC counter control registers - Data path Timestamp counter register - Data path bit counter register - Data path bit count timestamp register - Data path bit read timestamp register Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1666940627-7611-1-git-send-email-shengjiu.wang@nxp.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chancel Liu authored
There is a limit to eDMA AXI on i.MX93. Only TCD that has NBYTES in a multiple of 8bytes can enable scatter-gather. NBYTES is calculated by bus width times maxburst. On i.MX93 platform the value of maxburst is specified to 8. It makes sure that NBYTES is a multiple of 8bytes. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20221027060311.2549711-4-chancel.liu@nxp.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chancel Liu authored
Add compatible string and specific soc data to support SAI on i.MX93 platform. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20221027060311.2549711-3-chancel.liu@nxp.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chancel Liu authored
Add compatible string "fsl,imx93-sai" for i.MX93 platform Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20221027060311.2549711-2-chancel.liu@nxp.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 26 Oct, 2022 25 commits
-
-
Mark Brown authored
Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>: There is a typo which keeps propagating through existing Intel machine boards fix it with hope that fix stops it from appearing in new boards.
-
Mark Brown authored
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This is the part1 of my HDaudio cleanups, before the addition of to-be-announced HDaudio extensions. The patchset includes more consistent use of read/write/update helpers, removal of useless waits, structure members and programming sequences, removal of confusing sharing of private_data between FE and BE. Additional patches are coming to split the controller, codec and multi-link management functionality in well-identified files. Pierre-Louis Bossart (16): ASoC: SOF: ops: fallback to mmio in helpers ASoC: SOF: Intel: use mmio fallback for all platforms ASoC: SOF: ops: add readb/writeb helpers ASoC: SOF: ops: add snd_sof_dsp_updateb() helper ASoC: SOF: Intel: hda-dsp: use SOF helpers for consistency ASoC: SOF: Intel: hda-dai: start removing the use of runtime->private_data in BE ASoC: SOF: Intel: hda-dai: use component_get_drvdata to find hdac_bus ASoC: SOF: Intel: hda-dai: remove useless members in hda_pipe_params ASoC: SOF: Intel: hda-ctrl: remove useless sleep ASoC: SOF: Intel: hda: always do a full reset ASoC: SOF: Intel: hda: remove useless check on GCTL ASoC: SOF: Intel: hda-stream: use SOF helpers for consistency ASoC: SOF: Intel: hda-stream: rename CL_SD_CTL registers as SD_CTL ASoC: SOF: Intel: hda: use SOF helper for consistency ASoC: SOF: Intel: hda-stream: use snd_sof_dsp_updateb() helper ASoC: SOF: Intel: hda-stream: use readb/writeb for stream registers sound/soc/sof/intel/bdw.c | 6 +--- sound/soc/sof/intel/byt.c | 12 ++----- sound/soc/sof/intel/hda-common-ops.c | 6 +--- sound/soc/sof/intel/hda-ctrl.c | 41 ++++++++-------------- sound/soc/sof/intel/hda-dai.c | 31 +++++++---------- sound/soc/sof/intel/hda-dsp.c | 12 ++++--- sound/soc/sof/intel/hda-loader-skl.c | 30 ++++++++-------- sound/soc/sof/intel/hda-loader.c | 4 +-- sound/soc/sof/intel/hda-stream.c | 47 ++++++++++++------------- sound/soc/sof/intel/hda.c | 5 ++- sound/soc/sof/intel/hda.h | 25 +++++++------- sound/soc/sof/intel/pci-tng.c | 6 +--- sound/soc/sof/ops.h | 51 ++++++++++++++++++++-------- sound/soc/sof/sof-priv.h | 4 +++ 14 files changed, 136 insertions(+), 144 deletions(-) -- 2.34.1
-
Mark Brown authored
Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>: This series is a preparatory cleanup of the jz4740-i2s driver before adding support for a new SoC. The two improvements are lifting unnecessary restrictions on sample rates and formats -- the existing ones appear to be derived from the limitations of the JZ4740's internal codec and don't reflect the actual capabilities of the I2S controller. I'm unable to test the series on any JZ47xx SoCs, but I have tested on an X1000 (which is the SoC I'll be adding in a followup series).
-
Nícolas F. R. A. Prado authored
Commit 0adccaf1 ("ASoC: dt-bindings: rt5682: Add #sound-dai-cells") defined the sound-dai-cells property as 0. However, rt5682 has two DAIs, AIF1 and AIF2, and therefore should have sound-dai-cells set to 1. Fix it. Fixes: 0adccaf1 ("ASoC: dt-bindings: rt5682: Add #sound-dai-cells") Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20221024220015.1759428-4-nfraprado@collabora.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Nícolas F. R. A. Prado authored
The rt5682s codec is a DAI provider with two interfaces - AIF1 and AIF2 - and therefore should have a #sound-dai-cells property that is equal to 1. Add it. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20221024220015.1759428-2-nfraprado@collabora.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Peter Ujfalusi authored
sof_ipc4_fw_parse_ext_man() can return negative error numbers which is not correct for the used size_t type. Change the return value to ssize_t and use the same type where the function is called. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 73c091a2 ("ASoC: SOF: ipc4-loader: Support for loading external libraries") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20221025132706.30356-1-peter.ujfalusi@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Yong Zhi authored
Fix small cut-and-paste error in comment. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Yong Zhi <yong.zhi@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20221024164350.234830-1-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Nícolas F. R. A. Prado authored
sound-dai is a standard property whose type is already set to phandle-array by sound-dai.yaml, so there's no need to set it (and wrongly so for headset-codec) in this binding. What should be set however is the maximum number of items, which for headset-codec should be 1. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20221024230658.1772907-1-nfraprado@collabora.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Amadeusz Sławiński authored
It keeps propagating through machine boards, fix it once and for all. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20221024190841.31572-3-amadeuszx.slawinski@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Amadeusz Sławiński authored
It keeps propagating through machine boards, fix it once and for all. Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20221024190841.31572-2-amadeuszx.slawinski@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
Move most of the DAI probe/remove logic into component ops. This makes things more consistent because the AIC clock is now managed solely from the component side. And it makes it easier to add codec switching support later on. Reviewed-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-10-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
Move the component suspend/resume functions near the definition of the component driver to emphasize that they're unrelated to the DAI functions. Acked-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-9-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
The I2S controller on JZ47xx SoCs doesn't impose restrictions on sample rate and the driver doesn't make any assumptions about it, so the DAI should advertise a continuous sample rate range. Acked-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-8-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
The audio controller on JZ47xx SoCs can transfer 20- and 24-bit samples in the FIFO, so allow those formats to be used with the I2S driver. Although the FIFO doesn't care about the in-memory sample format, we only support 4-byte format variants because the DMA controller on these SoCs cannot transfer in 3-byte multiples. Reviewed-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-7-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
Some purely cosmetic changes: line up all the macro values to make things easier to read and sort the includes alphabetically. Acked-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-6-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
Get rid of a couple of macros and improve readability by using FIELD_PREP() and GENMASK() for the sample size setting. Acked-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-5-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
The differences between register fields on different SoC versions can be abstracted away using the regmap field API. This is easier to understand and extend than comparisons based on the version ID. Since the version IDs are unused after this change, remove them at the same time, and remove unused macros. Reviewed-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-4-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
Using regmap for accessing the AIC registers makes the driver a little easier to read, and later refactors can take advantage of regmap APIs to further simplify the driver. Reviewed-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-3-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Aidan MacDonald authored
On the JZ4740, there is a single bit that flushes (empties) both the transmit and receive FIFO. Later SoCs have independent flush bits for each FIFO. Independent FIFOs can be flushed before the snd_soc_dai_active() check because it won't disturb other active streams. This ensures that the FIFO we're about to use is always flushed before starting up. With shared FIFOs we can't do that because if another substream is active, flushing its FIFO would cause underrun errors. This also fixes a bug: since we were only setting the JZ4740's flush bit, which corresponds to the TX FIFO flush bit on other SoCs, other SoCs were not having their RX FIFO flushed at all. Fixes: 967beb2e ("ASoC: jz4740: Add jz4780 support") Reviewed-by: Paul Cercueil <paul@crapouillou.net> Cc: stable@vger.kernel.org Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20221023143328.160866-2-aidanmacdonald.0x0@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
readb/writeb are used directly without any wrappers or references to the BAR, as usually done for other registers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-17-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
No functionality change, only code consistency. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-16-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
No functionality change, just more consistency in the code. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-15-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
The use of the CL prefix is misleading. HDaudio streams are used for code loading since ApolloLake, but they are also used for regular audio transfers. No functionality change, pure rename. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-14-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
Not sure why we mixed sof and hdac helpers, this makes the code way less readable. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-13-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
Now that we always do a full reset, there's no point in checking if the controller is always out-of-reset. This is always true by construction. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221024165310.246183-12-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-