Commit graph

949507 commits

Author SHA1 Message Date
Keyon Jie f375bb336d
ASoC: SOF: append extended data to sof_ipc_comp_mixer
Append the extended data to the end of the struct sof_ipc_comp_mixer,
construct the ipc for COMP_NEW during the topology load stage.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:40 +01:00
Keyon Jie f8ee6c9f52
ASoC: SOF: append extended data to sof_ipc_comp_dai
Append the extended data to the end of the struct sof_ipc_comp_dai, and
update the ext_data_offset, to construct the IPC for the topology load
and runtime restore.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:39 +01:00
Keyon Jie a905bb0193
ASoC: SOF: topology: add helper for setting up IPC component
Add helper to allocate buffer for IPC component, configure the basic
settings, and set up the extended data for the subsequent IPC sending.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:38 +01:00
Keyon Jie 50b55fd463
ASoC: SOF: use the sof_ipc_comp reserved bytes for extended data
Use the 32bit reserved member of the struct sof_ipc_comp as the extended
data length, this will help to minimize the ABI change for adding new
extended data to the struct sof_ipc_comp, usually only minor ABI version
bump needed for every update with this new solution.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:37 +01:00
Keyon Jie 929e427a9c
ASoC: SOF: topology: parse comp_ext_tokens for all widgets
Parse comp_ext_tokens in the common sof_widget_ready(), and the
swidget->comp_ext will be used to construct the COMP_NEW ipc in the
subsequent commits.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:36 +01:00
Keyon Jie 92f500cfc3
ASoC: SOF: topology: create component extended tokens
Add comp_ext_tokens which will be used to parse all extended tokens,
these tokens will be stored it to struct snd_sof_widget.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:35 +01:00
Keyon Jie f970a77f1d
ASoC: SOF: add comp_ext to struct snd_sof_widget
Add member comp_ext to struct snd_sof_widget, which will be used for
topology extended tokens parsing.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:34 +01:00
Keyon Jie 43fbb0860c
ASoC: SOF: tokens: add token for component UUID
Add the definition SOF_TKN_COMP_UUID for the component UUID token, this
shall be used for all types of component in the future.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:34 +01:00
Mark Brown 1b3c63acb1
Merge series "ASoC: SOF: multi core support for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
This series extends the multi-core support in SOF. Capability
to specify which core to use, on a per component basis, is added
to topology. The topology load functionality in SOF is modified to
power up/down host controlled cores based on the topology
description.

Guennadi Liakhovetski (2):
  ASoC: SOF: add a "core" parameter to widget loading functions
  ASoC: SOF: support topology components on secondary cores

Ranjani Sridharan (1):
  ASoC: SOF: topology: fix core enable sequence

 include/uapi/sound/sof/tokens.h |   1 +
 sound/soc/sof/pm.c              |   1 +
 sound/soc/sof/sof-audio.c       |  25 ++++
 sound/soc/sof/sof-audio.h       |   5 +
 sound/soc/sof/sof-priv.h        |   3 +
 sound/soc/sof/topology.c        | 210 ++++++++++++++++++++++----------
 6 files changed, 184 insertions(+), 61 deletions(-)

--
2.27.0
2020-09-04 10:30:43 +01:00
Krzysztof Kozlowski 0c5f8ca49c
ASoC: samsung-i2s: Add missing properties
Usage of "unevaluatedProperties: false" is not correct as it suppresses
warnings about all undocumented properties.  Instead, add all missing
properties.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200903203250.19830-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04 10:30:42 +01:00
Krzysztof Kozlowski 6997e462b3
ASoC: odroid: Add missing properties
Usage of "unevaluatedProperties: false" is not correct as it suppresses
warnings about all undocumented properties.  Instead, add all missing
properties.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200903203250.19830-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04 10:30:41 +01:00
Ranjani Sridharan 8c9ff1219a
ASoC: SOF: topology: fix core enable sequence
Core power up involves 2 steps: The first step tries to
power up the core by setting the ADSPCS.SPA bit for the host-managed
cores. The second step involves sending the IPC to power up other
cores that are not host managed. The enabled_cores_mask should
be updated only when both these steps are successful. If the
IPC to the DSP fails, the host-managed core that was powered in
step 1 should be powered off before returning the error.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200902140756.1427005-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04 10:12:23 +01:00
Guennadi Liakhovetski d1c6c4a9fd
ASoC: SOF: support topology components on secondary cores
Currently SOF supports running pipelines on secondary DSP cores in a
limited way. This patch represents the next step in SOF multi-core DSP
support, it adds checks for core ID to individual topology components.
It takes care to power up all the requested cores. More advanced DSP
core power management should be added in the future.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200902140756.1427005-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04 10:12:22 +01:00
Guennadi Liakhovetski 0dcdf84289
ASoC: SOF: add a "core" parameter to widget loading functions
We want to be able to explicitly assign cores to individual pipeline
components. This patch adds a "core" parameter to widget loading
functions to be sent to the DSP for appropriate component scheduling.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200902140756.1427005-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04 10:12:21 +01:00
Shengjiu Wang f4c4b1bb2f
ASoC: fsl_sai: Set SAI Channel Mode to Output Mode
Transmit data pins will output zero when slots are masked or channels
are disabled. In CHMOD TDM mode, transmit data pins are tri-stated when
slots are masked or channels are disabled. When data pins are tri-stated,
there is noise on some channels when FS clock value is high and data is
read while fsclk is transitioning from high to low.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1599112427-22038-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-03 14:47:37 +01:00
Shengjiu Wang 770f58d7d2
ASoC: fsl_sai: Support multiple data channel enable bits
One data channel is one data line. From imx7ulp, the SAI IP is
enhanced to support multiple data channels.

If there is only two channels input and slots is 2, then enable one
data channel is enough for data transfer. So enable the TCE/RCE and
transmit/receive mask register according to the input channels and
slots configuration.

Move the data channel enablement from startup() to hw_params().

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1598958068-10552-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-03 14:47:36 +01:00
Krzysztof Kozlowski a57307ca6b
ASoC: odroid: Use unevaluatedProperties
Additional properties or nodes actually might appear (e.g.
assigned-clocks) so use unevaluatedProperties to fix dtbs_check warnings
like:

  arch/arm/boot/dts/exynos5422-odroidxu3.dt.yaml: sound:
    'assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks' do not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200830112633.6732-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 14:00:18 +01:00
Krzysztof Kozlowski 3e7ba1c043
ASoC: midas-audio: Correct parsing sound-dai phandles
The "sound-dai" property has cells therefore phandle-array should be
used, even if it is just one phandle.  This fixes dtbs_check warnings
like:

  arch/arm/boot/dts/exynos4412-trats2.dt.yaml: sound: cpu:sound-dai:0:1: missing phandle tag in 0
  arch/arm/boot/dts/exynos4412-trats2.dt.yaml: sound: cpu:sound-dai:0: [158, 0] is too long

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200830112633.6732-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 14:00:17 +01:00
Krzysztof Kozlowski 8187d83002
ASoC: samsung-i2s: Use unevaluatedProperties
Additional properties actually might appear (e.g. power-domains) so use
unevaluatedProperties to fix dtbs_check warnings like:

  arch/arm64/boot/dts/exynos/exynos5433-tm2.dt.yaml: i2s@11440000:
    Additional properties are not allowed ('power-domains', '#address-cells', 'interrupts', '#size-cells' were unexpected)

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200829142501.31478-6-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 14:00:16 +01:00
Douglas Anderson 160c174ff6
ASoC: rt5682: Prefer async probe
The probe of rt5682 is pretty slow.  A quick measurement shows that it
takes ~650 ms on at least one board.  There's no reason to block all
other drivers waiting for this probe to finish.  Set the flag to allow
other drivers to probe while we're probing.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200828162005.1.I4f67f494c4f759b0e5c7f487e040dfdcf16e0876@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 14:00:15 +01:00
Dan Murphy ece2a74c59
ASoC: tlv320adcx140: Add digital mic channel enable routing
Add the audio routing map to enable the digital mic paths when the
analog mic paths are not enabled.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200828112855.10112-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-28 15:49:42 +01:00
Dmitry Baryshkov 45dd9943fc
ASoC: core: remove artificial component and DAI name constraint
Current fmt_single_name code limits maximum name of a DAI or component
to 32 bytes. On some systems corresponding device names might be longer
than that (e.g.
17300000.remoteproc:glink-edge:apr:apr-service@8:routing). This will
result in duplicate DAI/component names. Rewrite fmt_single_name() to
remove such length limitations.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20200827205100.1479331-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-28 15:49:41 +01:00
Mark Brown 4b15c49719
Merge series "SOF fixes and updates for FW boot" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This series includes fixes and updates for the FW boot sequence for
Intel platforms.

Ranjani Sridharan (7):
  ALSA: hda: fix VS_LTRC register name
  ASoC: SOF: Intel: hda: Add helper function to program ICCMAX stream
  ASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()
  ASoC: SOF: Intel: hda: define macro for code loader stream format
  ASoC: SOF: Intel: hda: Define FW boot sequence with ICCMAX
  ASoC: SOF: Intel: hda: Add sof_tgl_ops for TGL platforms
  ASoC: SOF: Intel: hda: Simplify error handling during FW boot

Yong Zhi (1):
  ASoC: SOF: Intel: hda: Remove unused parameters in cl_dsp_init()

 include/sound/hda_register.h     |   2 +-
 sound/soc/sof/intel/Makefile     |   2 +-
 sound/soc/sof/intel/cnl.c        |  23 +----
 sound/soc/sof/intel/hda-ipc.h    |   4 +
 sound/soc/sof/intel/hda-loader.c | 145 ++++++++++++++++++-------------
 sound/soc/sof/intel/hda-stream.c |  69 +++++++++++++++
 sound/soc/sof/intel/hda.h        |   6 ++
 sound/soc/sof/intel/tgl.c        | 137 +++++++++++++++++++++++++++++
 sound/soc/sof/sof-pci-dev.c      |   2 +-
 9 files changed, 306 insertions(+), 84 deletions(-)
 create mode 100644 sound/soc/sof/intel/tgl.c

--
2.25.1
2020-08-27 14:43:26 +01:00
Kuninori Morimoto c1c277b2c4
ASoC: soc-core: add snd_soc_find_dai_with_mutex()
commit 25612477d2 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
added snd_soc_dai_link_set_capabilities().
But it is using snd_soc_find_dai() (A) which is required client_mutex (B).
And client_mutex is soc-core.c local.

	struct snd_soc_dai *snd_soc_find_dai(xxx)
	{
		...
(B)		lockdep_assert_held(&client_mutex);
		...
	}

	void snd_soc_dai_link_set_capabilities(xxx)
	{
		...
		for_each_pcm_streams(direction) {
			...
			for_each_link_cpus(dai_link, i, cpu) {
(A)				dai = snd_soc_find_dai(cpu);
				...
			}
			...
			for_each_link_codecs(dai_link, i, codec) {
(A)				dai = snd_soc_find_dai(codec);
				...
			}
		}
		...
	}

Because of these background, we will get WARNING if .config has CONFIG_LOCKDEP.

	WARNING: CPU: 2 PID: 53 at sound/soc/soc-core.c:814 snd_soc_find_dai+0xf8/0x100
	CPU: 2 PID: 53 Comm: kworker/2:1 Not tainted 5.7.0-rc1+ #328
	Hardware name: Renesas H3ULCB Kingfisher board based on r8a77951 (DT)
	Workqueue: events deferred_probe_work_func
	pstate: 60000005 (nZCv daif -PAN -UAO)
	pc : snd_soc_find_dai+0xf8/0x100
	lr : snd_soc_find_dai+0xf4/0x100
	...
	Call trace:
	 snd_soc_find_dai+0xf8/0x100
	 snd_soc_dai_link_set_capabilities+0xa0/0x16c
	 graph_dai_link_of_dpcm+0x390/0x3c0
	 graph_for_each_link+0x134/0x200
	 graph_probe+0x144/0x230
	 platform_drv_probe+0x5c/0xb0
	 really_probe+0xe4/0x430
	 driver_probe_device+0x60/0xf4

snd_soc_find_dai() will be used from (X) CPU/Codec/Platform driver with
mutex lock, and (Y) Card driver without mutex lock.
This snd_soc_dai_link_set_capabilities() is for Card driver,
this means called without mutex.
This patch adds snd_soc_find_dai_with_mutex() to solve it.

Fixes: 25612477d2 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blixvuab.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:43:25 +01:00
Pavel Dobias a11ffbbac9
ASoC: max9867: shutdown codec when changing filter type
Changing filter type without disabling codec results in filter
malfunction. Disable codec when changing filter type.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200827102528.29677-1-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:43:24 +01:00
Akshu Agrawal f7660445c8
ASoC: AMD: Clean kernel log from deferred probe error messages
While the driver waits for DAIs to be probed and retries probing,
have the error messages at debug level instead of error.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200826185454.5545-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:43:23 +01:00
Ranjani Sridharan 01d42d5a0a
ASoC: SOF: Intel: hda: Simplify error handling during FW boot
Modify cl_stream_prepare() to return a pointer to the prepared stream
if successful or ERR_PTR() otherwise. This would simplify the error
paths in hda_dsp_cl_boot_firmware() and hda_dsp_cl_boot_firmware_iccmax()
to perform the stream cleanup after FW boot. This change also renders
the function get_stream_with_tag() redundant.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-9-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:24 +01:00
Ranjani Sridharan 8b98491a6b
ASoC: SOF: Intel: hda: Add sof_tgl_ops for TGL platforms
Separate the dsp ops for TGL ops to specify the use of ICCMAX
FW boot sequence in the run op. All other ops are identical.
Also separate the TGL descriptors into a separate file to make
it easier to follow.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-8-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:23 +01:00
Ranjani Sridharan acf705a425
ASoC: SOF: Intel: hda: Define FW boot sequence with ICCMAX
Define the FW boot sequence for platforms that are recommended
to use ICCMAX. This function uses the existing prepare and cleanup
functions for creating a specially crafted capture stream before
powering up the DSP cores.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:22 +01:00
Ranjani Sridharan d43e381390
ASoC: SOF: Intel: hda: define macro for code loader stream format
This will be used for the ICCMAX stream as well.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:21 +01:00
Ranjani Sridharan c07fa3fcbd
ASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()
Modify the signature of get_stream_with_tag() to add the direction
as an argument to extend it for using with capture streams.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:20 +01:00
Ranjani Sridharan aca961f196
ASoC: SOF: Intel: hda: Add helper function to program ICCMAX stream
For some platforms, the recommended HW sequence for FW boot involves
starting a specially crafted capture stream before powering
on the DSP cores. Add a helper function to define the minimal
recommended stream programming sequence for this stream.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:19 +01:00
Yong Zhi 0ff06df0be
ASoC: SOF: Intel: hda: Remove unused parameters in cl_dsp_init()
cl_dsp_init() doesn't use the fwdata and fwsize parameters.
Remove it, and update caller accordingly.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:18 +01:00
Ranjani Sridharan c242766f28
ALSA: hda: fix VS_LTRC register name
It should be called VS_LTRP instead.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200826184532.1612070-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:17 +01:00
Mark Brown cd0f9228c7
Merge series "SOF fixes and updates" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This series includes fixes for error reporting, topology parsing and
runtime PM issues along with updates for DMIC support and IMX platforms.

Iulian Olaru (2):
  ASoC: SOF: imx: Replace sdev->private with sdev->pdata->hw_pdata
  ASoC: SOF: sof-of-dev: Add .arch_ops field

Jaska Uimonen (1):
  ASoC: SOF: intel: hda: support also devices with 1 and 3 dmics

Keyon Jie (1):
  ASoC: SOF: topology: fix the ipc_size calculation for process
    component

Rander Wang (1):
  ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work

Ranjani Sridharan (2):
  ASoC: SOF: Intel: hda: report error only for the last ROM init
    iteration
  ASoC: SOF: Intel: hda: add extended rom status dump to error log

 sound/soc/sof/imx/Kconfig        |  2 ++
 sound/soc/sof/imx/imx8.c         | 17 +++++++++----
 sound/soc/sof/imx/imx8m.c        | 10 +++++---
 sound/soc/sof/intel/hda-codec.c  |  4 +--
 sound/soc/sof/intel/hda-loader.c | 42 +++++++++++++++++++-------------
 sound/soc/sof/intel/hda.c        | 26 +++++++++++++++++++-
 sound/soc/sof/topology.c         |  4 +--
 7 files changed, 74 insertions(+), 31 deletions(-)

--
2.25.1
2020-08-26 13:19:18 +01:00
Iulian Olaru 5a1fa00ad7
ASoC: SOF: sof-of-dev: Add .arch_ops field
Add .arch_ops field in the sof_imx8x_ops structure.
The inclusion of this field will allow the usage of functions from
sof/core.c in order to print debug information such as the registers and
a stack dump in case of a firmware ops.

The SND_SOC_SOF_XTENSA is added in the imx/Kconfig file so the compilation
is successful.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-8-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:16 +01:00
Iulian Olaru 17b3f99a36
ASoC: SOF: imx: Replace sdev->private with sdev->pdata->hw_pdata
The correct way to save private data is to use sdev->pdata->hw_pdata.
Removed superfluous type-casts.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:16 +01:00
Ranjani Sridharan 29c8e4398f
ASoC: SOF: Intel: hda: add extended rom status dump to error log
Dump the extended ROM status information to the error logs
to aid with remote support. The analysis of these logs requires
access to non-public technical information.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:15 +01:00
Keyon Jie 878694dcbe
ASoC: SOF: topology: fix the ipc_size calculation for process component
The topology private struct is used for token parsing and its size
should not be included to the ipc_size, fix it here though it didn't
cause any real issue as the Firmware won't use this wrong-added data.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:14 +01:00
Jaska Uimonen 3dca35e35b
ASoC: SOF: intel: hda: support also devices with 1 and 3 dmics
Currently the dmic check code supports only devices with 2 or 4 dmics.
With other dmic counts the function will return 0. Lately we've seen
devices with only 1 dmic thus enable also configurations with 1, and
possibly 3, dmics. Add also topology postfix -1ch and -3ch for new dmic
configuration.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:13 +01:00
Rander Wang 6c63c954e1
ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work
When hda_codec_probe() doesn't initialize audio component, we disable
the codec and keep going. However,the resources are not released. The
child_count of SOF device is increased in snd_hdac_ext_bus_device_init
but is not decrease in error case, so SOF can't get suspended.

snd_hdac_ext_bus_device_exit will be invoked in HDA framework if it
gets a error. Now copy this behavior to release resources and decrease
SOF device child_count to release SOF device.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:12 +01:00
Ranjani Sridharan 53ec753137
ASoC: SOF: Intel: hda: report error only for the last ROM init iteration
The FW boot sequence includes multiple attempts for ROM init.
When it does take more than one attempt, we should not log the
errors encountered during the failed attempts and only log them
during the final iteration.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235040.1586478-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 13:19:11 +01:00
Iulian Olaru e17b7389dc
ASoC: SOF: loader: Add debug box region
This patch adds an IPC initiated debug box region in the snd_sof_dev
structure, defined in soc/sof/sof-priv.h. It is initialized at loading,
in the sof_get_windows function from soc/sof/loader.c, in a similar manner
with the stream box and host box.

This region is useful because the firmware will put an error message
here so the kernel can read it in case of a dsp oops.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235854.1588034-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 12:44:09 +01:00
Karol Trzcinski 60b7c1ba28
ASoC: SOF: ext_manifest: Parse debug ABI version
The debug ABI can be extracted from the extended manifest content.
This information known at build time does not need to be provided
in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235854.1588034-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 12:44:08 +01:00
Pierre-Louis Bossart e9157a449a
ASoC: SOF: loader: fix memory leak in get_ext_windows
sdev->info_window is allocated with kmemdup and never freed, use devm_
version since this is only used for first boot.

Fixes: 8d809c15ac ('ASoC: SOF: ext_manifest: parse windows')
Cc: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235854.1588034-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 12:44:08 +01:00
Karol Trzcinski 76ab546cd8
ASoC: SOF: IPC: make sof_ipc_window monosized
This step is needed to add possibility to pack sof_ipc_window inside
another one in used FW build tools - for example in extended manifest.
Structure reusability leads to easy parsing function reuse, so source
code is shorter and easier to maintain.

Using structures with constant size is less tricky and properly
supported by each toolchain by contrast to variable size elements.

This is minor ABI change - backward compatibility is kept.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235854.1588034-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 12:44:07 +01:00
Mark Brown 9db6f4329c
Merge series "ASoC: SOF: trivial code/log/comment improvements" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Remove useless variable initialization and allocation, adjust log
levels to make support easier, and fix comments. No functional
changes.

Guennadi Liakhovetski (2):
  ASoC: SOF: topology: (cosmetic) remove redundant variable
    initialisations
  ASoC: SOF: (cosmetic) use the "bool" type where it makes sense

Pierre-Louis Bossart (4):
  ASoC: SOF: IPC: reduce verbosity of IPC pointer updates
  ASoC: SOF: acpi: add dev_dbg() log for probe completion
  ASoC: SOF: Intel: add dev_dbg log when driver is not selected
  ASoC: Intel: use consistent HDAudio spelling in comments/docs

Ranjani Sridharan (2):
  ASoC: SOF: topology: remove unnecessary memory alloc for sdev->private
  ASoC: SOF: topology: reduce the log level for unhandled widgets

 include/sound/soc-acpi.h      |  2 +-
 sound/soc/intel/Kconfig       |  2 +-
 sound/soc/intel/skylake/skl.c |  6 +++---
 sound/soc/sof/Kconfig         |  2 +-
 sound/soc/sof/intel/Kconfig   |  2 +-
 sound/soc/sof/ipc.c           | 16 +++++++++++-----
 sound/soc/sof/pcm.c           |  8 ++++----
 sound/soc/sof/sof-acpi-dev.c  |  2 ++
 sound/soc/sof/sof-pci-dev.c   |  6 +++---
 sound/soc/sof/sof-priv.h      | 10 +++++-----
 sound/soc/sof/topology.c      | 20 ++++----------------
 11 files changed, 36 insertions(+), 40 deletions(-)

base-commit: aafdeba5cb
--
2.25.1
2020-08-25 20:53:30 +01:00
Dan Carpenter 672072976b
ASoC: hdac_hdmi: tidy up a memset()
The ARRAY_SIZE() is the number of the elements but we want to use the
number of bytes.  Fortunately, in this case the value is the same so it
doesn't affect runtime.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200825104623.GA278587@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:53:28 +01:00
Pierre-Louis Bossart 135ab457e7
ASoC: Intel: use consistent HDAudio spelling in comments/docs
We use HDaudio and HDAudio, pick one to make searches easier.
No functionality change

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200824200912.46852-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:39:39 +01:00
Pierre-Louis Bossart d5d023592e
ASoC: SOF: Intel: add dev_dbg log when driver is not selected
Mirror change suggested in legacy HDaudio driver.

On SKL+ Intel platforms, the driver selection is handled by the
snd_intel_dspcfg, and when the HDaudio legacy driver is not selected,
be it with the auto-selection or user preferences with a kernel
parameter, the probe aborts with no logs, only a -ENODEV return value.

Having no dmesg trace, even with dynamic debug enabled, makes support
more complicated than it needs to be, and even experienced users can
be fooled. A simple dev_dbg() trace solves this problem.

BugLink: https://github.com/thesofproject/linux/issues/2330
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200824200912.46852-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:39:38 +01:00