Commit graph

729 commits

Author SHA1 Message Date
Brent Lu
bc619cfc62
ASoC: SOF: add a helper to get topology configured bclk
Add helper function sof_dai_ssp_bclk() to get the BCLK frequency
configured by topology.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210625205042.65181-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-11 23:48:30 +01:00
Mark Brown
8cc802bd75
Merge series "ASoC: tlv320aic32x4: Add support for TAS2505" from Claudius Heine <ch@denx.de>:
Hi,

this is v2 from my patchset that add support for the TAS2505 to the tlv320aic32x4 driver.

kind regards,
Claudius

Changes from v1:
- clarified commit message of first patch, which add the type value to the struct
- removed unnecessary code to put and get speaker volume
- removed 'Gain' from 'HP Driver Playback Volume' control
- fixed rebase issues

Claudius Heine (3):
  ASoC: tlv320aic32x4: add type to device private data struct
  ASoC: tlv320aic32x4: add support for TAS2505
  ASoC: tlv320aic32x4: dt-bindings: add TAS2505 to compatible

 .../bindings/sound/tlv320aic32x4.txt          |   1 +
 sound/soc/codecs/tlv320aic32x4-i2c.c          |  22 ++-
 sound/soc/codecs/tlv320aic32x4-spi.c          |  23 ++-
 sound/soc/codecs/tlv320aic32x4.c              | 139 +++++++++++++++++-
 sound/soc/codecs/tlv320aic32x4.h              |  10 ++
 5 files changed, 186 insertions(+), 9 deletions(-)

base-commit: 70585216fe
--
2.32.0
2021-06-23 16:31:14 +01:00
Yang Yingliang
0ba0f44fd5
ASoC: SOF: imx: Add missing of_node_put() in imx8_probe()
This node pointer is returned by of_parse_phandle() with refcount
incremented in this function. of_node_put() on it before exiting
this function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210617032756.599359-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-22 12:47:13 +01:00
Takashi Iwai
a0309c3448 ASoC: Fixes for v5.13
A collection of fixes and device ID updates that have come up in the
 past few -rcs, none of which stand out particularly.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC/aSwACgkQJNaLcl1U
 h9DNXAf+O+fzbVOkXxp/r3yUa2VF0Zdit0R8xIcUh0k7vd+MqYECaGaKqX9sAKbn
 nQFNvzcdRjkiFFgmKpy6x2kJ/OXBJbRCvC5FfAAj2cJvzw4eN03wkqaa9JuEZX1e
 uJ+Ny1PELMglHqmWNC9bWnudEJoaYxpssI14u+FjOWJPzIxXSxWSGQknIG4d8/Rh
 BtifoTxWxsYIbKiiNhX6Ui5zdzRl5CeTLuKoKXBQRM0ivRwPuX0Y+VW/tsNiLUBT
 yN/CEEuu+GZevdHRvWEW3FwK8y7W36gueEYe7o+SFQVgyyjESnhCRdhRvo7uvzrx
 e1yVEe4ky0wbyhmBR+69SugYKqd1/A==
 =tHOl
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.13

A collection of fixes and device ID updates that have come up in the
past few -rcs, none of which stand out particularly.
2021-06-08 16:59:19 +02:00
Mark Brown
26bf457b4a
Merge series "ASoC: Constify snd_compress_ops" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:
The only use of the static and global snd_compress_ops structs is to
assign their address to the compress_ops field in the
snd_soc_component_driver struct which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.

Rikard Falkeborn (5):
  ASoC: cs47125: Constify static struct snd_compress_ops
  ASoC: wm5102: Constify static struct snd_compress_ops
  ASoC: wm5110: Constify static struct snd_compress_ops
  ASoC: qcom: q6asm-dai: Constify static struct snd_compress_ops
  ASoC: SOF: Intel: Constify sof_probe_compressed_ops

 sound/soc/codecs/cs47l24.c       | 2 +-
 sound/soc/codecs/wm5102.c        | 2 +-
 sound/soc/codecs/wm5110.c        | 2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
 sound/soc/sof/compress.c         | 2 +-
 sound/soc/sof/compress.h         | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

--
2.31.1
2021-06-01 18:10:41 +01:00
Kai Vehmanen
1f763d0388
ASoC: SOF: Intel: pci-tgl: add ADL-M support
Add PCI DID for Intel AlderLake-M.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210528184153.18251-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:05:19 +01:00
Ranjani Sridharan
d95eca7e3b
ASoC: SOF: Intel: hda: don't print ROM status if cl_dsp_init() fails
cl_dsp_init() dumps the ROM status if it fails after max
attempts before powering off the DSP. Remove the duplicate
log to print the ROM status and error in
hda_dsp_cl_boot_firmware(). These values are invalid anyway
as the DSP is already powered off.

Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210528160551.10145-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:05:18 +01:00
Ranjani Sridharan
7ff562fed9
ASoC: SOF: Intel: hda: clean up hda_dsp_dump()
Clean up the hda_dsp_dump() function to avoid duplicating
the ROM status and error.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210528160551.10145-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:05:17 +01:00
Rikard Falkeborn
7db43da8c0
ASoC: SOF: Intel: Constify sof_probe_compressed_ops
The only usage of sof_probe_compressed_ops is to assign its address to
the compress_ops field in the snd_soc_component_driver struct, which is
a pointer to const. The assignment is done in sound/soc/sof/pcm.c. Make
it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-6-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:05:15 +01:00
Kai Vehmanen
b640e8a4bd
ASoC: SOF: reset enabled_cores state at suspend
The recent changes to use common code to power up/down DSP cores also
removed the reset of the core state at suspend. It turns out this is
still needed. When the firmware state is reset to
SOF_FW_BOOT_NOT_STARTED, also enabled_cores should be reset, and
existing DSP drivers depend on this.

BugLink: https://github.com/thesofproject/linux/issues/2824
Fixes: 42077f08b3 ("ASoC: SOF: update dsp core power status in common APIs")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210528144330.2551-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01 14:03:01 +01:00
Mark Brown
d4e9889b02
Merge branch 'for-5.13' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.14 2021-05-25 16:44:26 +01:00
Takashi Iwai
dad19afce9 ASoC: Fixes for v5.13
A collection of fixes that have come in since the merge window, mainly
 device specific things.  The fixes to the generic cards from
 Morimoto-san are handling regressions that were introduced in the merge
 window on at least the Kontron sl28-var3-ads2.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmCraeoACgkQJNaLcl1U
 h9BuVgf+Ith7351Fz+Jd1Y8e0rdVXuR4qVrkwm6u93/PRmFsL8DDWfURiHPuXJ+W
 7NgsyreQEDLJYom8qloda/Lva2+FB0BHHkzUVLiZ7mDdbYq9Dush0QLLnOSP4p3O
 GeeFJeK4EkeGHHFBbFllJ6gVB9xiokEcghXz1a+PkNMkYuQpAswlvhHxlIfEk1Bv
 p1DBcM3gfT+3kfGynyz9A2O01zSd34Eg7tQuMqObxwFwpWY9mzrlYaPLdLF7Vtgc
 JyQVvjTMaUZtiN/zGUFyXxAboTGWIFlPJKvHLHCiKvivSveXamziasieUwDU/cBL
 X5SuIh883CghMhp8Dtx39zpcuiwEZQ==
 =sQPM
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.13

A collection of fixes that have come in since the merge window, mainly
device specific things.  The fixes to the generic cards from
Morimoto-san are handling regressions that were introduced in the merge
window on at least the Kontron sl28-var3-ads2.
2021-05-25 08:58:01 +02:00
Peter Ujfalusi
9d5536e0e1
ASoC: SOF: Intel: hda: Remove conditions against CONFIG_PCI
The HDA support can only be compiled when SND_SOC_SOF_PCI is enabled which
depends on CONFIG_PCI.

This makes the IS_ENABLED(CONFIG_PCI) checks redundant in the code, they
will resolve to true all the time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20210521092804.3721324-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:41 +01:00
Pierre-Louis Bossart
4f50f16e94
ASoC: SOF: ops: don't return void value
Sparse throws the following warning:

sound/soc/sof/ops.h:247:17: error: returning void-valued expression

Remove the useless returns.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:40 +01:00
Jaska Uimonen
ccaea61a8d
ASoC: SOF: topology: fix assignment to use le32_to_cpu
Fix sparse warning by using le32_to_cpu.

Signed-off-by: Jaska Uimonen <jaska.uimonen@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/20210521092804.3721324-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:39 +01:00
Peter Ujfalusi
c03459415c
ASoC: SOF: loader: Use snd_sof_dsp_block_read() instead sof_block_read()
SOF core should use the IO functions via callbacks and not directly to
ensure that it remains platform independent.

Fixes: 83ee7ab162 ("ASoC: SOF: Intel: byt: Refactor fw ready / mem windows creation")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.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/20210521092804.3721324-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:38 +01:00
Keyon Jie
3b2e93ed12
ASoC: SOF: ops: print out the polling register
Print the register offset out to provide more useful information for the
register polling debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:37 +01:00
Peter Ujfalusi
e5eaa4e66f
ASoC: SOF: pci: No need to cast second time to save the desc
At the start of the function we already have the desc, no need to cast it
again from pci_id->driver_data to save it to sof_pdata.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@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/20210521092804.3721324-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:36 +01:00
Peter Ujfalusi
fd979ec12e
ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functions
We can check for the desc->ops directly in the probe functions, the ops
is not used directly in the functions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@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/20210521092804.3721324-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:35 +01:00
Ranjani Sridharan
8c08652614
ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
BE hw_params op was recently added for SSP type DAIs.
But sending the DAI_CONFIG IPC during hw_params
is not supported with older firmware. So add an ABI check
to avoid sending the IPC if the firmware ABI is older than
3.18.

Fixes: e12be9fbfb ('ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs')
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210518174121.151601-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:18:00 +01:00
Jaska Uimonen
d29d41e28e
ASoC: topology: Add support for multiple kcontrol types to a widget
Current dapm widget has a single variable to describe its kcontrol's
type. As there can be many kcontrols in one widget it is inherently
presumed that the types are the same.

Lately there has been use cases where different types of kcontrols would
be needed for a single widget. Thus add pointer to dapm widget to hold
an array for different kcontrol types and modify the kcontrol creation
to operate in a loop based on individual kcontrol type.

Change control creation and deletion to use individual kcontrol types in
SOF driver. This is done in the same patch for not breaking bisect. SOF
driver is also currently the only one using the dapm widget
kcontrol_type.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210507070246.404446-1-jaska.uimonen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-14 16:31:15 +01:00
Pierre-Louis Bossart
ad839121dd
ASoC: SOF: Intel: hda: fix index used in inner loop
With more warnings than the default, Sparse throws the following
warning:

sound/soc/sof/intel/hda.c:1127:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1128:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1129:48: error: self-comparison always
evaluates to true

This looks like an obvious error, with a likely copy-pasted line
leading to the use of the wrong index in an inner loop. One of the
worst single-character bugs in a long time.

This problem was not detected in our tests since in practice SoundWire
platforms only have identical devices per link and the index mistake
did not change the results.

Fixes: 6f5d506d7ff1dq ('ASoC: SOF: Intel: SoundWire: refine ACPI match')
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210511213707.32958-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:47 +01:00
Pierre-Louis Bossart
47fad2393b
ASoC: SOF: Intel: move common ATOM stuff to module
Split between ACPI/PCI parts and use common module.

Since it's a split of existing code, the same dual-license is used for
the new atom.c and atom.h files.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210505170235.306797-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:03:16 +01:00
Pierre-Louis Bossart
1c5ab2dc75
ASoC: SOF: Intel: byt: prepare split between Baytrail and Merrifield
Atom devices are split in ACPI (Baytrail/Cherrytrail) and
PCI (Merrifield) cases. In preparation for a split between the two
parts and the use of a common module, rename functions with the atom_
prefix when appropriate and remove explicit BYT_ prefix for common
definitions.

This patch should not change any functionality.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210505170235.306797-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10 13:03:15 +01:00
Mark Brown
ffc9841d52
Merge remote-tracking branch 'asoc/for-5.13' into asoc-next 2021-04-23 19:01:02 +01:00
Ranjani Sridharan
eea1d18e9b
ASoC: SOF: use current DAI config during resume
Recently, the sof_pcm_dai_link_fixup() function was
updated to match SSP config with the PCM hw_params
and set the current_config for the DAI widget.

But the sof_restore_pipelines() function still chooses the
default config for the DAI widget upon resuming. Fix this
to use the last used config when setting up the DAI widget
during resume.

Fixes: c943a586f6 ("ASoC: SOF: match SSP config with pcm hw params")
Reviewed-by: Kai Vehmanen <kai.vehmanen@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/20210415162107.130963-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 18:11:30 +01:00
Mark Brown
13a9e21b80
Merge series "ASoC: SOF: Intel: descriptor corrections for TGL and ADL" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
One missed property for TigerLake and need for separate descriptors
between ADL-S and the other flavors.

Libin Yang (1):
  ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms

Sathya Prakash M R (1):
  ASoC: SOF: Intel: Update ADL P to use its own descriptor

 sound/soc/sof/intel/pci-tgl.c | 20 +++++++++++++++++++-
 sound/soc/sof/intel/tgl.c     |  2 +-
 2 files changed, 20 insertions(+), 2 deletions(-)

--
2.25.1
2021-04-12 19:56:23 +01:00
Mark Brown
2976eef29e
Merge series "ASoC: SOF: simplify probe and report errors" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
These patches simplify the sof_probe_complete handling and
address reporting of errors during probe.

Peter Ujfalusi (2):
  ASoC: SOF: core: Add missing error prints to device probe operation
  ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of

 sound/soc/sof/core.c         |  9 +++++++--
 sound/soc/sof/sof-acpi-dev.c | 18 +++---------------
 sound/soc/sof/sof-of-dev.c   | 18 +++---------------
 sound/soc/sof/sof-pci-dev.c  | 20 ++++----------------
 4 files changed, 17 insertions(+), 48 deletions(-)

--
2.25.1
2021-04-12 19:56:22 +01:00
Mark Brown
6fede18b0c
Merge series "ASoC: SOF: simplify nocodec mode" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This set of patches simplify the implementation
of nocodec mode in SOF.

Pierre-Louis Bossart (6):
  ASoC: SOF: add Kconfig option for probe workqueues
  ASoC: soc-acpi: add new fields for mach_params
  ASoC: SOF: change signature of set_mach_params() callback
  ASoC: SOF: Intel: update set_mach_params()
  ASoC: SOF: pcm: export snd_pcm_dai_link_fixup
  ASOC: SOF: simplify nocodec mode

 include/sound/soc-acpi.h  |  4 ++++
 include/sound/sof.h       |  3 ---
 sound/soc/sof/Kconfig     | 11 +++++++++++
 sound/soc/sof/intel/bdw.c |  8 ++++++--
 sound/soc/sof/intel/byt.c | 22 +++++++++++++---------
 sound/soc/sof/intel/hda.c |  8 ++++++--
 sound/soc/sof/intel/hda.h |  2 +-
 sound/soc/sof/nocodec.c   | 39 +++++++++++++++++++++------------------
 sound/soc/sof/ops.h       |  6 ++----
 sound/soc/sof/pcm.c       |  1 +
 sound/soc/sof/sof-audio.c | 34 +++++++++++++++-------------------
 sound/soc/sof/sof-priv.h  |  2 +-
 12 files changed, 81 insertions(+), 59 deletions(-)

--
2.25.1
2021-04-12 19:56:21 +01:00
Sathya Prakash M R
4ad03f894b
ASoC: SOF: Intel: Update ADL P to use its own descriptor
ADL P has specific machines and hence having its own
table will help separate the machines and FW

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 18:03:22 +01:00
Libin Yang
1b9889974c
ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms
All Intel TigerLake platforms should support the feature of getting
the system state from acpi to deal with S0ix support.

This was missed in previous commits, likely due to copy/paste from
older code.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 18:03:21 +01:00
Ranjani Sridharan
7459f8b703
ASoC: SOF: topology: remove useless code
The patch "ASoC: SOF: Intel: hda: assign link DMA channel at run-time"
fixed the sof_link_hda_unload() to remove the call to the BE
hw_free op but left the rest of code that become redundant.

So, remove sof_link_hda_unload() along with the link_unload() op
entirely as it is not longer needed.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@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/20210409220522.1542865-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:06:45 +01:00
Libin Yang
b2fe85790d
ASoC: SOF: Kconfig: fix typo of SND_SOC_SOF_PCI
It should be 'endif ## SND_SOC_SOF_PCI' instead of
'endif ## SND_SOC_SOF_INTEL_PCI'

Signed-off-by: Libin Yang <libin.yang@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/20210409221308.1544000-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:06:44 +01:00
Pierre-Louis Bossart
4c1cc83fcc
ASOC: SOF: simplify nocodec mode
Replace ugly #if (!IS_ENABLED) by if (!IS_ENABLED), remove
cross-module dependencies and use classic mechanism to pass
information to the machine driver.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:55 +01:00
Pierre-Louis Bossart
f3f3af1743
ASoC: SOF: pcm: export snd_pcm_dai_link_fixup
In preparation of the nocodec refactoring, export the dai-link
fixup. This will also be required when we have more clients and
platform drivers.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:54 +01:00
Pierre-Louis Bossart
974cccf490
ASoC: SOF: Intel: update set_mach_params()
Add information for num_dai_drivers and dai_drivers[], which will be
used in the refactored nocodec implementation

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:53 +01:00
Pierre-Louis Bossart
17e9d6b0a3
ASoC: SOF: change signature of set_mach_params() callback
To set additional parameters, we need to have access to sdev, not the
plain vanilla struct device pointer.

No functionality change.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:52 +01:00
Pierre-Louis Bossart
e4330cae2a
ASoC: SOF: add Kconfig option for probe workqueues
The probe workqueue is currently used in the HDaudio case, following
the example of the snd-hda-intel driver.

For development and validation, it's useful to enable the probe
workqueue even with ACPI devices or NOCODEC mode.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:50 +01:00
Peter Ujfalusi
4d1284cd79
ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of
Set the sof_data->sof_probe_complete callback unconditionally of
CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE.

The sof_probe_complete will be called when the sof_probe_continue()
function is successfully executed, called either directly from
snd_sof_device_probe() or from the scheduled work.

Since all error cases within the call chain of snd_sof_device_probe() have
error prints, there is no need to print again in the acpi/pci/of level.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20210409220959.1543456-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:01 +01:00
Peter Ujfalusi
3bcae98e10
ASoC: SOF: core: Add missing error prints to device probe operation
Two error cases in snd_sof_device_probe() and sof_probe_continue() are
missing error prints.
If either of them happens it is not possible to identify the reason for the
failure.

Add dev_err() prints for the cases to aim debugging.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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/20210409220959.1543456-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:00 +01:00
Jaska Uimonen
c943a586f6
ASoC: SOF: match SSP config with pcm hw params
This patch adds a function to find a match between pcm hw params and SSP
DAI config. Config is matched against sample rate and if match is found
current config is set. If match isn't found last matched config is left
as current i.e. current config is not touched. Functionality for SSP
DAIs with 1 config remains the same as before.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:19 +01:00
Jaska Uimonen
e12be9fbfb
ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs
Currently SSP DAIs don't have hw params callback function as there
wasn't anything to setup after initial topology loading. After enabling
multiple DAI configs the current config can be sent in the callback.

This patch changes the way SSP config ipc is sent to the dsp. Before it
was only sent once in topology loading, but now it will be additionally
sent always when stream is opened. Mechanism is similar as with HDA
DAIs.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:18 +01:00
Jaska Uimonen
c1c03888f1
ASoC: SOF: parse multiple SSP DAI and hw configs
ASoC parses multiple hw_configs defined in topology. However currently
in SOF only the first config is used and others are discarded. First
change SOF driver to parse and save possible multiple configs in ssp
case. Also save the default config value provided by ASoC. Functionality
with only one defined config stays the same.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:17 +01:00
Kai Vehmanen
dfb81e3b5f
ASoC: SOF: Intel: hda: drop display power on/off in D0i3 flows
Controller needs to ensure display power is enabled only for
HDA controller reset. Drop the display power-up/down calls from
D0i3 entry/exit paths.

This was previously not possible as codec drivers could not resume the
links, and instead controller kept the reference to display power. The
state of display power had be maintained in the D0i3 entry/exit code.
With commit 87fc20e4a0 ("ASoC: SOF: Intel: hda: use hdac_ext
fine-grained link management"), this is no longer needed and the code
can be cleaned up.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Keyon Jie <yang.jie@intel.com>
Link: https://lore.kernel.org/r/20210322143830.3880293-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:19:01 +00:00
Pierre-Louis Bossart
8bb84ca873
ASoC: SOF: Intel: move ELH chip info
ELH is a derivative of TGL, so it should be exposed in tgl.c for
consistency.

No functional change.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:31 +00:00
Libin Yang
d3aa96bf34
ASoC: SOF: Intel: APL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:30 +00:00
Libin Yang
b0503e8410
ASoC: SOF: Intel: CNL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:29 +00:00
Libin Yang
4939e49ea5
ASoC: SOF: Intel: ICL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:28 +00:00
Libin Yang
22aa9e021a
ASoC: SOF: Intel: TGL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Define the shutdown function to use
snd_sof_suspend as shutdown callback to make sure DSP is in D3 state.

Fixes: 44a4cfad8d ("ASoC: SOF: Intel: tgl: do thorough remove at .shutdown() callback")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:27 +00:00
Libin Yang
3c429f861e
ASoC: SOF: Intel: TGL: fix EHL ops
EHL is derived from TGL, not CNL, so we shall use the TGL ops.

Fixes: 8d4ba1be3d ("ASoC: SOF: pci: split PCI into different drivers")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:26 +00:00