1
0
Fork 0
Commit Graph

225 Commits (ba302d2a8ef0917a6d1c3775d1b4b9f2b26c8ef5)

Author SHA1 Message Date
Mark Brown a23d7f4a7c
Merge series "ASoC: remove rtd->cpu/codec_dai{s}" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Now, CPU/Codec DAI(s) were replaced by rtd->dais.
Thus, We don't need rtd->cpu/codec_dai{s} anymore.
This pathset replaces it by new macro.

Kuninori Morimoto (36):
  ASoC: soc-core: add asoc_rtd_to_cpu/codec() macro
  ASoC: amd: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: atmel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: au1x: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: bcm: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: cirrus: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: dwc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: fsl: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: generic: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: img: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: kirkwood: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: mediatek: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: meson: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: mxs: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: pxa: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: qcom: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: rockchip: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: samsung: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: sh: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: sof: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: sprd: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: stm: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: sunxi: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: tegra: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: ti: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: txx9: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: uniphier: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: ux500: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: xtensa: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: arm: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: codecs: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
  ASoC: soc-core: set rtd->num_cpu/codec at soc_new_pcm_runtime()
  ASoC: soc-core: tidyup soc_new_pcm_runtime() rtd setups
  ASoC: soc-core: remove cpu_dai/codec_dai/cpu_dais/codec_dais

 include/sound/soc.h                           | 30 +++++++------
 sound/arm/pxa2xx-pcm-lib.c                    |  8 ++--
 sound/soc/amd/acp-da7219-max98357a.c          |  2 +-
 sound/soc/amd/acp-rt5645.c                    |  4 +-
 sound/soc/amd/acp3x-rt5682-max9836.c          |  6 +--
 sound/soc/atmel/atmel-pcm-dma.c               |  4 +-
 sound/soc/atmel/atmel-pcm-pdc.c               |  2 +-
 sound/soc/atmel/atmel_wm8904.c                |  2 +-
 sound/soc/atmel/mikroe-proto.c                |  2 +-
 sound/soc/atmel/sam9g20_wm8731.c              |  2 +-
 sound/soc/atmel/sam9x5_wm8731.c               |  2 +-
 sound/soc/au1x/db1200.c                       |  2 +-
 sound/soc/au1x/dbdma2.c                       |  2 +-
 sound/soc/au1x/dma.c                          |  2 +-
 sound/soc/au1x/psc-ac97.c                     |  2 +-
 sound/soc/bcm/bcm63xx-pcm-whistler.c          | 16 +++----
 sound/soc/bcm/cygnus-pcm.c                    | 22 +++++-----
 sound/soc/cirrus/edb93xx.c                    |  4 +-
 sound/soc/cirrus/snappercl15.c                |  4 +-
 sound/soc/codecs/cs47l15.c                    |  4 +-
 sound/soc/codecs/cs47l24.c                    |  6 +--
 sound/soc/codecs/cs47l35.c                    |  6 +--
 sound/soc/codecs/cs47l85.c                    |  6 +--
 sound/soc/codecs/cs47l90.c                    |  6 +--
 sound/soc/codecs/cs47l92.c                    |  4 +-
 sound/soc/codecs/wm5110.c                     |  6 +--
 sound/soc/codecs/wm_adsp.c                    | 10 ++---
 sound/soc/dwc/dwc-pcm.c                       |  2 +-
 sound/soc/fsl/eukrea-tlv320.c                 |  4 +-
 sound/soc/fsl/fsl-asoc-card.c                 | 10 ++---
 sound/soc/fsl/fsl_asrc_dma.c                  |  6 +--
 sound/soc/fsl/fsl_spdif.c                     | 10 ++---
 sound/soc/fsl/fsl_ssi.c                       |  8 ++--
 sound/soc/fsl/imx-audmix.c                    |  8 ++--
 sound/soc/fsl/imx-mc13783.c                   |  4 +-
 sound/soc/fsl/imx-sgtl5000.c                  |  2 +-
 sound/soc/fsl/mpc5200_dma.c                   | 10 ++---
 sound/soc/fsl/mpc5200_psc_i2s.c               |  2 +-
 sound/soc/fsl/mpc8610_hpcd.c                  |  4 +-
 sound/soc/fsl/mx27vis-aic32x4.c               |  4 +-
 sound/soc/fsl/p1022_ds.c                      |  4 +-
 sound/soc/fsl/p1022_rdk.c                     |  4 +-
 sound/soc/fsl/wm1133-ev1.c                    |  6 +--
 sound/soc/generic/simple-card-utils.c         | 12 +++---
 sound/soc/img/img-i2s-in.c                    |  2 +-
 sound/soc/img/img-i2s-out.c                   |  2 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  6 +--
 sound/soc/intel/boards/bdw-rt5650.c           |  6 +--
 sound/soc/intel/boards/bdw-rt5677.c           |  6 +--
 sound/soc/intel/boards/broadwell.c            |  4 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |  8 ++--
 sound/soc/intel/boards/bxt_rt298.c            |  8 ++--
 sound/soc/intel/boards/byt-max98090.c         |  2 +-
 sound/soc/intel/boards/byt-rt5640.c           |  4 +-
 sound/soc/intel/boards/bytcht_cx2072x.c       | 10 ++---
 sound/soc/intel/boards/bytcht_da7213.c        |  8 ++--
 sound/soc/intel/boards/bytcht_es8316.c        |  8 ++--
 sound/soc/intel/boards/bytcht_nocodec.c       |  4 +-
 sound/soc/intel/boards/bytcr_rt5640.c         |  8 ++--
 sound/soc/intel/boards/bytcr_rt5651.c         |  8 ++--
 sound/soc/intel/boards/cht_bsw_max98090_ti.c  |  6 +--
 sound/soc/intel/boards/cht_bsw_nau8824.c      |  4 +-
 sound/soc/intel/boards/cht_bsw_rt5645.c       | 14 +++----
 sound/soc/intel/boards/cht_bsw_rt5672.c       |  8 ++--
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |  6 +--
 sound/soc/intel/boards/glk_rt5682_max98357a.c | 10 ++---
 sound/soc/intel/boards/haswell.c              |  2 +-
 sound/soc/intel/boards/kbl_da7219_max98357a.c |  8 ++--
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  6 +--
 sound/soc/intel/boards/kbl_rt5660.c           |  6 +--
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  8 ++--
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |  8 ++--
 .../soc/intel/boards/skl_nau88l25_max98357a.c | 12 +++---
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 16 +++----
 sound/soc/intel/boards/skl_rt286.c            |  8 ++--
 sound/soc/intel/boards/sof_da7219_max98373.c  |  8 ++--
 sound/soc/intel/boards/sof_pcm512x.c          |  8 ++--
 sound/soc/intel/boards/sof_rt5682.c           |  6 +--
 sound/soc/intel/haswell/sst-haswell-pcm.c     | 26 ++++++------
 sound/soc/intel/skylake/skl-pcm.c             | 10 ++---
 sound/soc/kirkwood/armada-370-db.c            |  2 +-
 sound/soc/kirkwood/kirkwood-dma.c             |  2 +-
 sound/soc/mediatek/common/mtk-afe-fe-dai.c    | 10 ++---
 .../mediatek/common/mtk-afe-platform-driver.c |  2 +-
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c    |  2 +-
 sound/soc/mediatek/mt2701/mt2701-cs42448.c    |  4 +-
 sound/soc/mediatek/mt2701/mt2701-wm8960.c     |  4 +-
 sound/soc/mediatek/mt6797/mt6797-afe-pcm.c    |  2 +-
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c    |  2 +-
 sound/soc/mediatek/mt8173/mt8173-max98090.c   |  4 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5514.c    |  2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5676.c    |  4 +-
 sound/soc/mediatek/mt8173/mt8173-rt5650.c     |  6 +--
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c    |  2 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |  4 +-
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   |  2 +-
 sound/soc/meson/aiu-fifo.c                    |  2 +-
 sound/soc/meson/axg-card.c                    |  8 ++--
 sound/soc/meson/axg-fifo.c                    |  2 +-
 sound/soc/meson/meson-card-utils.c            |  2 +-
 sound/soc/mxs/mxs-sgtl5000.c                  |  4 +-
 sound/soc/pxa/brownstone.c                    |  4 +-
 sound/soc/pxa/corgi.c                         |  4 +-
 sound/soc/pxa/hx4700.c                        |  4 +-
 sound/soc/pxa/imote2.c                        |  4 +-
 sound/soc/pxa/magician.c                      |  8 ++--
 sound/soc/pxa/mioa701_wm9713.c                |  4 +-
 sound/soc/pxa/mmp-pcm.c                       |  2 +-
 sound/soc/pxa/mmp-sspa.c                      |  2 +-
 sound/soc/pxa/poodle.c                        |  4 +-
 sound/soc/pxa/pxa2xx-i2s.c                    |  2 +-
 sound/soc/pxa/spitz.c                         |  4 +-
 sound/soc/pxa/ttc-dkb.c                       |  2 +-
 sound/soc/pxa/z2.c                            |  4 +-
 sound/soc/pxa/zylonite.c                      |  6 +--
 sound/soc/qcom/apq8016_sbc.c                  |  2 +-
 sound/soc/qcom/apq8096.c                      |  6 +--
 sound/soc/qcom/lpass-platform.c               |  2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c              |  4 +-
 sound/soc/qcom/qdsp6/q6routing.c              |  2 +-
 sound/soc/qcom/sdm845.c                       | 22 +++++-----
 sound/soc/qcom/storm.c                        |  2 +-
 sound/soc/rockchip/rk3288_hdmi_analog.c       |  4 +-
 sound/soc/rockchip/rk3399_gru_sound.c         | 16 +++----
 sound/soc/rockchip/rockchip_max98090.c        |  6 +--
 sound/soc/rockchip/rockchip_rt5645.c          |  6 +--
 sound/soc/samsung/arndale.c                   |  6 +--
 sound/soc/samsung/bells.c                     | 16 +++----
 sound/soc/samsung/h1940_uda1380.c             |  2 +-
 sound/soc/samsung/i2s.c                       |  2 +-
 sound/soc/samsung/jive_wm8750.c               |  4 +-
 sound/soc/samsung/littlemill.c                | 14 +++----
 sound/soc/samsung/lowland.c                   |  4 +-
 sound/soc/samsung/neo1973_wm8753.c            | 10 ++---
 sound/soc/samsung/odroid.c                    |  2 +-
 sound/soc/samsung/pcm.c                       |  4 +-
 sound/soc/samsung/rx1950_uda1380.c            |  2 +-
 sound/soc/samsung/s3c-i2s-v2.c                |  2 +-
 sound/soc/samsung/s3c24xx_simtec.c            |  4 +-
 sound/soc/samsung/s3c24xx_uda134x.c           |  6 +--
 sound/soc/samsung/smartq_wm8987.c             |  4 +-
 sound/soc/samsung/smdk_spdif.c                |  2 +-
 sound/soc/samsung/smdk_wm8580.c               |  2 +-
 sound/soc/samsung/smdk_wm8994.c               |  2 +-
 sound/soc/samsung/smdk_wm8994pcm.c            |  4 +-
 sound/soc/samsung/snow.c                      |  4 +-
 sound/soc/samsung/spdif.c                     |  8 ++--
 sound/soc/samsung/speyside.c                  |  8 ++--
 sound/soc/samsung/tm2_wm5110.c                | 16 +++----
 sound/soc/samsung/tobermory.c                 |  8 ++--
 sound/soc/sh/dma-sh7760.c                     | 16 +++----
 sound/soc/sh/fsi.c                            |  2 +-
 sound/soc/sh/migor.c                          |  6 +--
 sound/soc/sh/rcar/core.c                      |  2 +-
 sound/soc/soc-compress.c                      | 36 ++++++++--------
 sound/soc/soc-core.c                          | 42 +++++++------------
 sound/soc/soc-dapm.c                          |  4 +-
 sound/soc/soc-generic-dmaengine-pcm.c         |  6 +--
 sound/soc/soc-pcm.c                           | 30 ++++++-------
 sound/soc/sof/intel/hda-dai.c                 |  6 +--
 sound/soc/sof/intel/hda-dsp.c                 |  2 +-
 sound/soc/sprd/sprd-pcm-compress.c            |  4 +-
 sound/soc/sprd/sprd-pcm-dma.c                 |  2 +-
 sound/soc/stm/stm32_adfsdm.c                  | 12 +++---
 sound/soc/stm/stm32_sai_sub.c                 |  2 +-
 sound/soc/sunxi/sun4i-spdif.c                 |  2 +-
 sound/soc/tegra/tegra_alc5632.c               |  2 +-
 sound/soc/tegra/tegra_max98090.c              |  2 +-
 sound/soc/tegra/tegra_rt5640.c                |  2 +-
 sound/soc/tegra/tegra_rt5677.c                |  2 +-
 sound/soc/tegra/tegra_sgtl5000.c              |  2 +-
 sound/soc/tegra/tegra_wm8753.c                |  2 +-
 sound/soc/tegra/tegra_wm8903.c                |  6 +--
 sound/soc/tegra/trimslice.c                   |  2 +-
 sound/soc/ti/ams-delta.c                      |  4 +-
 sound/soc/ti/davinci-evm.c                    |  4 +-
 sound/soc/ti/davinci-vcif.c                   |  4 +-
 sound/soc/ti/n810.c                           |  2 +-
 sound/soc/ti/omap-abe-twl6040.c               |  6 +--
 sound/soc/ti/omap-mcbsp-st.c                  |  2 +-
 sound/soc/ti/omap-mcbsp.c                     |  4 +-
 sound/soc/ti/omap-mcpdm.c                     |  2 +-
 sound/soc/ti/omap3pandora.c                   |  4 +-
 sound/soc/ti/osk5912.c                        |  2 +-
 sound/soc/ti/rx51.c                           |  2 +-
 sound/soc/txx9/txx9aclc.c                     |  2 +-
 sound/soc/uniphier/aio-compress.c             | 22 +++++-----
 sound/soc/uniphier/aio-dma.c                  |  6 +--
 sound/soc/ux500/mop500_ab8500.c               |  6 +--
 sound/soc/ux500/ux500_pcm.c                   |  8 ++--
 sound/soc/xtensa/xtfpga-i2s.c                 |  2 +-
 191 files changed, 573 insertions(+), 577 deletions(-)

--
2.17.1
2020-03-27 15:33:10 +00:00
Pierre-Louis Bossart f09e9c7f63
ASoC: SOF: Intel: hda-ctrl: add reset cycle before parsing capabilities
Without this cycle, HDaudio capability parsing fails on some devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:37 +00:00
Rander Wang 90de3281c8
Asoc: SOF: Intel: hda: check SoundWire wakeen interrupt in irq thread
If pci device is in D0, wakeen interrupt will be
aggregated at cAVS level as interrupt. This commit
check the wakeen status and process it in irq thread

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:36 +00:00
Rander Wang bbd19cdca8
ASoC: SOF: Intel: hda: add WAKEEN interrupt support for SoundWire
When a SoundWire link is in clock stop state, a Slave device may wake
up the Master for some events such as jack detection. The WAKEEN
interrupt will be triggered and processed by the audio pci device.

If audio device is in D3, the interrupt will be routed to PME, or
aggregated at cAVS level as interrupt when audio device is in D0. This
patch only supports D3 case, where the audio pci device will be
resumed by a PME event and the WAKEEN interrupt will be processed
after audio pci device is powered up and ROM is initialized
successfully.

The WAKEEN handling is only enabled after the first boot due to
dependencies on a shim_lock mutex being initialized.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:35 +00:00
Pierre-Louis Bossart 02df8f4364
ASoC: SOF: Intel: hda: add parameter to control SoundWire clock stop quirks
Add module parameter so that the different modes can be quickly tested.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:34 +00:00
Bard Liao 722ba5f1f5
ASoC: SOF: Intel: hda: merge IPC, stream and SoundWire interrupt handlers
We have a single irq handler for SOF interrupts. We can further merge
SoundWire ones to completely remove MSI interrupts handling issues
leading to timeouts.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:33 +00:00
Pierre-Louis Bossart 3eadff5639
ASoC: SOF: Intel: hda: disable SoundWire interrupts on suspend
Doing this avoid conflicts and errors reported on the bus.

The interrupts are only re-enabled on resume after the firmware is
downloaded, so the behavior is not fully symmetric

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:33 +00:00
Pierre-Louis Bossart b9ddd81bad
ASoC: SOF: Intel: hda: initial SoundWire machine driver autodetect
For now we have a limited number of machine driver configurations, and
we can detect them based on the link configuration returned after
checking hardware and firmware (BIOS) configurations.

The link configuration is checked with a link_mask as well as a list
of _ADR descriptors for each link.

There is a chance that in extreme cases where the BIOS contains too
much information we would need to detect which Slave devices actually
report as 'attached'. This would be more accurate than static
table-based solutions, but it also introduces timing dependencies
since we don't know when those devices might become attached, so will
only be only be looked at if we see limitations with static methods
and the usual quirks based e.g. on DMI information.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:32 +00:00
Pierre-Louis Bossart d2c383aa49
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
These callbacks are invoked when a matching hw_params/hw_free() DAI
operation takes place, and will result in IPC operations with the SOF
firmware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:31 +00:00
Pierre-Louis Bossart 51dfed1e17
ASoC: SOF: Intel: add SoundWire configuration interface
Now that the SoundWire core supports the multi-step initialization,
call the relevant APIs.

The actual hardware enablement can be done in two places, ideally we'd
want to startup the SoundWire IP as soon as possible (while still
taking power rail dependencies into account)

However when suspend/resume is implemented, the DSP device will be
resumed first, and only when the DSP firmware is downloaded/booted
would the SoundWire child devices be resumed, so there are only
marginal benefits in starting the IP earlier for the first probe.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325215027.28716-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 15:16:29 +00:00
Kuninori Morimoto be3e8de706
ASoC: sof: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87d093ir4q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27 14:44:47 +00:00
Kai Vehmanen 7e26df0ced
ASoC: SOF: Intel: hda: call codec wake at chip init
Further align HDA init sequence to the legacy non-DSP HDA driver by
calling snd_hdac_set_codec_wakeup() during the chip init sequence.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 18:31:16 +00:00
Kai Vehmanen aae5a6e92f
ASoC: SOF: Intel: hda: do not leave clock gating off upon error
The misc clock gating (MISCBDCGE) is disabled for controller reset and
reenabled once reset is complete.

Fix the case when error happens during reset, and clock gating is
left disabled. The clock gating should be reenabled also in this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 18:31:15 +00:00
Ranjani Sridharan 66de6beb93
ASoC: SOF: Intel: hda: Improve DSP state logging
Improve the DSP power state logs with the state names
instead of values.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 18:31:13 +00:00
Mark Brown 673f45f7bf
Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7 2020-03-13 18:52:23 +00:00
Mark Brown bd2b34e485
Merge series "ASoC: SOF: multi-cpu dais, IPC and Intel improvements for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Corrections for compatibility with the multi-cpu dai check for
min-channels, IPC simplifications, and removal of unnecessary
boot-related code for Intel platforms.

Amery Song (2):
  ASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
  ASoC: SOF: Intel: remove unnecessary waitq before loading firmware

Bard Liao (2):
  ASoC: SOF: Intel: hda-dai: add stream capability
  ASoC: SOF: topology: connect dai widget to all cpu-dais

Karol Trzcinski (2):
  ASoC: SOF: Make sof_ipc_ext_data enum more rigid
  ASoC: SOF: Remove SOF_IPC_EXT_DMA_BUFFER

 include/sound/sof/info.h         | 22 +-------
 sound/soc/sof/intel/cnl.c        |  5 --
 sound/soc/sof/intel/hda-dai.c    | 96 ++++++++++++++++++++++++++++++++
 sound/soc/sof/intel/hda-ipc.c    | 20 +------
 sound/soc/sof/intel/hda-loader.c |  3 -
 sound/soc/sof/intel/hda.c        |  3 -
 sound/soc/sof/intel/hda.h        |  1 -
 sound/soc/sof/loader.c           |  6 --
 sound/soc/sof/sof-priv.h         |  5 --
 sound/soc/sof/topology.c         |  8 ++-
 10 files changed, 108 insertions(+), 61 deletions(-)

base-commit: 101247a3b8
--
2.20.1
2020-03-13 16:17:01 +00:00
Kai Vehmanen 42c67753ca
ASoC: SOF: Intel: hda: remove SND_SOC_SOF_HDA_COMMON_HDMI_CODEC
To help user-space with HDMI codec driver transition, both
a kernel module parameter and a kernel option were initially
provided to configure default behaviour of SOF on Intel hardware
with commit 139c7febad ("ASoC: SOF: Intel: add support for
snd-hda-codec-hdmi").

As hdac-hdmi is already now lagging in features compared to
snd-hda-codec-hdmi, move ahead with the transition and remove
the build option to select between the two, and instead default
to snd-hda-codec-hdmi if it is enabled in kernel build.

The old behaviour of using hdac-hdmi driver can still be forced
via the kernel module parameter.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:52 +00:00
Amery Song 828c2f7871
ASoC: SOF: Intel: remove unnecessary waitq before loading firmware
The HDA_DSP_IPC_PURGE_FW IPC from ROM is already handled in
cl_dsp_init(), and it will never be received in the IRQ thread,
so the wait condition on this IPC will never be satisfied. The
wait before loading firmware is redundant and can be removed safely.

Signed-off-by: Amery Song <chao.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:25 +00:00
Amery Song 9b65b2a80e
ASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
The HDA_DSP_IPC_PURGE_FW IPC from ROM is already handled in
cl_dsp_init(), and as IPC IRQ is disabled at this stage, this
IPC will be never received in the IRQ thread. The function
hda_dsp_ipc_is_sof for filtering the ROM IPC can be removed
safely.

Signed-off-by: Amery Song <chao.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Keyon <yang.jie@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:24 +00:00
Bard Liao e81d47e94c
ASoC: SOF: Intel: hda-dai: add stream capability
snd_soc_dai_stream_valid() will check if the stream is valid by testing
stream->channels_min. So we do need the information in dai driver.

The stream name is not added since we want to sure
playback_widget/capture_widget will be created by topology.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:22 +00:00
Cezary Rojewski 16dcefc23e
ASoC: SOF: Intel: Fix stream cleanup on hw free
Field "substream" gets assigned during stream setup in
hda_dsp_pcm_hw_params() but it is never cleared afterwards during
cleanup procedure. Now, any non-pcm operation e.g.: compress can
mistakenly make use of that pointer as it's bypassing all
"if (s->substream)" checks.

Nulling the pointer during hw_free operation ensures no wild pointers
are left behind.

Fixes: cdae3b9a47aa ("ASoC: SOF: Intel: Add Intel specific HDA PCM operations")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312120058.15057-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 13:12:35 +00:00
Mark Brown fae664ebc7
Merge series "ASoC: SOF: updates for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
4 unrelated improvements grouped in one bundle.

Jaska Uimonen (1):
  ASoC: SOF: ipc: check ipc return value before data copy

Keyon Jie (2):
  ASoC: SOF: pcm: skip DMA buffer pre-allocation
  ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE
    done

Tomasz Lauda (1):
  ASoC: SOF: add core id to sof_ipc_comp

 include/sound/sof/topology.h     |  3 ++-
 include/uapi/sound/sof/abi.h     |  2 +-
 sound/soc/sof/intel/hda-loader.c |  6 ++++++
 sound/soc/sof/ipc.c              | 12 +++++++-----
 sound/soc/sof/pcm.c              |  6 ++----
 5 files changed, 18 insertions(+), 11 deletions(-)

base-commit: 6941b0b5f919e9839e8c25efaeb53854efee14e5
--
2.20.1
2020-03-02 14:31:46 +00:00
Ranjani Sridharan 787c5214ea
ASoC: SOF: Intel: hda: use snd_sof_dsp_set_power_state() op
Replace the calls to hda_dsp_set_power_state() with the
top-level SOF op snd_sof_set_power_state().
Along with this, modify the hda_dsp_resume() function to return
the value of snd_sof_set_power_state() directly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200228234225.6963-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-02 14:31:43 +00:00
Keyon Jie 8354d9b445
ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done
Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the
interrupt and avoid the arrival of the confusing unexpected ipc.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-02 14:13:49 +00:00
Kai Vehmanen 71cc8abb6e
ASoC: SOF: Intel: hda: allow operation without i915 gfx
Add support to configure the HDA controller with an external HDA
codec even if iDisp codec in i915 is not available.

This can happen for multiple reasons:
 - internal graphics is disabled on the system
 - i915 driver is not enabled in kernel or it fails to init
 - i915 codec reports error in HDA codec probe
 - HDA codec driver probe fails

Address all these scenarios, but keep using the existing topology.
In case failures occur, HDMI PCM nodes are created, but they will
report error if application tries to use them. No ALSA mixer controls
are created. If the external HDA codec init fails as well, SOF probe
will return error as before.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206085
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1163677
BugLink: https://github.com/thesofproject/linux/issues/1658
Link: https://lore.kernel.org/r/20200220171028.22023-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-20 20:28:45 +00:00
Cezary Rojewski 7036810646
ASoC: SOF: Intel: Add Probe compress CPU DAIs
Declare extraction CPU DAI as well as sof_probe_compr_ops. FE DAIs can
link against these new CPU DAI to create new compress devices.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200218143924.10565-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18 21:52:11 +00:00
Cezary Rojewski 4c414da93a
ASoC: SOF: Intel: Probe compress operations
Add HDA handlers for soc_compr_ops and snd_compr_ops which cover probe
related operations. Implementation supports both connection purposes.
These merely define stream setups as core flow is covered by SOF
compress core.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200218143924.10565-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18 21:52:09 +00:00
Cezary Rojewski 49d7948ed1
ASoC: SOF: Intel: Expose SDnFMT helpers
Hda stream is setup in similar fashion for compress as it is for pcm
operations. To reuse existing code in compress path, expose SDnFMT
helper routines.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200218143924.10565-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18 21:52:08 +00:00
Cezary Rojewski f3b433e469
ASoC: SOF: Implement Probe IPC API
Add all required types and methods to support each and every request
that driver could sent to firmware. Probe is one of SOF firmware
features which allows for data extraction and injection directly from
or to DMA stream.

Exposes eight IPCs:
- addition and removal of injection DMAs
- addition and removal of probe points
- info retrieval of injection DMAs and probe points
- probe initialization and cleanup

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200218143924.10565-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18 21:52:06 +00:00
Cezary Rojewski 4a9ce6e4d9
ASoC: SOF: Intel: Account for compress streams when servicing IRQs
Update stream irq handler definition to correctly set hdac_stream
current position when servicing stream interrupts for compress streams.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200218143924.10565-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-18 21:52:06 +00:00
Mark Brown 7b94ace7ec
Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7 2020-02-11 16:18:04 +00:00
Ranjani Sridharan 851fd87324
ASoC: SOF: Intel: hda: Allow trace DMA in S0 when DSP is in D0I3 for debug
Trace DMA is disabled by default when the DSP is in D0I3.
Add a debug option to keep trace DMA enabled when the DSP
is in D0I3 during S0.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:48:08 +00:00
Ranjani Sridharan 63e51fd33f
ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0
This patch implements support for DSP D0i3 when the system
is in S0. The basic idea is to schedule a delayed work after
every successful IPC TX that checks if there are only
D0I3-compatible streams active and if so transition
the DSP to D0I3.

With the introduction of DSP D0I3 in S0, we need to
ensure that the DSP is in D0I0 before sending any new
IPCs. The exception for this would be the
compact IPCs that are used to set the DSP in
D0I3/D0I0 states.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:48:07 +00:00
Ranjani Sridharan 207bf12f64
ASoC: SOF: Intel: hda: Amend the DSP state transition diagram
Amend the DSP state transition diagram in preparation
for introducing the feature to support opportunistic
DSP D0I3 state when the system is in S0.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:48:06 +00:00
Ranjani Sridharan 61e285caf4
ASoC: SOF: Move DSP power state transitions to platform-specific ops
The DSP device substates such as D0I0/D0I3
are platform-specific. Therefore, the d0_substate
field of struct snd_sof_dev is replaced
with the dsp_power_state field which represents the current
state of the DSP. This field holds both the device state
and the platform-specific substate values.

With the DSP device substates being platform-specific,
the DSP power state transitions need to be performed in
the platform-specific suspend/resume ops as well.

In order to achieve this, the ops signature has to be
modified to pass the target device state as an
argument. The target substate will be determined by
the platform-specific ops before performing the transition.
For example, in the case of the system suspending to S0IX,
the top-level SOF device suspend callback needs to
only determine if the DSP will be entering
D3 or remain in D0. The target substate in case the device
needs to remain in D0 (D0I0 or D0I3) will be determined
by the platform-specific suspend op.

With the addition of the extended set of power states for the DSP,
the set_power_state op for HDA platforms has to be extended
to handle only the appropriate state transitions. So, the
implementation for the Intel HDA platforms is also modified.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:48:05 +00:00
Ranjani Sridharan 043ae13bbd
ASoC: SOF: Add system_suspend_target field to struct snd_sof_dev
Add the system_suspend_target field to struct snd_sof_dev
to track the intended system suspend power target. This will
be used as one of the criteria for determining the
final DSP power state.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11 11:48:03 +00:00
Kai Vehmanen af7aae1b1f
ASoC: SOF: Intel: hda: move i915 init earlier
To be compliant with i915 display driver requirements, i915 power-up
must be done before any HDA communication takes place, including
parsing the bus capabilities. Otherwise the initial codec probe
may fail.

Move i915 initialization earlier in the SOF HDA sequence. This
sequence is now aligned with the snd-hda-intel driver where the
display_power() call is before snd_hdac_bus_parse_capabilities()
and rest of the capability parsing.

Also remove unnecessary ifdef around hda_codec_i915_init(). There's
a dummy implementation provided if CONFIG_SND_SOC_SOF_HDA is not
enabled.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200206200223.7715-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-10 14:06:12 +00:00
Kai Vehmanen 816938b272
ASoC: SOF: Intel: hda: fix ordering bug in resume flow
When HDA controller is resumed from suspend, i915 HDMI/DP
codec requires that following order of actions is kept:

 - i915 display power up and configuration of link params
 - hda link reset and setup

Current SOF HDA code delegates display codec power control
to the codec driver. This works most of the time, but in
runtime PM sequences, the above constraint may be violated.
On platforms where BIOS values for HDA link parameters do
not match hardware reset defaults, this may lead to errors
in HDA verb transactions after resume.

Fix the issue by explicitly powering the display codec
in the HDA controller resume/suspend calls, thus ensuring
correct ordering. Special handling is needed for the D0i3
flow, where display power must be turned off even though
DSP is left powered.

Now that we have more invocations of the display power helper
functions, the conditional checks surrounding each call have
been moved inside hda_codec_i915_display_power(). The two
special cases of display powering at initial probe are handled
separately. The intent is to avoid powering the display whenever
no display codecs are used.

Note that early powering of display was removed in
commit 687ae9e287 ("ASoC: intel: skl: Fix display power regression").
This change was also copied to the SOF driver. No failures
have resulted as hardware default values for link parameters
have worked out of the box. However with recent i915 driver
changes like done in commit 87c1694533 ("drm/i915: save
AUD_FREQ_CNTRL state at audio domain suspend"), this does not
hold anymore and errors are hit.

Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200206200223.7715-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-10 14:06:04 +00:00
Takashi Iwai 9db0288273 ASoC: Fixes for v5.6
A collection of updates for bugs fixed since the initial pull
 request, the most important one being the addition of COMMON_CLK
 for wcd934x which is needed for MFD to be merged.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl46jnATHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0FfTB/9pn+BR2PZWE349/Etdj4Tb0mHO3mfG
 7sptuPYCXrFRJ82HPcSIIY8nUMBP+lYciIBE4Dn09QDxwPALFuEuzcM7XmJpJIKJ
 Vg9ooyYC4/59ijQJXFGR61Xaf30PcvdxE1sC3+SEt6ROn9C/whZHFzpnPJgmeFbq
 LIVI2ne/QpPQ+fozvUjkr8nOrEbLIhH6DeCRKExmQ5PYnM7fO//s51HmCUOAxQwJ
 FvEH2NCZwvGA43xSYeAdWfE1C3DgdEIT1VKEfeA+Va2tjwPz64mtA6xbaNW99xV6
 5/ii/c1x3Yjvy+F6IAqrmwCDZWQJ+xIgy4nbNLd2V8t1alYKWz22aVOr
 =qO+a
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.6-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.6

A collection of updates for bugs fixed since the initial pull
request, the most important one being the addition of COMMON_CLK
for wcd934x which is needed for MFD to be merged.
2020-02-05 12:33:45 +01:00
Kai Vehmanen 0c75419a94
ASoC: SOF: Intel: do not disable i915 power during probe
Change HDA probe behaviour slightly so that i915 power is not
turned off if i915 audio codecs are found in the initial probe done
by SOF Intel driver, and power is kept on until HDA codec driver
probe runs.

This will reduce number of mode sets on platforms with low
minimum CDCLK (like GLK) and brings the SOF probe sequence closer
to legacy HDA driver in terms of i915 audio codec power management.

BugLink: https://github.com/thesofproject/linux/issues/1642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200120160117.29130-3-kai.vehmanen@linux.intel.com
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27 17:51:43 +00:00
Kai Vehmanen 23ee09032d
ASoC: SOF: Intel: refactor i915_get/put functions
The current interface to control i915 display power is misleading.
The hda_codec_i915_get() and hda_codec_i915_put() names suggest
a refcounting based interface. This is confusing as no refcounting
is done and the underlying HDAC library interface does not support
refcounts eithers.

Clarify the code by replacing the functions with a single
hda_codec_i915_display_power() that is aligned with
snd_hdac_display_power().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200120160117.29130-2-kai.vehmanen@linux.intel.com
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27 17:51:27 +00:00
Mark Brown a7196caf83
Merge branch 'asoc-5.6' into asoc-next 2020-01-23 12:36:45 +00:00
Mark Brown 20230620b4
Merge branch 'asoc-5.5' into asoc-linus 2020-01-23 12:36:42 +00:00
Mark Brown ea3f0ce756 ASoC: Fixes for v5.5
This is mostly driver specific fixes, plus an error handling fix
 in the core.  There is a rather large diffstat for the stm32 SAI
 driver, this is a very large but mostly mechanical update which
 wraps every register access in the driver to allow a fix to the
 locking which avoids circular locks, the active change is much
 smaller and more reasonably sized.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4gVcMTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0IMOB/wJszUsDT3K46IvCg0qKJhsW+vsFsuo
 bjk03Fsbi/v6ukcrIbRxBl50saqut8MFibSgrMTlDCkCOvQbz3C+S2N96N9SKWSX
 gfEYd6PzdxVkZCx8xqybB82WGXjNBzoJue7lIYe2ytCIwjasPZtBjfNW9E+6KNkC
 zOGoRLGSDepZRovDQM8JbALhKHw4z5a19fDOGiESuDfp3kjsTKAe8R+UXRvcsIDc
 mqBblGMcKOZtRw87MDlDK2iKLPJEKAS3ndr6/a8+iX02hJMb3Yu6NbMmU4/0kHfC
 3xc7xoyTZW8GVnhsLchJhOBaz+TFizTqBJTCr1tjkEjPB504SZm+/Wtx
 =/nsR
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4h1RITHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0AjyB/41oCDts2pMZqxyt9PNBE3p4TDrRmxE
 Ocbtn+ygKWCaqEX+Ecy8rPMtXEM1Ziz4o57+iOUWlpLd63uXDxBwF+t8+oXtbvCP
 qfAO4IV7Fnw6CZTDvl5VFkSJKz+8woqP+ucqRIZSQLgqjuXXm26NVvZR93VY9av4
 gdHregixNNxLk1lElp9ZKyos3FvhkAFf/Fl4oNEgAH/7mP8yj82sJPd/RQYiaeNu
 t1vMC++Rh6cqt4X8gMWz8yET4LjqIWzQVMdyGJ9BP9mUtGUtuwK3kkQKpCpu1dMc
 b2y1G5uUPFBT9bgIOWyPqXIqsqdBSauuD5/e1jCz2Tgeq961C47qAiBC
 =khtD
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.5-rc6' into asoc-5.6

ASoC: Fixes for v5.5

This is mostly driver specific fixes, plus an error handling fix
in the core.  There is a rather large diffstat for the stm32 SAI
driver, this is a very large but mostly mechanical update which
wraps every register access in the driver to allow a fix to the
locking which avoids circular locks, the active change is much
smaller and more reasonably sized.
2020-01-17 15:38:56 +00:00
Cezary Rojewski a6947c9d86
ASoC: SOF: Intel: hda: Fix SKL dai count
With fourth pin added for iDisp for skl_dai, update SOF_SKL_DAI_NUM to
account for the change. Without this, dais from the bottom of the list
are skipped. In current state that's the case for 'Alt Analog CPU DAI'.

Fixes: ac42b142cd76 ("ASoC: SOF: Intel: hda: Add iDisp4 DAI")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200113114054.9716-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17 15:28:51 +00:00
Takashi Iwai e5dbdcb312 ASoC: Fixes for v5.5
This is mostly driver specific fixes, plus an error handling fix
 in the core.  There is a rather large diffstat for the stm32 SAI
 driver, this is a very large but mostly mechanical update which
 wraps every register access in the driver to allow a fix to the
 locking which avoids circular locks, the active change is much
 smaller and more reasonably sized.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4gVcMTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0IMOB/wJszUsDT3K46IvCg0qKJhsW+vsFsuo
 bjk03Fsbi/v6ukcrIbRxBl50saqut8MFibSgrMTlDCkCOvQbz3C+S2N96N9SKWSX
 gfEYd6PzdxVkZCx8xqybB82WGXjNBzoJue7lIYe2ytCIwjasPZtBjfNW9E+6KNkC
 zOGoRLGSDepZRovDQM8JbALhKHw4z5a19fDOGiESuDfp3kjsTKAe8R+UXRvcsIDc
 mqBblGMcKOZtRw87MDlDK2iKLPJEKAS3ndr6/a8+iX02hJMb3Yu6NbMmU4/0kHfC
 3xc7xoyTZW8GVnhsLchJhOBaz+TFizTqBJTCr1tjkEjPB504SZm+/Wtx
 =/nsR
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.5-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.5

This is mostly driver specific fixes, plus an error handling fix
in the core.  There is a rather large diffstat for the stm32 SAI
driver, this is a very large but mostly mechanical update which
wraps every register access in the driver to allow a fix to the
locking which avoids circular locks, the active change is much
smaller and more reasonably sized.
2020-01-16 14:14:26 +01:00
Pierre-Louis Bossart d873997192
ASoC: SOF: Intel: hda-dai: fix compilation warning in pcm_prepare
Fix GCC warning with W=1, previous cleanup did not remove unnecessary
variable.

sound/soc/sof/intel/hda-dai.c: In function ‘hda_link_pcm_prepare’:

sound/soc/sof/intel/hda-dai.c:265:31: warning: variable ‘hda_stream’
set but not used [-Wunused-but-set-variable]
  265 |  struct sof_intel_hda_stream *hda_stream;
      |                               ^~~~~~~~~~

Fixes: a3ebccb52e ("ASoC: SOF: Intel: hda: reset link DMA state in prepare")
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200113205620.27285-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-14 15:26:59 +00:00
Kai Vehmanen 2c63bea714
ASoC: SOF: Intel: fix HDA codec driver probe with multiple controllers
In case system has multiple HDA controllers, it can happen that
same HDA codec driver is used for codecs of multiple controllers.
In this case, SOF may fail to probe the HDA driver and SOF
initialization fails.

SOF HDA code currently relies that a call to request_module() will
also run device matching logic to attach driver to the codec instance.
However if driver for another HDA controller was already loaded and it
already loaded the HDA codec driver, this breaks current logic in SOF.
In this case the request_module() SOF does becomes a no-op and HDA
Codec driver is not attached to the codec instance sitting on the HDA
bus SOF is controlling. Typical scenario would be a system with both
external and internal GPUs, with driver of the external GPU loaded
first.

Fix this by adding similar logic as is used in legacy HDA driver
where an explicit device_attach() call is done after request_module().

Also add logic to propagate errors reported by device_attach() back
to caller. This also works in the case where drivers are not built
as modules.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200110235751.3404-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-13 15:12:23 +00:00
Bard liao ceca2197b2
ASoC: SOF: Intel: lower print level to dbg if we will reinit DSP
We will reinit DSP in a loop when it fails to initialize the first
time, as recommended. So, it is not an error before we finally give
up. And reorder the trace to make it more readable.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200110235751.3404-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-13 15:12:22 +00:00
Takashi Iwai fbca72c154 ASoC: Fixes for v5.5
More fixes that have been collected, nothing super remarkable here - the
 few core fixes are mainly error handling related as are many of the
 driver fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4TL10THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0OCZB/9X2QIslZRGJi4gM1jLmcvPy64FLqUE
 iRE0Gi3MVG7r2i7HIgnTu2NHD/Ozpzs89droA0KpXC/uf/JaI8HRXY+tnHP4Qo1F
 126h0T0JoDoZDr7IwHY5O+8Zgzqiaq3+JpUB9IBGrHw2DvBx1LCjBR6RRc7vFYM2
 mA7HZ260GslhcUwGD+YYBglsABUkP60/MyWb/frxqugclNkUXP9GbnDEBGbVaZCC
 hZqus4BBHEGGiTNyL6kb2D6lvxF2e0OH7FpAi55g9lWkN6uzUNph8/o9HBLkNsTI
 XEGFRJzJGdwelEbrd+kA7QCCVt3IqxsulpsVndhbn4oSgav5xJeC1VsY
 =d133
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.5-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.5

More fixes that have been collected, nothing super remarkable here - the
few core fixes are mainly error handling related as are many of the
driver fixes.
2020-01-06 17:39:15 +01:00