linux-2.6-microblaze.git
3 years agoASoC: txx9: Replace tasklet with work
Takashi Iwai [Thu, 3 Sep 2020 10:47:49 +0000 (12:47 +0200)]
ASoC: txx9: Replace tasklet with work

The tasklet is an old API that should be deprecated, usually can be
converted to another decent API.  In ASoC TXx9 ACLC driver, a tasklet
is still used for offloading the hardware reset function.  It can be
achieved gracefully with a work queued, too.

This patch replaces the tasklet usage in TXx9 ACLC driver with a
simple work.  The conversion is fairly straightforward.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200903104749.21435-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: Replace tasklet with work
Takashi Iwai [Thu, 3 Sep 2020 10:47:48 +0000 (12:47 +0200)]
ASoC: sh: Replace tasklet with work

The tasklet is an old API that should be deprecated, usually can be
converted to another decent API.  In ASoC SH SIU driver, a tasklet is
still used for offloading the hardware reset function.  It can be
achieved gracefully with a work queued, too.

This patch replaces the tasklet usage in SH SIU driver with a simple
work.  The conversion is fairly straightforward.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200903104749.21435-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: Replace tasklet with work
Takashi Iwai [Thu, 3 Sep 2020 10:47:47 +0000 (12:47 +0200)]
ASoC: fsl: Replace tasklet with work

The tasklet is an old API that should be deprecated, usually can be
converted to another decent API.  In ASoC FSL ESAI CPU DAI driver, a
tasklet is still used for offloading the hardware reset function.
It can be achieved gracefully with a work queued, too.

This patch replaces the tasklet usage in fsl esai driver with a simple
work.  The conversion is fairly straightforward.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200903104749.21435-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge branch 'topic/tasklet-convert' of https://git.kernel.org/pub/scm/linux/kernel...
Mark Brown [Wed, 9 Sep 2020 14:20:17 +0000 (15:20 +0100)]
Merge branch 'topic/tasklet-convert' of https://git./linux/kernel/git/tiwai/sound into asoc-5.10

3 years agoMerge series "ASoC: qcom: common: Parse auxiliary devices from device tree" from...
Mark Brown [Tue, 8 Sep 2020 14:50:13 +0000 (15:50 +0100)]
Merge series "ASoC: qcom: common: Parse auxiliary devices from device tree" from Stephan Gerhold <stephan@gerhold.net>:

In some cases we need to probe additional audio components that do
not appear as part of the DAI links specified in the device tree.
Examples for this are auxiliary devices such as analog amplifiers
or codecs.

The ASoC core provides a way to probe these components by adding
them to snd_soc_card->aux_dev.

This patch set allows specifying them in the device tree through
a new "aux-devs" property.

v1: https://lore.kernel.org/linux-arm-msm/20200819091533.2334-1-stephan@gerhold.net/
Changes in v2:
  - Fix value type in device tree bindings:
    aux-devs should be array of phandles without any arguments, so change
    <phandles with arguments> -> <array of phandles>

Stephan Gerhold (2):
  ASoC: dt-bindings: qcom: Document "aux-devs" property
  ASoC: qcom: common: Parse auxiliary devices from device tree

 .../devicetree/bindings/sound/qcom,apq8016-sbc.txt        | 7 +++++++
 Documentation/devicetree/bindings/sound/qcom,apq8096.txt  | 8 ++++++++
 Documentation/devicetree/bindings/sound/qcom,sdm845.txt   | 8 ++++++++
 sound/soc/qcom/common.c                                   | 4 ++++
 4 files changed, 27 insertions(+)

--
2.28.0

3 years agoASoC: fsl: imx-es8328: add missing put_device() call in imx_es8328_probe()
Yu Kuai [Tue, 25 Aug 2020 13:02:24 +0000 (21:02 +0800)]
ASoC: fsl: imx-es8328: add missing put_device() call in imx_es8328_probe()

if of_find_device_by_node() succeed, imx_es8328_probe() doesn't have
a corresponding put_device(). Thus add a jump target to fix the exception
handling for this function implementation.

Fixes: 7e7292dba215 ("ASoC: fsl: add imx-es8328 machine driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20200825130224.1488694-1-yukuai3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: common: Parse auxiliary devices from device tree
Stephan Gerhold [Wed, 26 Aug 2020 09:51:41 +0000 (11:51 +0200)]
ASoC: qcom: common: Parse auxiliary devices from device tree

In some cases we need to probe additional audio components that do
not appear as part of the DAI links specified in the device tree.
Examples for this are auxiliary devices such as analog amplifiers
or codecs.

The ASoC core provides a way to probe these components by adding
them to snd_soc_card->aux_dev. We can use the snd_soc_of_parse_aux_devs()
function to parse them from the device tree.

As an example for this, some MSM8916 smartphones have an analog
speaker amplifier connected to the HPHR output. With the new property
this can be modelled as follows:

speaker-amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
sound-name-prefix = "Speaker Amp";
};

&sound {
aux-devs = <&speaker_amp>;
audio-routing = "Speaker Amp IN", "HPHR";
};

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200826095141.94017-3-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: qcom: Document "aux-devs" property
Stephan Gerhold [Wed, 26 Aug 2020 09:51:40 +0000 (11:51 +0200)]
ASoC: dt-bindings: qcom: Document "aux-devs" property

In some cases we need to probe additional audio components that do
not appear as part of the DAI links specified in the device tree.
Examples for this are auxiliary devices such as analog amplifiers
or codecs.

To make them work they need to be added as part of "aux-devs"
and connected to some other audio component using the audio routes
configurable using "(qcom,)audio-routing".

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200826095141.94017-2-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mt6359: fix failed to parse DT properties
Tzung-Bi Shih [Tue, 8 Sep 2020 07:00:44 +0000 (15:00 +0800)]
ASoC: mt6359: fix failed to parse DT properties

Mt6359 platform device is instantiated by mfd_add_devices().  In the
case, dev->of_node is NULL so that mt6359_parse_dt() always fails to
parse the desired DT properties.

Gets the DT properties via dev->parent->of_node.

Fixes: 8061734ab654 ("ASoC: mediatek: mt6359: add codec driver")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200908070044.1142644-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO
Dharageswari R [Tue, 8 Sep 2020 09:28:25 +0000 (12:28 +0300)]
ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO

This patch implements the snd_sof_bytes_ext_volatile_get() to read the
actual parameters from DSP by sending the SOF_IPC_COMP_GET_DATA IPC
for the kcontrol of type SOF_TPLG_KCTL_BYTES_VOLATILE_RO.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20200908092825.1813847-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: topology: Add support for WO and RO TLV byte kcontrols
Dharageswari R [Tue, 8 Sep 2020 09:28:24 +0000 (12:28 +0300)]
ASoC: topology: Add support for WO and RO TLV byte kcontrols

This patch adds support for write-only and read-only TLV byte kcontrols
by checking for appropriate get/put IO handlers.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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/20200908092825.1813847-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: Kconfig: Allow the j721e machine driver to be used on K3 platform
Peter Ujfalusi [Tue, 8 Sep 2020 11:32:04 +0000 (14:32 +0300)]
ASoC: ti: Kconfig: Allow the j721e machine driver to be used on K3 platform

The initial machine driver supports only j721e-cpb and the ivi addon, but
other EVMs for different K3 SoC can have similar audio setup which can
be supported by the driver with small or no modification.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200908113204.12012-1-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: sun8i-codec driver cleanup" from Samuel Holland <samuel@sholland...
Mark Brown [Mon, 7 Sep 2020 14:29:00 +0000 (15:29 +0100)]
Merge series "ASoC: sun8i-codec driver cleanup" from Samuel Holland <samuel@sholland.org>:

Now that the fixes series is merged, here is a series of small cleanups
to the sun8i-codec driver. These help shorten the patch stack for the
next series, which will add support for the other two DAIs in this
codec: AIF2 and AIF3.

Samuel Holland (9):
  ASoC: sun8i-codec: Remove extraneous widgets
  ASoC: sun8i-codec: Fix AIF1 MODCLK widget name
  ASoC: sun8i-codec: Fix AIF1_ADCDAT_CTRL field names
  ASoC: sun8i-codec: Fix AIF1_MXR_SRC field names
  ASoC: sun8i-codec: Fix ADC_DIG_CTRL field name
  ASoC: sun8i-codec: Fix field bit number indentation
  ASoC: sun8i-codec: Sort masks in a consistent order
  ASoC: sun8i-codec: Attach the bus clock to the regmap
  ASoC: sun8i-codec: Manage module clock via DAPM

 sound/soc/sunxi/sun8i-codec.c | 104 ++++++++++++----------------------
 1 file changed, 37 insertions(+), 67 deletions(-)

--
2.26.2

3 years agoMerge series "ASoC: SOF: component UUID support for 5.10" from Kai Vehmanen <kai...
Mark Brown [Mon, 7 Sep 2020 14:28:59 +0000 (15:28 +0100)]
Merge series "ASoC: SOF: component UUID support for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

This series adds support for UUID based component identification
in SOF. UUIDs provide a more scalable alternative to the old
component type based approach to identify which DSP components
should be loaded.

More detailed description of UUID usage in SOF is available in:
https://thesofproject.github.io/latest/developer_guides/uuid/

UUID support is an incremental update to the SOF IPC interface. Driver
remains compatible with pre-UUID (ABI <3.17) firmware versions.

Keyon Jie (16):
  ASoC: SOF: tokens: add token for component UUID
  ASoC: SOF: add comp_ext to struct snd_sof_widget
  ASoC: SOF: topology: create component extended tokens
  ASoC: SOF: topology: parse comp_ext_tokens for all widgets
  ASoC: SOF: use the sof_ipc_comp reserved bytes for extended data
  ASoC: SOF: topology: add helper for setting up IPC component
  ASoC: SOF: append extended data to sof_ipc_comp_dai
  ASoC: SOF: append extended data to sof_ipc_comp_mixer
  ASoC: SOF: append extended data to sof_ipc_comp_volume
  ASoC: SOF: append extended data to sof_ipc_comp_host
  ASoC: SOF: append extended data to sof_ipc_comp_src
  ASoC: SOF: append extended data to sof_ipc_comp_asrc
  ASoC: SOF: append extended data to sof_ipc_comp_tone
  ASoC: SOF: append extended data to sof_ipc_comp_process
  ASoC: SOF: append extended data to sof_ipc_comp_mux
  ASoC: SOF: topology: make process type optional

 include/sound/sof/topology.h    |  12 +-
 include/uapi/sound/sof/tokens.h |   1 +
 sound/soc/sof/sof-audio.c       |  23 +++-
 sound/soc/sof/sof-audio.h       |   3 +
 sound/soc/sof/topology.c        | 208 ++++++++++++++++++++------------
 5 files changed, 161 insertions(+), 86 deletions(-)

--
2.27.0

3 years agoMerge series "ASoC: Add sdw stream operations to dailink ops." from Bard Liao <yung...
Mark Brown [Mon, 7 Sep 2020 14:28:58 +0000 (15:28 +0100)]
Merge series "ASoC: Add sdw stream operations to dailink ops." from Bard Liao <yung-chuan.liao@linux.intel.com>:

Sdw stream operation APIs can be called once per stream. Move these
operations to dailink ops. The linked series is "soundwire: Remove sdw
stream operations from Intel soundwire dai".

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Changes in v3:
 - s/ASOC/ASoC

Pierre-Louis Bossart (3):
  ASoC: soc-dai: clarify return value for get_sdw_stream()
  ASoC: Intel: sof_sdw: add dailink .trigger callback
  ASoC: Intel: sof_sdw: add dailink .prepare and .hw_free callback

 include/sound/soc-dai.h          |  3 +-
 sound/soc/intel/boards/sof_sdw.c | 81 ++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 1 deletion(-)

--
2.17.1

3 years agoASoC: Intel: KeemBay: Fix warning potential ! vs ~ typo
Michael Sit Wei Hong [Fri, 4 Sep 2020 02:09:04 +0000 (10:09 +0800)]
ASoC: Intel: KeemBay: Fix warning potential ! vs ~ typo

To set platform in slave mode setting the MASTER_MODE bit is not needed.
Removing !MASTER_MODE conditional to avoid potential errors and warning.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200904020904.19577-1-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: topology: make process type optional
Keyon Jie [Fri, 4 Sep 2020 13:27:44 +0000 (16:27 +0300)]
ASoC: SOF: topology: make process type optional

As components can be now identified with a UUID based mechanism, the
process type is no longer required. For new DSP components, process and
its component type can be set to SOF_PROCESS_NONE and SOF_COMP_NONE.
Allow this combination in topology load, modify the load time check for
process type to reflect this.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-17-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_mux
Keyon Jie [Fri, 4 Sep 2020 13:27:43 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_mux

Append the extended data to the end of the struct sof_ipc_comp_mux,
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-16-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_process
Keyon Jie [Fri, 4 Sep 2020 13:27:42 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_process

Append the extended data to the end of the struct sof_ipc_comp_process,
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-15-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_tone
Keyon Jie [Fri, 4 Sep 2020 13:27:41 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_tone

Append the extended data to the end of the struct sof_ipc_comp_tone,
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-14-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_asrc
Keyon Jie [Fri, 4 Sep 2020 13:27:40 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_asrc

Append the extended data to the end of the struct sof_ipc_comp_asrc,
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-13-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_src
Keyon Jie [Fri, 4 Sep 2020 13:27:39 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_src

Append the extended data to the end of the struct sof_ipc_comp_src,
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-12-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_host
Keyon Jie [Fri, 4 Sep 2020 13:27:38 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_host

Append the extended data to the end of the struct sof_ipc_comp_host,
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-11-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_volume
Keyon Jie [Fri, 4 Sep 2020 13:27:37 +0000 (16:27 +0300)]
ASoC: SOF: append extended data to sof_ipc_comp_volume

Append the extended data to the end of the struct sof_ipc_comp_volume,
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-10-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_mixer
Keyon Jie [Fri, 4 Sep 2020 13:27:36 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: append extended data to sof_ipc_comp_dai
Keyon Jie [Fri, 4 Sep 2020 13:27:35 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: topology: add helper for setting up IPC component
Keyon Jie [Fri, 4 Sep 2020 13:27:34 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: use the sof_ipc_comp reserved bytes for extended data
Keyon Jie [Fri, 4 Sep 2020 13:27:33 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: topology: parse comp_ext_tokens for all widgets
Keyon Jie [Fri, 4 Sep 2020 13:27:32 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: topology: create component extended tokens
Keyon Jie [Fri, 4 Sep 2020 13:27:31 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: add comp_ext to struct snd_sof_widget
Keyon Jie [Fri, 4 Sep 2020 13:27:30 +0000 (16:27 +0300)]
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>
3 years agoASoC: SOF: tokens: add token for component UUID
Keyon Jie [Fri, 4 Sep 2020 13:27:29 +0000 (16:27 +0300)]
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>
3 years agoASoC: sun8i-codec: Manage module clock via DAPM
Samuel Holland [Mon, 31 Aug 2020 03:48:52 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Manage module clock via DAPM

By representing the module clock as a DAPM widget, we ensure that the
clock is only enabled when the module is actually in use, without
additional code in runtime PM hooks.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200831034852.18841-10-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Attach the bus clock to the regmap
Samuel Holland [Mon, 31 Aug 2020 03:48:51 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Attach the bus clock to the regmap

When attached to the regmap, the bus clock is automatically enabled as
needed to access device registers. This avoids needing code to manage it
separately in the driver.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200831034852.18841-9-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Sort masks in a consistent order
Samuel Holland [Mon, 31 Aug 2020 03:48:50 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Sort masks in a consistent order

All other definitions are sorted from largest to smallest bit number.
This makes the AIF1CLK_CTRL mask constants consistent with them.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-8-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Fix field bit number indentation
Samuel Holland [Mon, 31 Aug 2020 03:48:49 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Fix field bit number indentation

Several fields have inconsistent indentation, presumably because the
patch "looked correct" due to the additional "+" character at the
beginning of the line.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-7-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Fix ADC_DIG_CTRL field name
Samuel Holland [Mon, 31 Aug 2020 03:48:48 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Fix ADC_DIG_CTRL field name

This is the enable bit for the "AD"C, not the "DA"C.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-6-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Fix AIF1_MXR_SRC field names
Samuel Holland [Mon, 31 Aug 2020 03:48:47 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Fix AIF1_MXR_SRC field names

Even though they are for the left channel mixer, they are documented as
"MXR_SRC". This matches the naming scheme used for the main DAC. The "R"
is part of the abbreviation for "mixer", not a reference to the channel.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-5-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Fix AIF1_ADCDAT_CTRL field names
Samuel Holland [Mon, 31 Aug 2020 03:48:46 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Fix AIF1_ADCDAT_CTRL field names

They are controlling "AD0" (AIF1 slot 0 ADC), not "DA0".

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-4-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Fix AIF1 MODCLK widget name
Samuel Holland [Mon, 31 Aug 2020 03:48:45 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Fix AIF1 MODCLK widget name

The name should reference "AIF1", not "AFI1".

Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-3-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sun8i-codec: Remove extraneous widgets
Samuel Holland [Mon, 31 Aug 2020 03:48:44 +0000 (22:48 -0500)]
ASoC: sun8i-codec: Remove extraneous widgets

This driver is for the digital part of the codec only. The analog part,
including the microphone inputs, is managed by a separate driver. These
widgets look like they were copied from sun4i-codec. Since they do not
perform any function in this driver, remove them.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200831034852.18841-2-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: add dailink .prepare and .hw_free callback
Pierre-Louis Bossart [Fri, 4 Sep 2020 18:28:54 +0000 (02:28 +0800)]
ASoC: Intel: sof_sdw: add dailink .prepare and .hw_free callback

Add .prepare and .hw_free callback to dailink.

The companion patch for this patch is the removal of stream operations
in the .prepare and .hw_free callbacks at the DAI level in
drivers/soundwire/intel.c

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200904182854.3944-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: add dailink .trigger callback
Pierre-Louis Bossart [Fri, 4 Sep 2020 18:28:53 +0000 (02:28 +0800)]
ASoC: Intel: sof_sdw: add dailink .trigger callback

Add trigger functionality to dailink, so far only .startup() and
.shutdown() were implemented at the machine driver level.

The companion patch for this patch is the removal of the trigger
callback at the DAI level in drivers/soundwire/intel.c

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200904182854.3944-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-dai: clarify return value for get_sdw_stream()
Pierre-Louis Bossart [Fri, 4 Sep 2020 18:28:52 +0000 (02:28 +0800)]
ASoC: soc-dai: clarify return value for get_sdw_stream()

Previous changes move to use ERR_PTR(-ENOTSUPP), but it's not clear
what implementations can return in case of errors. Explicitly document
that NULL is not a possible return value, only ERR_PTR with a negative
error code is valid.

Fixes: 308811a327c38 ('ASoC: soc-dai: return proper error for get_sdw_stream()')
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200904182854.3944-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: SOF: multi core support for 5.10" from Kai Vehmanen <kai.vehmanen...
Mark Brown [Fri, 4 Sep 2020 09:30:43 +0000 (10:30 +0100)]
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

3 years agoASoC: samsung-i2s: Add missing properties
Krzysztof Kozlowski [Thu, 3 Sep 2020 20:32:48 +0000 (22:32 +0200)]
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>
3 years agoASoC: odroid: Add missing properties
Krzysztof Kozlowski [Thu, 3 Sep 2020 20:32:47 +0000 (22:32 +0200)]
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>
3 years agoASoC: SOF: topology: fix core enable sequence
Ranjani Sridharan [Wed, 2 Sep 2020 14:07:56 +0000 (17:07 +0300)]
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>
3 years agoASoC: SOF: support topology components on secondary cores
Guennadi Liakhovetski [Wed, 2 Sep 2020 14:07:55 +0000 (17:07 +0300)]
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>
3 years agoASoC: SOF: add a "core" parameter to widget loading functions
Guennadi Liakhovetski [Wed, 2 Sep 2020 14:07:54 +0000 (17:07 +0300)]
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>
3 years agoASoC: fsl_sai: Set SAI Channel Mode to Output Mode
Shengjiu Wang [Thu, 3 Sep 2020 05:53:47 +0000 (13:53 +0800)]
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>
3 years agoASoC: fsl_sai: Support multiple data channel enable bits
Shengjiu Wang [Tue, 1 Sep 2020 11:01:08 +0000 (19:01 +0800)]
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>
3 years agoALSA: ua101: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:21 +0000 (09:32 +0530)]
ALSA: ua101: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-11-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:20 +0000 (09:32 +0530)]
ALSA: usb-audio: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-10-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: txx9: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:19 +0000 (09:32 +0530)]
ASoC: txx9: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200902040221.354941-9-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: siu: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:18 +0000 (09:32 +0530)]
ASoC: siu: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200902040221.354941-8-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: fsl_esai: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:17 +0000 (09:32 +0530)]
ASoC: fsl_esai: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200902040221.354941-7-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hdsp: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:16 +0000 (09:32 +0530)]
ALSA: hdsp: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-6-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: riptide: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:15 +0000 (09:32 +0530)]
ALSA: riptide: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-5-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:14 +0000 (09:32 +0530)]
ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-4-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:13 +0000 (09:32 +0530)]
ALSA: firewire: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200902040221.354941-3-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: convert tasklets to use new tasklet_setup() API
Allen Pais [Wed, 2 Sep 2020 04:02:12 +0000 (09:32 +0530)]
ALSA: core: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-2-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: odroid: Use unevaluatedProperties
Krzysztof Kozlowski [Sun, 30 Aug 2020 11:26:33 +0000 (13:26 +0200)]
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>
3 years agoASoC: midas-audio: Correct parsing sound-dai phandles
Krzysztof Kozlowski [Sun, 30 Aug 2020 11:26:32 +0000 (13:26 +0200)]
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>
3 years agoASoC: samsung-i2s: Use unevaluatedProperties
Krzysztof Kozlowski [Sat, 29 Aug 2020 14:24:57 +0000 (16:24 +0200)]
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>
3 years agoASoC: rt5682: Prefer async probe
Douglas Anderson [Fri, 28 Aug 2020 23:20:27 +0000 (16:20 -0700)]
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>
3 years agoASoC: tlv320adcx140: Add digital mic channel enable routing
Dan Murphy [Fri, 28 Aug 2020 11:28:55 +0000 (06:28 -0500)]
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>
3 years agoASoC: core: remove artificial component and DAI name constraint
Dmitry Baryshkov [Thu, 27 Aug 2020 20:51:00 +0000 (23:51 +0300)]
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>
3 years agoMerge series "SOF fixes and updates for FW boot" from Ranjani Sridharan <ranjani...
Mark Brown [Thu, 27 Aug 2020 13:43:26 +0000 (14:43 +0100)]
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

3 years agoASoC: soc-core: add snd_soc_find_dai_with_mutex()
Kuninori Morimoto [Wed, 26 Aug 2020 23:55:39 +0000 (08:55 +0900)]
ASoC: soc-core: add snd_soc_find_dai_with_mutex()

commit 25612477d20b52 ("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: 25612477d20b52 ("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>
3 years agoASoC: max9867: shutdown codec when changing filter type
Pavel Dobias [Thu, 27 Aug 2020 10:25:28 +0000 (12:25 +0200)]
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>
3 years agoASoC: AMD: Clean kernel log from deferred probe error messages
Akshu Agrawal [Wed, 26 Aug 2020 18:54:20 +0000 (00:24 +0530)]
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>
3 years agoASoC: SOF: Intel: hda: Simplify error handling during FW boot
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:32 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: Add sof_tgl_ops for TGL platforms
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:31 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: Define FW boot sequence with ICCMAX
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:30 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: define macro for code loader stream format
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:29 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:28 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: Add helper function to program ICCMAX stream
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:27 +0000 (11:45 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: Remove unused parameters in cl_dsp_init()
Yong Zhi [Wed, 26 Aug 2020 18:45:26 +0000 (11:45 -0700)]
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>
3 years agoALSA: hda: fix VS_LTRC register name
Ranjani Sridharan [Wed, 26 Aug 2020 18:45:25 +0000 (11:45 -0700)]
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>
3 years agoMerge series "SOF fixes and updates" from Ranjani Sridharan <ranjani.sridharan@linux...
Mark Brown [Wed, 26 Aug 2020 12:19:18 +0000 (13:19 +0100)]
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

3 years agoASoC: SOF: sof-of-dev: Add .arch_ops field
Iulian Olaru [Tue, 25 Aug 2020 23:50:40 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: imx: Replace sdev->private with sdev->pdata->hw_pdata
Iulian Olaru [Tue, 25 Aug 2020 23:50:39 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: add extended rom status dump to error log
Ranjani Sridharan [Tue, 25 Aug 2020 23:50:38 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: topology: fix the ipc_size calculation for process component
Keyon Jie [Tue, 25 Aug 2020 23:50:37 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: intel: hda: support also devices with 1 and 3 dmics
Jaska Uimonen [Tue, 25 Aug 2020 23:50:36 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work
Rander Wang [Tue, 25 Aug 2020 23:50:35 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: Intel: hda: report error only for the last ROM init iteration
Ranjani Sridharan [Tue, 25 Aug 2020 23:50:34 +0000 (16:50 -0700)]
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>
3 years agoASoC: SOF: loader: Add debug box region
Iulian Olaru [Tue, 25 Aug 2020 23:58:54 +0000 (16:58 -0700)]
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>
3 years agoASoC: SOF: ext_manifest: Parse debug ABI version
Karol Trzcinski [Tue, 25 Aug 2020 23:58:53 +0000 (16:58 -0700)]
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>
3 years agoASoC: SOF: loader: fix memory leak in get_ext_windows
Pierre-Louis Bossart [Tue, 25 Aug 2020 23:58:52 +0000 (16:58 -0700)]
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: 8d809c15acf23 ('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>
3 years agoASoC: SOF: IPC: make sof_ipc_window monosized
Karol Trzcinski [Tue, 25 Aug 2020 23:58:51 +0000 (16:58 -0700)]
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>
3 years agoMerge series "ASoC: SOF: trivial code/log/comment improvements" from Pierre-Louis...
Mark Brown [Tue, 25 Aug 2020 19:53:30 +0000 (20:53 +0100)]
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: aafdeba5cbc14cecee3797e669473b70a2b3e81e
--
2.25.1

3 years agoASoC: hdac_hdmi: tidy up a memset()
Dan Carpenter [Tue, 25 Aug 2020 10:46:23 +0000 (13:46 +0300)]
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>
3 years agoASoC: Intel: use consistent HDAudio spelling in comments/docs
Pierre-Louis Bossart [Mon, 24 Aug 2020 20:09:12 +0000 (15:09 -0500)]
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>
3 years agoASoC: SOF: Intel: add dev_dbg log when driver is not selected
Pierre-Louis Bossart [Mon, 24 Aug 2020 20:09:11 +0000 (15:09 -0500)]
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>
3 years agoASoC: SOF: acpi: add dev_dbg() log for probe completion
Pierre-Louis Bossart [Mon, 24 Aug 2020 20:09:10 +0000 (15:09 -0500)]
ASoC: SOF: acpi: add dev_dbg() log for probe completion

When the probe relies on a workqueue, the completion is not signaled
by a return value. Mirror the log already present for PCI probe, so
that CI checks can test if the probe actually worked by filtering the
console logs.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: IPC: reduce verbosity of IPC pointer updates
Pierre-Louis Bossart [Mon, 24 Aug 2020 20:09:09 +0000 (15:09 -0500)]
ASoC: SOF: IPC: reduce verbosity of IPC pointer updates

When using dynamic debug, the console is swamped with verbose position
pointer logs, which really don't add much information. Move then to
vdbg to keep traces usable and allow for easier end-user support.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@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-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: topology: reduce the log level for unhandled widgets
Ranjani Sridharan [Mon, 24 Aug 2020 20:09:08 +0000 (15:09 -0500)]
ASoC: SOF: topology: reduce the log level for unhandled widgets

Virtual widgets are added to topology to be compatible with legacy
machine drivers. Reduce the log level for messages printed when
such widgets are ignored by the SOF driver.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@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/20200824200912.46852-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: topology: remove unnecessary memory alloc for sdev->private
Ranjani Sridharan [Mon, 24 Aug 2020 20:09:07 +0000 (15:09 -0500)]
ASoC: SOF: topology: remove unnecessary memory alloc for sdev->private

Looks like it was left over from the previous implementation of
DMIC PDM token parsing. It is not used anymore.

Reviewed-by: Bard Liao <yung-chuan.liao@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/20200824200912.46852-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>