Commit graph

21818 commits

Author SHA1 Message Date
Pierre-Louis Bossart
23c8aa3eba
ASoC: Intel: sof_sdw: remove hard-coded codec_conf table
Now that the ACPI machine params provide all the information needed,
allocate the card codec_conf dynamically and set .dlc and
.prefix_name.

Signed-off-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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200923080514.3242858-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-23 18:13:14 +01:00
Pierre-Louis Bossart
f93808308a
ASoC: Intel: add codec name prefix to ACPI machine description
The current SOF machine driver adds a name prefix for each codec,
mainly to differentiate ALSA controls for left and right amplifiers.

This is a good idea, but the machine driver duplicates some of the
information that already exists in ACPI descriptors, so add those
prefixes there. Follow-up patches will make use of the information
encoded in these tables and remove duplication.

Signed-off-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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200923080514.3242858-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-23 18:13:13 +01:00
Pierre-Louis Bossart
f1bf9a6b4e
ASoC: Intel: sof_sdw: remove ternary operator
cppcheck reports the following warning:

sound/soc/intel/boards/sof_sdw.c:866:46: style: Clarify calculation
precedence for '&' and '?'. [clarifyCalculation]
 hdmi_num = sof_sdw_quirk & SOF_SDW_TGL_HDMI ?
                                             ^

There's no reason to use the ternary operator here, we might as well
use a regular if-else construct.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200923080514.3242858-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-23 18:13:12 +01:00
Necip Fazil Yildiran
50b18e4a26
ASoC: cros_ec_codec: fix kconfig dependency warning for SND_SOC_CROS_EC_CODEC
When SND_SOC_CROS_EC_CODEC is enabled and CRYPTO is disabled, it results
in the following Kbuild warning:

WARNING: unmet direct dependencies detected for CRYPTO_LIB_SHA256
  Depends on [n]: CRYPTO [=n]
  Selected by [y]:
  - SND_SOC_CROS_EC_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && CROS_EC [=y]

The reason is that SND_SOC_CROS_EC_CODEC selects CRYPTO_LIB_SHA256 without
depending on or selecting CRYPTO while CRYPTO_LIB_SHA256 is subordinate to
CRYPTO.

Honor the kconfig menu hierarchy to remove kconfig dependency warnings.

Fixes: 93fa0af479 ("ASoC: cros_ec_codec: switch to library API for SHA-256")
Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
Link: https://lore.kernel.org/r/20200917141803.92889-1-fazilyildiran@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-22 16:04:21 +01:00
Dan Murphy
90e2a588c9
ASoC: tas2562: Remove duplicate code for I/V sense
Remove duplicate code for programming the I/V sense the call to update
the register was duplicated in commit 09ed395b05 ("ASoC: tas2562:
Add voltage sense slot configuration").

Fixes: 09ed395b05 ("ASoC: tas2562: Add voltage sense slot configuration")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200922142411.10364-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-22 16:04:20 +01:00
Cheng-Yi Chiang
55c5cc63ab
ASoC: hdmi-codec: Use set_jack ops to set jack
Use set_jack ops to set jack so machine drivers do not need to include
hdmi-codec.h explicitly.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-22 12:48:03 +01:00
Mark Brown
376dd57d88
Merge series "ASoC: SOF: fix kcontrol size checks" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
Series that fixes checks for 'size' in kcontrol get/put ext_bytes methods
for SOF. The gaps in these checks were discovered via cppcheck warnings
on unused variable values.

Pierre-Louis Bossart (5):
  ASoC: SOF: control: fix size checks for ext_bytes control .get()
  ASoC: SOF: control: fix size checks for volatile ext_bytes control
    .get()
  ASoC: SOF: control: add size checks for ext_bytes control .put()
  ASoC: SOF: control: remove const in sizeof()
  ASoC: SOF: topology: remove const in sizeof()

 sound/soc/sof/control.c  | 53 +++++++++++++++++++++++++++++++---------
 sound/soc/sof/topology.c |  2 +-
 2 files changed, 43 insertions(+), 12 deletions(-)

--
2.27.0
2020-09-21 23:57:25 +01:00
Kai Vehmanen
163cd1059a
ASoC: hdac: make SOF HDA codec driver probe deterministic
To provide backward compatibility to older systems, the SOF HDA driver
allows user to specify which HDMI codec driver to use at runtime via
kernel parameter. This mechanism has a subtle flaw in that it assumes
the codec drivers not to be loaded when the SOF PCI driver is loaded.

The problem is rooted in use of the hdev->type field.
snd_hdac_ext_bus_device_init() initializes this field to HDA_DEV_ASOC.
This signals the HDA core that ASoC drivers should be considered in
driver matching (hda_bus_match()). The SOF and SST drivers continue by
overriding this field to HDA_DEV_LEGACY and proceeding to load driver
modules with request_module(). Correct drivers will get loaded and
attached.

If however the codec drivers are already loaded when
snd_hdac_ext_bus_device_init() is called, the matching will not work as
expected as device type is still set to HDA_DEV_ASOC. Specifically if
hdac-hdmi is attached when machine driver is configured to use hdac-hda,
this leads to out-of-bounds memory access in
hda_dsp_hdmi_build_controls().

Fix the issue by adding codec type as a parameter to
snd_hdac_ext_bus_device_init() and ensuring type is set correctly from
the start.

Fixes: 139c7febad ("ASoC: SOF: Intel: add support for snd-hda-codec-hdmi")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200921100841.2882662-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:24 +01:00
Dan Murphy
be05ab41c6
ASoC: tas2770: Refactor sample rate function
Refactor the tas2770_set_samplerate to simplify the code and access the
I2C bus only once per rate request. The ramp rate and sample rate bits
are contained in the same register so a single call to the
snd_soc_update_bits function is all that is needed

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-9-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:23 +01:00
Dan Murphy
d3964aff73
ASoC: tas2770: Fix the spacing and new lines
Fix up the spacing for argument alignment and add new lines to separate
code. Eliminate unneccessary goto statements when the error code could
just be returned.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-8-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:22 +01:00
Dan Murphy
ec9377dca2
ASoC: tas2770: Convert bit mask to GENMASK in header
Update the hardcoded masks with the GENMASK macro. Also update some of
the hardcoded bits with the BIT macro

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-6-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:21 +01:00
Dan Murphy
d3d71c99b5
ASoC: tas2770: Fix unbalanced calls to pm_runtime
Fix the unbalanced call to the pm_runtime_disable when removing the
module.  pm_runtime_enable is not called nor is the pm_runtime setup in
the code.  Remove the i2c_remove function and the pm_runtime_disable.

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-5-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:20 +01:00
Dan Murphy
8adcdbe63a
ASoC: tas2562: Add the TAS2110 class-D amplifier
Add the TAS2110 amplifier to the TAS2562 driver. The TAS2110 is register
and bitmap compatible. The chips differ in that the TAS2110 does not
have the I/V Sense feedback path. Since these features do not exist the
device needs to be registered without these controls.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200921153820.18357-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:57:18 +01:00
Pierre-Louis Bossart
2ca210112a
ASoC: SOF: control: add size checks for ext_bytes control .put()
Make sure the TLV header and size are consistent before copying from
userspace.

Fixes: c3078f5397 ('ASoC: SOF: Add Sound Open Firmware KControl support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200921110814.2910477-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:14:47 +01:00
Pierre-Louis Bossart
ec5a97624a
ASoC: SOF: control: fix size checks for volatile ext_bytes control .get()
Mirror addition of checks for regular ext_bytes controls.

Fixes: 783560d02d ('ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200921110814.2910477-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:14:46 +01:00
Pierre-Louis Bossart
3331bcd6a2
ASoC: SOF: control: fix size checks for ext_bytes control .get()
cppcheck complains twice:

sound/soc/sof/control.c:436:2: style: Assignment of function parameter
has no effect outside the function. [uselessAssignmentArg]
 size -= sizeof(const struct snd_ctl_tlv);
 ^

sound/soc/sof/control.c:436:7: style: Variable 'size' is assigned a
value that is never used. [unreadVariable]
 size -= sizeof(const struct snd_ctl_tlv);

Somehow we dropped the checks for the size argument when upstreaming
the code, somewhere between v5 and v6.

Re-add a size check to avoid providing userspace with more data that
it asked for.

Also fix all error codes, we should return -ENOSPC instead of -EINVAL.

Fixes: c3078f5397 ('ASoC: SOF: Add Sound Open Firmware KControl support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200921110814.2910477-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 23:14:45 +01:00
Mark Brown
97ee967e6c
Merge branch 'asoc-5.9' into asoc-5.10 2020-09-21 22:37:14 +01:00
Miquel Raynal
ec96690de8
ASoC: tlv320aic32x4: Enable fast charge
At power-up the analog circuits may take up to one full second before
being charged with the default configuration. Using the analog blocks
before they are ready generates a *very* crappy sound.

Enable the fast charge feature, which will require a bit more power
than normal charge but will definitely speed up the starting operation
by shrinking this delay to up to 40 ms.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20200911173140.29984-4-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 22:08:36 +01:00
Miquel Raynal
40b3713628
ASoC: tlv320aic32x4: Fix bdiv clock rate derivation
Current code expects a single channel to be always used. Fix this
situation by forwarding the number of channels used. Then fix the
derivation of the bdiv clock rate.

Fixes: 96c3bb0023 ("ASoC: tlv320aic32x4: Dynamically Determine Clocking")
Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20200911173140.29984-3-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 22:08:35 +01:00
Miquel Raynal
5b4458ebb4
ASoC: tlv320aic32x4: Ensure a minimum delay before clock stabilization
As indicated in the datasheet, a 10ms delay must be observed after
programming the divisors.

The lack of delay prevents the codec to work properly and the playback
appears extremely slow and totally un-audible on a custom sama5 based
board.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20200911173140.29984-2-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 22:08:34 +01:00
Shuming Fan
501ef01339
ASoC: rt711: wait for the delayed work to finish when the system suspends
To avoid the IO error, we need to cancel the delayed work and wait for it to finish.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200921094308.31921-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:55 +01:00
Dan Murphy
cadab0aefc
ASoC: tas2770: Fix error handling with update_bits
snd_soc_update_bits returns a 1 when the bit was successfully updated,
returns a 0 is no update was needed and a negative if the call failed.
The code is currently failing the case of a successful update by just
checking for a non-zero number. Modify these checks and return the error
code only if there is a negative.

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-7-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:54 +01:00
Dan Murphy
4b8ab8a776
ASoC: tas2770: Fix required DT properties in the code
The devicetree binding indicates that the ti,asi-format, ti,imon-slot-no
and ti,vmon-slot-no are not required but the driver requires them or it
fails to probe. Honor the binding and allow these entries to be optional
and set the corresponding values to the default values for each as defined
in the data sheet.

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-4-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:53 +01:00
Dan Murphy
4272caf34a
ASoC: tas2770: Add missing bias level power states
Add the BIAS_STANDBY and BIAS_PREPARE to the set_bias_level or else the
driver will return -EINVAL which is not correct as they are valid
states.

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:52 +01:00
Dan Murphy
b0bcbe6157
ASoC: tas2770: Fix calling reset in probe
tas2770_reset is called during i2c probe. The reset calls the
snd_soc_component_write which depends on the tas2770->component being
available. The component pointer is not set until codec_probe so move
the reset to the codec_probe after the pointer is set.

Fixes: 1a476abc72 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918190548.12598-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:52 +01:00
Shuming Fan
5f2df2a458
ASoC: rt700: wait for the delayed work to finish when the system suspends
To avoid the IO error, we need to cancel the delayed work and wait for it to finish.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200921094244.31869-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 20:40:51 +01:00
Dan Murphy
534c0f4391
ASoC: tas2562: Add the TAS2564 compatible
Add the TAS2564 as a supported amplifier.  This amplifier is register,
bitmap and feature compatible to the TAS2562.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200918150130.21015-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 17:28:12 +01:00
Kai Vehmanen
5b51b9221f
ASoC: SOF: imx: add missing MODULE_LICENSE() for imx-common
Fix build warning:
WARNING: modpost: missing MODULE_LICENSE() in sound/soc/sof/imx/imx-common.o

Fixes: 18ebffe4d0 ("ASoC: SOF: imx: Add debug support for imx platforms")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200921104746.2903507-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 17:28:11 +01:00
Daniel Baluta
43437d0417
ASoC: SOF: pm: Fix prepare callback behavior for OF usecase
On i.MX platforms PM is not managed via ACPI although CONFIG_ACPI
can be set. So, in order to correctly set the system target state
we introduce a flag for platforms that require to use acpi target
states.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.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/20200921105038.2909899-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 17:28:10 +01:00
Guillermo Rodríguez
6410887222
ASoC: cs42l51: add additional ADC volume controls
Add volume controls for:
- Analog programmable gain amplifier (PGA) (-3 .. +12 dB)
- ADC attenuator (0 .. -96 dB)

Signed-off-by: Guillermo Rodríguez <guille.rodriguez@gmail.com>
Acked-by: David Rhodes <David.rhodes@cirrus.com>
Link: https://lore.kernel.org/r/20200918134317.22574-1-guille.rodriguez@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 17:28:09 +01:00
Keyon Jie
2263063fc4
ASoC: SOF: topology: fix the process being scheduled on core0 always
In commit 783898ce68 ("ASoC: SOF: append extended data to
sof_ipc_comp_process") the process components are set to run on the
fixed core 0, this break us from scheduling components on any other DSP
core.

Since we can get the DSP core index from swidget->core, it is duplicated
to pass the extra 'core' argument for those sof_widget_load_xx()
functions.

Here removes the duplicate 'core' argument and get component core from
swidget->core directly to fix the issue mentioned above.

Fixes: 783898ce68 ("ASoC: SOF: append extended data to sof_ipc_comp_process")
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@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/20200921104544.2897112-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21 17:28:08 +01:00
Linus Torvalds
343b529a00 sound fixes for 5.9-rc6
Here is a collection of fixes for 5.9.  All look small and are
 nothing scary.  The majority of changes are about ASoC driver-
 specific fixes, while there are a couple of ASoC core fixes (DAI
 lookup and lockdep stuff) and usual HD-audio quirks.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl9k6X4OHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/9ihAAiTQtzf4s9BkyyiCsH3vrRa7+8qX8N/vMk+8k
 vintgqMVwDr1hpkB2ZnpEOkbrcdzFAByOnLU66t42kTiKwjiTdABii8vpVUUpSdw
 MwM11+IEor5MaNdNZwt3lfBK0j30AfU3ag5lyPsw8afQpUla/nkk16AIwzOO4u1Q
 ajy+vdBz15q8IeR80geSvuTDHvNO4X+3pI381kekEbg/D5U/KlGCYe1q0Ln6RJ5B
 pguzNFiyWIKu9w6YdPI7hgGInlA3V0Eltnt7LAI6TfIL32v+gDF5V5UAYGhENsT3
 Belc3OP4iQrrYCJ/9mLyhpz4n6urQk/hZBND2I3CLybk/OyCmxZCPCkHq2nk7NaL
 dWPs+0xiJnoh60UWGeDiejUNqVgIxRcI0WA+XJA+ELg6zfOU3KDVh3Swm+SlY3c/
 OQXjZxw5XzSYvg98cTaA+CYGRO1u4vMM5iPWa0KajQcMGbu+h5ogGZLggfsuNQ6/
 0oqBvomkfEPFINupmiJgzkb6MuXSvXxE6WHPyfAD0xT2Dh8u8vrIEmKqABQDJpaJ
 8JACBYUCax+Y1OFTvWj8LZ75sXBBiL+ynzetlP9h7zDqYLwU1ZwVAeyS0CPt7E5e
 A220weSOzcJNZz4ZM4c0XSN7cvz1MpkVlKTihj4Evx2xXagMgE47/F355SQlt6C4
 Y8G85/0=
 =VuAQ
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Here is a collection of fixes for 5.9. All look small and are nothing
  scary.

  The majority of changes are about ASoC driver- specific fixes, while
  there are a couple of ASoC core fixes (DAI lookup and lockdep stuff)
  and usual HD-audio quirks"

* tag 'sound-5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
  ALSA: hda/realtek - The Mic on a RedmiBook doesn't work
  ASoC: tlv320adcx140: Wake up codec before accessing register
  ASoC: core: Do not cleanup uninitialized dais on soc_pcm_open failure
  ALSA: hda: fixup headset for ASUS GX502 laptop
  ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN Converter9 2-in-1
  ASoC: Intel: haswell: Fix power transition refactor
  ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
  ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions
  ASoC: wm8994: Skip setting of the WM8994_MICBIAS register for WM1811
  ASoC: meson: axg-toddr: fix channel order on g12 platforms
  ASoC: soc-core: add snd_soc_find_dai_with_mutex()
  ASoC: qcom: common: Fix refcount imbalance on error
  ASoC: rt700: Fix return check for devm_regmap_init_sdw()
  ASoC: rt715: Fix return check for devm_regmap_init_sdw()
  ASoC: rt711: Fix return check for devm_regmap_init_sdw()
  ASoC: rt1308-sdw: Fix return check for devm_regmap_init_sdw()
  ASoC: max98373: Fix return check for devm_regmap_init_sdw()
  ASoC: ti: fixup ams_delta_mute() function name
  ASoC: pcm3168a: ignore 0 Hz settings
  ASoC: Intel: tgl_max98373: fix a runtime pm issue in multi-thread case
  ...
2020-09-18 11:38:08 -07:00
Camel Guo
d521432149
ASoC: tlv320adcx140: Add support for configuring GPIO pin
Add support to configure the GPIO pin to the specific configuration.
The GPIO pin can be configured as GPO, IRQ, SDOUT2, PDMCLK, MICBASE_EN,
GPI, MCLK, SDIN, PDMDIN1, PDMDIN2, PDMDIN3 or PDMDIN4 and the output
drive can be configured with various configuration.

Signed-off-by: Camel Guo <camelg@axis.com>
Link: https://lore.kernel.org/r/20200918114025.18205-2-camel.guo@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-18 13:09:02 +01:00
Mark Brown
41cfc734ab
Merge series "ASoC: fsl_sai: update the register list" from Shengjiu Wang <shengjiu.wang@nxp.com>:
As sai ip is upgraded, so update sai register list.

Shengjiu Wang (3):
  ASoC: fsl_sai: Add new added registers and new bit definition
  ASoC: fsl_sai: Add fsl_sai_check_version function
  ASoC: fsl_sai: Set MCLK input or output direction

changes in v2:
- update commit message for first commit
- Add acked-by Nicolin

 sound/soc/fsl/fsl_sai.c | 77 ++++++++++++++++++++++++++++++++++++
 sound/soc/fsl/fsl_sai.h | 87 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 164 insertions(+)

--
2.27.0
2020-09-17 17:40:16 +01:00
Mark Brown
e6937b6d1a
Merge series "ASoC: SOF: small fixes for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
Series that adds debug support for IMX platforms, more details to
FW version information, adds missing -EACCESS handling to
pm_runtime_get_sync() calls and a set of minor cosmetic, trace
verbosity and coding style issues.

Guennadi Liakhovetski (3):
  ASoC: SOF: (cosmetic) remove redundant "ret" variable uses
  ASoC: SOF: remove several superfluous type-casts
  ASoC: SOF: fix range checks

Iulian Olaru (1):
  ASoC: SOF: imx: Add debug support for imx platforms

Karol Trzcinski (1):
  ASoC: SOF: Add `src_hash` to `sof_ipc_fw_version` structure

Pierre-Louis Bossart (3):
  ASoC: SOF: debug: update test for pm_runtime_get_sync()
  ASoC: SOF: control: update test for pm_runtime_get_sync()
  ASoC: SOF: Intel: hda: reduce verbosity of boot error logs

 include/sound/sof/info.h         |  4 +-
 sound/soc/sof/control.c          | 62 +++++++++++++--------------
 sound/soc/sof/debug.c            |  2 +-
 sound/soc/sof/imx/Kconfig        |  8 ++++
 sound/soc/sof/imx/Makefile       |  3 ++
 sound/soc/sof/imx/imx-common.c   | 72 ++++++++++++++++++++++++++++++++
 sound/soc/sof/imx/imx-common.h   | 16 +++++++
 sound/soc/sof/imx/imx8.c         | 23 +++++++++-
 sound/soc/sof/imx/imx8m.c        | 17 +++++++-
 sound/soc/sof/intel/hda-loader.c | 16 +++----
 sound/soc/sof/intel/hda.c        | 12 ++++--
 sound/soc/sof/intel/hda.h        |  2 +
 sound/soc/sof/sof-audio.c        |  6 +--
 sound/soc/sof/sof-priv.h         |  8 ++++
 sound/soc/sof/topology.c         | 44 ++++++++++---------
 15 files changed, 226 insertions(+), 69 deletions(-)
 create mode 100644 sound/soc/sof/imx/imx-common.c
 create mode 100644 sound/soc/sof/imx/imx-common.h

--
2.27.0
2020-09-17 17:40:15 +01:00
Mark Brown
4c3021f0af
Merge series "ASoC: q6afe: add clocks support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
q6afe already exposes clocks using apis, but not as proper
clock controller driver. This patch puts those clocks
in to a proper clock controller so that other drivers that
depend on those clocks can be properly expressed.

Srinivas Kandagatla (2):
  ASoC: q6afe: dt-bindings: add q6afe clock bindings
  ASoC: q6afe-clocks: add q6afe clock controller

 .../devicetree/bindings/sound/qcom,q6afe.txt  |  23 ++
 include/dt-bindings/sound/qcom,q6afe.h        |  74 ++++-
 sound/soc/qcom/Kconfig                        |   4 +
 sound/soc/qcom/qdsp6/Makefile                 |   1 +
 sound/soc/qcom/qdsp6/q6afe-clocks.c           | 270 ++++++++++++++++++
 5 files changed, 371 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/qcom/qdsp6/q6afe-clocks.c

--
2.21.0
2020-09-17 17:40:14 +01:00
Shengjiu Wang
337d348b83
ASoC: ak4458: Add DSD support for ak4458 and ak4497
Ak4458 can't support DSD512 format, but ak4497 can, so add
a new enum variable (enum ak4458_type) in ak4458_drvdata to
distinguish these two platforms.

Ak4497 has two kinds of DSD input pin, it can be selected by
the dsd-path property from DT.

In hw_params(), bit clock is calculated according to different
DSD format (DSD64, DSD128, DSD256, DSD512), then registers
are configured.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1600178220-28973-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:13 +01:00
Dan Murphy
42d5031d3e
ASoC: tlv320adcx140: Add the config to configure Tx ASI output
Add code to allow the ASI Tx output to be placed into High-z mode
during unused ASI cycles.  This allows for other devices that may be on
the bus to drive the ASI out. By default the 320adcx140 sends 0's for
unused cycles.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200915190606.1744-4-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:10 +01:00
Douglas Anderson
dcde34c47d
ASoC: qcom: lpass-sc7180: Add MODULE_DEVICE_TABLE
The lpass-sc7180 driver can be built as a module but is lacking a
MODULE_DEVICE_TABLE.  This means it won't auto-load.  Fix this
oversight.

Fixes: 24caf8d9eb ("ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200916111545.1.I4c3758817d94c433bafeac344a395e21ea6657e3@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:09 +01:00
Rander Wang
30ee3738f8
ASoC: SOF: Intel: Add support for tgl-h
SOF will support tgl-h and tgl-lp in different FW binaries due to
hardware difference, so create another dev_desc entry with FW name
of sof-tgl-h.ri and dsp_desc named tglh_chip_info for tgl-h.

Fixes: c8d2e2bfae ("ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H")
Signed-off-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/20200917103609.2559916-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:09 +01:00
Matthias Schiffer
df44bc16e6
ASoC: codec: tlv320aic32x4: do software reset before clock registration
To avoid the actual PLL settings to differ from the state expected by
the clock driver, the codec should only be fully reset before the clocks
are registered. But we also need to ensure that the software reset
happens at all before clock registration, as not all boards have a reset
GPIO.

Move the software reset from aic32x4_component_probe() to
aic32x4_probe() and reorder the reset and registration sequence:

1. Reset via GPIO (if available)
2. Reset via software
3. Register component
4. Register clocks

Note that aic32x4_component_probe() is only called after aic32x4_probe()
has finished, so the reset in aic32x4_component_probe() was happening too
late.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20200902133043.19504-2-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:08 +01:00
Matthias Schiffer
251e5c8694
ASoC: codec: tlv320aic32x4: fix missing aic32x4_disable_regulators() in error path
The regulators need to be disabled in the aic32x4_register_clocks()
failure case as well.

Fixes: 9d4befff5a ("ASoC: codec: tlv3204: Moving GPIO reset and add ADC reset")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20200902133043.19504-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 17:40:07 +01:00
Mark Brown
4db68e62a0
Merge branch 'asoc-5.9' into asoc-5.10 2020-09-17 16:35:38 +01:00
Shengjiu Wang
a57d4e8730
ASoC: fsl_sai: Set MCLK input or output direction
SAI support select MCLK direction with version.major > 3
and version.minor > 1, the default direction is input,
set it to be output according to DT property.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1600323079-5317-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 16:34:01 +01:00
Shengjiu Wang
1dc658b13c
ASoC: fsl_sai: Add fsl_sai_check_version function
fsl_sai_check_version can help to parse the version info
in VERID and PARAM registers.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1600323079-5317-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 16:34:00 +01:00
Shengjiu Wang
0b2cbce689
ASoC: fsl_sai: Add new added registers and new bit definition
On i.MX8MQ/i.MX8MN/i.MX8MM platform, the sai IP is upgraded.
There are some new registers and new bit definition. This
patch is to complete the register list.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1600323079-5317-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 16:33:59 +01:00
Srinivas Kandagatla
520a1c396d
ASoC: q6afe-clocks: add q6afe clock controller
q6afe already exposes lpass clocks, however this was not presented
as proper clock controller driver. This patch basically adds clock
controller support for q6afe clocks.

This is useful for other drivers like lpass digital codec or lpass
lowpower island drivers to request or vote for these clocks.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910135708.14842-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 16:13:13 +01:00
Pierre-Louis Bossart
776100a4ce
ASoC: SOF: Intel: hda: reduce verbosity of boot error logs
Previous commits reduced the verbosity of errors during boot
iterations, but there are still a couple remaining which generate
false positives. Errors should only be logged when after last attempt
to download firmware failed.

Duplicating logs and assigning them different levels based on the
iteration number isn't really elegant, use macro as suggested by
Guennadi.

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200917105633.2579047-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:21 +01:00
Guennadi Liakhovetski
0e4ea87870
ASoC: SOF: fix range checks
On multiple locations checks are performed of untrusted values after adding
a constant to them. This is wrong, because the addition might overflow and
the result can then pass the check, although the original value is invalid.
Fix multiple such issues by checking the actual value and not a sum of it
and a constant.

Signed-off-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/20200917105633.2579047-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:20 +01:00
Guennadi Liakhovetski
db69bcf915
ASoC: SOF: remove several superfluous type-casts
No need to type-cast assignments between void and other pointers in C.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@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/20200917105633.2579047-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:19 +01:00
Guennadi Liakhovetski
b9f8e1387c
ASoC: SOF: (cosmetic) remove redundant "ret" variable uses
In some cases no "ret" variable is even needed, those functions always
return 0 anyway, in other cases "ret" initialisation is redundant.

Signed-off-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/20200917105633.2579047-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:19 +01:00
Pierre-Louis Bossart
99ceec5ca0
ASoC: SOF: control: update test for pm_runtime_get_sync()
We need to avoid reporting an error for -EACCESS when pm_runtime is
not enabled.

Signed-off-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/20200917105633.2579047-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:18 +01:00
Pierre-Louis Bossart
7db6db9d1a
ASoC: SOF: debug: update test for pm_runtime_get_sync()
We need to avoid reporting an error for -EACCESS when pm_runtime is
not enabled.

Signed-off-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/20200917105633.2579047-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:17 +01:00
Iulian Olaru
18ebffe4d0
ASoC: SOF: imx: Add debug support for imx platforms
This patch adds debug support for imx platforms. This is important in
order to gather information about the state of the DSP in case of an
oops and the reason for the oops.

This is done by checking if a message with a panic code has been placed
in the debug box, in the imx8_dsp_handle_request function from sof/imx.

If positive, the function imx8_dump, added in common, will be called.
The first step is to gather information about the registers, filename,
line number and stack by calling the imx8_get_registers, added in common.
Then the information will be printed to the console by calling the
get_status function.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200917105633.2579047-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 15:53:15 +01:00
Dan Murphy
244ac15de7
ASoC: tlv320adcx140: Fix BCLK inversion for DSP modes
Fix the BCLK inversion for DSP modes
This is how it is defined by ASoC:
 * BCLK:
 * - "normal" polarity means signal is available at rising edge of BCLK
 * - "inverted" polarity means signal is available at falling edge of BCLK

The adcx140 defines the BCLK edge based on coding type.
The PCM (DSP_A/B) should drive on rising and sample on falling edge, so
from ASoC pov, it is IB_NF. But from the codec pov if it is configured in
DSP mode, then the BCLK should not be inverted, defaults to the coding
standard.

For i2s, it is NB_NF from ASoC pov (drive on falling, sample on rising).
>From the codec's pov BCLK should not invert either, as this is the default
for the coding.

So, inversion must take the format into account:
IB_NF + DSP_A/B == the codec bclk inversion should be disabled
NB_NF + DSP_A/B == the codec bclk inversion should be enabled
NB_NF + I2S == the codec bclk inversion should be disabled

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200915190606.1744-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 14:47:13 +01:00
Dan Murphy
df16e22104
ASoC: tlv320adcx140: Idle the device while writing registers
It was observed that if the device was active and register writes were
performed there were some unwanted behaviors particularly when writing
the word length and some filter options. So when writing to the device
the device should be placed in sleep mode and then exit sleep mode once
the register update is complete.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200915190606.1744-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 14:47:12 +01:00
Camel Guo
73154aca4a
ASoC: tlv320adcx140: Fix digital gain range
According to its datasheet, the digital gain should be -100 dB when
CHx_DVOL is 1 and 27 dB when CHx_DVOL is 255. But with the current
dig_vol_tlv, "Digital CHx Out Volume" shows 27.5 dB if CHx_DVOL is 255
and -95.5 dB if CHx_DVOL is 1. This commit fixes this bug.

Fixes: 689c7655b5 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Signed-off-by: Camel Guo <camelg@axis.com>
Link: https://lore.kernel.org/r/20200908090417.16695-1-camel.guo@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 14:47:11 +01:00
Pierre-Louis Bossart
6788fc1a66
ASoC: topology: disable size checks for bytes_ext controls if needed
When CONFIG_SND_CTL_VALIDATION is set, accesses to extended bytes
control generate spurious error messages when the size exceeds 512
bytes, such as

[ 11.224223] sof_sdw sof_sdw: control 2:0:0:EQIIR5.0 eqiir_coef_5:0:
invalid count 1024

In addition the error check returns -EINVAL which has the nasty side
effect of preventing applications accessing controls from working,
e.g.

root@plb:~# alsamixer
cannot load mixer controls: Invalid argument

It's agreed that the control interface has been abused since 2014, but
forcing a check should not prevent existing solutions from working.

This patch skips the checks conditionally if CONFIG_SND_CTL_VALIDATION
is set and the byte array provided by topology is > 512. This
preserves the checks for all other cases.

Fixes: 1a3232d2f6 ('ASoC: topology: Add support for TLV bytes controls')
BugLink: https://github.com/thesofproject/linux/issues/2430
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200917103912.2565907-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 14:47:10 +01:00
Viorel Suman
944c517b8c
ASoC: fsl_audmix: make clock and output src write only
"alsactl -f state.conf store/restore" sequence fails because setting
"mixing clock source" and "output source" requires active TDM clock
being started for configuration propagation. Make these two controls
write only so that their values are not stored at "alsactl store".

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1600104274-13110-1-git-send-email-viorel.suman@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17 14:47:09 +01:00
derek.fang
8d9a14fc73
ASoC: rt1015: Fix the failure to flush DAC data before playback
Fix the failure to flush DAC data before playback.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/1600073839-6762-2-git-send-email-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-14 13:53:57 +01:00
derek.fang
da145172b2
ASoC: rt1015: Fix DC calibration on bypass boost mode
Fix the DC calibration unsuccessful issue on rt1015
bypass boost mode.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/1600073839-6762-1-git-send-email-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-14 13:53:57 +01:00
Olof Johansson
465c335bb5 Samsung S3C24xx and S3C64xx machine code cleanup for v5.10
Big cleanup for the Samsung S3C24xx and S3C64xx platforms, although it
 also touches files shared with S5Pv210 and Exynos.  This is mostly Arnd
 Bergmann work which Krzysztof Kozlowski took over, rebased and polished.
 
 The goal is to cleanup, merge and finally make the Samsung S3C24xx and
 S3C64xx architectures multiplatform.  The multiplatform did not happen
 yet here - just cleaning up and merging into one arch/arm/mach-s3c
 directory.  However this is step forward for multiplatform or at least
 to keep this code still maintainable.
 
 This pulls also branch with changes for Samsung SoC sound drivers from
 broonie/sound because the cleanups there were part of this series and
 all further patches depend on them.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAl9NGucQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD1zzWD/0T5JdPls++8JUK04hxkunMJO3Ye2ir/a2C
 YAI2M6fbOludcPeGCRnPBZ3uTbeSOXFrV6UuSVi8EVKoAb0EV3G50XGQecmy/TVx
 nq/c90gtnsODL0Kxjm0767WZl9clKaIE3+VNSyQXAhqJqXK8A1L8ovsUpQEj6fr4
 vaNQi6lW7o0r98OEB14M0z59lSWjanUZ33/R22L3AsRihlJTH0Sye2+zVG85LfMD
 5okekSHndt2/NCUxgLTZIkp/cD/pzmhMRZTl1zWvZPPFsbzpuB9wZt46b7vkEzuN
 NgPElEB9AJgyh/28D064lER6TFhz3TcATZjmEIXX+3tYIaoA2lj60QiSejM2FyBk
 U5a0DYAyzwNs4R1GSQxrKnQS1AXQ+yoDniPcyNaSmuZbxaodAs9Hjxg9KfJ2bfs5
 DFfSUJhf1Uam8UYolMbXqSkhd2KQjXpkF0eLK7sGk3wanO+YEqVs777fHpwIPLmd
 767PD0YN+EfDUwmXAJ5Jgv2kvOJIGul7BTgpWtbRHEaDvLHRQl5OhjsWsj9kWCFX
 fx0Jz1sAUqi+gNq3XUFM88/VPEkTgejmVRULnBxqVsar5b/0BeRJEgA6Ljycv0Jv
 2ux5zdMuX/+Xc4zdaJOWaL8NqRuT8nSynKXbWHTzJk4cF3p12/g3q3LOHBBLcLL6
 AzTEA6iZ0w==
 =bjMI
 -----END PGP SIGNATURE-----

Merge tag 'samsung-soc-s3c-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/soc

Samsung S3C24xx and S3C64xx machine code cleanup for v5.10

Big cleanup for the Samsung S3C24xx and S3C64xx platforms, although it
also touches files shared with S5Pv210 and Exynos.  This is mostly Arnd
Bergmann work which Krzysztof Kozlowski took over, rebased and polished.

The goal is to cleanup, merge and finally make the Samsung S3C24xx and
S3C64xx architectures multiplatform.  The multiplatform did not happen
yet here - just cleaning up and merging into one arch/arm/mach-s3c
directory.  However this is step forward for multiplatform or at least
to keep this code still maintainable.

This pulls also branch with changes for Samsung SoC sound drivers from
broonie/sound because the cleanups there were part of this series and
all further patches depend on them.

* tag 'samsung-soc-s3c-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: (62 commits)
  ARM: s3c: Avoid naming clash of S3C24xx and S3C64xx timer setup
  ARM: s3c: Cleanup from old plat-samsung include
  ARM: s3c: make headers local if possible
  ARM: s3c: move into a common directory
  ARM: s3c24xx: stop including mach/hardware.h from mach/io.h
  cpufreq: s3c24xx: move low-level clk reg access into platform code
  cpufreq: s3c2412: use global s3c2412_cpufreq_setrefresh
  ARM: s3c: remove cpufreq header dependencies
  cpufreq: s3c24xx: split out registers
  fbdev: s3c2410fb: remove mach header dependency
  ARM: s3c24xx: bast: avoid irq_desc array usage
  ARM: s3c24xx: spi: avoid hardcoding fiq number in driver
  ARM: s3c24xx: include mach/irqs.h where needed
  ARM: s3c24xx: move s3cmci pinctrl handling into board files
  ARM: s3c24xx: move iis pinctrl config into boards
  ARM: s3c24xx: move spi fiq handler into platform
  ARM: s3c: adc: move header to linux/soc/samsung
  ARM: s3c24xx: move irqchip driver back into platform
  ARM: s3c24xx: move regs-spi.h into spi driver
  ARM: s3c64xx: remove mach/hardware.h
  ...

Link: https://lore.kernel.org/r/20200831154751.7551-1-krzk@kernel.org
Signed-off-by: Olof Johansson <olof@lixom.net>
2020-09-13 11:15:01 -07:00
Takashi Iwai
8949b6660c ASoC: Fixes for v5.9
Most of this is various driver specific fixes, none of which are
 terribly exciting in themselves, plus one core fix adding and using a
 new DAI lookup function to deal with a lockdep warning.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl9bX1gTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0F04B/44DFfhh3KELcZkIiG4CLfoLRl1g3iw
 EEjFHJRJkpVjKJmTGeVgUTYI6UOH4U9abMGey6s4uCZW2AEb5CGODiWlcKAfy7l2
 i7XHbbJacsiJKU6ezR66azpuF+Hb5z/Z9AKfVuCDHHItXuj09A4H7V45AAd1IbEU
 KWdPSAcex18OgEKhYZNxBkMapsTJQl04cDUWiel7PYT7nJYxLAz46JMI2y4IJ3S8
 tXed+T1IDflruk819Mn1XAxYzvOVPcNRD6hHuSUEECV/BZcLJFEHPkvnLKEjKwNe
 so66doBMcAGkuGoYlURh2otZWgoX56e7IYrqX5m2N1fIskSRkOeNl5J4
 =WLI9
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.9

Most of this is various driver specific fixes, none of which are
terribly exciting in themselves, plus one core fix adding and using a
new DAI lookup function to deal with a lockdep warning.
2020-09-11 18:26:04 +02:00
Mark Brown
d70a4412e2
Merge series "ASoC: SOF: DSP core management fixes for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
This series contains some improvements to how DSP core management
is done in SOF, and adds a distinction between cores managed by
the host versus cores managed by the DSP.

Pierre-Louis Bossart (1):
  ASoC: SOF: Intel: hda-loader: s/master/primary

Ranjani Sridharan (3):
  ASoC: SOF: rename cores_mask to host_managed_cores_mask
  ASoC: SOF: Intel: hda: modify core_power_up/down op
  ASoC: SOF: Intel: remove the  HDA_DSP_CORE_MASK() macro

 sound/soc/sof/intel/apl.c        |  2 +-
 sound/soc/sof/intel/bdw.c        |  2 +-
 sound/soc/sof/intel/byt.c        |  6 +++---
 sound/soc/sof/intel/cnl.c        | 15 ++++-----------
 sound/soc/sof/intel/hda-dsp.c    | 20 +++++++++++++++++---
 sound/soc/sof/intel/hda-loader.c | 11 +++++------
 sound/soc/sof/intel/hda.c        |  2 +-
 sound/soc/sof/intel/hda.h        |  3 ---
 sound/soc/sof/intel/shim.h       |  2 +-
 sound/soc/sof/intel/tgl.c        |  2 +-
 10 files changed, 34 insertions(+), 31 deletions(-)

--
2.27.0
2020-09-11 15:52:24 +01:00
Mark Brown
2b7d52a9ba
Merge series "ASoC: mediatek: mt8183-da7219: support machine driver for rt1015p" from Tzung-Bi Shih <tzungbi@google.com>:
The series reuses mt8183-da7219-max98357.c for supporting machine
driver with rt1015p speaker amplifier.

The 1st patch adds document for the new proposed compatible string.

The 2nd patch changes the machine driver to support "RT1015P" codec.

Tzung-Bi Shih (2):
  ASoC: dt-bindings: mt8183-da7219: add compatible string for using
    rt1015p
  ASoC: mediatek: mt8183-da7219: support machine driver with rt1015p

 .../bindings/sound/mt8183-da7219-max98357.txt |  1 +
 sound/soc/mediatek/Kconfig                    |  1 +
 .../mediatek/mt8183/mt8183-da7219-max98357.c  | 40 +++++++++++++++++++
 3 files changed, 42 insertions(+)

--
2.28.0.526.ge36021eeef-goog
2020-09-11 15:52:23 +01:00
Mark Brown
6ea8a79bf6
Merge series "ASoC: ti: j721e-evm: Support for j7200 variant" from Peter Ujfalusi <peter.ujfalusi@ti.com>:
Hi,

Changes since v1:
- Suffix the 2359296000 constant with 'u' to silence C90 warning

When j7200 SOM is connected to the CPB, the audio setup is a bit different:
Only 48KHz family have clock path, 44.1KHz is not supported.

Update the binding documentation and add support for the j7200 version of CPB
to the driver.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: dt-bindings: ti,j721e-cpb-audio: Document support for j7200-cpb
  ASoC: ti: j721e-evm: Add support for j7200-cpb audio

 .../bindings/sound/ti,j721e-cpb-audio.yaml    | 92 ++++++++++++++-----
 sound/soc/ti/j721e-evm.c                      | 11 +++
 2 files changed, 81 insertions(+), 22 deletions(-)

--
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
2020-09-11 15:52:22 +01:00
Olivier Moysan
4e723e7565
ASoC: stm32: sai: add pm_runtime support
Enable support of pm_runtime on STM32 SAI driver to allow
SAI power state monitoring.
pm_runtime_put_autosuspend() is called from ASoC framework
on pcm device close.
The pmdown_time delay is available in runtime context, and may be set
in SAI driver to take into account shutdown delay on playback.
However, this shutdown delay is already handled in the DAPMs
of the audio codec linked to SAI CPU DAI.
So, the choice is made, not to support this delay on CPU DAI side.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200911081507.7276-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:52:21 +01:00
Tuo Li
375e2c3525
ALSA: rockchip_i2s: fix a possible divide-by-zero bug in rockchip_i2s_hw_params()
The variable bclk_rate is checked in:
  if (bclk_rate && mclk_rate % bclk_rate)

This indicates that bclk_rate can be zero.
If so, a divide-by-zero bug will occur:
  div_bclk = mclk_rate / bclk_rate;

To fix this possible bug, the function returns -EINVAL when bclk_rate is
zero.

Signed-off-by: Tuo Li <tuoli96@outlook.com>
Link: https://lore.kernel.org/r/TY2PR04MB4029799E60A5BCAAD5B7B5BBB8280@TY2PR04MB4029.apcprd04.prod.outlook.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:52:20 +01:00
Sathyanarayana Nujella
2a4b91a264
ASoC: SOF: Intel: Use DMI oem string search for tgl_max98373_rt5682
DMI product name is used to support system variants based out of
tgl_max98373_rt5682 in current implementation. Replace this DMI search with
DMI_OEM_STRING. Coreboot(BIOS used in these systems) is
setting the needed DMI_OEM_STRING field to uniquely identify these
systems.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@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/20200910162705.2026036-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:52:19 +01:00
Pierre-Louis Bossart
52e4d0ae62
ASoC: SOF: Intel: hda-loader: s/master/primary
Use inclusive language for DSP cores.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200910164125.2033062-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:29:32 +01:00
Ranjani Sridharan
fde1065528
ASoC: SOF: Intel: remove the HDA_DSP_CORE_MASK() macro
Remove the HDA_DSP_CORE_MASK() macro and use BIT() and GENMASK()
macros directly for more clarity.

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/20200910164125.2033062-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:29:31 +01:00
Ranjani Sridharan
914fab3b43
ASoC: SOF: Intel: hda: modify core_power_up/down op
Modify the core_power_up/down ops for HDA platforms to restrict
the core_mask to the ones allowed by chip->cores_mask. This is needed
because on some HDA platforms not all cores can be powered up/down
by the host and this must be handled internally in the FW.

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/20200910164125.2033062-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:29:30 +01:00
Ranjani Sridharan
64b969177c
ASoC: SOF: rename cores_mask to host_managed_cores_mask
Rename the cores_mask in struct sof_intel_dsp_desc to
host_managed_cores_mask to be more indicative of the fact that
only these cores can be powered up/down by the host.

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/20200910164125.2033062-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:29:29 +01:00
Peter Ujfalusi
18c140f4a2
ASoC: ti: j721e-evm: Add support for j7200-cpb audio
When j7200 SOM is attached to the CPB we only have parent clock for 48KHz
family and the rate of the parent clock is 2359296000Hz.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200910124110.19361-3-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 15:05:33 +01:00
Tzung-Bi Shih
7e5bfdddd8
ASoC: mediatek: mt8183-da7219: support machine driver with rt1015p
Supports machine driver with rt1015p ("mt8183_da7219_rt1015p").
Embeds in the existing mt8183-da7219-max98357.c because they share
most of the code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200911024833.1673961-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11 14:48:45 +01:00
Mark Brown
a0822e3eea
Merge series "ASoC: q6dsp: Add support to Codec Ports." from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
LPASS IP on SoCs like SM8250 has Digital Codec part integrated into it.
This ports are exposed in Q6DSP as Codec ports. This patchset adds
support to those q6afe ports along with q6routing and q6afe-dai.

This patchset has been tested along with other patches on
Qualcomm Robotics RB5 Platform with Soundwire and WSA8815 Codec.

Thanks,
srini

Srinivas Kandagatla (8):
  ASoC: q6dsp: q6afe: add support to Codec DMA ports
  ASoC: q6dsp: q6routing: add support to Codec DMA ports
  ASoC: q6dsp: q6afe: prepare afe_apr_send_pkt to take response opcode
  ASoC: q6dsp: q6afe: add global q6afe waitqueue
  ASoC: q6dsp: q6afe: add lpass hw voting support
  ASoC: q6dsp: q6afe: update q6afe_set_param to support global clocks
  ASoC: q6dsp: q6afe: add codec lpass clocks
  ASoC: q6dsp: q6afe-dai: add support to Codec DMA ports

 include/dt-bindings/sound/qcom,q6afe.h |  22 ++
 sound/soc/qcom/qdsp6/q6afe-dai.c       | 229 ++++++++++++++++++
 sound/soc/qcom/qdsp6/q6afe.c           | 308 +++++++++++++++++++++++--
 sound/soc/qcom/qdsp6/q6afe.h           |  33 ++-
 sound/soc/qcom/qdsp6/q6routing.c       | 121 +++++++++-
 5 files changed, 689 insertions(+), 24 deletions(-)

--
2.21.0
2020-09-10 13:29:30 +01:00
Srinivas Kandagatla
1fdbcfa9fd
ASoC: q6dsp: q6afe-dai: add support to Codec DMA ports
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:29 +01:00
Srinivas Kandagatla
0c3e35fc1e
ASoC: q6dsp: q6afe: add codec lpass clocks
LPASS now has integrated codec control whose clocks are controlled by Q6DSP.
This patch adds support to those clocks.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:28 +01:00
Srinivas Kandagatla
84ab3b9f19
ASoC: q6dsp: q6afe: update q6afe_set_param to support global clocks
Previously there was no case where we need to set clock or send commands
that are not associated with q6afe ports, now we have cases like clock
voting and clock consumers like codecs that needed these clocks.

update q6afe_set_param() to support such cases, including token passing.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:27 +01:00
Srinivas Kandagatla
55e07531d9
ASoC: q6dsp: q6afe: add lpass hw voting support
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:26 +01:00
Srinivas Kandagatla
181202d021
ASoC: q6dsp: q6afe: add global q6afe waitqueue
In some cases like clocks q6afe would have to process commands
without an associated q6afe port, in such cases waitqueue is
required at global level to wait for the command to finish.
This patch also adds the command result to go with this waitqueue.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:25 +01:00
Srinivas Kandagatla
342a4f8ca1
ASoC: q6dsp: q6afe: prepare afe_apr_send_pkt to take response opcode
Update afe_apr_send_pkt() to take response opcode that it should wait for.
This is helpful in cases where we expect response other than the
actual command opcode.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:24 +01:00
Srinivas Kandagatla
825492cb51
ASoC: q6dsp: q6routing: add support to Codec DMA ports
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:23 +01:00
Srinivas Kandagatla
150b2e86c5
ASoC: q6dsp: q6afe: add support to Codec DMA ports
New LPASS supports various codec macros, DSP firmware already
has support to those ports. Add corresponding configuration
support to those ports in adsp drivers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200910101732.23484-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 13:29:22 +01:00
Tzung-Bi Shih
c07152d46b
ASoC: rt1015p: add codec driver
Adds rt1015p codec driver.

Rt1015p is a rt1015 variant.
- It doesn't support I2C.
- It only supports S24, 48kHz, 64FS.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200910042949.3795682-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-10 12:49:44 +01:00
Pierre-Louis Bossart
38edbfae6c ASoC: codecs: realtek-soundwire: ignore initial PARITY errors
The parity calculation is not reset on a Severe Reset, which leads to
misleading/harmless errors reported on startup. The addition of a
quirk helps filter out such errors while leaving the error checks on
in steady-state.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200908134521.6781-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-09-10 11:21:05 +05:30
Pierre-Louis Bossart
2acd30b9f6 ASoC/soundwire: bus: use property to set interrupt masks
Add a slave-level property and program the SCP_INT1_MASK as desired by
the codec driver. Since there is no DisCo property this has to be an
implementation-specific firmware property or hard-coded in the driver.

The only functionality change is that implementation-defined
interrupts are no longer set for amplifiers - those interrupts are
typically for jack detection or acoustic event detection/hotwording.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200908134521.6781-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-09-10 11:21:04 +05:30
Codrin Ciubotariu
06ca24e98e
ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller
The new SPDIF TX controller is a serial port compliant with the IEC-
60958 standard. It also supports programmable User Data and Channel
Status fields.

This IP is embedded in Microchip's sama7g5 SoC.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20200909145348.367033-2-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-09 17:15:57 +01:00
Takashi Iwai
dd8c0c0b37
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>
2020-09-09 15:42:10 +01:00
Takashi Iwai
d668e640d5
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>
2020-09-09 15:42:09 +01:00
Takashi Iwai
a3d1f931ea
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>
2020-09-09 15:42:08 +01:00
Mark Brown
05680cc0e5
Merge branch 'topic/tasklet-convert' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-5.10 2020-09-09 15:20:17 +01:00
Camel Guo
1a5ce48fd6
ASoC: tlv320adcx140: Wake up codec before accessing register
According to its datasheet, after reset this codec goes into sleep
mode. In this mode, any register accessing should be avoided except for
exiting sleep mode. Hence this commit moves SLEEP_CFG access before any
register accessing.

Signed-off-by: Camel Guo <camelg@axis.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200908083521.14105-2-camel.guo@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-08 17:26:03 +01:00
Mark Brown
bc442e472c
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
2020-09-08 15:50:13 +01:00
Yu Kuai
e525db7e4b
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: 7e7292dba2 ("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>
2020-09-08 15:50:12 +01:00
Stephan Gerhold
1b839d3e15
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>
2020-09-08 15:37:50 +01:00
Tzung-Bi Shih
6835302853
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: 8061734ab6 ("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>
2020-09-08 13:55:01 +01:00
Dharageswari R
783560d02d
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>
2020-09-08 13:55:00 +01:00
Dharageswari R
819b9f6002
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>
2020-09-08 13:54:59 +01:00
Peter Ujfalusi
34ce41003b
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>
2020-09-08 13:54:58 +01:00
Mark Brown
8b2f57d6c9
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
2020-09-07 15:29:00 +01:00
Mark Brown
daa9076460
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
2020-09-07 15:28:59 +01:00
Mark Brown
a252632df8
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
2020-09-07 15:28:58 +01:00
Michael Sit Wei Hong
b40f708deb
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>
2020-09-07 15:28:57 +01:00
Keyon Jie
988d941882
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>
2020-09-07 15:16:47 +01:00
Keyon Jie
d2306f4ed1
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>
2020-09-07 15:16:46 +01:00
Keyon Jie
783898ce68
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>
2020-09-07 15:16:45 +01:00
Keyon Jie
3584ba4c78
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>
2020-09-07 15:16:44 +01:00
Keyon Jie
c7ded58846
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>
2020-09-07 15:16:43 +01:00
Keyon Jie
b64ce2c62c
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>
2020-09-07 15:16:43 +01:00
Keyon Jie
bbc1364cdd
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>
2020-09-07 15:16:42 +01:00
Keyon Jie
9fed9d91c0
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>
2020-09-07 15:16:41 +01:00
Keyon Jie
f375bb336d
ASoC: SOF: append extended data to sof_ipc_comp_mixer
Append the extended data to the end of the struct sof_ipc_comp_mixer,
construct the ipc for COMP_NEW during the topology load stage.

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

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

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

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

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

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200904132744.1699575-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 15:16:34 +01:00
Samuel Holland
6b3bb3c82b
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>
2020-09-07 14:00:02 +01:00
Samuel Holland
efb736fb9e
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>
2020-09-07 14:00:01 +01:00
Samuel Holland
f30ef55c33
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>
2020-09-07 14:00:00 +01:00
Samuel Holland
fcb7b39ee3
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>
2020-09-07 13:59:59 +01:00
Samuel Holland
30aff91ec7
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>
2020-09-07 13:59:58 +01:00
Samuel Holland
0ba9549302
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>
2020-09-07 13:59:58 +01:00
Samuel Holland
fa5c0ca1f9
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>
2020-09-07 13:59:57 +01:00
Samuel Holland
2455e37ade
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>
2020-09-07 13:59:56 +01:00
Samuel Holland
b8cbb1cab7
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>
2020-09-07 13:59:55 +01:00
Pierre-Louis Bossart
06998d49bc
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>
2020-09-07 13:15:51 +01:00
Pierre-Louis Bossart
ae3a3918ed
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>
2020-09-07 13:15:50 +01:00
Cezary Rojewski
20244b2a8a
ASoC: core: Do not cleanup uninitialized dais on soc_pcm_open failure
Introduce for_each_rtd_dais_rollback macro which behaves exactly like
for_each_codec_dais_rollback and its cpu_dais equivalent but for all
dais instead.

Use newly added macro to fix soc_pcm_open error path and prevent
uninitialized dais from being cleaned-up.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Fixes: 5d9fa03e6c ("ASoC: soc-pcm: tidyup soc_pcm_open() order")
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200907111939.16169-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07 12:40:24 +01:00
Linus Torvalds
86edf52e7c sound fixes for 5.9-rc4
A collection of small changes, nothing intrusive:
 
 * Remaining tasklet API conversions, now all sound stuff have been
   converted
 * A few HD-audio and USB-audio quirks and minor fixes
 * FireWire Tascam and Digi00xx fixes
 * Drop of kernel WARNING from PCM OSS for syzkaller
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl9R8ckOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+Dtg//ShtXFp622T5NiMvDF5sG8AlbvGLf1dUdja62
 6sF2kba9vhncI9ejjGSJBCdfun3dtNkjsffacKOzTbnSHbwsBjU7J68zP1dru+d2
 88WXb4h8iAxAPcPHSgblpdi+ifeKGEYsAr7tbVa5KIpFKDxW7qLw5ntXu0G0vuW3
 +ao/p3TB/LT5I42bu0UmXsfuO7dVoyyzOSDdlse0mFNNeNSLVslAkaqqYSosmp1/
 I2gPyP814OwqrPITGvlnDWLfCnuTVDQodtAYb6sADPpplBTGu4uVfJUD+w6xVNDX
 2byY6Q2TYYolrBUSvsPxUSXAfogvGQFppOnpbxnZftIrDoFC8WN048vWEfYZ2CWn
 bVDQmErqAk8+l3r8kllW6IXhJxF2CMivv92Ht+8VA4sw29RVGtUXw6Gm7aJvoqP3
 zewF7RZh6vNJVsjAv4KEpYTyNLQi9eYCygeB9INA7dWBZeyaolchX1Ptrd4fhyo7
 ko20Fbu+vuk18B9zNE5yIpBKNpqDVNyTCnZSU9kzCicVZ/OD15fw/sUXUVo3wx5X
 ZRLBdJrccXni+LlbYHT6tJPtnQtBHITffN2/zvGPPXlViLexz88jtqWaTayy4J1u
 L63BIA3L8IfAW1ln22CfNlKbwN+Ku1uJwJnPHiUPDABXH6Uk2oeCxI5BRLzyTieB
 oe1jrcs=
 =CwOB
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small changes, nothing intrusive:

   - remaining tasklet API conversions, now all sound stuff have been
     converted

   - a few HD-audio and USB-audio quirks and minor fixes

   - FireWire Tascam and Digi00xx fixes

   - drop a kernel WARNING from PCM OSS for syzkaller"

* tag 'sound-5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits)
  ALSA: hda/realtek - Improved routing for Thinkpad X1 7th/8th Gen
  ALSA: hda: use consistent HDAudio spelling in comments/docs
  ALSA: hda: add dev_dbg log when driver is not selected
  ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
  ALSA: hda: hdmi - add Rocketlake support
  ALSA: ua101: convert tasklets to use new tasklet_setup() API
  ALSA: usb-audio: convert tasklets to use new tasklet_setup() API
  ASoC: txx9: convert tasklets to use new tasklet_setup() API
  ASoC: siu: convert tasklets to use new tasklet_setup() API
  ASoC: fsl_esai: convert tasklets to use new tasklet_setup() API
  ALSA: hdsp: convert tasklets to use new tasklet_setup() API
  ALSA: riptide: convert tasklets to use new tasklet_setup() API
  ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
  ALSA: firewire: convert tasklets to use new tasklet_setup() API
  ALSA: core: convert tasklets to use new tasklet_setup() API
  ALSA: pcm: oss: Remove superfluous WARN_ON() for mulaw sanity check
  ALSA: hda - Fix silent audio output and corrupted input on MSI X570-A PRO
  ALSA: hda/hdmi: always check pin power status in i915 pin fixup
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion NT950XCJ-X716A
  ALSA: usb-audio: Add basic capture support for Pioneer DJ DJM-250MK2
  ...
2020-09-04 12:05:25 -07:00
Ranjani Sridharan
8c9ff1219a
ASoC: SOF: topology: fix core enable sequence
Core power up involves 2 steps: The first step tries to
power up the core by setting the ADSPCS.SPA bit for the host-managed
cores. The second step involves sending the IPC to power up other
cores that are not host managed. The enabled_cores_mask should
be updated only when both these steps are successful. If the
IPC to the DSP fails, the host-managed core that was powered in
step 1 should be powered off before returning the error.

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

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

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

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

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

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

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1598958068-10552-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-03 14:47:36 +01:00
Pierre-Louis Bossart
d0bbcb4e83 ASoC: codecs: soundwire: remove port_ready[] usage from codecs.
port_ready will be changed to a fixed array in sdw.h and all initialization
work will be done at soundwire side in the following patch. So remove them
from codec drivers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200831134318.11443-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-09-03 16:02:29 +05:30
Hans de Goede
6a0137101f
ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN Converter9 2-in-1
The MPMAN Converter9 2-in-1 almost fully works with out default settings.
The only problem is that it has only 1 speaker so any sounds only playing
on the right channel get lost.

Add a quirk for this model using the default settings + MONO_SPEAKER.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200901080623.4987-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-02 18:59:29 +01:00
Allen Pais
ad77b35abb 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>
2020-09-02 13:26:33 +02:00
Allen Pais
ea0364c01e 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>
2020-09-02 13:26:15 +02:00
Allen Pais
b07e4a3fb2 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>
2020-09-02 13:25:51 +02:00
Cezary Rojewski
154549558a
ASoC: Intel: haswell: Fix power transition refactor
While addressing existing power-cycle limitations for
sound/soc/intel/haswell solution, change brings regression for standard
audio userspace flows e.g.: when using PulseAudio.

Occasional sound-card initialization fail is still better than
permanent audio distortions, so revert the change.

Fixes: 8ec7d60432 ("ASoC: Intel: haswell: Power transition refactor")
Reported-by: Christian Bundy <christianbundy@fraction.io>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200901153041.14771-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 17:00:45 +01:00
Camel Guo
2569231d71
ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
In adcx140_i2c_probe, adcx140->dev is accessed before its
initialization. This commit fixes this bug.

Fixes: 689c7655b5 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Camel Guo <camel.guo@axis.com>
Link: https://lore.kernel.org/r/20200901135736.32036-1-camel.guo@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 16:04:40 +01:00
Douglas Anderson
160c174ff6
ASoC: rt5682: Prefer async probe
The probe of rt5682 is pretty slow.  A quick measurement shows that it
takes ~650 ms on at least one board.  There's no reason to block all
other drivers waiting for this probe to finish.  Set the flag to allow
other drivers to probe while we're probing.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200828162005.1.I4f67f494c4f759b0e5c7f487e040dfdcf16e0876@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 14:00:15 +01:00
Sylwester Nawrocki
f5a2cda4f1
ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions
When the wm8958_mic_detect, wm8994_mic_detect functions get called from
the machine driver, e.g. from the card's late_probe() callback, the CODEC
device may be PM runtime suspended and any regmap writes have no effect.
Add PM runtime calls to these functions to ensure the device registers
are updated as expected.
This suppresses an error during boot
"wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec"
caused by the regmap access error due to the cache_only flag being set.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200827173357.31891-2-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 13:13:17 +01:00
Sylwester Nawrocki
811c549443
ASoC: wm8994: Skip setting of the WM8994_MICBIAS register for WM1811
The WM8994_MICBIAS register is not available in the WM1811 CODEC so skip
initialization of that register for that device.
This suppresses an error during boot:
"wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec"

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200827173357.31891-1-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-01 13:13:16 +01:00
Jerome Brunet
9c4b205a20
ASoC: meson: axg-toddr: fix channel order on g12 platforms
On g12 and following platforms, The first channel of record with more than
2 channels ends being placed randomly on an even channel of the output.

On these SoCs, a bit was added to force the first channel to be placed at
the beginning of the output. Apparently the behavior if the bit is not set
is not easily predictable. According to the documentation, this bit is not
present on the axg series.

Set the bit on g12 and fix the problem.

Fixes: a3c23a8ad4 ("ASoC: meson: axg-toddr: add g12a support")
Reported-by: Nicolas Belin <nbelin@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200828151438.350974-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-28 19:02:54 +01:00
Dan Murphy
ece2a74c59
ASoC: tlv320adcx140: Add digital mic channel enable routing
Add the audio routing map to enable the digital mic paths when the
analog mic paths are not enabled.

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

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20200827205100.1479331-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-28 15:49:41 +01:00
Kuninori Morimoto
20d9fdee72
ASoC: soc-core: add snd_soc_find_dai_with_mutex()
commit 25612477d2 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
added snd_soc_dai_link_set_capabilities().
But it is using snd_soc_find_dai() (A) which is required client_mutex (B).
And client_mutex is soc-core.c local.

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

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

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

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

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

Fixes: 25612477d2 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blixvuab.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-28 11:38:23 +01:00
Mark Brown
4b15c49719
Merge series "SOF fixes and updates for FW boot" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This series includes fixes and updates for the FW boot sequence for
Intel platforms.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200826184532.1612070-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27 14:22:18 +01:00
Mark Brown
d563b6c834
Merge series "ASoC: Fix return check for devm_regmap_init_sdw()" from Vinod Koul <vkoul@kernel.org>:
This series attempts to fix return check for devm_regmap_init_sdw()

Changes in v2:
 - Add missing patch for rt711
 - Add patch for rt700

Vinod Koul (5):
  ASoC: max98373: Fix return check for devm_regmap_init_sdw()
  ASoC: rt1308-sdw: Fix return check for devm_regmap_init_sdw()
  ASoC: rt711: Fix return check for devm_regmap_init_sdw()
  ASoC: rt715: Fix return check for devm_regmap_init_sdw()
  ASoC: rt700: Fix return check for devm_regmap_init_sdw()

 sound/soc/codecs/max98373-sdw.c | 4 ++--
 sound/soc/codecs/rt1308-sdw.c   | 4 ++--
 sound/soc/codecs/rt700-sdw.c    | 4 ++--
 sound/soc/codecs/rt711-sdw.c    | 4 ++--
 sound/soc/codecs/rt715-sdw.c    | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

--
2.26.2
2020-08-26 19:26:59 +01:00
Dinghao Liu
c1e6414cdc
ASoC: qcom: common: Fix refcount imbalance on error
for_each_child_of_node returns a node pointer np with
refcount incremented. So when devm_kzalloc fails, a
pairing refcount decrement is needed to keep np's
refcount balanced.

Fixes: 16395ceee1 ("ASoC: qcom: common: Fix NULL pointer in of parser")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200820042828.10308-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 19:26:58 +01:00
Vinod Koul
db1a4250ae
ASoC: rt700: Fix return check for devm_regmap_init_sdw()
devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.

Reported-by: Takashi Iwai <tiwai@suse.de>
Fixes: 7d2a5f9ae4 ("ASoC: rt700: add rt700 codec driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-6-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 18:58:43 +01:00
Vinod Koul
282eb0b52e
ASoC: rt715: Fix return check for devm_regmap_init_sdw()
devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.

Reported-by: Takashi Iwai <tiwai@suse.de>
Fixes: d1ede0641b ("ASoC: rt715: add RT715 codec driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-5-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 18:58:42 +01:00
Vinod Koul
be1a4b2c56
ASoC: rt711: Fix return check for devm_regmap_init_sdw()
devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.

Reported-by: Takashi Iwai <tiwai@suse.de>
Fixes: 320b8b0d13 ("ASoC: rt711: add rt711 codec driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-4-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 18:58:41 +01:00
Vinod Koul
344850d93c
ASoC: rt1308-sdw: Fix return check for devm_regmap_init_sdw()
devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.

Reported-by: Takashi Iwai <tiwai@suse.de>
Fixes: a87a6653a2 ("ASoC: rt1308-sdw: add rt1308 SdW amplifier driver")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-3-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 18:58:40 +01:00
Vinod Koul
6e0c9b5f90
ASoC: max98373: Fix return check for devm_regmap_init_sdw()
devm_regmap_init_sdw() returns a valid pointer on success or ERR_PTR on
failure which should be checked with IS_ERR. Also use PTR_ERR for
returning error codes.

Reported-by: Takashi Iwai <tiwai@suse.de>
Fixes: 56a5b7910e ("ASoC: codecs: max98373: add SoundWire support")
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200826163340.3249608-2-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-26 18:58:39 +01:00
Mark Brown
cd0f9228c7
Merge series "SOF fixes and updates" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This series includes fixes for error reporting, topology parsing and
runtime PM issues along with updates for DMIC support and IMX platforms.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This is minor ABI change - backward compatibility is kept.

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

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

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

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

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

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

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

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

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

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

BugLink: https://github.com/thesofproject/linux/issues/2330
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200824200912.46852-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:39:38 +01:00
Pierre-Louis Bossart
71d551f5aa
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>
2020-08-25 20:39:38 +01:00
Pierre-Louis Bossart
277ff2364b
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>
2020-08-25 20:39:37 +01:00
Ranjani Sridharan
f46ff50660
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>
2020-08-25 20:39:36 +01:00
Ranjani Sridharan
f3e9ed5e90
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>
2020-08-25 20:39:35 +01:00
Guennadi Liakhovetski
f738d8156d
ASoC: SOF: (cosmetic) use the "bool" type where it makes sense
Several fields in struct snd_sof_dev are used as boolean flags, use
the "bool" type for them.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-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-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:39:34 +01:00
Guennadi Liakhovetski
c81a4ef725
ASoC: SOF: topology: (cosmetic) remove redundant variable initialisations
Remove two cases of redundant variable initialisation.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-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-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 20:39:33 +01:00
Kuninori Morimoto
d062085d61
ASoC: ti: fixup ams_delta_mute() function name
commit 059374fe9e ("ASoC: ti: merge .digital_mute() into .mute_stream()")
merged .digital_mute() into .mute_stream().
But it didn't rename ams_delta_digital_mute() to ams_delta_mute().
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/87blizy5ts.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 18:47:04 +01:00
Kuninori Morimoto
7ad26d6671
ASoC: pcm3168a: ignore 0 Hz settings
Some sound card try to set 0 Hz as reset, but it is impossible.
This patch ignores it to avoid error return.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6yjy5sy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-25 18:47:03 +01:00
Mark Brown
1959ba4e40 Linux 5.9-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl9C2tseHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGgXoH/AuyLuMWwukVjVAx
 b2N2Ri0qFVyZWLky+uPqc4NkqJCbD/Rt2Kq8odLnJOrs2bXKpP5KrMl4sVqwSRr4
 CSkHkpo4oglmIxe5ptoWmWjrvHm/KNDZd2PY8cehii5eXG+aS7g3rIYjSFlXzP+1
 yndJ00H7CDOxHd/DngqfD+Sr7j76EM1iZE9316JR7TEu5o38I4Ipu6+3L3uFZVlf
 M90SmymY6hM7AJAyuOrd79ffXQry9KvWMUYyRkYyDK8y9taOSzfdfpppk8q5cVB1
 l4pcPNBiveRM3Yet7UAMb8FSz8OG0rPkkCsq8ALNU/UO91IDY832OUyLxXUpWlf6
 ZWRP2HA=
 =596f
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl9E4W4THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0Eh8B/9HIQJn/HEJ78U3It7TOOO7NY1nfA/T
 2FtgPvkaE2EcWC5uVE0pCTRzimP5ZGSywnxftDd8G5lWHrhtE4+5nzJ96V4Hk4Zn
 +xatmiDQk80pDfv01aPjFhgr3YKc5H3uJo7rmpjqFIIzoY+8YFCpkvfE26wJ7AWf
 z0srr+Ab+5SYXCyGf9EgkSBEiSytStSGK7Iw9/2IejzIVE7RBLnYWtdnTdTmChWk
 Pan5zaqj3cKRSXxxMa1gTa3OdvjhVU3+yMxAEsWlAuvx3wjUpo2i0k2nyQoQ7Fgb
 TFsNyBdkz6RPzkwWKuINYup+SCozISOS90m34BLBA+uPxtTpAzjTnsDP
 =jIuH
 -----END PGP SIGNATURE-----

Merge tag 'v5.9-rc2' into asoc-5.9

Linux 5.9-rc2
2020-08-25 11:00:43 +01:00
Rander Wang
0235bc0462
ASoC: Intel: tgl_max98373: fix a runtime pm issue in multi-thread case
When the playback & capture streams are stopped simultaneously, the
SOF PCI device will remain pm_runtime active. The root-cause is a race
condition with two threads reaching the trigger function at the same
time. They see another stream is active so the dapm pin is not
disabled, so the codec remains active as well as the parent PCI
device.

For max98373, the capture stream provides feedback when playback is
working and it is unused when playback is stopped. So the dapm pin
should be set only when playback is active.

Fixes: 94d2d08974 ('ASoC: Intel: Boards: tgl_max98373: add dai_trigger function')
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20200821195603.215535-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 20:15:14 +01:00
Mark Brown
aafdeba5cb
Merge series "ASoC: Intel: machine driver updates for 5.10" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This series updates the tables used to select SoundWire configurations
for CometLake and TigerLake, and adds support for SDCA (SoundWire
Device Class for Audio) codecs in the common machine driver. These
codec drivers are still being tested on early silicon/boards and will
be contributed at a later time.

For TigerLake Chromebooks a new DMI quirk is added, as well as a means
to override the topology names. A pm_runtime fix is also provided to
deal with playback/capture dependencies with an amplifier w/
feedback. I also included a minor codec correction for the TGL
amplifier.

Bard Liao (5):
  ASoC: Intel: modify SoundWire version id in acpi match table
  ASoC: Intel: sof_sdw: check SoundWire version when matching codec
  ASoC: Intel: sof_sdw: rename id as part_id
  ASoC: Intel: sof_sdw: add rt711 rt1316 rt714 SDCA codec support.
  ASoC: Intel: sof_sdw: clean-up inclusion of header files

Pierre-Louis Bossart (5):
  ASoC: Intel: soc-acpi: cnl: add support for rt5682 on SoundWire link2
  ASoC: Intel: sof-soundwire: add support for rt5682 on link2
  ASoC: Intel: soc-acpi: mirror CML and TGL configurations
  ASoC: Intel: soc-acpi: add support for SDCA boards
  ASoC: codecs: max98373-sdw: add missing test on resume

Rander Wang (2):
  ASoC: Intel: tgl_max98373: fix a runtime pm issue in multi-thread case
  ASoC: Intel: sof_sdw: Add support for product Ripto

Sathyanarayana Nujella (2):
  ASoC: Intel: sof_rt5682: override quirk data for tgl_max98373_rt5682
  ASoC: SOF: Add topology filename override based on dmi data match

 sound/soc/codecs/max98373-sdw.c               |   3 +
 sound/soc/intel/boards/Kconfig                |   3 +
 sound/soc/intel/boards/Makefile               |   7 +-
 sound/soc/intel/boards/sof_maxim_common.c     |   7 +-
 sound/soc/intel/boards/sof_rt5682.c           |  13 ++
 sound/soc/intel/boards/sof_sdw.c              |  98 +++++++---
 sound/soc/intel/boards/sof_sdw_common.h       |  22 ++-
 sound/soc/intel/boards/sof_sdw_dmic.c         |   1 +
 sound/soc/intel/boards/sof_sdw_max98373.c     |   2 +
 sound/soc/intel/boards/sof_sdw_rt1308.c       |   2 +
 sound/soc/intel/boards/sof_sdw_rt1316.c       | 113 ++++++++++++
 sound/soc/intel/boards/sof_sdw_rt5682.c       |   2 +
 sound/soc/intel/boards/sof_sdw_rt700.c        |   2 +
 sound/soc/intel/boards/sof_sdw_rt711.c        |   2 +
 sound/soc/intel/boards/sof_sdw_rt711_sdca.c   | 174 ++++++++++++++++++
 sound/soc/intel/boards/sof_sdw_rt715_sdca.c   |  42 +++++
 .../intel/common/soc-acpi-intel-cml-match.c   |  79 +++++++-
 .../intel/common/soc-acpi-intel-cnl-match.c   |  33 +++-
 .../intel/common/soc-acpi-intel-icl-match.c   |  10 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   | 165 ++++++++++++++++-
 sound/soc/sof/intel/hda.c                     |   8 +-
 sound/soc/sof/sof-pci-dev.c                   |  24 +++
 22 files changed, 764 insertions(+), 48 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_sdw_rt1316.c
 create mode 100644 sound/soc/intel/boards/sof_sdw_rt711_sdca.c
 create mode 100644 sound/soc/intel/boards/sof_sdw_rt715_sdca.c

base-commit: fcea8b023a
--
2.25.1
2020-08-24 13:59:47 +01:00
Shengjiu Wang
c1e47e8919
ASoC: fsl_sai: Add -EPROBE_DEFER check for regmap init
Regmap initialization may return -EPROBE_DEFER for clock
may not be ready, so check -EPROBE_DEFER error type before
start another Regmap initialization.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1598255887-1391-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:59:46 +01:00
Shengjiu Wang
2ff6d5a108
ASoC: ak5558: Add regulator support
"AVDD" is for analog power supply,  "DVDD" is for digital power
supply, they can improve the power management.

As the regulator is enabled in pm runtime resume, which is
behind the component driver probe, so accessing registers in
component driver probe will fail. Fix this issue by enabling
regcache_cache_only after pm_runtime_enable.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1598190877-9213-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:59:45 +01:00
Bard Liao
3f2c656491
ASoC: Intel: sof_sdw: clean-up inclusion of header files
"struct snd_soc_dapm_widget" and "struct snd_kcontrol_new" are used in most
of these .c files. Adding the header files to prevent from depending on
<sound/soc.h>

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:36 +01:00
Bard Liao
b75bea4b88
ASoC: intel: sof_sdw: add rt711 rt1316 rt714 SDCA codec support.
Add rt711, rt1316, and rt714 SDCA codecs support in sof_sdw machine driver.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:35 +01:00
Sathyanarayana Nujella
5253a73d56
ASoC: SOF: Add topology filename override based on dmi data match
Add topology filename override based on system DMI data matching,
typically to account for a different hardware layout.

In ACPI based systems, the tplg_filename is pre-defined in an ACPI
machine table. When a DMI quirk is detected, the
sof_pdata->tplg_filename is not set with the hard-coded ACPI value,
and instead is set with the DMI-specific filename.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:35 +01:00
Sathyanarayana Nujella
3e1734b64c
ASoC: Intel: sof_rt5682: override quirk data for tgl_max98373_rt5682
A Chrome System based on tgl_max98373_rt5682 has different SSP interface
configurations. Using DMI data of this variant DUT, override quirk
data.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:34 +01:00
Rander Wang
626200df24
SoC: Intel: sof_sdw: Add support for product Ripto
Ripto is another product based on TGL with the same
audio hardware configuration as Volteer.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-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/20200821195603.215535-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:33 +01:00
Bard Liao
535df653f7
ASoC: Intel: sof_sdw: rename id as part_id
The "id" field in sof_sdw_codec_info struct is actually the "part
id". Rename to prevent confusions.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:32 +01:00
Bard Liao
2e2d287bbe
ASoC: Intel: sof_sdw: check SoundWire version when matching codec
Some codecs with the same part id but different SoundWire versions
have different configurations. So we have to separate them in
codec_info_list[].

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:31 +01:00
Pierre-Louis Bossart
65fae64d79
ASoC: codecs: max98373-sdw: add missing test on resume
All existing SoundWire codecs follow the same pattern on resume,
except for this codec which doesn't test if the hardware is
initialized.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:30 +01:00
Rander Wang
e300486ad9
ASoC: Intel: tgl_max98373: fix a runtime pm issue in multi-thread case
When the playback & capture streams are stopped simultaneously, the
SOF PCI device will remain pm_runtime active. The root-cause is a race
condition with two threads reaching the trigger function at the same
time. They see another stream is active so the dapm pin is not
disabled, so the codec remains active as well as the parent PCI
device.

For max98373, the capture stream provides feedback when playback is
working and it is unused when playback is stopped. So the dapm pin
should be set only when playback is active.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20200821195603.215535-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:29 +01:00
Pierre-Louis Bossart
44751fc5f0
ASoC: Intel: soc-acpi: add support for SDCA boards
The description and board layout is similar to previous ones for
CometLake and TigerLake, except for a bump to SoundWire 1.2 and
updates to part numbers to reflect the SDCA (SoundWire Device Class
for Audio) hardware support.

Note that one of the RT1316 amplifiers uses a non-zero UniqueID which
is not required and will be ignored.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:28 +01:00
Pierre-Louis Bossart
6cb8bd60ba
ASoC: Intel: soc-acpi: mirror CML and TGL configurations
Some TGL devices use the same audio hardware as on CML platforms, with
RT711 on link0, RT1308 on link1 and optionally link2, and RT715 on
link 3.

To clarify configurations, the rt1308 configurations are split between
single amp on link1 and dual amps on link1. The case with two amps on
different links is already identified with the group1 attribute.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:27 +01:00
Pierre-Louis Bossart
b161a12192
ASoC: Intel: sof-soundwire: add support for rt5682 on link2
The UpExtreme board provides support for SoundWire link2 in 2 of the 3
advanced modes. Let's use it w/ rt5682.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:26 +01:00
Pierre-Louis Bossart
6f7cf9125e
ASoC: Intel: soc-acpi: cnl: add support for rt5682 on SoundWire link2
Add one of the configurations for rt5682 w/ the Up Extreme Advanced
Audio mode using the SoundWire link2.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:26 +01:00
Bard Liao
69a785da52
ASoC: Intel: modify SoundWire version id in acpi match table
The SoundWire version id of the existing RT1308, RT711, and RT715
codecs should be 2 (index for SoundWire 1.1), it was mistakenly set as
1 which pointed to the wrong version (SoundWire 1.0).

This off-by-one error had no functional impact so far since the
version number was not used, however in future patches this version
will be required.

Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24 13:41:25 +01:00
Gustavo A. R. Silva
df561f6688 treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-23 17:36:59 -05:00
Linus Torvalds
7f04f3ed62 sound fixes for 5.9-rc2
A collection of small fixes over several drivers, but all are driver-
 specific and nothing looks scary.  Slightly large changes are seen in
 ASoC qcom driver for the bugs that were revealed by the recent ASoC
 core change to report the invalid register access errors.  Also ASoC
 fsl got a slight intensive change for the distortion fix.  Others are
 only trivial fixes or device-specific quirks.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl8/kt4OHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+sexAAoPtgbUActijlJY34J4cm7kIt1wVulKKgdxMu
 LQEbuJPbRuv80fcr7MIcYTc6Q20frb3kQYJNxyPAG7afVV5wkGa/dO6mUrS3LHyg
 UsQLqm6iHqZNg0wo8cZK9Lhs+VwWrD1VWnV+5ODL5koT/SYfzqI7Km3lKketA4y/
 MvsRFhW03Mc6SabRINqxNcE3YTUHi8HPgM4aF9mQmBQTqm3tnld6MSCgo4B129cY
 rnNoGcpJmcZRGo1ZM7kUGS+FfLeclt3STvepbpz2iAoTWiI55X67uVwjAO3GHW4s
 5EoycKu0f8D6g3ZO0evari1vJRhC0X2QVHO42CaDk32PKxnh+xlR4sBfuJW0Zsqt
 AR+Jibv/wiF+vmlC0s+DQqgaxPkCJrK6zJ4uvjZi+iZhqXhq8Rl9DmIOCUwPoPZd
 PsKhenrmjecL3yd7kgYMtSm6orjaAzkG9r8rUnTWuWvtnpIyMe9eN3BsOGZnI0GV
 sn0UCVJQSmlxNcbWfFX+w/hYajY82FGRYbUf8bOAMWIxZP5ecPu54cn5eta70JQk
 w+b3Th9FSFJDlnATA+WAoh4TmYHmuYBISjmx4tLjnMwKxUCirJt90o7hl04Ntwwe
 1/pA4bIN6dN+csaLgWJzstlCxr/8H0LyQgRdvCfAES2ejboUQliiNOO0fDHkdf87
 PTCJtUg=
 =T8Rb
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes over several drivers, but all are driver-
  specific and nothing looks scary.

  Slightly large changes are seen in ASoC qcom driver for the bugs that
  were revealed by the recent ASoC core change to report the invalid
  register access errors. Also ASoC fsl got a slight intensive change
  for the distortion fix.

  Others are only trivial fixes or device-specific quirks"

* tag 'sound-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (25 commits)
  ALSA: hda: avoid reset of sdo_limit
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion
  ALSA: usb-audio: ignore broken processing/extension unit
  ASoC: intel: Fix memleak in sst_media_open
  ASoC: wm8994: Avoid attempts to read unreadable registers
  ASoC: msm8916-wcd-analog: fix register Interrupt offset
  ASoC: wm8994: Prevent access to invalid VU register bits on WM1811
  ALSA: hda/realtek: Add model alc298-samsung-headphone
  ALSA: usb-audio: Update documentation comment for MS2109 quirk
  ALSA: isa: fix spelling mistakes in the comments
  ALSA: usb-audio: Add capture support for Saffire 6 (USB 1.1)
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book
  ASoC: q6routing: add dummy register read/write function
  ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM
  ASoC: Make soc_component_read() returning an error code again
  ASoC: amd: Replacing component->name with codec_dai->name.
  ASoC: fsl: Fix unused variable warning
  ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n
  ...
2020-08-21 10:07:54 -07:00
Adam Thomson
fcea8b023a
ASoC: da7219: Fix I/O voltage range configuration during probe
Previous improvements around handling device and codec level
probe functionality added the possibility of the voltage level
being undefined for the scenario where the IO voltage retrieved
from the regulator supply was below 1.2V, whereas previously the
code defaulted to the 2.5V to 3.6V range in that case. This
commit restores the default value to avoid this happening.

Fixes: aa5b18d1c2 ("ASoC: da7219: Move soft reset handling to codec level probe")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20200821142259.C2ECE3FB96@swsrvapps-01.diasemi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 16:22:55 +01:00
Stephan Gerhold
3c27ea23ff
ASoC: qcom: Set card->owner to avoid warnings
On Linux 5.9-rc1 I get the following warning with apq8016-sbc:

WARNING: CPU: 2 PID: 69 at sound/core/init.c:207 snd_card_new+0x36c/0x3b0 [snd]
CPU: 2 PID: 69 Comm: kworker/2:1 Not tainted 5.9.0-rc1 #1
Workqueue: events deferred_probe_work_func
pc : snd_card_new+0x36c/0x3b0 [snd]
lr : snd_card_new+0xf4/0x3b0 [snd]
Call trace:
 snd_card_new+0x36c/0x3b0 [snd]
 snd_soc_bind_card+0x340/0x9a0 [snd_soc_core]
 snd_soc_register_card+0xf4/0x110 [snd_soc_core]
 devm_snd_soc_register_card+0x44/0xa0 [snd_soc_core]
 apq8016_sbc_platform_probe+0x11c/0x140 [snd_soc_apq8016_sbc]

This warning was introduced in
commit 81033c6b58 ("ALSA: core: Warn on empty module").
It looks like we are supposed to set card->owner to THIS_MODULE.

Fix this for all the qcom ASoC drivers.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 79119c7986 ("ASoC: qcom: Add Storm machine driver")
Fixes: bdb052e81f ("ASoC: qcom: add apq8016 sound card support")
Fixes: a6f933f63f ("ASoC: qcom: apq8096: Add db820c machine driver")
Fixes: 6b1687bf76 ("ASoC: qcom: add sdm845 sound card support")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200820154511.203072-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 16:12:10 +01:00
Bard Liao
751365035b
ASoC: intel: sof_sdw: add .exit callback function
We may allocate some resources in sof_sdw_codec_info .init function.
Adding a corresponding .exit function can help to release these resources.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200820134542.8682-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 15:24:41 +01:00
Matthias Schiffer
b507475588
ASoC: fsl-asoc-card: add support for TLV320AIC32x4 codec
The TLV320AIC32x4 is commonly used on TQ-Systems starterkit mainboards
for i.MX-based SoMs (i.MX6Q/DL, i.MX6UL, i.MX7) and LS1021A.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200821071153.7317-2-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 15:24:40 +01:00
Brent Lu
5e7820e369
ASoC: intel: atom: Add period size constraint
Use constraint to make sure the period size could always be multiple
of 1ms to align with the fundamental design/limitation of firmware.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/1596198365-10105-2-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 15:04:28 +01:00
Pierre-Louis Bossart
a115ab9b8b
ASoC: SOF: Intel: add build support for SoundWire
Select SoundWire capabilities on newer Intel platforms, starting with
CannonLake/CoffeeLake/CometLake.

As done for HDaudio, the SoundWire link is an opt-in capability. We
explicitly test for ACPI to avoid warnings on unmet dependencies on
the SoundWire side.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200819124429.3785-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21 11:59:07 +01:00
Mark Brown
1e15dd6f84
Merge series "Add mediatek codec mt6359 driver" from Jiaxin Yu <jiaxin.yu@mediatek.com>:
Add mediatek codec (MT6359) driver

MT6359 support playback and capture feature.

On downlink path, it includes three DACs for handset, headset,
and lineout path. On unlink path, it includeds three ADCs for
main mic, second mic, 3rd mic, and headset mic.

By scenario, select *_MUX widget to create damp path.
And by select mic_type_mux to choose DMIC/AMIC/....

For example, select these MUX widget to create headset path
(1) DAC In Mux --> "Normal Path"
(2) HP Mux --> "Audio Playback"

v6 changes:
	1. Remove the compatible string in mt6359codec because MFD should be registering the platform device.

v5 changes:
	1. Don't need to unregister the component whic is already relegated to devm.
	2. patchwork link:
		https://patchwork.kernel.org/cover/11716387/
		https://patchwork.kernel.org/patch/11717757/
		https://patchwork.kernel.org/patch/11716491/

v4 changes:
	1. Add a remove() function to undo regulator_enable().
	2. Removed unnecessary logs.
	3. patchwork link:
		https://patchwork.kernel.org/cover/11715553/
		https://patchwork.kernel.org/patch/11716015/
		https://patchwork.kernel.org/patch/11715557/

v3 changes:
	1. patchwork link:
		https://patchwork.kernel.org/cover/11714291/
		https://patchwork.kernel.org/patch/11714295/
		https://patchwork.kernel.org/patch/11714339/

v2 changes:
	1. patchwork link:
		https://patchwork.kernel.org/cover/11706935/
		https://patchwork.kernel.org/patch/11708865/
		https://patchwork.kernel.org/patch/11706937/

v1 changes:
	1.lkml link:
		https://lkml.org/lkml/2020/3/5/1257

Jiaxin Yu (2):
  ASoC: mediatek: mt6359: add codec driver
  dt-bindings: mediatek: mt6359: add codec document

 .../devicetree/bindings/sound/mt6359.yaml     |   61 +
 sound/soc/codecs/Kconfig                      |    8 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/mt6359.c                     | 2753 +++++++++++++++++
 sound/soc/codecs/mt6359.h                     | 2640 ++++++++++++++++
 5 files changed, 5464 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt6359.yaml
 create mode 100644 sound/soc/codecs/mt6359.c
 create mode 100644 sound/soc/codecs/mt6359.h

--
2.18.0
2020-08-20 20:30:34 +01:00
Colin Ian King
a467f2f8ad
ASoC: qcom: add missing out of memory check on drvdata->clks allocation
Currently drvdata->clks is not being checked for an allocation failure,
leading to potential null pointer dereferencing. Fix this by adding a
check and returning -ENOMEM if an error occurred.

Fixes: 1220f6a76e ("ASoC: qcom: Add common array to initialize soc based core clocks")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Rohit kumar <rohitkr@codeaurora.org>
Addresses-Coverity: ("Dereference null return value")
Link: https://lore.kernel.org/r/20200819160103.164893-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-20 20:30:33 +01:00
Pierre-Louis Bossart
1eb629363a
ASoC: SOF: Intel: hda: import SOUNDWIRE_INIT namespace
Make sure the SoundWire driver can be loaded

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200819124404.3734-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-20 20:30:32 +01:00
Jiaxin Yu
8061734ab6
ASoC: mediatek: mt6359: add codec driver
Add the mt6359 codec driver.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/1597913493-10747-2-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-20 20:17:25 +01:00
Arnd Bergmann
673085f450 ARM: s3c24xx: move iis pinctrl config into boards
The s3c_gpio_cfgall_range() function is an internal interface of the
samsung gpio driver and should not be called directly by drivers, so
move the iis pin initialization into the boards.

This means the pin configuration is only run once at early boot, rather
than each time the driver binds, but the effect should be the same.

Note that the s3c2412-i2s driver has no boards using it in mainline linux,
the driver gets selected for the jive machine but is never instantiated.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-28-krzk@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2020-08-20 17:40:57 +02:00
Krzysztof Kozlowski
35ee36c793 ASoC: Convert Samsung drivers to platform drivers
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl89eogTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0Ko0B/9icB170ZABvmA6+P+QPM+zpKI3+Kfu
 zrrkt+ZLA3B0ldWCv245v8QStIxnKI5Zlo/Letxgu72R4JJLl0KzIYQek3ywjUS7
 +0n3q8mcz+RbQ0hegGNe0W6FHlIZk55aw6aCyCBymmkXM0xnyMDMvvqSpDr2hB5S
 rf+yjzxZSRpiu43esY4nyBQ2AovlNdzzH8KywjeUABJ9PF6mLeJr8QHlkgJQLCi5
 AhcDFs+iQNoT9hf2IdSY36KU+5IXqnYC6vFOWuaOhSoN4erwbjw7AsefsVE16HTo
 LzQEW5Kl1We4dnpKbV49cBU7ahvCLh4k3VWHo551BQrGR1oqDIVE0/pi
 =+eMQ
 -----END PGP SIGNATURE-----

Merge tag 'samsung-platdrv-boards' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into next/soc-s3c-cleanup

Pull Samsung S3C ASoC cleanup patches from Mark Brown.  These patches
are part of the entire cleanup series so all further work depends on
them.
2020-08-20 17:36:39 +02:00
Arnd Bergmann
db8230d29c ARM: s5pv210: don't imply CONFIG_PLAT_SAMSUNG
The plat-samsung directory and mach-s5pv210 can be build
completely independently, so split the two Kconfig symbols
CONFIG_PLAT_SAMSUNG and CONFIG_ARCH_S5PV210.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-18-krzk@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2020-08-19 21:34:26 +02:00
Mark Brown
8dba698868 ASoC: Convert Samsung drivers to platform drivers
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl89eogTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0Ko0B/9icB170ZABvmA6+P+QPM+zpKI3+Kfu
 zrrkt+ZLA3B0ldWCv245v8QStIxnKI5Zlo/Letxgu72R4JJLl0KzIYQek3ywjUS7
 +0n3q8mcz+RbQ0hegGNe0W6FHlIZk55aw6aCyCBymmkXM0xnyMDMvvqSpDr2hB5S
 rf+yjzxZSRpiu43esY4nyBQ2AovlNdzzH8KywjeUABJ9PF6mLeJr8QHlkgJQLCi5
 AhcDFs+iQNoT9hf2IdSY36KU+5IXqnYC6vFOWuaOhSoN4erwbjw7AsefsVE16HTo
 LzQEW5Kl1We4dnpKbV49cBU7ahvCLh4k3VWHo551BQrGR1oqDIVE0/pi
 =+eMQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl89euUTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0LQiB/9XgBeSXp3otOPiEih3SJKXKorHGx0S
 jGRHonm0vm9/abFk7NrCLvB+YLoTEgYuNSfdYXMCMm2rUOi6PX1vdG4PWxZv5R83
 /oITC2zpZE1VOJGYOppJgppxQi6yO9vxrqHKHLqYjXlz0Jj3hg/sEfSqT5lsimUl
 SpxBFPISxCjxR7HmpTK9jN6GZWVK164RrjF71aHMV1ig+7SDmy27PCEHdsxa4mcb
 RjqWraNn+SpsQf85FbrFkCBv/BN52Ew0vg0zTVGMRawaDStt/WvtYHpgSx9Za7P4
 pCFZwTkcnbR5/gKBb54veFx0Rk4bsFjqy+bPfRjU0Sxravb6LAZOn5o9
 =XVNx
 -----END PGP SIGNATURE-----

Merge tag 'samsung-platdrv-boards' into asoc-5.10

ASoC: Convert Samsung drivers to platform drivers
2020-08-19 20:17:55 +01:00
Samuel Holland
a2f6d303e2
ASoC: sun8i-codec: Hook up component probe function
Due to a mistake made while reordering patches, commit 90cac93297
("ASoC: sun8i-codec: Fix DAPM to match the hardware topology") added
the sun8i_codec_component_probe function without referencing it from
the component definition. Add the reference so the probe function gets
called as expected.

Fixes: 90cac93297 ("ASoC: sun8i-codec: Fix DAPM to match the hardware topology")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200819034038.46418-1-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 20:17:51 +01:00
Arnd Bergmann
dcacbc0f9b
ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS
The constant requires indirectly including a machine header file,
but it's not actually used any more since commit 87b132bc03 ("ASoC:
samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API"), so
remove it completely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-27-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 20:15:45 +01:00
Arnd Bergmann
83d74e3542
ASoC: samsung: rx1950: turn into platform driver
Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-26-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 20:15:44 +01:00
Arnd Bergmann
e26a2abcc2
ASoC: samsung: neo1973: turn into platform driver
Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-25-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 20:15:43 +01:00
Arnd Bergmann
9666e27f90
ASoC: samsung: h1940: turn into platform driver
Avoid machine specific headers by using a gpio lookup table
combined with a platform_driver for this board.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200806182059.2431-24-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 20:15:42 +01:00
Pierre-Louis Bossart
9e4730586e
ASoC: codecs: rt*-sdw: use SDW_SLAVE_ENTRY_EXT
Add version and class information explicitly to prepare for support
for new devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200818141435.29205-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 12:52:25 +01:00
Mateusz Gorski
5610921a44
ASoC: Intel: skl_hda_dsp_generic: Fix NULLptr dereference in autosuspend delay
Different modules for HDMI codec are used depending on the
"hda_codec_use_common_hdmi" option being enabled or not. Driver private
context for both of them is different.
This leads to null-pointer dereference error when driver tries to set
autosuspend delay for HDMI codec while the option is off (hdac_hdmi
module is used for HDMI).

Change the string in conditional statement to "ehdaudio0D0" to ensure
that only the HDAudio codec is handled by this function.

Fixes: 5bf73b1b1d ("ASoC: intel/skl/hda - fix oops on systems without i915 audio codec")
Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200722173524.30161-1-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-19 12:12:53 +01:00
Takashi Iwai
9e96716026 ASoC: Fixes for v5.9
A bunch of fixes that came in during the merge window, mostly for issues
 that were uncovered by the changes to report errors on invalid register
 access plus one important fix in that code itself.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl88HrYTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JA2B/900+o6U6GH+uqk0HfHPt+Kj0cFHHE5
 AS88HxKDNQztj2MQwGKQMzbPCUyHLhlzgaqYXx1++9pWmfJ7DOs646UhQ2VenKB8
 nVxpkv9FZbdIDiLuEHPL+i+nzcIzPBYR7Hxcn37pqaYzG+DvNAl8VuSufZueQkXi
 qVfVT2sCyNDNMnLl/HZ2RwE/sbS43nqn8LH4+Y4dDcIRR9wdVyMWEGBJ4WYlMFOv
 3tjg6b9PlRo40RT5CCTcPeTIFniIv8c76TTpUwtvb+fjVMWYnLh9BbDNEa903AGP
 AU8CaM3ZEw15NZ008G9Bs04z6WqS/ZCeJTaXK8heKEsSjdsceKDEaicC
 =cmGI
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.9

A bunch of fixes that came in during the merge window, mostly for issues
that were uncovered by the changes to report errors on invalid register
access plus one important fix in that code itself.
2020-08-19 08:03:04 +02:00
Charles Keepax
a4d328efed
ASoC: wm_adsp: Update naming in error handling
It seems the datasheet has never used the word slave for this error
status bit and has always used the term address error. So update the
driver to match the datasheets and also in the process align a bit
better with avoiding the use of such words where possible.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200818160126.4852-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 18:22:17 +01:00
Mark Brown
28f9579517
Merge series "ASoC: qdsp6: add gapless compressed audio support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
This patchset adds gapless compressed audio support on q6asm.
Gapless on q6asm is implemented using 2 streams in a single q6asm session.

First few patches such as stream id per each command, gapless flags
and silence meta data are for preparedness for adding gapless support.
Last patch implements copy callback to allow finer control over buffer offsets,
specially in partial drain cases.

This patchset is tested on RB3 aka DB845c platform.

This patchset as it is will support gapless however QDSP can also
support switching decoders on a single stream. Patches to support such feature
are send in different patchset which involves adding generic interfaces.

Thanks,
srini

Changes since v2:(mostly suggested by Pierre)
- removed unnessary kernel style comments,
- moved TIMESTAMP flag to respective patch.
- move preparatory code from gapless support patch to new one.
- fix subject prefix of one patch.
- add comments to clarify valid stream_ids

Srinivas Kandagatla (10):
  ASoC: q6asm: rename misleading session id variable
  ASoC: q6asm: make commands specific to streams
  ASoC: q6asm: use flags directly from q6asm-dai
  ASoC: q6asm: add length to write command token
  ASoC: q6asm: add support to remove intial and trailing silence
  ASoC: q6asm: add support to gapless flag in q6asm open
  ASoC: q6asm-dai: add next track metadata support
  ASoC: q6asm-dai: prepare set params to accept profile change
  ASoC: q6asm-dai: add gapless support
  ASoC: q6asm-dai: add support to copy callback

 sound/soc/qcom/qdsp6/q6asm-dai.c | 414 +++++++++++++++++++++++--------
 sound/soc/qcom/qdsp6/q6asm.c     | 169 +++++++++----
 sound/soc/qcom/qdsp6/q6asm.h     |  49 ++--
 3 files changed, 469 insertions(+), 163 deletions(-)

--
2.21.0
2020-08-18 14:53:03 +01:00
Mark Brown
5ca8f9a539
Merge series "ASoC: Intel: fix cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This patchset tries to reduce the number of warnings on those drivers,
so that cppcheck can become a viable tool to detect issues (currently
hundreds of reports).

Most of the problems are related to unnecessary/redundant variable
assignments, prototypes and one nice logical mistake resulting in an
always-true condition.

Pierre-Louis Bossart (21):
  ASoC: Intel: Atom: sst-atom-controls: remove redundant assignments
  ASoC: Intel: Atom: compress: remove redundant assignment
  ASoC: Intel: Atom: platform-pcm: remove redundant assignment
  ASoC: Intel: Atom: sst: remove useless NULL assignment
  ASoC: Intel: Atom: remove redundant initialization
  ASoC: Intel: Atom: sst_pvt: remove redundant initialization
  ASoC: Intel: Atom: platform-pcm: fix redundant return
  ASoC: Intel: Atom: remove useless assignment
  ASoC: Intel: Atom: sst_loader: remove always-true condition
  ASoC: Intel: Atom: sst_pvt: simplify return handling
  ASoC: Intel: Atom: (cosmetic) align parameters
  ASoC: Intel: Baytrail: (cosmetic) align function parameters
  ASoC: Intel: common: (cosmetic) align function parameters
  ASoC: Intel: haswell: (cosmetic) align function parameters
  ASoC: Intel: haswell-ipc: remove redundant assignments
  ASoC: Intel: Skylake: skl-nhlt: remove redundant initialization
  ASoC: Intel: Skylake: cldma: remove redundant initialization
  ASoC: Intel: Skylake: sst-utils: remove redundant assignment
  ASoC: Intel: Skylake: skl-topology: remove redundant assignments
  ASoC: Intel: Skylake: skl-topology: remove redundant assignment
  ASoC: Intel: Skylake: (cosmetic) align function parameters

 sound/soc/intel/atom/sst-atom-controls.c      |  4 +--
 .../intel/atom/sst-mfld-platform-compress.c   |  3 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  4 +--
 sound/soc/intel/atom/sst-mfld-platform.h      |  4 +--
 sound/soc/intel/atom/sst/sst.c                |  5 ++-
 sound/soc/intel/atom/sst/sst.h                | 34 +++++++++----------
 sound/soc/intel/atom/sst/sst_loader.c         |  3 +-
 sound/soc/intel/atom/sst/sst_pvt.c            |  4 +--
 sound/soc/intel/baytrail/sst-baytrail-ipc.h   |  3 +-
 sound/soc/intel/common/sst-dsp-priv.h         |  2 +-
 sound/soc/intel/common/sst-dsp.h              | 15 ++++----
 sound/soc/intel/haswell/sst-haswell-ipc.c     |  4 +--
 sound/soc/intel/haswell/sst-haswell-ipc.h     |  2 +-
 sound/soc/intel/skylake/cnl-sst-dsp.h         |  4 +--
 sound/soc/intel/skylake/skl-nhlt.c            |  2 +-
 sound/soc/intel/skylake/skl-sst-cldma.c       |  2 +-
 sound/soc/intel/skylake/skl-sst-ipc.h         | 16 ++++-----
 sound/soc/intel/skylake/skl-sst-utils.c       |  2 +-
 sound/soc/intel/skylake/skl-topology.c        |  8 ++---
 sound/soc/intel/skylake/skl-topology.h        |  8 ++---
 sound/soc/intel/skylake/skl.h                 |  2 +-
 21 files changed, 63 insertions(+), 68 deletions(-)

--
2.25.1
2020-08-18 14:53:02 +01:00
Mark Brown
ba3e069fc1
Merge series "ASoC: da7219: Reorganise device/codec level probe/remove" from Adam Thomson <Adam.Thomson.Opensource@diasemi.com>:
This patch set reorganises and fixes device and codec level probe/remove
handling within the driver, to allow clean probe and remove at the codec level.

This set relates to an issue raised by Yong Zhi where a codec level re-probe
would fail due to clks still being registered from the previous instantiation.
In addition some improvements around regulator handling and soft reset have
also been included.

Adam Thomson (3):
  ASoC: da7219: Move required devm_* allocations to device level code
  ASoC: da7219: Move soft reset handling to codec level probe
  ASoC: da7219: Fix clock handling around codec level probe

 sound/soc/codecs/da7219-aad.c |  85 +++++---
 sound/soc/codecs/da7219-aad.h |   3 +
 sound/soc/codecs/da7219.c     | 493 +++++++++++++++++++++++-------------------
 sound/soc/codecs/da7219.h     |   1 +
 4 files changed, 328 insertions(+), 254 deletions(-)

--
1.9.1
2020-08-18 14:53:01 +01:00
Mark Brown
bf66f140d6
Merge series "refine and clean code for synchronous mode" from Shengjiu Wang <shengjiu.wang@nxp.com>:
refine and clean code for synchronous mode

Shengjiu Wang (3):
  ASoC: fsl_sai: Refine enable/disable TE/RE sequence in trigger()
  ASoC: fsl_sai: Drop TMR/RMR settings for synchronous mode
  ASoC: fsl_sai: Replace synchronous check with fsl_sai_dir_is_synced

changes in v3:
- Add reviewed-by Nicolin
- refine the commit log.
- Add one more patch #3

changes in v2:
- Split the commit
- refine the sequence in trigger stop

 sound/soc/fsl/fsl_sai.c | 173 +++++++++++++++++++++++-----------------
 1 file changed, 102 insertions(+), 71 deletions(-)

--
2.27.0
2020-08-18 14:52:59 +01:00
Mark Brown
cba62c8b49
Merge series "ASoC: qcom: Add support for SC7180 lpass variant" from Rohit kumar <rohitkr@codeaurora.org>:
This patch chain add audio support for SC7180 soc by doing the required
modification in existing common lpass-cpu/lpass-platform driver.
This also fixes some concurrency issue.

This patch series is already tested by Srinivas on Dragon Board 410c.
Changes since v5:
        - Fixed remove api in lpass-sc7180.c
        - Addressed comments by Rob in yaml Documentation.

Ajit Pandey (4):
  ASoC: qcom: Add common array to initialize soc based core clocks
  ASoC: qcom: lpass-platform: Replace card->dev with component->dev
  include: dt-bindings: sound: Add sc7180-lpass bindings header
  ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio

Rohit kumar (8):
  ASoC: qcom: lpass-cpu: Move ahbix clk to platform specific function
  ASoC: qcom: lpass-platform: fix memory leak
  ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers
  ASoC: qcom: lpass-cpu: fix concurrency issue
  dt-bindings: sound: lpass-cpu: Add sc7180 lpass cpu node
  ASoC: qcom: lpass-cpu: Use platform_get_resource
  ASoC: qcom: lpass-platform: Use platform_get_irq
  dt-bindings: sound: lpass-cpu: Move to yaml format

 .../devicetree/bindings/sound/qcom,lpass-cpu.txt   |  79 --------
 .../devicetree/bindings/sound/qcom,lpass-cpu.yaml  | 189 ++++++++++++++++++
 include/dt-bindings/sound/sc7180-lpass.h           |  10 +
 sound/soc/qcom/Kconfig                             |   5 +
 sound/soc/qcom/Makefile                            |   2 +
 sound/soc/qcom/lpass-apq8016.c                     |  86 ++++++--
 sound/soc/qcom/lpass-cpu.c                         | 204 ++++++++++---------
 sound/soc/qcom/lpass-ipq806x.c                     |  67 +++++++
 sound/soc/qcom/lpass-lpaif-reg.h                   | 157 ++++++++-------
 sound/soc/qcom/lpass-platform.c                    | 155 +++++++++++----
 sound/soc/qcom/lpass-sc7180.c                      | 216 +++++++++++++++++++++
 sound/soc/qcom/lpass.h                             |  63 +++++-
 12 files changed, 934 insertions(+), 299 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-cpu.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
 create mode 100644 include/dt-bindings/sound/sc7180-lpass.h
 create mode 100644 sound/soc/qcom/lpass-sc7180.c

--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
2020-08-18 14:52:57 +01:00
Mark Brown
354caf5836
Merge series "Codec workaround" from Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>:
This patch series enables some features on the tlv3204 codec and also fixes some issues faced while testing

v2: Fixed the build error from snd_soc_component_read32
v1: initial ASoC: codec: tlv3204: Codec workaround series

Michael Sit Wei Hong (3):
  ASoC: codec: tlv3204: Enable 24 bit audio support
  ASoC: codec: tlv3204: Increased maximum supported channels
  ASoC: codec: tlv3204: Moving GPIO reset and add ADC reset

 sound/soc/codecs/tlv320aic32x4.c | 60 +++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 16 deletions(-)

--
2.17.1
2020-08-18 14:52:56 +01:00
Mark Brown
4782e6cc29
Merge series "ASoC: sun50i-codec-analog: Cleanup and power management" from Samuel Holland <samuel@sholland.org>:
This series performs some minor cleanup on the driver for the analog
codec in the Allwinner A64, and hooks up the existing mute switches to
DAPM widgets, in order to provide improved power management.

Changes since v1:
  - Collected Acked-by/Reviewed-by tags
  - Used SOC_MIXER_NAMED_CTL_ARRAY to avoid naming a widget "Earpiece"

Samuel Holland (8):
  ASoC: sun50i-codec-analog: Fix duplicate use of ADC enable bits
  ASoC: sun50i-codec-analog: Gate the amplifier clock during suspend
  ASoC: sun50i-codec-analog: Group and sort mixer routes
  ASoC: sun50i-codec-analog: Make headphone routes stereo
  ASoC: sun50i-codec-analog: Enable DAPM for headphone switch
  ASoC: sun50i-codec-analog: Make line out routes stereo
  ASoC: sun50i-codec-analog: Enable DAPM for line out switch
  ASoC: sun50i-codec-analog: Enable DAPM for earpiece switch

 sound/soc/sunxi/sun50i-codec-analog.c | 176 ++++++++++++++++----------
 1 file changed, 111 insertions(+), 65 deletions(-)

--
2.26.2
2020-08-18 14:52:55 +01:00
Mark Brown
163ae5d1e1
Merge series "This patch series is to enable multiple features on the Keembay Platform" from Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>:
v2: Change channel-max device tree property to use new compatible string
v1: Initial patch series

Michael Sit Wei Hong (2):
  ASoC: Intel: KMB: Enable TDM audio capture
  dt-bindings: sound: intel,keembay-i2s: Add new compatible string

 .../bindings/sound/intel,keembay-i2s.yaml     |   1 +
 sound/soc/intel/keembay/kmb_platform.c        | 145 +++++++++++++-----
 2 files changed, 109 insertions(+), 37 deletions(-)

--
2.17.1
2020-08-18 14:52:53 +01:00
Mark Brown
2d32c6087d
Merge series "Allwinner A64 digital audio codec fixes" from Samuel Holland <samuel@sholland.org>:
This series fixes a couple of issues with the digital audio codec in the
Allwinner A64 SoC:
  1) Left/right channels were swapped when playing/recording audio
  2) DAPM topology was wrong, breaking some kcontrols

This is the minimum set of changes necessary to fix these issues in a
backward-compatible way. For that reason, some DAPM widgets still have
incorrect or confusing names; those and other issues will be fixed in
later patch sets.

Samuel Holland (7):
  ASoC: dt-bindings: Add a new compatible for the A64 codec
  ASoC: sun8i-codec: Fix DAPM to match the hardware topology
  ASoC: sun8i-codec: Add missing mixer routes
  ASoC: sun8i-codec: Add a quirk for LRCK inversion
  ARM: dts: sun8i: a33: Update codec widget names
  arm64: dts: allwinner: a64: Update codec widget names
  arm64: dts: allwinner: a64: Update the audio codec compatible

 .../sound/allwinner,sun8i-a33-codec.yaml      |   6 +-
 arch/arm/boot/dts/sun8i-a33-olinuxino.dts     |   4 +-
 arch/arm/boot/dts/sun8i-a33.dtsi              |   4 +-
 .../dts/allwinner/sun50i-a64-bananapi-m64.dts |   8 +-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts |   8 +-
 .../boot/dts/allwinner/sun50i-a64-pine64.dts  |   8 +-
 .../dts/allwinner/sun50i-a64-pinebook.dts     |   8 +-
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   |   8 +-
 .../boot/dts/allwinner/sun50i-a64-pinetab.dts |   8 +-
 .../allwinner/sun50i-a64-sopine-baseboard.dts |   8 +-
 .../boot/dts/allwinner/sun50i-a64-teres-i.dts |   8 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |  11 +-
 sound/soc/sunxi/sun8i-codec.c                 | 137 ++++++++++++++----
 13 files changed, 155 insertions(+), 71 deletions(-)

--
2.26.2
2020-08-18 14:52:52 +01:00
Mark Brown
fbe7a5dbd8
Merge series "ASoC: rt5682: Use clk APIs better" from Stephen Boyd <swboyd@chromium.org>:
This patch series drops a printk message down to dev_dbg() because it
was noisy and then migrates this driver to use clk_hw based APIs instead
of clk based APIs because this device is a clk provider, not a clk
consumer. I've only lightly tested the last two patches but I don't have
all combinations of clks for this device.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Shuming Fan <shumingf@realtek.com>

Stephen Boyd (3):
  ASoC: rt5682: Use dev_dbg() in rt5682_clk_check()
  ASoC: rt5682: Drop usage of __clk_get_name()
  ASoC: rt5682: Use clk_hw based APIs for registration

 sound/soc/codecs/rt5682.c | 73 ++++++++++++---------------------------
 sound/soc/codecs/rt5682.h |  2 --
 2 files changed, 23 insertions(+), 52 deletions(-)

Based on the last patch to this driver in linux-next.

base-commit: 6301adf942
--
Sent by a computer, using git, on the internet
2020-08-18 14:52:50 +01:00
Mark Brown
9af73c31f4
Merge series "ASoC: SOF/Intel: fix cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
A small set of fixes to reduce the number of warnings.

Pierre-Louis Bossart (5):
  ASOC: SOF: Intel: hda-codec: move unused label to correct position
  ASoC: SOF: Intel: hda-codec: move variable used conditionally
  ASoC: Intel: rename shadowed variable for all broadwell boards
  ASoC: Intel: bytcht_cx2072x: simplify return handling
  ASoC: Intel: sof_sdw: clarify operator precedence

 sound/soc/intel/boards/bdw-rt5650.c     | 10 +++++-----
 sound/soc/intel/boards/bdw-rt5677.c     |  8 ++++----
 sound/soc/intel/boards/broadwell.c      |  8 ++++----
 sound/soc/intel/boards/bytcht_cx2072x.c |  2 +-
 sound/soc/intel/boards/sof_sdw.c        |  2 +-
 sound/soc/sof/intel/hda-codec.c         |  7 ++++++-
 6 files changed, 21 insertions(+), 16 deletions(-)

--
2.25.1
2020-08-18 14:52:49 +01:00
Shengjiu Wang
a8fd5ca801
ASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rate
On some platform(.e.g. i.MX8QM MEK), the "extal" clock is different
with the mclk of codec, then the clock rate is also different.
So it is better to get clock rate of "extal" rate by clk_get_rate,
don't reuse the clock rate of mclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1597047103-6863-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 14:52:46 +01:00
Srinivas Kandagatla
db24fa5756
ASoC: qcom: add a dedicated menuconfig
Currently list of Qualcomm drivers is growing, so put them in to a
proper menu so that it does not mix up with other ASOC configs in menuconfig.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811105818.7890-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 14:52:45 +01:00
Sebastian Krzyszkowiak
89383a2707
ASoC: wm8962: Export DAC/ADC monomix switches
This allows solutions like ALSA UCM to utilize hardware mono downmix
for cases where mono output to a single speaker is desired only in
specific situations (like on a mobile phone).

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/3662154.EqNIRYjrc8@pliszka
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18 14:52:44 +01:00