Commit graph

40546 commits

Author SHA1 Message Date
Srinivasa Rao Mandadapu 214174d9f5
ASoC: codec: wcd938x: Add irq config support
This patch fixes compilation error in wcd98x codec driver.

Fixes: 0454422288 ("ASoC: codecs: wcd938x: add audio routing and Kconfig")

Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1633614675-27122-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:14 +01:00
Takashi Iwai 5af82c81b2
ASoC: DAPM: Fix missing kctl change notifications
The put callback of a kcontrol is supposed to return 1 when the value
is changed, and this will be notified to user-space.  However, some
DAPM kcontrols always return 0 (except for errors), hence the
user-space misses the update of a control value.

This patch corrects the behavior by properly returning 1 when the
value gets updated.

Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211006141712.2439-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:12 +01:00
Andy Shevchenko c25d4546ca
ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log saturation
dev_err_probe() avoids printing into log when the deferred probe is invoked.
This is possible when clock provider is pending to appear.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211006150428.16434-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:11 +01:00
Andy Shevchenko 10f4a96543
ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional()
First of all, replace indexed API by plain one since we have index 0.
Second, switch to optional variant and drop duplicated code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211006150428.16434-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:10 +01:00
Andy Shevchenko 6f32c52106
ASoC: Intel: bytcht_es8316: Use temporary variable for struct device
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211006150428.16434-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:09 +01:00
Andy Shevchenko 2577b868a4
ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata()
Access to platform data via dev_get_platdata() getter to make code cleaner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.com>
Link: https://lore.kernel.org/r/20211006150428.16434-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:08 +01:00
Srinivasa Rao Mandadapu db0767b8a6
ASoC: wcd938x: Fix jack detection issue
This patch is to fix audio 3.5mm jack detection failure
on wcd938x codec based target.

Fixes: bcee7ed09b (ASoC: codecs: wcd938x: add Multi Button Headset Control support)

Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1633614619-27026-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-07 15:45:07 +01:00
Takashi Iwai c0f1886de7 ALSA: hda: intel: Allow repeatedly probing on codec configuration errors
It seems that a few recent AMD systems show the codec configuration
errors at the early boot, while loading the driver at a later stage
works magically.  Although the root cause of the error isn't clear,
it's certainly not bad to allow retrying the codec probe in such a
case if that helps.

This patch adds the capability for retrying the probe upon codec probe
errors on the certain AMD platforms.  The probe_work is changed to a
delayed work, and at the secondary call, it'll jump to the codec
probing.

Note that, not only adding the re-probing, this includes the behavior
changes in the codec configuration function.  Namely,
snd_hda_codec_configure() won't unregister the codec at errors any
longer.  Instead, its caller, azx_codec_configure() unregisters the
codecs with the probe failures *if* any codec has been successfully
configured.  If all codec probe failed, it doesn't unregister but let
it re-probed -- which is the most case we're seeing and this patch
tries to improve.

Even if the driver doesn't re-probe or give up, it will go to the
"free-all" error path, hence the leftover codecs shall be disabled /
deleted in anyway.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1190801
Link: https://lore.kernel.org/r/20211006141940.2897-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-07 09:15:22 +02:00
Werner Sembach dd6dd6e3c7 ALSA: hda/realtek: Add quirk for TongFang PHxTxX1
This applies a SND_PCI_QUIRK(...) to the TongFang PHxTxX1 barebone. This
fixes the issue of the internal Microphone not working after booting
another OS.

When booting a certain another OS this barebone keeps some coeff settings
even after a cold shutdown. These coeffs prevent the microphone detection
from working in Linux, making the Laptop think that there is always an
external microphone plugged-in and therefore preventing the use of the
internal one.

The relevant indexes and values where gathered by naively diff-ing and
reading a working and a non-working coeff dump.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211006130415.538243-1-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-06 15:59:29 +02:00
Mark Brown dc1fad25bb
Merge series "ASoC: Intel: machine driver updates for 5.16" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
One quirk for a Dell TigerLake/SoundWire device, and initial support
for platforms based on the ES8336 codec (aka ES8316). For full
functionality, an update of the codec driver will be needed.

Pierre-Louis Bossart (5):
  ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on
    ES8336 codec
  ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on
    ES8336 codec
  ASoC: Intel: add machine driver for SOF+ES8336
  ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
  ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45

 sound/hda/intel-dsp-config.c                  |  22 +-
 sound/soc/intel/boards/Kconfig                |  14 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/sof_es8336.c           | 569 ++++++++++++++++++
 sound/soc/intel/boards/sof_sdw.c              |  10 +
 .../intel/common/soc-acpi-intel-bxt-match.c   |   6 +
 .../intel/common/soc-acpi-intel-glk-match.c   |   7 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   |  47 ++
 8 files changed, 674 insertions(+), 3 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_es8336.c

--
2.25.1
2021-10-05 16:25:24 +01:00
Mark Brown 6d0c1f787c
Merge series "ASoC: SOF: Intel: add flags to turn on SSP clocks early" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
With the chip shortage, some GeminiLake Intel-based designs were
respun and now rely on codecs that need the SSP bit clock turned on in
the hw_params stage, not the trigger stage. This patchset mirrors the
flags added in the SOF DAI_CONFIG IPC, and sets the flags when this
capability is indicated as necessary in the topology files where the
SSP configuration is stored.

We initially considered a more generic solution with an on-demand SSP
clock activation using the common clock framework. This would be a
more elegant solution indeed, but it would have required more
intrusive changes that would conflict with the SOF multi-client
support (in-development), and more backport hassles on product
branches. The on-demand activation of clocks is still a desired
feature that will be enabled at a later point.

Bard Liao (1):
  ASoC: SOF: dai-intel: add SOF_DAI_INTEL_SSP_CLKCTRL_MCLK/BCLK_ES bits

Pierre-Louis Bossart (4):
  ASoC: SOF: dai: mirror group_id definition added in firmware
  ASoC: SOF: dai: include new flags for DAI_CONFIG
  ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG
  ASoC: SOF: Intel: hda-dai: improve SSP DAI handling for dynamic
    pipelines

 include/sound/sof/dai-intel.h |  4 ++
 include/sound/sof/dai.h       | 10 ++++-
 sound/soc/sof/intel/hda-dai.c | 82 ++++++++++++++++++++++++++++++++++-
 sound/soc/sof/intel/hda.c     |  6 +++
 sound/soc/sof/sof-audio.c     |  4 ++
 5 files changed, 103 insertions(+), 3 deletions(-)

--
2.25.1
2021-10-05 16:25:23 +01:00
Mark Brown 84a96720f3
Merge series "ASoC: SOF: topology: minor updates" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Two patches to visualize settings and override dynamic pipelines + one
correction for errors on connections.

Pierre-Louis Bossart (2):
  ASoC: SOF: topology: show clks_control value in dynamic debug
  ASoC: SOF: topology: allow for dynamic pipelines override for debug

Ranjani Sridharan (1):
  ASoC: SOF: topology: return error if sof_connect_dai_widget() fails

 sound/soc/sof/sof-priv.h |  6 ++++++
 sound/soc/sof/topology.c | 24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 9 deletions(-)

--
2.25.1
2021-10-05 16:25:22 +01:00
Daniel Baluta 7b84fd262d
ASoC: SOF: OF: Add fw_path and tplg_path parameters
This allows specifying an alternate path for SOF firmware or
SOF topology.

This is particularly useful for i.MX when running Linux vs Android.

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>
Link: https://lore.kernel.org/r/20211005071949.1277613-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:59 +01:00
Rikard Falkeborn d54aa2aeaa
ASoC: amd: acp-rt5645: Constify static snd_soc_ops
The struct cz_aif1_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211004224514.8783-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:58 +01:00
Ranjani Sridharan 4a23076987
ASoC: SOF: topology: return error if sof_connect_dai_widget() fails
Return the error if sof_connect_dai_widget() fails to
abort topology loading and prevent card registration.

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/20211004212729.199550-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:56 +01:00
Pierre-Louis Bossart ea6bfbbe3e
ASoC: SOF: topology: allow for dynamic pipelines override for debug
For debug and community support, it's useful to expose a kernel
parameter to prevent the use of dynamic pipelines exposed in a
topology file, or conversely to force an existing topology to use
dynamic pipelines.

Add an override bit and an enable bit which is valid only when the
override is set.

For products, the intent is that the topology file defines the
behavior, these two bits are only intended for diagnosis and
performance checks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:55 +01:00
Pierre-Louis Bossart cf9f3fffae
ASoC: SOF: topology: show clks_control value in dynamic debug
We log most of the SSP configurations except the clks_control. This
will be used to enable bclk/mclk early start so it's useful to show
the information to the user.

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 <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:09:54 +01:00
Pierre-Louis Bossart 84e3cfd16a
ASoC: SOF: Intel: hda-dai: improve SSP DAI handling for dynamic pipelines
In order to keep the widget use_count balanced, make sure the DAI
widgets are allocated once in hw_params and released in hw_free. A
'setup' status flag is used to deal with cases where the .hw_params
callback is invoked multiple times, and likewise with cases where
hw_free is invoked without hw_params being called first (which can
happen if the FE hw_params fails).

In addition, this patch frees the widgets in the suspend transition,
and reallocates them in the .prepare callback. The 'setup' flag helps
in this case differentiate between resume (setup needed) and
xruns (setup not needed).

This balanced operation was not needed previously but will be required
when SOF dynamic pipelines are enabled.

Co-developed-by: Ranjani Sridharan <ranjani.sridharan@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>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:08:14 +01:00
Pierre-Louis Bossart b30b60a26a
ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG
The DAI_CONFIG is used for both hw_params and hw_free. Use flags to
specify what stage the configuration applies to.

the DAI_CONFIG IPC may be sent also during the widget setup so each
flag is cleared after the IPC to restore the state.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:08:12 +01:00
Pierre-Louis Bossart 64ba6d2ce7
ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45
This device is based on SDCA codecs but with a single amplifier
instead of two.

BugLink: https://github.com/thesofproject/linux/issues/3161
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:03 +01:00
Pierre-Louis Bossart f2470679b0
ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
We don't have a configuration for a single amp on link1.

BugLink: https://github.com/thesofproject/linux/issues/3161
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:02 +01:00
Pierre-Louis Bossart a164137ce9
ASoC: Intel: add machine driver for SOF+ES8336
Add machine driver to support APL/GLK/TGL platforms.
The TGL platform supports DMIC, APL and GLK do not.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@intel.com>
Signed-off-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/20211004213512.220836-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:06:00 +01:00
Pierre-Louis Bossart 9d36ceab94
ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on ES8336 codec
These devices are based on an I2C/I2S device, we need to force the use
of the SOF driver otherwise the legacy HDaudio driver will be loaded -
only HDMI will be supported.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@intel.com>
Signed-off-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/20211004213512.220836-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:05:58 +01:00
Pierre-Louis Bossart 790049fb66
ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on ES8336 codec
A number of devices, such as the "Chuwi HI10x" and "UNIQCELL Q15.6",
are based on APL/GLK with an I2C/I2S ES8336 codec.

Add table to find topology and firmware files.

Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@intel.com>
Signed-off-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/20211004213512.220836-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05 13:05:56 +01:00
Kailang Yang 5aec989130 ALSA: hda/realtek - ALC236 headset MIC recording issue
In power save mode, the recording voice from headset mic will 2s more delay.
Add this patch will solve this issue.

[ minor coding style fix by tiwai ]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/ccb0cdd5bbd7486eabbd8d987d384cb0@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-05 09:01:32 +02:00
Takashi Iwai 5963e52621 ALSA: usb-audio: Enable rate validation for Scarlett devices
The Scarlett device series from Focusrite Novation seem requiring the
sample rate validations as we've done for MOTU devices; otherwise the
driver probes invalid audioformat entries that contain the sample
rates that actually don't work, and this may result in an incomplete
setup as reported recently.

This patch adds the needed quirk flag for enabling the sample rate
validation for Focusrite Novation devices.

Fixes: fe773b8711 ("ALSA: usb-audio: workaround for iface reset issue")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214493
Link: https://lore.kernel.org/r/20211004074050.28241-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-05 07:57:19 +02:00
Hans de Goede 7924f1bc94
ASoC: Intel: cht_bsw_nau8824: Set card.components string
Set the card.components string using the new nau8824_components() helper
which returns a components string based on the DMI quirks inside the
nau8824 codec driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:30 +01:00
Hans de Goede efee0fca19
ASoC: nau8824: Add a nau8824_components() helper
Some devices using the NAU8824 have only one speaker. To still have things
working properly this requires the left + right channels to both be mixed
to the left speaker output.

This mixer setup is done by userspace based on UCM profiles. But this
requires userspace to know that there is a mono-speaker. Add a helper
function (for the machine driver) to get a components string providing
this info.

This is done inside the codec driver because the codec driver already
has a DMI quirk table.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:29 +01:00
Hans de Goede 92d3360108
ASoC: nau8824: Add DMI quirk mechanism for active-high jack-detect
Add a quirk mechanism to allow specifying that active-high jack-detection
should be used on platforms where this info is not available in devicetree.

And add an entry for the Cyberbook T116 tablet to the DMI table, so that
jack-detection will work properly on this tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:28 +01:00
Hans de Goede d316597c53
ASoC: nau8824: Fix NAU8824_JACK_LOGIC define
The NAU8824_JACK_LOGIC define was wrong, for active high jack-detect
to work bit 1 needs to be set, rather then bit 0.

The correct bit was found in the Android kernel source dump for
a Cyberbook T116 tablet; and this was also tested on that same tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211002211459.110124-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:26 +01:00
Hans de Goede 6e037b72cf
ASoC: rt5651: Use IRQF_NO_AUTOEN when requesting the IRQ
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then
disabling it immediately after requesting it.

This fixes a possible race where the IRQ might trigger between requesting
and disabling it; and this also leads to a small code cleanup.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211003132255.31743-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:25 +01:00
Hans de Goede 1cf2aa6659
ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then
disabling it immediately after requesting it.

This fixes a possible race where the IRQ might trigger between requesting
and disabling it; and this also leads to a small code cleanup.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211003132255.31743-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-04 15:55:24 +01:00
Werner Sembach cc03069a39 ALSA: hda/realtek: Add quirk for Clevo X170KM-G
This applies a SND_PCI_QUIRK(...) to the Clevo X170KM-G barebone. This
fixes the issue of the devices internal Speaker not working.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211001133111.428249-3-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-04 09:35:26 +02:00
Werner Sembach 1f8d398e1c ALSA: hda/realtek: Complete partial device name to avoid ambiguity
The string "Clevo X170" is not enough to unambiguously identify the correct
device.

Fixing it so another Clevo barebone name starting with "X170" can be added
without causing confusion.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211001133111.428249-2-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-04 09:35:16 +02:00
Seven Lee aab1ad11d6
ASoC: nau8821: new driver
The driver is for codec NAU88L21 of Nuvoton Technology Corporation.
The NAU88L21 is an ultra-low power high performance audio codec that
supports both analog and digital audio functions.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20211001103108.3297848-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-02 01:31:58 +01:00
Mark Brown 27547a3923
Merge series "Add support for on demand pipeline setup/destroy" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

The previous, v2 of this series was sent by Daniel Baluta:
https://lore.kernel.org/alsa-devel/20210917143659.401102-1-daniel.baluta@oss.nxp.com/

We have agreed that it might be better that someone from Intel is going to take it
from here as we already have the infrastructure up to test and verify the
dynamic pipelines support.

Changes since v2 (sent by Daniel Baluta):
- patch 10: Fix NULL point dereference in hda_dai_update_config()
- I have kept Daniel's SoB for the series.

Changes since v1:
- Signed-off-by tag added by Daniel

This series implements initial support for dynamic pipelines to setup/teardown
pipeline as needed when a PCM is open/closed.

Initially dynamic pipelines are only supported with single core setup which will
be expanded with a follow-up series.

Review with SOF community at
https://github.com/thesofproject/linux/pull/2794

The feature has been merged on 1st of April to sof-dev, all issues found since
has been fixed and squashed to this upstream series.

Regards,
Peter
---
Ranjani Sridharan (12):
  ASoC: topology: change the complete op in snd_soc_tplg_ops to return
    int
  ASoC: SOF: control: Add access field in struct snd_sof_control
  ASoC: SOF: topology: Add new token for dynamic pipeline
  ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai
    config set up
  AsoC: dapm: export a couple of functions
  ASoC: SOF: Add new fields to snd_sof_route
  ASoC: SOF: restore kcontrols for widget during set up
  ASoC: SOF: Don't set up widgets during topology parsing
  ASoC: SOF: Introduce widget use_count
  ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
  ASoC: SOF: Add support for dynamic pipelines
  ASoC: SOF: topology: Add kernel parameter for topology verification

 include/sound/soc-dpcm.h               |   1 +
 include/sound/soc-topology.h           |   2 +-
 include/uapi/sound/sof/tokens.h        |   1 +
 sound/soc/intel/skylake/skl-topology.c |   6 +-
 sound/soc/soc-dapm.c                   |   2 +
 sound/soc/soc-pcm.c                    |   4 +-
 sound/soc/soc-topology.c               |  10 +-
 sound/soc/sof/intel/hda-dai.c          | 174 +++---
 sound/soc/sof/intel/hda.c              | 177 ++++--
 sound/soc/sof/intel/hda.h              |   5 +
 sound/soc/sof/ipc.c                    |  22 +
 sound/soc/sof/pcm.c                    |  58 +-
 sound/soc/sof/pm.c                     |   4 +-
 sound/soc/sof/sof-audio.c              | 709 +++++++++++++++++++------
 sound/soc/sof/sof-audio.h              |  32 +-
 sound/soc/sof/sof-priv.h               |   1 +
 sound/soc/sof/topology.c               | 362 +++++--------
 17 files changed, 1032 insertions(+), 538 deletions(-)

--
2.33.0
2021-10-01 23:44:28 +01:00
Viorel Suman 83bea088f9
ASoC: fsl_spdif: implement bypass mode from in to out
Implement SPDIF bypass mode. It implies internal SoC
routing of SPDIF input signal to SPDIF output signal. The
test bed requires two boards: B1 configured in bypass mode,
and B2 to feed B1 SPDIF RX port and read B1 SPDIF TX port:
   B2 TX -> B1 RX,
   B2 RX <- B1 TX.
The test procedure:
 a) Boot both boards
 b) B2: start "arecord <spdifcard> -r 48kHz | aplay <local DAC>"
 c) B2: start "aplay <spdifcard> -r 48kHz <2ch 48kHz audio file>"
 d) B1: enable bypass mode:
	amixer -cimxspdif cset numid=8,iface=PCM,name='Bypass Mode' on
 e) B2: check DAC audio, make sure the same sample rate is used at
	steps b) and c), in example above the rate is 48kHz.
 f) B1: try to run "aplay" or "arecord" on imxspdif card while in
	bypass mode - both must fail until bypass mode is disabled
 g) B1: disable bypass mode:
	amixer -cimxspdif cset numid=8,iface=PCM,name='Bypass Mode' off
 h) B1: check the usual playback and capture on imxspdif card.
	During this test try to set bypass mode - must not be allowed
	while playback or capture is running.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1632649760-1651-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:56:03 +01:00
Ranjani Sridharan c0e7969cf9
ASoC: SOF: topology: Add kernel parameter for topology verification
Add a kernel debug flag to enable a one-shot topology
verification for all pipelines including the dynamic
ones. If the debug flag is set, all the topology
component loading will be verified during the complete
callback.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:31 +01:00
Ranjani Sridharan 5fcdbb2d45
ASoC: SOF: Add support for dynamic pipelines
Add support for dynamic pipelines by modifying the PCM
hw_params ioctl implementation to determine the widgets
required for a PCM stream by querying the list of
connected DAPM widgets. This list is saved as part of
snd_sof_pcm_stream struct and will be used to setup the widgets.

The sof_widget_list_setup/free routines setup and free connected
DAPM widgets when a PCM is opened/closed. These routines accept
a list of connected DAPM widgets as input and determine the SOF
widgets, their corresponding pipeline widgets and connections
between them that need to be setup before the PCM is triggered.

Please note that the dynamic pipeline feature will only be enabled
for those pipelines whose dynamic_pipeline_widget flag is set in
topologies. Add a new token called SOF_TKN_SCHED_DYNAMIC_PIPELINE
that when set in topology will be applied to the
dynamic_pipeline_widget flag of the pipeline widget.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:30 +01:00
Ranjani Sridharan 0acb48dd31
ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
With the implementation of the dynamic pipeline feature, widgets
will only be setup when a PCM is opened during the
hw_params ioctl. The BE hw_params callback is responsible for
sending the DAI_CONFIG for the DAI widgets in the DSP.
With dynamic pipelines, the DAI widgets will need to set up
first before sending the DAI_CONFIG IPC in the BE hw_params.

Update the BE hw_params/hw_free callbacks for all ALH, HDA and SSP
DAIs to set up/free the DAI widget before/after DAI_CONFIG IPC.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:29 +01:00
Ranjani Sridharan 8b00141692
ASoC: SOF: Introduce widget use_count
Add a new field, use_count to struct snd_sof_widget to keep track
of the usage count for each widget. Since widgets can belong to
multiple pipelines, this field will ensure that the widget
is setup only when the first pipeline that needs it is started
and freed when the last pipeline that needs it is stopped. There is
no need to protect the widget use_count access as the core already
handles mutual exclusion at the PCM level.
Add a new helper sof_widget_free() to handle freeing the SOF
widgets and export the sof_widget_setup/free() functions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:28 +01:00
Ranjani Sridharan 1b7d57d717
ASoC: SOF: Don't set up widgets during topology parsing
In preparation for supporting dynamic pipelines, move the
widget setup, DAI config IPCs to the complete callback
during topology loading. For current topology where all
the pipelines are static, all the pipelines will be set up
during complete. For topologies with dynamic and static pipelines,
this will enable setting up only the static ones  during
topology loading. Reuse the sof_restore_pipelines() function for
this purpose and rename it to sof_set_up_pipelines().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:27 +01:00
Ranjani Sridharan 5f3aad73fc
ASoC: SOF: restore kcontrols for widget during set up
Restore kcontrols for each widget after it has been set up
successfully.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
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>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:26 +01:00
Ranjani Sridharan 0a2dea1f10
ASoC: SOF: Add new fields to snd_sof_route
Add two new fields to save the source widget and sink widget
pointers in struct snd_sof_route to make it easier to look up
routes by source/sink widget. Also, add a flag to indicate
if the route has been set up in the DSP. These will be used
when the dynamic pipeline feature is implemented and routes
will have to be set up at run time.

Also, add a new sof_tear_down_pipelines() callback, that will
used to reset the set up status for all routes during suspend.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:24 +01:00
Ranjani Sridharan d1a7af0979
AsoC: dapm: export a couple of functions
Export a couple of DAPM functions that can be used by
ASoC drivers to determine connected widgets when a PCM
is started.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:23 +01:00
Ranjani Sridharan 93d71245c6
ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai config set up
Refactor the existing code to use helper functions to
set up/free widgets, send dai config and set up kcontrols for
widgets. These will be reused later on for setting up widgets in
the connected DAPM widgets list for a particular PCM when the
dynamic pipeline feature is implemented.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:23 +01:00
Ranjani Sridharan 2c28ecad0d
ASoC: SOF: topology: Add new token for dynamic pipeline
Today, we set up all widgets required for all PCM streams
at the time of topology parsing even if they are not
used. An optimization would be to only set up the widgets
required for currently active PCM streams. This would give
the FW the opportunity to power gate unused memory blocks,
thereby saving power.

For dynamic pipelines, the widgets in the connected DAPM path
for each PCM will need to be set up at runtime. This patch
introduces a new token, DYNAMIC_PIPELINE, for scheduler type
widgets that indicate whether a pipeline should be set up
statically during topology load or at runtime when the PCM is
opened. Introduce a new field called dynamic_pipeline_widget
in struct snd_sof_widget to save the value of the parsed token.

The token is set only for the pipeline (scheduler type)
widget and must be propagated to all widgets in the same
pipeline during topology load. Introduce another field called
pipe_widget in struct snd_sof_widget that saves the pointer to
the scheduler widget with the same pipeline ID as that of the
widget. This field is populated when the pipeline completion
callback is invoked during topology loading.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:22 +01:00
Ranjani Sridharan 199a3754f2
ASoC: SOF: control: Add access field in struct snd_sof_control
Add a new field to save the access setting for all controls
in struct snd_sof_control. This will be used to ensure that
only widgets belonging to static pipelines have volatile
controls.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:21 +01:00
Ranjani Sridharan 415717e1e3
ASoC: topology: change the complete op in snd_soc_tplg_ops to return int
In the SOF driver, the operations performed in the complete callback
can fail and therefore topology loading should return an error in
such cases. So, change the signature of the complete op
in struct snd_soc_tplg_ops to return an int to return the error.

Also, amend the complete callback functions in the SOF driver and
the SKL driver to conform with the new signature.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 20:48:19 +01:00
Rikard Falkeborn cd96663bc2
ASoC: qcom: apq8096: Constify static snd_soc_ops
The struct iapq8096_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211001115030.10402-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:35:05 +01:00
Derek Fang 0b26ca1725
ASoC: rt5682s: Fix HP noise caused by SAR mode switch when the system resumes
When the system resumes from S3, if the system plays a beep,
there is continuous "Zizi.." noise from HP that could be heard.
It is caused by the SAR mode switch during the combo jack
re-detection which be executed parallelly in a workqueue
after the system resumes.

This patch changes the behavior of SAR mode switch to
avoid this issue.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211001074113.2223-2-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:35:04 +01:00
Derek Fang 04a8374c32
ASoC: rt5682s: Enable ASRC auto-disable to fix pop during jack plug-in while playback
When codec's ASRC was enabled, the DA and AD filters use
the reference clk which tracks the I2S clks.
And if the I2S clks' timing of open and close are not expected,
this patch allows the filters to switch to use sysclk if
ASRC's ref clks disappeared and could fix the below possible issues:
1. Avoid DA filter to keep surplus samples.
2. Avoid that AD filter works failed during dapm's power on.

For example,
if I2S clks were closed before dacdat during playback off
due to jack unplug, it causes ref clks disappeared and
DA filter remained some samples which will produce pop noise
on the next HP playback.
ASRC auto-disable could clear the samples during the playback off.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211001074113.2223-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:35:03 +01:00
Trevor Wu bd8bec1408
ASoC: mediatek: mt8195: move of_node_put to remove function
platforms->of_node and codes->of_node are assigned in probe function,
and of_node_put is called at the end of probe function, because of_node
seems to be not used after probe functon

In this patch, of_node_put is moved to platform remove function in case
of_node is used at any occasions after probe function in the future.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211001031601.3953-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:35:01 +01:00
Malik_Hsu 9c89254762
ASoC: Intel: sof_rt5682: Add support for max98360a speaker amp
Add a board config adl_mx98360a_rt5682 to support alc5682 headset
codec and max98360a speaker amplifier. Follow Intel BT offload design
by connecting alc5682 to SSP0 and max98360a to SSP1.

Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211001150316.414141-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:35:00 +01:00
Rikard Falkeborn 620868b2a0
ASoC: tegra: Constify static snd_soc_ops
The struct tegra_machine_snd_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211001114517.6752-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01 19:34:59 +01:00
Chris Chiu 2b987fe844 ALSA: hda - Enable headphone mic on Dell Latitude laptops with ALC3254
The headphone mic is not working on Dell Latitude laptops with ALC3254.
The codec vendor id is 0x10ec0295 and share the same pincfg as defined
in ALC295_STANDARD_PINS. So the ALC269_FIXUP_DELL1_MIC_NO_PRESENCE will
be applied per alc269_pin_fixup_tbl[] but actually the headphone mic is
using NID 0x1b instead of 0x1a. The ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
need to be applied instead.

Use ALC269_FIXUP_DELL4_MIC_NO_PRESENCE for particular models before
a generic fixup comes out.

Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211001062856.1037901-1-chris.chiu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-01 09:00:18 +02:00
Jack Yu 57589f8276
ASoC: rt5682: move clk related code to rt5682_i2c_probe
The DAI clock is only used in I2S mode, to make it clear
and to fix clock resource release issue, we move CCF clock
related code to rt5682_i2c_probe to fix clock
register/unregister issue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210929054344.12112-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 15:23:47 +01:00
Shengjiu Wang 2cbf90a6d5
ASoC: fsl_rpmsg: Add rpmsg audio support for i.MX8ULP
On i.MX8ULP the audio interface and codec are controlled
by Cortex-M domain, Cortex-M core provides audio service
over rpmsg.

The rpmsg audio function is almost same as i.MX7ULP
platform, so share same configuration.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1632972413-22130-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:26:05 +01:00
Guo Zhengkui 626605a3df
ASoC: wm_adsp: remove a repeated including
Remove a repeated "#include <linux/firmware.h>" in line 32.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Acked-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210929123217.5240-1-guozhengkui@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:26:04 +01:00
Peter Ujfalusi 724cd2e426
ASoC: SOF: Change SND_SOC_SOF_TOPLEVEL from config to menuconfig
We have growing number of options under SND_SOC_SOF_TOPLEVEL as SOF
adaptation is growing (Intel, NXP, AMD and Mediatek) and new features are
added.
It will make the menuconfig user experience much cleaner if we move the
SOF options under a separate page.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210930070438.16846-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:26:03 +01:00
Derek Fang 853cb0be0e
ASoC: rt5682s: Revise the macro RT5682S_PLLB_SRC_MASK
Revise the macro RT5682S_PLLB_SRC_MASK to 0x1
because the mux is only two-source.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210930102928.28628-3-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:26:01 +01:00
Derek Fang 087330c642
ASoC: rt5682s: Use dev_dbg instead of pr_debug
It could observe the debug messages more clearly by using dev_dbg.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210930102928.28628-2-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:26:00 +01:00
Derek Fang 67e068ec45
ASoC: rt5682s: Remove the volatile SW reset register from reg_default
This reg is for SW reset.
It shouldn't have default value, so remove.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210930102928.28628-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:25:59 +01:00
Hans de Goede 42871e95a3
ASoC: nau8824: Fix headphone vs headset, button-press detection no longer working
Commit 1d25684e22 ("ASoC: nau8824: Fix open coded prefix handling")
replaced the nau8824_dapm_enable_pin() helper with direct calls to
snd_soc_dapm_enable_pin(), but the helper was using
snd_soc_dapm_force_enable_pin() and not forcing the MICBIAS + SAR
supplies on breaks headphone vs headset and button-press detection.

Replace the snd_soc_dapm_enable_pin() calls with
snd_soc_dapm_force_enable_pin() to fix this.

Cc: stable@vger.kernel.org
Fixes: 1d25684e22 ("ASoC: nau8824: Fix open coded prefix handling")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210929201512.460360-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-30 13:25:55 +01:00
Takashi Iwai 1f8763c59c ALSA: seq: Fix a potential UAF by wrong private_free call order
John Keeping reported and posted a patch for a potential UAF in
rawmidi sequencer destruction: the snd_rawmidi_dev_seq_free() may be
called after the associated rawmidi object got already freed.
After a deeper look, it turned out that the bug is rather the
incorrect private_free call order for a snd_seq_device.  The
snd_seq_device private_free gets called at the release callback of the
sequencer device object, while this was rather expected to be executed
at the snd_device call chains that runs at the beginning of the whole
card-free procedure.  It's been broken since the rewrite of
sequencer-device binding (although it hasn't surfaced because the
sequencer device release happens usually right along with the card
device release).

This patch corrects the private_free call to be done in the right
place, at snd_seq_device_dev_free().

Fixes: 7c37ae5c62 ("ALSA: seq: Rewrite sequencer device binding with standard bus")
Reported-and-tested-by: John Keeping <john@metanate.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210930114114.8645-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-30 14:13:22 +02:00
John Liu eb67662284 ALSA: hda/realtek: Enable 4-speaker output for Dell Precision 5560 laptop
The Dell Precision 5560 laptop appears to use the 4-speakers-on-ALC289
audio just like its sibling product XPS 9510, so it requires the same
quirk to enable woofer output. Tested on my Dell Precision 5560.

Signed-off-by: John Liu <johnliu55tw@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210930115316.659-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-30 13:54:00 +02:00
Takashi Iwai 8ec59ac3ad ALSA: usb-audio: Fix a missing error check in scarlett gen2 mixer
The check of the returned error code is missing in
scarlett2_update_monitor_other().  Let's fix it.

Fixes: d5bda7e039 ("ALSA: usb-audio: scarlett2: Add support for the talkback feature")
Reported-by: kernel test robot <lkp@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/202109131831.9IodEzRx-lkp@intel.com
Link: https://lore.kernel.org/r/20210929073540.9611-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-30 13:48:51 +02:00
Rikard Falkeborn 2831b71917
ASoC: ux500: mop500: Constify static snd_soc_ops
The struct mop500_ab8500_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210929094401.28086-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-29 13:06:38 +01:00
Rikard Falkeborn 5100436c27
ASoC: ti: Constify static snd_soc_ops
These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210929093121.21253-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-29 13:06:37 +01:00
Brent Lu 3c561a090c
ASoC: intel: sof_rt5682: update platform device name for Maxim amplifier
To follow 20-character length limitation of platform device name, we
have only 7 character space for amplifier. Therefore, the last
character of mx98357a and mx98360a is removed to save space.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Fixes: e224ef76fa ('ASoC: intel: sof_rt5682: support jsl_rt5682s_mx98360a board')
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210927143249.439129-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:29 +01:00
Peter Ujfalusi b689d81b16
ASoC: SOF: ipc: Make the error prints consistent in tx_wait_done()
If we get an error on reply (msg->reply_error) then we should print the
error value out.

At the same time extend the print to include the message size as well and
do the same in case of a timeout.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210928073615.29574-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:28 +01:00
Marc Herbert 18845128f5
ASoC: SOF: prefix some terse and cryptic dev_dbg() with __func__
These helped troubleshoot some DMA issue in SOF.

Signed-off-by: Marc Herbert <marc.herbert@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928102635.26227-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:27 +01:00
Guennadi Liakhovetski 6a0ba071b7
ASoC: SOF: add error handling to snd_sof_ipc_msg_data()
If an invalid stream is passed to snd_sof_ipc_msg_data() it won't
fill the provided object with data. The caller has to be able to
recognise such cases to avoid handling invalid data. Make the
function return an error when failing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928103516.8066-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:26 +01:00
Trevor Wu b05cfb1215
ASoC: mediatek: mt8195: add missing of_node_put in probe
dp node and hdmi node are retrieved from of_parse_phandle(), so using
of_node_put() on them before return.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210928063520.23927-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:25 +01:00
Pierre-Louis Bossart 3e5cdded93
ASoC: SOF: imx: add header file for ops
Sparse (make C=2) complains about undeclared variables. Fix by adding
a real prototype instead of 'extern' in sof-of-dev.c

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: Paul Olaru <paul.olaru@oss.nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928072807.27838-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:24 +01:00
Ranjani Sridharan a1ce6e43e2
ASoC: SOF: pm: fix a stale comment
There is no restore_stream flag anymmore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928074030.30553-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:23 +01:00
Peter Ujfalusi 22c861fd7f
ASoC: SOF: Intel: hda-stream: Print stream name on STREAM_SD_OFFSET timeout
In order to provide more information in case of timeout observed while
reading STREAM_SD_OFFSET, print out the stream name or in case there is
no audio stream associated (like dma-trace), print "--"

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210928081744.4785-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28 13:16:21 +01:00
Thomas Gleixner f2ff7147c6 ALSA: pcsp: Make hrtimer forwarding more robust
The hrtimer callback pcsp_do_timer() prepares rearming of the timer with
hrtimer_forward(). hrtimer_forward() is intended to provide a mechanism to
forward the expiry time of the hrtimer by a multiple of the period argument
so that the expiry time greater than the time provided in the 'now'
argument.

pcsp_do_timer() invokes hrtimer_forward() with the current timer expiry
time as 'now' argument. That's providing a periodic timer expiry, but is
not really robust when the timer callback is delayed so that the resulting
new expiry time is already in the past which causes the callback to be
invoked immediately again. If the timer is delayed then the back to back
invocation is not really making it better than skipping the missed
periods. Sound is distorted in any case.

Use hrtimer_forward_now() which ensures that the next expiry is in the
future. This prevents hogging the CPU in the timer expiry code and allows
later on to remove hrtimer_forward() from the public interfaces.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210923153339.623208460@linutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-28 10:58:08 +02:00
Mark Brown ca4c040d4a
Merge series "add driver to support firmware loading on Cirrus Logic DSPs" from Simon Trimmer <simont@opensource.cirrus.com>:
This series of patches gradually separates the ASoC specific wm_adsp
code from that required to manage firmware in Cirrus Logic DSPs.

The series starts with renaming, progresses to splitting the
functionality before finally moving the independent functionality into
drivers/firmware so that it can be used by both the existing ASoC
wm_adsp and new non-audio parts.

Charles Keepax (3):
  ASoC: wm_adsp: Move check for control existence
  ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed
    buffers
  ASoC: wm_adsp: Move sys_config_size to wm_adsp

Simon Trimmer (13):
  ASoC: wm_adsp: Remove use of snd_ctl_elem_type_t
  ASoC: wm_adsp: Cancel ongoing work when removing controls
  ASoC: wm_adsp: Rename generic DSP support
  ASoC: wm_adsp: Introduce cs_dsp logging macros
  ASoC: wm_adsp: Separate some ASoC and generic functions
  ASoC: wm_adsp: Split DSP power operations into helper functions
  ASoC: wm_adsp: Separate generic cs_dsp_coeff_ctl handling
  ASoC: wm_adsp: Move check of dsp->running to better place
  ASoC: wm_adsp: Pass firmware names as parameters when starting DSP
    core
  ASoC: wm_adsp: move firmware loading to client
  ASoC: wm_adsp: Split out struct cs_dsp from struct wm_adsp
  ASoC: wm_adsp: Separate wm_adsp specifics in cs_dsp_client_ops
  firmware: cs_dsp: add driver to support firmware loading on Cirrus
    Logic DSPs

 MAINTAINERS                                   |   11 +
 drivers/firmware/Kconfig                      |    1 +
 drivers/firmware/Makefile                     |    1 +
 drivers/firmware/cirrus/Kconfig               |    5 +
 drivers/firmware/cirrus/Makefile              |    3 +
 drivers/firmware/cirrus/cs_dsp.c              | 3109 ++++++++++++++++
 include/linux/firmware/cirrus/cs_dsp.h        |  242 ++
 .../linux/firmware/cirrus}/wmfw.h             |    8 +-
 sound/soc/codecs/Kconfig                      |    1 +
 sound/soc/codecs/cs47l15.c                    |   22 +-
 sound/soc/codecs/cs47l24.c                    |   20 +-
 sound/soc/codecs/cs47l35.c                    |   24 +-
 sound/soc/codecs/cs47l85.c                    |   32 +-
 sound/soc/codecs/cs47l90.c                    |   34 +-
 sound/soc/codecs/cs47l92.c                    |   20 +-
 sound/soc/codecs/madera.c                     |   18 +-
 sound/soc/codecs/wm2200.c                     |   30 +-
 sound/soc/codecs/wm5102.c                     |   16 +-
 sound/soc/codecs/wm5110.c                     |   24 +-
 sound/soc/codecs/wm_adsp.c                    | 3188 ++---------------
 sound/soc/codecs/wm_adsp.h                    |  105 +-
 21 files changed, 3794 insertions(+), 3120 deletions(-)
 create mode 100644 drivers/firmware/cirrus/Kconfig
 create mode 100644 drivers/firmware/cirrus/Makefile
 create mode 100644 drivers/firmware/cirrus/cs_dsp.c
 create mode 100644 include/linux/firmware/cirrus/cs_dsp.h
 rename {sound/soc/codecs => include/linux/firmware/cirrus}/wmfw.h (91%)

--
2.33.0
2021-09-27 18:32:10 +01:00
Mark Brown 93323666d2
ASoC: ak4458: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the ak4458 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920163817.16490-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:15 +01:00
Mark Brown b55f03436b
ASoC: ak5558: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the ak5558 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164753.17030-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:14 +01:00
Sugar Zhang b0e3b0a707
ASoC: dmaengine: Introduce module option prealloc_buffer_size_kbytes
Currently, The fixed 512KB prealloc buffer size is too larger for
tiny memory kernel (such as 16MB memory). This patch adds the module
option "prealloc_buffer_size_kbytes" to specify prealloc buffer size.

It's suitable for cards which use the generic dmaengine pcm driver
with no config.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1632394246-59341-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:13 +01:00
Mark Brown d090004252
ASoC: dwc-i2s: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the dwc-i2s driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921205313.46710-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:12 +01:00
Mark Brown a35f2d4406
ASoC: ak4671: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the ak4671 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164211.16718-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:11 +01:00
Mark Brown 2a36bd83bf
ASoC: alc5623: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the alc5623 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920165036.17142-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:10 +01:00
Mark Brown a91b0e5b0b
ASoC: bcm: Convert to modern clocking terminology
As part of the effort to remove our old APIs based on outdated terminology
update the Broadcom drivers to use modern terminology.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916143423.24025-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:09 +01:00
Mark Brown 99a26f2416
ASoC: cpcap: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the cpcap driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921213034.31427-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:08 +01:00
Colin Ian King 9929265f2a
ASoC: meson: aiu: Fix spelling mistake "Unsupport" -> "Unsupported"
There is a spelling mistake in a dev_err error message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20210924231242.144692-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:07 +01:00
Colin Ian King a4db95b282
ASoC: codecs: Fix spelling mistake "Unsupport" -> "Unsupported"
There are spelling mistakes in dev_err error messages. Fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210924231003.144502-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:05 +01:00
Mark Brown e3a0dbc5d6
ASoC: ad193x: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the ad193x driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916142232.33914-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:04 +01:00
Rikard Falkeborn 313fab4820
ASoC: tegra: Constify static snd_soc_dai_ops structs
The only usage of these is to assign their address to the ops field in
the snd_soc_dai_driver struct, which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210922205438.34519-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:03 +01:00
Stefan Binding edd6dffdc6
ASoC: cs42l42: Use two thresholds and increased wait time for manual type detection
Some headsets require very different comparator thresholds for type detection,
as well as longer settling times. In order to detect a larger number of headsets,
use 2 thresholds to give maximum coverage (1.25V and 1.75V), as well as a longer
settling time of 100ms. This will not affect default audotodetect mode
and applies to manual mode type detection only.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210927111437.18113-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:02 +01:00
Mark Brown 9943ab72fd
ASoC: adav80x: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adav80x driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-6-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:01 +01:00
Mark Brown 21b686e0bf
ASoC: adau1977: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adau1977 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-5-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:01:00 +01:00
Mark Brown a41a008fe8
ASoC: adau17x1: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adau17x1 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-4-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:59 +01:00
Mark Brown 33ff453907
ASoC: adau1701: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adau1701 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-3-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:58 +01:00
Mark Brown 829fddb1f6
ASoC: adau1373: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adau1373 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-2-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:57 +01:00
Mark Brown 9c42dd7bfb
ASoC: adau1372: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the adau1372 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:56 +01:00
Mark Brown 88e5cdddb5
ASoC: ad1836: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the ad1836 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916142125.7226-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:55 +01:00
Mark Brown c7801a3c68
ASoC: ep93xx: Convert to modern clocking terminology
As part of the effort to remove our old APIs based on outdated terminology
update the EP93xx drivers to use modern terminology.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916143828.36215-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:54 +01:00
Arnd Bergmann 501849d97e
ASoC: samsung: add missing "fallthrough;"
With gcc, we get a warning in this file:

In file included from include/linux/io.h:13,
                 from sound/soc/samsung/s3c-i2s-v2.c:16:
sound/soc/samsung/s3c-i2s-v2.c: In function 's3c2412_i2s_trigger':
arch/arm/include/asm/io.h:92:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
 #define __raw_writel __raw_writel
                      ^
arch/arm/include/asm/io.h:299:29: note: in expansion of macro '__raw_writel'
 #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c)
                             ^~~~~~~~~~~~
arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
 #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
                                    ^~~~~~~~~~~~~~
sound/soc/samsung/s3c-i2s-v2.c:398:3: note: in expansion of macro 'writel'
   writel(0x0, i2s->regs + S3C2412_IISFIC);
   ^~~~~~
sound/soc/samsung/s3c-i2s-v2.c:400:2: note: here
  case SNDRV_PCM_TRIGGER_RESUME:
  ^~~~

From all I can tell, this was indeed meant to fall through, so
add "fallthrough;" statement to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210927095449.1070639-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:53 +01:00
Mark Brown 3e8908fbfd
ASoC: ak4642: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the ak4642 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164042.16624-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:52 +01:00
Yassine Oudjana a270bd9abd
ASoC: wcd9335: Use correct version to initialize Class H
The versioning scheme was changed in an earlier patch, which caused the version
being used to initialize WCD9335 to be interpreted as if it was WCD937X, which
changed code paths causing broken headphones output. Pass WCD9335 instead of
WCD9335_VERSION_2_0 to wcd_clsh_ctrl_alloc to fix it.

Fixes: 19c5d1f6a0 ("ASoC: codecs: wcd-clsh: add new version support")
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210925022339.786296-1-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:51 +01:00
Mark Brown 155acb01bf
ASoC: alc5632: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the alc5632 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920165128.17224-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:50 +01:00
Mark Brown 8515f828c5
ASoC: ak4104: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the ak4104 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916150922.20183-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:48 +01:00
Mark Brown 2b0a5d8d28
ASoC: ak4118: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the ak4118 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916150804.20058-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:47 +01:00
Mark Brown c5bc627511
ASoC: zl38060: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the zl38060 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921205117.4393-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:46 +01:00
Simon Trimmer f6bc909e76
firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs
wm_adsp originally provided firmware loading on some audio DSP and was
implemented as an ASoC codec driver. However, the firmware loading now
covers a wider range of DSP cores and peripherals containing them,
beyond just audio. So it needs to be available to non-audio drivers. All
the core firmware loading support has been moved into a new driver
cs_dsp, leaving only the ASoC-specific parts in wm_adsp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-17-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:42 +01:00
Simon Trimmer 2dd044641e
ASoC: wm_adsp: Separate wm_adsp specifics in cs_dsp_client_ops
This is preparation for moving the generic DSP support out of ASoC.
The event callbacks let the client add custom handling of events.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-16-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:41 +01:00
Simon Trimmer e146820215
ASoC: wm_adsp: Split out struct cs_dsp from struct wm_adsp
In preparation for moving the generic DSP support out of ASoC split
struct wm_adsp into two parts, one will form the structure for the new
generic DSP code and embed that one into wm_adsp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-15-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:40 +01:00
Simon Trimmer a828056fa1
ASoC: wm_adsp: move firmware loading to client
This is preparation for moving the generic DSP support out of ASoC.
Passing the firmware as parameters into the power_up functions
simplifies the generic code that will be moved out of wm_adsp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-14-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:39 +01:00
Simon Trimmer 2169f2f151
ASoC: wm_adsp: Pass firmware names as parameters when starting DSP core
As preparation for moving the generic DSP support out of ASoC pass the
firmware names used when loading files as parameters as the generic code
can't refer directly to the array specific to wm_adsp. The code
remaining in wm_adsp.c doesn't need to change, it can continue to use
the string arrays directly.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-13-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:38 +01:00
Simon Trimmer edb1d6d7f0
ASoC: wm_adsp: Move check of dsp->running to better place
In preparation for moving the generic DSP support out of ASoC, move
the check of dsp->running to a more appropriate place that will move
to the generic code.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-12-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:37 +01:00
Simon Trimmer 0700bc2fb9
ASoC: wm_adsp: Separate generic cs_dsp_coeff_ctl handling
This is preparation for moving the generic DSP support out of ASoC. The
majority of the handling of firmware controls is generic and this change
separates the generic and ASoC specific details into separate structures
and functions and renames the generic code named wm_* to cs_*.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-11-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:36 +01:00
Charles Keepax 6092be2d93
ASoC: wm_adsp: Move sys_config_size to wm_adsp
sys_config_size is part of the compressed stream support, move it from
what will become generic DSP code so that it remains in ASoC.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-10-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:35 +01:00
Simon Trimmer 186152df4d
ASoC: wm_adsp: Split DSP power operations into helper functions
This is preparation for moving the generic DSP support out of
ASoC. This change separates the generic handling of power and state
transitions from the DAPM API wrapper.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-9-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:35 +01:00
Simon Trimmer 25ca837ba6
ASoC: wm_adsp: Separate some ASoC and generic functions
Split some functions into ASoC and generic portions so that existing
interfaces can be retained whilst allowing the implementation to be
moved out of ASoC.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-8-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:34 +01:00
Simon Trimmer 6ab1d0cc84
ASoC: wm_adsp: Introduce cs_dsp logging macros
In preparation for moving the generic DSP support out of ASoC, add
some new logging macros that will be used from the generic code.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-7-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:33 +01:00
Simon Trimmer 5beb8eeade
ASoC: wm_adsp: Rename generic DSP support
This rename is preparation for moving the generic DSP support out of
ASoC, generic code named wm_* will be renamed to cs_*.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-6-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:31 +01:00
Simon Trimmer df6c505c12
ASoC: wm_adsp: Cancel ongoing work when removing controls
Removes wm_adsp_ctl_work and integrates the work_struct into
wm_coeff_ctl so it may be referenced.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-5-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:31 +01:00
Charles Keepax 04ae085967
ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed buffers
When parsing a compressed buffer from the firmware the driver currently
open codes reading the firmware coefficient containing the buffer
description. Improve this slightly by using the coefficient read
functions already provided by the wm_adsp driver. It is worth noting
this change requires the running variable to be set before
wm_adsp_buffer_init is called, however this is safe, since its all still
under the power lock and nothing in the compressed code gates itself on
running.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-4-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:30 +01:00
Charles Keepax 6477960755
ASoC: wm_adsp: Move check for control existence
Checking earlier in the function if a control already exists avoids
superfluous string construction and also prepares for future
refactoring.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-3-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:29 +01:00
Simon Trimmer d07a6d454f
ASoC: wm_adsp: Remove use of snd_ctl_elem_type_t
In preparation for moving the generic DSP support out of ASoC, remove
the use of the ALSA specific types for the control type. The use of an
ALSA type was unnecessary, the simplified code is easier to read and
avoids Sparse warnings.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-2-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 13:00:28 +01:00
Mark Brown 0cc3687ead
ASoC: cs4341: Add SPI device ID table
Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding SPI IDs for parts that
only have a compatible listed.

Fixes: 96c8395e21 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210924194844.45974-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 12:59:09 +01:00
Mark Brown ceef3240f9
ASoC: pcm179x: Add missing entries SPI to device ID table
Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding SPI IDs for parts that
only have a compatible listed.

Fixes: 96c8395e21 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210924194956.46079-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-27 12:59:08 +01:00
Jaroslav Kysela 09d2317440 ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION
The new framing mode causes the user space regression, because
the alsa-lib code does not initialize the reserved space in
the params structure when the device is opened.

This change adds SNDRV_RAWMIDI_IOCTL_USER_PVERSION like we
do for the PCM interface for the protocol acknowledgment.

Cc: David Henningsson <coding@diwic.se>
Cc: <stable@vger.kernel.org>
Fixes: 08fdced60c ("ALSA: rawmidi: Add framing mode")
BugLink: https://github.com/alsa-project/alsa-lib/issues/178
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210920171850.154186-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-23 09:26:40 +02:00
Mark Brown 39e178a4cc
ASoC: pl1022_rdk: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the pl1022_rdk driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-16-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:31 +01:00
Mark Brown fcd444bf6a
ASoC: pl1022_ds: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the pl1022_ds driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-15-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:30 +01:00
Mark Brown 8a7f299b85
ASoC: mpc8610_hpcd: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the mpc8610_hpcd driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-14-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:29 +01:00
Mark Brown 419099b4c3
ASoC: imx-sgtl5000: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-sgtl5000 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-13-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:28 +01:00
Mark Brown caa0a6075a
ASoC: imx-rpmsg: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-rpmsg driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-12-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:27 +01:00
Mark Brown a90f847ad2
ASoC: imx-hdmi: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-hdmi driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-11-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:26 +01:00
Mark Brown 56b69e4e4b
ASoC: imx-es8328: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-es8328 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-10-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:25 +01:00
Mark Brown d689e28012
ASoC: imx-card: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-card driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-9-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:24 +01:00
Mark Brown bf10102248
ASoC: imx-audmix: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the imx-audmix driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-8-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:23 +01:00
Mark Brown 89efbdaaa4
ASoC: fsl_ssi: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl_ssi driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-7-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:22 +01:00
Mark Brown 361284a4eb
ASoC: fsl_sai: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl_sai driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-6-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:21 +01:00
Mark Brown a51da9dc9b
ASoC: fsl-mqs: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl-mqs driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-5-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:20 +01:00
Mark Brown e0b64fa34c
ASoC: fsl-esai: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl-esai driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-4-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:19 +01:00
Mark Brown 2757b340b2
ASoC: fsl-audmix: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl-audmix driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-3-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:18 +01:00
Mark Brown 8fcfd34934
ASoC: fsl-asoc-card: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the fsl-asoc-card driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-2-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:17 +01:00
Mark Brown 4348be6330
ASoC: eureka-tlv320: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the eureka-tlv320 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:16 +01:00
Mark Brown 94767044f0
ASoC: cros_ec_codec: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update
the cros_ec_codec driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210920170414.17903-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22 13:23:15 +01:00
Takashi Sakamoto cb1bcf5ed5 ALSA: firewire-motu: fix truncated bytes in message tracepoints
In MOTU protocol v2/v3, first two data chunks across 2nd and 3rd data
channels includes message bytes from device. The total size of message
is 48 bits per data block.

The 'data_block_message' tracepoints event produced by ALSA firewire-motu
driver exposes the sequence of messages to userspace in 64 bit storage,
however lower 32 bits are actually available since current implementation
truncates 16 bits in upper of the message as a result of bit shift
operation within 32 bit storage.

This commit fixes the bug by perform the bit shift in 64 bit storage.

Fixes: c6b0b9e65f ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210920110734.27161-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-21 18:48:32 +02:00
Takashi Iwai 77ff9e7be0 ASoC: Fixes for v5.15
A crop of mostly device specific fixes that have been applied since
 the merge window, nothing particularly standout here.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmFIe80ACgkQJNaLcl1U
 h9DaFAf6A4VlW7tUXJE+JP7eQGEjxhep84wDnSWJDGFccdbGINVumBTmirzutguU
 dhq0NRCZgSDfBqKKP7f6l27yc/2Ei35wN7yK2VzIIdtqtcZ+Ho3ipFpvdqDyzbuf
 DriMTP83qEs9AJve+GMePwB8aUyGj7QKjkIHXj65FsLI+c2KBQkNf127ydwd4faq
 UrFCuYrs11bD0ohx8GDDbdsmz2jriUZBfaesPwuzfy/O/59caaKqt9Uq1qUxqOJ7
 3Gx1xB3mBhg005dezHgAED9coFW2TSAetIcEMnPrHBqzx8MB6DomcK1+Y8pRbekC
 4NoZrRxuTm2o5TGEwi/XPlCnSb7CAw==
 =29Gi
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.15

A crop of mostly device specific fixes that have been applied since
the merge window, nothing particularly standout here.
2021-09-21 18:42:14 +02:00
Colin Ian King b5377a7678
ASoC: qdsp6: q6afe-dai: Fix spelling mistake "Fronend" -> "Frontend"
There is a spelling mistake in the module description. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210920184152.18109-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21 15:03:33 +01:00
Shengjiu Wang a635d66be1
ASoC: fsl_spdif: Add support for i.MX8ULP
On i.MX8ULP the spdif works with EDMA, so add compatible
string and soc specific data for i.MX8ULP.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1631238562-27081-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21 13:24:52 +01:00
Rikard Falkeborn 815b55e110
ASoC: fsl: Constify static snd_soc_ops
These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210920193947.10237-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21 13:24:51 +01:00
Shengjiu Wang 74b7ee0e7b
ASoC: fsl_xcvr: Fix channel swap issue with ARC
With pause and resume test for ARC, there is occasionally
channel swap issue. The reason is that currently driver set
the DPATH out of reset first, then start the DMA, the first
data got from FIFO may not be the Left channel.

Moving DPATH out of reset operation after the dma enablement
to fix this issue.

Fixes: 2856448686 ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1631265510-27384-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21 13:23:36 +01:00
Peter Rosin 3f4b57ad07
ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers
Commit 25d27c4f68 ("ASoC: pcm512x: Add support for more data formats")
breaks the TSE-850 device, which is using a pcm5142 in I2S and
CBM_CFS mode (maybe not relevant). Without this fix, the result
is:

pcm512x 0-004c: Failed to set data format: -16

And after that, no sound.

This fix is not 100% correct. The datasheet of at least the pcm5142
states that four bits (0xcc) in the I2S_1 register are "RSV"
("Reserved. Do not access.") and no hint is given as to what the
initial values are supposed to be. So, specifying defaults for
these bits is wrong. But perhaps better than a broken driver?

Fixes: 25d27c4f68 ("ASoC: pcm512x: Add support for more data formats")
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/2d221984-7a2e-7006-0f8a-ffb5f64ee885@axentia.se
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21 13:23:34 +01:00
Mark Brown cca46db7e2
Merge series "ASoC: compress: Support module_get on stream open" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

SOF is marking all componet drivers with module_get_upon_open = 1 which works
fine with normal PCM streams, however on compressed side the module get upon
open is not supported. The module_get works when module_get_upon_open is not set
becasue the snd_soc_component_module_get_when_probe() will pass NULL for the
substream parameter of snd_soc_component_module_get().

In order to re-use the existing infrastructure for module_get, the proposal is
to convert the mark_module to void pointer (like the pm mark) and implement
matching code for the compressed open/free to pcm open/close.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: soc-component: Convert the mark_module to void*
  ASoC: compress/component: Use module_get_when_open/put_when_close for
    cstream

 include/sound/soc-component.h | 14 ++++----
 sound/soc/soc-component.c     | 61 +++++++++++++++--------------------
 sound/soc/soc-compress.c      | 43 +++++++++++++++++++++---
 3 files changed, 71 insertions(+), 47 deletions(-)

--
2.33.0
2021-09-20 15:46:54 +01:00
Mark Brown 2a07ef63f5
Merge series "Extend AHUB audio support for Tegra210 and later" from Sameer Pujar <spujar@nvidia.com>:
Earlier as part of series [0], support for ADMAIF and I/O modules (such
as I2S, DMIC and DSPK) was added. This series aims at exposing some of
the AHUB internal modules (listed below), which can be used for audio
pre or post processing.

  * SFC (Sampling Frequency Converter)
  * MVC (Master Volume Control)
  * AMX (Audio Multiplexer)
  * ADX (Audio Demultiplexer)
  * Mixer

These modules can be plugged into audio paths and relevant processing
can be done. The MUX routes are extended to allow add or remove above
modules in the path via mixer controls. This is similar to how specific
ADMAIF channels are connected to relevant I/O module instances at the
moment.

Some of these modules can alter PCM parameters. Consider example of
resampler (44.1 -> 48 kHz) in the path.

  aplay(44.1 kHz) -> ADMAIF -> SFC -> (48 kHz) I2S -> (48kHz) Codec

The modules following SFC should be using converted sample rate and DAIs
need to be configured accordingly. The audio-graph driver provides a
mechanism to fixup the new parameters which can be specified in DT for a
given DAI. Then core uses these new values via fixup callback and then
pass it to respective DAIs hw_param() callback. The "convert-rate",
described in [1], property can be used when there is rate conversion in
the audio path. Similarly "convert-channels" can be used when there is
channel conversion in the path. There is no "convert-xxx" property for
sample size conversions. It can be added if necessary.

[0] https://www.lkml.org/lkml/2020/7/21/1357
[1] Documentation/devicetree/bindings/sound/audio-graph-port.yaml

Changelog
=========

v1 -> v2
--------
 * Put comments for soft reset application in the drivers.
 * Split out mute/volume control logic in put() calls of MVC driver and
   use separate callbacks for the respective kcontrols.
 * Update kcontrol put() callback in MVC driver to return 1 whenever
   there is change. Similar change is done in other drivers too.
 * Use name-prefix.yaml reference for the driver documentation now.
 * Add sound-name-prefix pattern for MIXER driver and use prefix
   accordingly in DT.

Sameer Pujar (13):
  ASoC: soc-pcm: Don't reconnect an already active BE
  ASoC: simple-card-utils: Increase maximum DAI links limit to 512
  ASoC: audio-graph: Fixup CPU endpoint hw_params in a BE<->BE link
  ASoC: dt-bindings: tegra: Few more Tegra210 AHUB modules
  ASoC: tegra: Add routes for few AHUB modules
  ASoC: tegra: Add Tegra210 based MVC driver
  ASoC: tegra: Add Tegra210 based SFC driver
  ASoC: tegra: Add Tegra210 based AMX driver
  ASoC: tegra: Add Tegra210 based ADX driver
  ASoC: tegra: Add Tegra210 based Mixer driver
  arm64: defconfig: Enable few Tegra210 based AHUB drivers
  arm64: tegra: Add few AHUB devices for Tegra210 and later
  arm64: tegra: Extend APE audio support on Jetson platforms

 .../bindings/sound/nvidia,tegra210-adx.yaml        |   76 +
 .../bindings/sound/nvidia,tegra210-ahub.yaml       |   20 +
 .../bindings/sound/nvidia,tegra210-amx.yaml        |   76 +
 .../bindings/sound/nvidia,tegra210-mixer.yaml      |   74 +
 .../bindings/sound/nvidia,tegra210-mvc.yaml        |   76 +
 .../bindings/sound/nvidia,tegra210-sfc.yaml        |   73 +
 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 1554 ++++++++-
 arch/arm64/boot/dts/nvidia/tegra186.dtsi           |  120 +
 arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 1493 +++++++-
 .../arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi | 1520 ++++++++-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi           |  116 +
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts |  876 +++++
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts |  876 +++++
 arch/arm64/boot/dts/nvidia/tegra210.dtsi           |   77 +
 arch/arm64/configs/defconfig                       |    5 +
 include/sound/simple_card_utils.h                  |    2 +-
 sound/soc/generic/audio-graph-card.c               |    4 +-
 sound/soc/soc-pcm.c                                |    4 +
 sound/soc/tegra/Kconfig                            |   48 +
 sound/soc/tegra/Makefile                           |   10 +
 sound/soc/tegra/tegra210_adx.c                     |  531 +++
 sound/soc/tegra/tegra210_adx.h                     |   72 +
 sound/soc/tegra/tegra210_ahub.c                    |  511 ++-
 sound/soc/tegra/tegra210_amx.c                     |  600 ++++
 sound/soc/tegra/tegra210_amx.h                     |   93 +
 sound/soc/tegra/tegra210_mixer.c                   |  674 ++++
 sound/soc/tegra/tegra210_mixer.h                   |  100 +
 sound/soc/tegra/tegra210_mvc.c                     |  645 ++++
 sound/soc/tegra/tegra210_mvc.h                     |  117 +
 sound/soc/tegra/tegra210_sfc.c                     | 3549 ++++++++++++++++++++
 sound/soc/tegra/tegra210_sfc.h                     |   78 +
 31 files changed, 13647 insertions(+), 423 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-adx.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-amx.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mixer.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-mvc.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra210-sfc.yaml
 create mode 100644 sound/soc/tegra/tegra210_adx.c
 create mode 100644 sound/soc/tegra/tegra210_adx.h
 create mode 100644 sound/soc/tegra/tegra210_amx.c
 create mode 100644 sound/soc/tegra/tegra210_amx.h
 create mode 100644 sound/soc/tegra/tegra210_mixer.c
 create mode 100644 sound/soc/tegra/tegra210_mixer.h
 create mode 100644 sound/soc/tegra/tegra210_mvc.c
 create mode 100644 sound/soc/tegra/tegra210_mvc.h
 create mode 100644 sound/soc/tegra/tegra210_sfc.c
 create mode 100644 sound/soc/tegra/tegra210_sfc.h

--
2.7.4
2021-09-20 15:46:53 +01:00
Wolfram Sang 0f9a84b20f
ASoC: codecs: max98390: simplify getting the adapter of a client
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20210918213553.14514-2-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 15:46:40 +01:00
Peter Ujfalusi 5374b9215d
ASoC: Intel: boards: Update to modern clocking terminology
As part of the effort to remove our old APIs based on outdated terminology
update the Intel board drivers to use modern terminology.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20210920065508.7854-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 15:46:26 +01:00
Mark Brown ef92ed2623
ASoC: ab8500: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the ab8500 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210916141335.43818-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:38:11 +01:00
Peter Ujfalusi 600e0ae9aa
ASoC: SOF: Remove struct sof_ops_table and sof_get_ops() macro
sof_get_ops() is not used and the struct sof_ops_table is only used by that
macro.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210920064156.4763-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:38:10 +01:00
Jiapeng Chong cf21e114f6
ASoC: rt5682s: make rt5682s_aif2_dai_ops and rt5682s_soc_component_dev
This symbol is not used outside of rt5682s.c, so marks it static.

Fix the following sparse warning:

sound/soc/codecs/rt5682s.c:2848:39: warning: symbol
'rt5682s_soc_component_dev' was not declared. Should it be static?

sound/soc/codecs/rt5682s.c:2842:30: warning: symbol
'rt5682s_aif2_dai_ops' was not declared. Should it be static?

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1631955726-77693-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:38:09 +01:00
Sameer Pujar 05bb3d5ec6
ASoC: tegra: Add Tegra210 based Mixer driver
The Mixer supports mixing of up to ten 7.1 audio input streams and
generate five outputs (each of which can be any combination of the
ten input streams)

This patch registers Mixer driver with ASoC framework. The component
driver exposes DAPM widgets, routes and kcontrols for the device.
The DAI driver exposes Mixer interfaces, which can be used to connect
different components in the ASoC layer. Makefile and Kconfig support
is added to allow build the driver. It can be enabled in the DT via
"nvidia,tegra210-amixer" compatible binding.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-11-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:36 +01:00
Sameer Pujar a99ab6f395
ASoC: tegra: Add Tegra210 based ADX driver
The Audio Demultiplexer (ADX) block takes an input stream with up to
16 channels and demultiplexes it into four output streams of up to 16
channels each. A byte RAM helps to form output frames by any combination
of bytes from the input frame. Its design is identical to that of byte
RAM in the AMX except that the data flow direction is reversed.

This patch registers ADX driver with ASoC framework. The component driver
exposes DAPM widgets, routes and kcontrols for the device. The DAI driver
exposes ADX interfaces, which can be used to connect different components
in the ASoC layer. Makefile and Kconfig support is added to allow build
the driver. It can be enabled in the DT via "nvidia,tegra210-adx"
compatible binding.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-10-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:35 +01:00
Sameer Pujar 77f7df346c
ASoC: tegra: Add Tegra210 based AMX driver
The Audio Multiplexer (AMX) block can multiplex up to four input streams
each of which can have maximum 16 channels and generate an output stream
with maximum 16 channels. A byte RAM helps to form an output frame by
any combination of bytes from the input frames.

This patch registers AMX driver with ASoC framework. The component driver
exposes DAPM widgets, routes and kcontrols for the device. The DAI driver
exposes AMX interfaces, which can be used to connect different components
in the ASoC layer. Makefile and Kconfig support is added to allow build
the driver. It can be enabled in the DT via "nvidia,tegra210-amx" for
Tegra210 and Tegra186. For Tegra194 and later, "nvidia,tegra194-amx" can
be used.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-9-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:34 +01:00
Sameer Pujar b2f74ec53a
ASoC: tegra: Add Tegra210 based SFC driver
The Sampling Frequency Converter (SFC) converts the sampling frequency
of the input signal from one frequency to another. It supports sampling
frequency conversions of streams of up to two channels (stereo).

This patch registers SFC driver with ASoC framework. The component driver
exposes DAPM widgets, routes and kcontrols for the device. The DAI driver
exposes SFC interfaces, which can be used to connect different components
in the ASoC layer. Makefile and Kconfig support is added to allow build
the driver. It can be enabled in the DT via "nvidia,tegra210-sfc"
compatible binding.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-8-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:33 +01:00
Sameer Pujar e539891f96
ASoC: tegra: Add Tegra210 based MVC driver
The Master Volume Control (MVC) provides gain or attenuation to a digital
signal path. It can be used in input or output signal path for per-stream
volume control or it can be used as master volume control. The MVC block
has one input and one output. The input digital stream can be mono or
multi-channel (up to 7.1 channels) stream. An independent mute control is
also included in the MVC block.

This patch registers MVC driver with ASoC framework. The component driver
exposes DAPM widgets, routes and kcontrols for the device. The DAI driver
exposes MVC interfaces, which can be used to connect different components
in the ASoC layer. Makefile and Kconfig support is added to allow build
the driver. It can be enabled in the DT via "nvidia,tegra210-mvc"
compatible binding.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-7-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:32 +01:00
Sameer Pujar 94d486c2e5
ASoC: tegra: Add routes for few AHUB modules
Add routing support for following modules of AHUB:
 * SFC (Sampling Frequency Converter)
 * MVC (Master Volume Control)
 * AMX (Audio Multiplexer)
 * ADX (Audio Demultiplexer)
 * Mixer

These modules can be plugged into audio path as per the need using
routing controls similar to the already existing routes to I/O modules
such as I2S, DMIC and DSPK.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-6-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:31 +01:00
Sameer Pujar 30b428d02c
ASoC: audio-graph: Fixup CPU endpoint hw_params in a BE<->BE link
When multiple components are connected back to back in an audio path,
hw_param fixup may be required for CPU or Codec endpoint of BE<->BE
DAI links. Currently fixup support is available for Codec and this
commit adds similar feature for CPU endpoint of a BE<->BE link.

For example a resampler component can be plugged into an audio path.
  [ FE -> BE1 -> ... -> resampler -> ... BEn ]

The resampler DAI links can be:
  BEx (CPU)              -> resampler input (Codec)
  resampler output (CPU) -> BEy (Codec)

Thus input and output sample rate parameters for resampler can be
fixed up as per the resample requirement.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/1631551342-25469-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:29 +01:00
Sameer Pujar 0c25db3f76
ASoC: soc-pcm: Don't reconnect an already active BE
In some cases, multiple FE components have the same BE component in their
respective DPCM paths. One such example would be a mixer component, which
can receive two or more inputs and sends a mixed output. In such cases,
to avoid reconfiguration of already active DAI (mixer output DAI in this
case), check the BE stream state to filter out the redundancy.

In summary, allow connection of BE if the respective current stream state
is either NEW or CLOSED.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1631551342-25469-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:31:27 +01:00
Peter Ujfalusi cd46f38244
ASoC: compress/component: Use module_get_when_open/put_when_close for cstream
Currently the try_module_get() and module_put() is not possible for
compressed streams if the module_get_upon_open is set to 1 which means that\
the components are not protected in a same way as components when normal
audio is used.

SOF is setting module_get_upon_open to 1 for component drivers which works
correctly for audio stream but when compressed stream is used then the
module is not protected.

Convert the compress open and free operation to mimic the steps of it's
pcm counterpart to fix this issue.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210901095255.3617-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:30:18 +01:00
Peter Ujfalusi a739fdc262
ASoC: soc-component: Convert the mark_module to void*
The mark_module of the snd_soc_component is strict snd_pcm_substream type
which prevents it to be used by compressed streams.

Change the type to void* along with the snd_soc_component_module_get()
and snd_soc_component_module_put() to allow the same mark to be used by
compressed when it's module_get_upon_open is set to 1.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210901095255.3617-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-20 13:30:17 +01:00
Mark Brown 2266721938
Merge series "ASoC: SOF: ipc: Small cleanups for message handler functions" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

Rename the parameter for ipc_trace_message() to match it's content and use
%#x" for hexadecimal prints in remaining places.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: SOF: ipc: Clarify the parameter name for ipc_trace_message()
  ASoC: SOF: ipc: Print 0x prefix for errors in
    ipc_trace/stream_message()

 sound/soc/sof/ipc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--
2.33.0
2021-09-17 14:56:43 +01:00
Mark Brown 703ac1f2a5
ASoC: 88pm860x: Update to modern clocking terminology
As part of moving to remove the old style defines for the bus clocks update
the 88pm860x driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916140847.50900-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:17:48 +01:00
Peter Ujfalusi 0ed66cb7b6
ASoC: SOF: Rename sof_arch_ops to dsp_arch_ops
From the name sof_arch_ops one can not decipher that these ops are DSP
architecture ops.
Rename it to dsp_arch_ops and change also the macro to retrieve the DSP
architecture specific ops as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210916130308.7969-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:17:47 +01:00
Peter Ujfalusi f6b0c731a0
ASoC: SOF: ipc: Remove redundant error check from sof_ipc_tx_message_unlocked
If the snd_sof_dsp_send_msg() failed then we have already returned from
sof_ipc_tx_message_unlocked() with the error message.

There is no need to check if ret is really 0 after this and we can return
directly the return value from tx_wait_done()

At the same time make the remaining checks for error (ret) to match.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210916125725.25934-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:17:45 +01:00
Peter Ujfalusi b95b64510a
ASoC: SOF: ipc: Print 0x prefix for errors in ipc_trace/stream_message()
The dev_err() in ipc_trace_message() and ipc_stream_message() is missing
the 0x prefix for the hexadecimal number when printed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210917085823.27222-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:17:44 +01:00
Peter Ujfalusi 59fdde1d4e
ASoC: SOF: ipc: Clarify the parameter name for ipc_trace_message()
ipc_trace_message() receives the type not the ID.
Use the same naming as the ipc_stream_message() function: msg_type to
help the reader to follow the code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20210917085823.27222-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:17:43 +01:00
Peter Ujfalusi cfacfefd38
ASoC: SOF: trace: Omit error print when waking up trace sleepers
Do not print error message from snd_sof_trace_notify_for_error() when
possible sleeping trace work is woken up to flush the remaining debug
information.

This action by itself is not an error, it is just an action we take when
an error occurs to make sure that all information have been fed to the
userspace (if we have trace in use).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210917085108.25532-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:16:36 +01:00
Trevor Wu 3abe2eec87
ASoC: mediatek: mt8195: remove wrong fixup assignment on HDMITX
S24_LE params fixup is only required for DPTX.
Remove fixup ops assignment for HDMITX.

Fixes: 40d605df0a ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210917082805.30898-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-17 13:16:35 +01:00
Mark Brown f1291f41af
Merge series "ASoC: cs42l42: Implement Manual Type detection as fallback" from Vitaly Rodionov <vitalyr@opensource.cirrus.com>:
For some headsets CS42L42 autodetect mode is not working correctly.
They will be detected as unknown types or as headphones. According
to the CS42L42 datasheet, if the headset autodetect failed,
then the driver should switch to manual mode and perform a manual steps sequence.
These steps were missing in the current driver code. This patch will add manual
mode fallback steps in case autodetect failed. The default behavior is not affected,
manual mode runs only when autodetect failed.

Tested for regression with autodetect with all known headsets - no regression.
Tested with all headsets customers reported as false detected:
Gumdrop DropTech B1 - detected as headset OK
HUAWEI AM115 - detected as headset OK
UGREEN EP103 - detected as headset OK
HONOR AM116 - detected as headset OK

Stefan Binding (1):
  ASoC: cs42l42: Implement Manual Type detection as fallback

 sound/soc/codecs/cs42l42.c | 104 ++++++++++++++++++++++++++++++++-----
 sound/soc/codecs/cs42l42.h |  54 +++++++++++++++++++
 2 files changed, 146 insertions(+), 12 deletions(-)

--
2.25.1
2021-09-16 16:06:47 +01:00
Mark Brown 8e0850f98d
Merge series "ASoC: SOF: Clean up the probe support" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

The probe debug feature of SOF can be used to extract streams of data from a
given point of a pipeline for analysis.

The support is implemented by using the ALSA/ASoC compress support for the
capture stream, but the code can not be used by/for a normal compressed data
stream. It is a debug feature.

Merge the probe implementation in the core (compress.c/h and probe.c/h) into
one file: sof-probes.c/h

Rename the Intel HDA specific probe implementation from hda-compressc.c to
hda-probes.c

We also need to add IPC logging support for the probes messages and drop the
unused references to SOF compress to have reasonably clean code.

Regards,
Peter
---
Peter Ujfalusi (5):
  ASoC: SOF: ipc: Add probe message logging to ipc_log_header()
  ASoC: SOF: pcm: Remove non existent CONFIG_SND_SOC_SOF_COMPRESS
    reference
  ASoC: SOF: probe: Merge and clean up the probe and compress files
  ASoC: SOF: Intel: Rename hda-compress.c to hda-probes.c
  ASoC: SOF: sof-probes: Correct the function names used for
    snd_soc_cdai_ops

Ranjani Sridharan (1):
  ASoC: SOF: compress: move and export sof_probe_compr_ops

 sound/soc/sof/Makefile                        |   3 +-
 sound/soc/sof/compress.c                      | 147 ---------
 sound/soc/sof/compress.h                      |  32 --
 sound/soc/sof/core.c                          |   2 +-
 sound/soc/sof/debug.c                         |   2 +-
 sound/soc/sof/intel/Makefile                  |   2 +-
 sound/soc/sof/intel/hda-dai.c                 |  16 +-
 .../intel/{hda-compress.c => hda-probes.c}    |   0
 sound/soc/sof/ipc.c                           |  23 ++
 sound/soc/sof/pcm.c                           |   6 +-
 sound/soc/sof/probe.h                         |  85 ------
 sound/soc/sof/sof-priv.h                      |   5 -
 sound/soc/sof/{probe.c => sof-probes.c}       | 280 +++++++++++-------
 sound/soc/sof/sof-probes.h                    |  38 +++
 14 files changed, 248 insertions(+), 393 deletions(-)
 delete mode 100644 sound/soc/sof/compress.c
 delete mode 100644 sound/soc/sof/compress.h
 rename sound/soc/sof/intel/{hda-compress.c => hda-probes.c} (100%)
 delete mode 100644 sound/soc/sof/probe.h
 rename sound/soc/sof/{probe.c => sof-probes.c} (52%)
 create mode 100644 sound/soc/sof/sof-probes.h

--
2.33.0
2021-09-16 16:06:45 +01:00
Mark Brown 8461d7d83f
ASoC: au1x: Convert to modern terminology for DAI clocking
As part of retiring the old macros defining the DAI clocking mode in the
DAI format update the au1x drivers to use the new style macros.

Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:11:37 +01:00
Mark Brown 4a8cf938d5
ASoC: atmel: Convert to new style DAI format definitions
Convert the Atmel drivers to use the new style defines for clocking in DAI
formats.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Acked-by: Peter Rosin <peda@axentia.se>
2021-09-16 14:11:30 +01:00
Charles Keepax c6d1fa6c8f
misc: cs35l41: Remove unused pdn variable
Remove pdn variable that was made redundant in an earlier patch.

Fixes: c2f14cc2bc ("ASoC: cs35l41: Fix use of an uninitialised variable")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210916082346.12001-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:11:16 +01:00
Viorel Suman 243442bcd9
ASoC: SOF: imx8m: add SAI1 info
Add SAI1 instance to imx8m_dai array.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210916073725.359561-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:11:15 +01:00
Vitaly Rodionov 7a20dec45d
ASoC: cs42l42: Minor fix all errors reported by checkpatch.pl script
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210916110932.10293-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:11:14 +01:00
Peter Ujfalusi 3b4a673fa4
ASoC: SOF: core: Move probe work related code under a single if () branch
Relocate the INIT_WORK() at the same place where we schedule the work to
make the code simpler and easier to follow.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210916124902.24248-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:05:24 +01:00
Stefan Binding 1245181449
ASoC: cs42l42: Implement Manual Type detection as fallback
Some headsets are not detected correctly by Automatic Type Detection
on cs42l42. Instead, Manual Type Detection can be used to give a
more accurate value.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210916102750.9212-2-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:05:23 +01:00
Peter Ujfalusi 49efed5058
ASoC: SOF: sof-probes: Correct the function names used for snd_soc_cdai_ops
The snd_soc_cdai_ops have startup and shutdown callbacks defined unlike
the component callbacks where open and free is used.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:15 +01:00
Peter Ujfalusi f95b4152ad
ASoC: SOF: Intel: Rename hda-compress.c to hda-probes.c
The hda-compress.c is implementing the SOF probe support for intel HDA
platforms using compress API.

To avoid the confusion, rename it to reflect this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:14 +01:00
Peter Ujfalusi 7bbdda8009
ASoC: SOF: probe: Merge and clean up the probe and compress files
The probe debug functionality is implemented via compress support and it
was spread across two set of files:
probe.c/h
compress.c/h

Merge the two files into sof-probes.s/h and clean them up by removing
unused struct definitions, functions. We can also move most of the
functions static as they are only used internally.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:13 +01:00
Ranjani Sridharan 2dc51106cc
ASoC: SOF: compress: move and export sof_probe_compr_ops
sof_probe_compr_ops are not platform-specific. So move
it to common compress code and export the symbol. The
compilation of the common compress code is already dependent
on the selection of CONFIG_SND_SOC_SOF_DEBUG_PROBES, so no
need to check the Kconfig section for defining sof_probe_compr_ops
again.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:12 +01:00
Peter Ujfalusi 8a72072458
ASoC: SOF: pcm: Remove non existent CONFIG_SND_SOC_SOF_COMPRESS reference
The SND_SOC_SOF_COMPRESS is not valid Kconfig option, remove it.

At the same time remove the also the declaration of the non existent
sof_compressed_ops.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:11 +01:00
Peter Ujfalusi 4ba344dc79
ASoC: SOF: ipc: Add probe message logging to ipc_log_header()
Probe related messages are missing from the logging, for example the
PROBE_INIT would show up as:

ipc tx: 0xc0010000: unknown GLB command
ipc tx succeeded: 0xc0010000: unknown GLB command

Add code to handle  the probe messages to have human readable output

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:04:09 +01:00
Peter Ujfalusi 25766ee44f
ASoC: SOF: loader: Re-phrase the missing firmware error to avoid duplication
In case the firmware is missing we will have the following in the kernel
log:

1 | Direct firmware load for intel/sof/sof-tgl-h.ri failed with error -2
2 | error: request firmware intel/sof/sof-tgl-h.ri failed err: -2
3 | you may need to download the firmware from https://github.com/thesofproject/sof-bin/
4 | error: failed to load DSP firmware -2
5 | error: sof_probe_work failed err: -2

The first line is the standard, request_firmware() warning.
The second and third line is printed in snd_sof_load_firmware_raw()
Note that the first and second line is mostly identical.

With this patch the log will be changed to:
1 | Direct firmware load for intel/sof/sof-tgl-h.ri failed with error -2
2 | error: sof firmware file is missing, you might need to
3 |        download it from https://github.com/thesofproject/sof-bin/
4 | error: failed to load DSP firmware -2
5 | error: sof_probe_work failed err: -2

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210916085342.29993-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:01:55 +01:00
Marc Herbert 8a8e1813ff
ASoC: SOF: loader: release_firmware() on load failure to avoid batching
Invoke release_firmware() when the firmware fails to boot in
sof_probe_continue().

The request_firmware() framework must be informed of failures in
sof_probe_continue() otherwise its internal "batching"
feature (different from caching) cached the firmware image
forever. Attempts to correct the file in /lib/firmware/ were then
silently and confusingly ignored until the next reboot. Unloading the
drivers did not help because from their disconnected perspective the
firmware had failed so there was nothing to release.

Also leverage the new snd_sof_fw_unload() function to simplify the
snd_sof_device_remove() function.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210916085008.28929-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-16 14:01:54 +01:00
Stefan Binding 94d508fa31 ALSA: hda/cs8409: Setup Dolphin Headset Mic as Phantom Jack
Dell's requirement to have headset mic as phantom jack on this
specific dolphin hardware platform.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210916095646.7631-1-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-16 12:24:46 +02:00
Alexey Dobriyan be830389bd ALSA: pcxhr: "fix" PCXHR_REG_TO_PORT definition
The following preprocessor directive is non-compliant:

	#undef PCXHR_REG_TO_PORT(x)

gcc warns about extra tokens but nobody sees them as they are under if
branch which is never parsed.

Make it an #error, it is not clear to me what the author meant.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Link: https://lore.kernel.org/r/YUCCv47sm4zf9OVO@localhost.localdomain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-16 11:09:04 +02:00
Peter Ujfalusi bde4f08cff
ASoC: SOF: debug: No need to export the snd_sof_debugfs_io_item()
The snd_sof_debugfs_io_item() only used within debug.c, no need to export
it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:09 +01:00
Peter Ujfalusi 55dfc2a74d
ASoC: SOF: loader: Use the generic ops for region debugfs handling
Do not access the sdev->bar[] directly to make the code generic, use the
new generic ops for handing the regions for debugfs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:08 +01:00
Peter Ujfalusi fe509b34b7
ASoC: SOF: Intel: Provide debugfs_add_region_item ops for core
Set the generic iomem callback for debugfs_add_region_item to avoid
regression when the core switches to use the generic interface for
the regions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:07 +01:00
Peter Ujfalusi ff2f99b078
ASoC: SOF: imx: Provide debugfs_add_region_item ops for core
Set the generic iomem callback for debugfs_add_region_item to avoid
regression when the core switches to use the generic interface for
the regions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:06 +01:00
Peter Ujfalusi 07e833b473
ASoC: SOF: debug: Add generic API and ops for DSP regions
Add new debugfs_add_region_item along with a generic wrapper
snd_sof_debugfs_add_region_item() to abstract away the DSP regions related
debugfs support.

At the same commit add iomem based generic implementation for the new ops

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:05 +01:00
Peter Ujfalusi 4624bb2f03
ASoC: SOF: core: Do not use 'bar' as parameter for block_read/write
The use of bar in the core poses limits on the portability of the code
to other, non iomapped platforms.
To make the API more generic, remove the use of 'bar' as parameter
for the block copy API.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:04 +01:00
Peter Ujfalusi 4ff134e2f9
ASoC: SOF: loader: No need to export snd_sof_fw_parse_ext_data()
snd_sof_fw_parse_ext_data() is used only internally within loader.c and
there is no need to export it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:03 +01:00
Peter Ujfalusi 098a68f2c5
ASoC: SOF: imx: Do not initialize the snd_sof_dsp_ops.read64
The read64 operation is not used by IMX along with other IO functions.
No need to set it for the ops.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:02 +01:00
Peter Ujfalusi b295818346
ASoC: SOF: ipc: Remove snd_sof_dsp_mailbox_init()
The snd_sof_dsp_mailbox_init() is called only from sof_get_windows()
to set the sdev->dsp_box.offset/size and sdev->host_box.offset/size

Instead of using a function, set the offsets and sizes like we do for the
other boxes in sof_get_windows().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:01 +01:00
Peter Ujfalusi 6375dbdbde
ASoC: SOF: Intel: bdw: Set the mailbox offset directly in bdw_probe
To align with other platforms, set only the sdev->dsp_box.offset in
bdw_probe().
The mailbox offset must be set in order to be able to receive the firmware
ready message.

The offsets and sizes will be re-configured after the FW ready message
based on the window information.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:25:00 +01:00
Peter Ujfalusi d9be4a88c3
ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types
i.MX8 only uses SOF_FW_BLK_TYPE_IRAM (1) and SOF_FW_BLK_TYPE_SRAM (3)
bars, everything else is left as 0 in sdev->bar[] array.

If a broken or purposefully crafted firmware image is loaded with other
types of FW_BLK_TYPE then a kernel crash can be triggered.

Make sure that only IRAM/SRAM type is converted to bar index.

Fixes: afb93d7165 ("ASoC: SOF: imx: Add i.MX8M HW support")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:23:49 +01:00
Peter Ujfalusi 10d93a9819
ASoC: SOF: imx: imx8: Bar index is only valid for IRAM and SRAM types
i.MX8 only uses SOF_FW_BLK_TYPE_IRAM (1) and SOF_FW_BLK_TYPE_SRAM (3)
bars, everything else is left as 0 in sdev->bar[] array.

If a broken or purposefully crafted firmware image is loaded with other
types of FW_BLK_TYPE then a kernel crash can be triggered.

Make sure that only IRAM/SRAM type is converted to bar index.

Fixes: 202acc565a ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210915122116.18317-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 16:23:48 +01:00
Mark Brown 87427e9f43
Merge series "ASoC: SOF: Remove unused members from struct sof_dev_desc" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

dma_engine, dma_size and resindex_dma_base is unused from sof_dev_desc, drop
them.

resindex_dma_base is initialized to -1 for Intel platforms, but it is not used.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: SOF: intel: Do no initialize resindex_dma_base
  ASoC: SOF: Drop resindex_dma_base, dma_engine, dma_size from
    sof_dev_desc

 include/sound/sof.h           | 5 -----
 sound/soc/sof/intel/pci-apl.c | 2 --
 sound/soc/sof/intel/pci-cnl.c | 3 ---
 sound/soc/sof/intel/pci-icl.c | 2 --
 sound/soc/sof/intel/pci-tgl.c | 5 -----
 sound/soc/sof/intel/pci-tng.c | 1 -
 6 files changed, 18 deletions(-)

--
2.33.0
2021-09-15 16:12:29 +01:00
Mark Brown dde9ad0ead
Merge series "ASoC: SOF: Intel: hda: Cleanups for local function uses" from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,

Small cleanups regarding to HDA function locations and dropping of definitions
of not implemented functions.

Regards,
Peter
---
Peter Ujfalusi (3):
  ASoC: SOF: Intel: hda-dsp: Declare locally used functions as static
  ASoC: SOF: Intel: hda: Remove boot_firmware skl and iccmax_icl
    declarations
  ASoC: SOF: Intel: hda: Relocate inline definitions from hda.h to hda.c
    for sdw

 sound/soc/sof/intel/hda-dsp.c | 61 +++++++++++++++++------------------
 sound/soc/sof/intel/hda.c     | 33 ++++++++++++++++++-
 sound/soc/sof/intel/hda.h     | 41 -----------------------
 3 files changed, 62 insertions(+), 73 deletions(-)

--
2.33.0
2021-09-15 16:12:27 +01:00
Mark Brown f40569693b
Merge series "Support ALC5682I-VS codec" from Brent Lu <brent.lu@intel.com>:
Support the ALC5682I-VS codec in Intel's rt5682 machine driver with
three board configurations.

Brent Lu (4):
  ASoC: Intel: sof_rt5682: support ALC5682I-VS codec
  ASoC: intel: sof_rt5682: support jsl_rt5682s_rt1015p board
  ASoC: intel: sof_rt5682: support jsl_rt5682s_rt1015 board
  ASoC: intel: sof_rt5682: support jsl_rt5682s_mx98360a board

 sound/soc/intel/boards/Kconfig                |   1 +
 sound/soc/intel/boards/sof_rt5682.c           | 105 +++++++++++++++---
 .../intel/common/soc-acpi-intel-jsl-match.c   |  24 ++++
 3 files changed, 112 insertions(+), 18 deletions(-)

--
2.25.1
2021-09-15 16:12:26 +01:00
Charles Keepax 4295c8cc17
ASoC: cs35l41: Fix a bunch of trivial code formating/style issues
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:35 +01:00
Charles Keepax 3e60abeb5c
ASoC: cs35l41: Fixup the error messages
It is not idiomatic for ASoC to print the function name in the error
messages, however it is expected to show the return code. Update the
error messages to follow these conventions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:34 +01:00
Charles Keepax e371eadf2a
ASoC: cs35l41: Don't overwrite returned error code
In multiple places the driver overwrites the error code returned with
a static error code, this is not helpful for debugging. Update to pass
the error codes straight through.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:33 +01:00
Charles Keepax fe1024d504
ASoC: cs35l41: Combine adjacent register writes
cs35l41 is often connected over I2C which is a very slow bus, as such
timings can be greatly improved combining writes where acceptable.
Update several points where the driver does multiple register writes
when a single one would suffice.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:32 +01:00
Charles Keepax 3a2eb0b4b0
ASoC: cs35l41: Use regmap_read_poll_timeout to wait for OTP boot
Just clean up the code a little by using the helper rather than open
coding waiting for OTP_BOOT_DONE.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:31 +01:00
Charles Keepax c2f14cc2bc
ASoC: cs35l41: Fix use of an uninitialised variable
The loop checking PDN_DONE doesn't check the return value from
regmap_read, nor does it initialise val. This means if regmap_read fails
val will be checked for the PDN_DONE bit whilst being uninitialised.

Fix this up by switching to regmap_read_poll_timeout which tidies up the
code and avoids the uninitialised variable.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:30 +01:00
Trevor Wu 6d66c5ccf5
ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow
mt6359-sound is a MFD driver. Because its regmap is retrieved from its
parent, it shouldn't be freed in mt6359-sound driver.

snd_soc_component_exit_regmap() will do regmap_exit(), this results in
unexpected results if sound card unregister flow is invoked when users
try to bind/unbind audio codec.

Remove the usage of snd_soc_component_exit_regmap(). Instead, set
component->regmap = NULL in the component remove function.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210915034659.25044-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:29 +01:00
Peter Ujfalusi 96ec174106
ASoC: SOF: loader: load_firmware callback is mandatory, treat it like that
Since the load_firmware callback in snd_sof_dsp_ops is mandatory and it
is tested during probe.

Move the snd_sof_load_firmware() wrapper to ops.h as inline and drop the
check of sof_ops(sdev)->load_firmware

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210914125356.19828-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:28 +01:00
Colin Ian King ce3f935763
ASoC: mediatek: mt8195: make array adda_dai_list static const
Don't populate the array adda_dai_list on the stack but instead it
static const. Also makes the object code smaller by 33 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  28271	  11640	      0	  39911	   9be7	mt8195/mt8195-dai-adda.o

After:
   text	   data	    bss	    dec	    hex	filename
  28142	  11736	      0	  39878	   9bc6	mt8195/mt8195-dai-adda.o

(gcc version 11.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210915105027.10805-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:27 +01:00
Bixuan Cui b2fc2c92d2
ASoC: mediatek: mt8195: Add missing of_node_put()
The platform_node is returned by of_parse_phandle() should have
of_node_put() before return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210911081246.33867-1-cuibixuan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:12:26 +01:00
Peter Ujfalusi 3e9d5b0952
ASoC: SOF: Intel: hda: Relocate inline definitions from hda.h to hda.c for sdw
Move the only locally needed inline functions to hda.c when
CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE is not enabled to make the header file
less cluttered with information no needed to be there.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210915071805.5704-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:11:20 +01:00
Peter Ujfalusi cf813f6792
ASoC: SOF: Intel: hda: Remove boot_firmware skl and iccmax_icl declarations
hda_dsp_cl_boot_firmware_iccmax_icl and hda_dsp_cl_boot_firmware_skl is
no longer backed with an implementation, remove them from the hda.h

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210915071805.5704-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:11:19 +01:00
Peter Ujfalusi 189bf1deee
ASoC: SOF: Intel: hda-dsp: Declare locally used functions as static
The following functions can be made static as they are only used locally:
hda_dsp_core_reset_enter
hda_dsp_core_reset_leave
hda_dsp_core_stall_reset
hda_dsp_core_power_up
hda_dsp_core_power_down
hda_dsp_core_is_enabled

The hda_dsp_ipc_int_disable is also only used within hda-dsp.c, but for
symmetry for hda_dsp_ipc_int_enable (used by hda-loader.c) leave it as it
is.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210915071805.5704-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:11:18 +01:00
Peter Ujfalusi 7e7d5ffa37
ASoC: SOF: intel: Do no initialize resindex_dma_base
.resindex_dma_base is not used by the code and in all instances it is set
to -1.
To make it possible to remove it from the sof_dev_desc struct, first remove
all references from the intel drivers (initialization).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210915065541.1178-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:10:12 +01:00
Brent Lu e224ef76fa
ASoC: intel: sof_rt5682: support jsl_rt5682s_mx98360a board
This patch adds driver data for two MAX98360A speaker amplifiers on SSP1
and one ALC5682I-VS headphone codec on SSP0 for JSL platform.

Topology is leveraged from jsl_rt5682_mx98360a since the capability of
two ALC5682 variants is the same.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210914101847.778688-5-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:09:07 +01:00
Brent Lu 04afb621f9
ASoC: intel: sof_rt5682: support jsl_rt5682s_rt1015 board
This patch adds driver data for two ALC1015Q-CG speaker amplifiers on
SSP1 and one ALC5682I-VS headphone codec on SSP0 for JSL platform.

Topology is leveraged from jsl_rt5682_rt1015 since the capability of
two ALC5682 variants is the same.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210914101847.778688-4-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:09:06 +01:00
Brent Lu 46414bc325
ASoC: intel: sof_rt5682: support jsl_rt5682s_rt1015p board
This patch adds driver data for two ALC1015Q-VB speaker amplifiers on
SSP1 and one ALC5682I-VS headphone codec on SSP0 for JSL platform.

Topology is leveraged from jsl_rt5682_rt1015p since the capability of
two ALC5682 variants is the same.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210914101847.778688-3-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:09:05 +01:00
Brent Lu 9a50d6090a
ASoC: Intel: sof_rt5682: support ALC5682I-VS codec
Add a new quirk SOF_RT5682S_HEADPHONE_CODEC_PRESENT to support
ALC5682I-VS headphone codec which driver is a new one, rt5682s, with
new macros and functions.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210914101847.778688-2-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:09:04 +01:00
Yong Zhi ac4dfccb96
ASoC: SOF: Fix DSP oops stack dump output contents
Fix @buf arg given to hex_dump_to_buffer() and stack address used
in dump error output.

Fixes: e657c18a01 ('ASoC: SOF: Add xtensa support')
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210915063230.29711-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15 13:07:51 +01:00
Cameron Berkenpas ad7cc2d41b ALSA: hda/realtek: Quirks to enable speaker output for Lenovo Legion 7i 15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 laptops.
This patch initializes and enables speaker output on the Lenovo Legion 7i
15IMHG05, Yoga 7i 14ITL5/15ITL5, and 13s Gen2 series of laptops using the
HDA verb sequence specific to each model.

Speaker automute is suppressed for the Lenovo Legion 7i 15IMHG05 to avoid
breaking speaker output on resume and when devices are unplugged from its
headphone jack.

Thanks to: Andreas Holzer, Vincent Morel, sycxyc, Max Christian Pohle and
all others that helped.

[ minor coding style fixes by tiwai ]

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208555
Signed-off-by: Cameron Berkenpas <cam@neo-zeon.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210913212627.339362-1-cam@neo-zeon.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-14 11:09:17 +02:00
Takashi Iwai 7b9cf90366 ALSA: usb-audio: Unify mixer resume and reset_resume procedure
USB-audio driver assumes that the normal resume would preserve the
device configuration while reset_resume wouldn't, and tries to restore
the mixer elements only at reset_resume callback.  However, this seems
too naive, and some devices do behave differently, resetting the
volume at the normal resume; this resulted in the inconsistent volume
that surprised users.

This patch changes the mixer resume code to handle both the normal and
reset resume in the same way, always restoring the original mixer
element values.  This allows us to unify the both callbacks as well as
dropping the no longer used reset_resume field, which ends up with a
good code reduction.

A slight behavior change by this patch is that now we assign
restore_mixer_value() as the default resume callback, and the function
is no longer called at reset-resume when the resume callback is
overridden by the quirk function.  That is, if needed, the quirk
resume function would have to handle similarly as
restore_mixer_value() by itself.

Reported-by: En-Shuo Hsu <enshuo@chromium.org>
Cc: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Link: https://lore.kernel.org/r/CADDZ45UPsbpAAqP6=ZkTT8BE-yLii4Y7xSDnjK550G2DhQsMew@mail.gmail.com
Link: https://lore.kernel.org/r/20210910105155.12862-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-13 15:00:31 +02:00
Takashi Iwai 6f44578430 Revert "ALSA: hda: Drop workaround for a hang at shutdown again"
This reverts commit 8fc8e90315.

It was expected that the fixes in HD-audio codec side would make the
workaround redundant, but unfortunately it doesn't seem sufficing.
Resurrect the workaround for now.

Fixes: 8fc8e90315 ("ALSA: hda: Drop workaround for a hang at shutdown again")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210913124330.24530-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-13 14:54:37 +02:00
Mark Brown 1e5dd2b9d6
Merge series "Patches to update for rockchip pdm" from Sugar Zhang <sugar.zhang@rock-chips.com>:
These patches fixup or update for rockchip pdm.

Changes in v4:
- Acked by Rob Herring

Changes in v3:
- Fix property 'path-map' suggested by Rob Herring.

Changes in v2:
- Fix yamllint errors.

Sugar Zhang (7):
  ASoC: rockchip: Add support for rv1126 pdm
  ASoC: dt-bindings: rockchip: Add binding for rv1126 pdm
  ASoC: rockchip: pdm: Add support for rk3568 pdm
  ASoC: dt-bindings: rockchip: Add binding for rk3568 pdm
  ASoC: rockchip: pdm: Add support for path map
  ASoC: dt-bindings: rockchip: pdm: Document property
    'rockchip,path-map'
  ASoC: dt-bindings: rockchip: Convert pdm bindings to yaml

 .../devicetree/bindings/sound/rockchip,pdm.txt     |  46 --------
 .../devicetree/bindings/sound/rockchip,pdm.yaml    | 120 +++++++++++++++++++++
 sound/soc/rockchip/rockchip_pdm.c                  | 112 +++++++++++++++++--
 sound/soc/rockchip/rockchip_pdm.h                  |   6 ++
 4 files changed, 232 insertions(+), 52 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/rockchip,pdm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,pdm.yaml

--
2.7.4
2021-09-13 11:24:04 +01:00
Mark Brown a13a228e52
Merge series "Cirrus Logic CS35L41 Amplifier" from David Rhodes <drhodes@opensource.cirrus.com>:
ASoC driver and devicetree documentation for a new
Cirrus Logic amplifier CS35L41

v7 changes:
Remove property 'classh-bst-max-limit'

David Rhodes (2):
  ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
  ASoC: cs35l41: Add bindings for CS35L41

 .../devicetree/bindings/sound/cs35l41.yaml    |  151 ++
 include/sound/cs35l41.h                       |   34 +
 sound/soc/codecs/Kconfig                      |   12 +
 sound/soc/codecs/Makefile                     |    4 +
 sound/soc/codecs/cs35l41-i2c.c                |  114 ++
 sound/soc/codecs/cs35l41-spi.c                |  143 ++
 sound/soc/codecs/cs35l41-tables.c             |  597 +++++++
 sound/soc/codecs/cs35l41.c                    | 1545 +++++++++++++++++
 sound/soc/codecs/cs35l41.h                    |  775 +++++++++
 9 files changed, 3375 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cs35l41.yaml
 create mode 100644 include/sound/cs35l41.h
 create mode 100644 sound/soc/codecs/cs35l41-i2c.c
 create mode 100644 sound/soc/codecs/cs35l41-spi.c
 create mode 100644 sound/soc/codecs/cs35l41-tables.c
 create mode 100644 sound/soc/codecs/cs35l41.c
 create mode 100644 sound/soc/codecs/cs35l41.h

--
2.25.1
2021-09-13 11:24:03 +01:00
Takashi Sakamoto 64794d6db4 ALSA: oxfw: fix transmission method for Loud models based on OXFW971
Loud Technologies Mackie Onyx 1640i (former model) is identified as
the model which uses OXFW971. The analysis of packet dump shows that
it transfers events in blocking method of IEC 61883-6, however the
default behaviour of ALSA oxfw driver is for non-blocking method.

This commit adds code to detect it assuming that all of loud models
based on OXFW971 have such quirk. It brings no functional change
except for alignment rule of PCM buffer.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210913021042.10085-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-09-13 07:31:58 +02:00
gearhead 0beeb33030
ASoC: pcm5102a: increase rate from 192k to 384k
the pcm5102a is capable of 384k, but the current code limits it to 192k.
This commit extends to 384k

Signed-off-by: gearhead <ys3al35l@gmail.com>
Link: https://lore.kernel.org/r/20210907210130.116769-1-ys3al35l@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:20 +01:00
Jack Yu 87f40af26c
ASoC: rt1011: add i2s reference control for rt1011
Add i2s reference control for rt1011 amp.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210906101208.11585-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:19 +01:00
Peter Ujfalusi 756bbe4205
ASoC: SOF: Handle control change notification from firmware
If the value/data associated with a control changes in SOF it will send a
notification (SOF_IPC_GLB_COMP_MSG with SOF_IPC_COMP_GET_VALUE/DATA).

We have support for binary volatile control type, but we might have
features where enum/switch/volume changes. Re-implementing everything as
volatile as well would be not much of a gain for several reasons:
- volatile controls would do an IPC all the time, regardless if there is a
  need or not.
- We still don't have notification which forces userspace to continuously
  poll.

When such notification arrives we use snd_ctl_notify_one() to signal
userspace about the change.

The kernel is prepared for two types of notification:
- the notification carries the new data for the control (num_elems != 0)
The new value/data is copied to the control's local data

- blank message about a change
The new flag for the scontrol (comp_data_dirty) is set and when next
time user space reads the value via the kcontrol's get callback we will
refresh the control's local data from the firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Tested-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Link: https://lore.kernel.org/r/20210903114018.2962-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:18 +01:00
Trevor Wu 2b9b42c847
ASoC: mt8195: remove unnecessary CONFIG_PM
The unnecessary conditional inclusion caused the following warning.

>> sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:3260:32: warning: unused
>> variable 'mt8195_afe_pm_ops' [-Wunused-const-variable]
   static const struct dev_pm_ops mt8195_afe_pm_ops = {
                                  ^
   1 warning generated.

Because runtime_pm already handles the case without CONFIG_PM, we
can remove CONFIG_PM condition.

Fixes: 6746cc8582 ("ASoC: mediatek: mt8195: add platform driver")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210902071440.6087-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:16 +01:00
Rander Wang 5767271861
ASoC: SOF: control: fix a typo in put operations for kcontrol
SOF_CTRL_TYPE_VALUE_CHAN_SET should be used for put operations
for consistency. The current use of _GET is obviously incorrect
but _GET and _SET result in the same action so there is no
functional change introduced by this patch.

Signed-off-by: Rander Wang <rander.wang@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210902114744.27237-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:16 +01:00
Shengjiu Wang b7bbbf0136
ASoC: fsl_rpmsg: add soc specific data structure
Each platform has different supported rates and
formats, so add soc specific data for each platform.
This soc specific data is attached with compatible string.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1630044038-19036-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:15 +01:00
Derek Fang bdd229ab26
ASoC: rt5682s: Add driver for ALC5682I-VS codec
This is an initial codec driver for Realtek ALC5682I-VS codec.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Signed-off-by: Derek Fang <derek.fang@realtek.com<mailto:derek.fang@realtek.com>>
Link: https://lore.kernel.org/r/20210831130258.19286-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:09 +01:00
Colin Ian King d67bbdda25
ASoC: mediatek: mt8195: Fix unused initialization of pointer etdm_data
The pointer etdm_data is being inintialized with a value that is never
read, it is later being re-assigned a new value. Remove the redundant
initialization.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210903114928.11743-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:08 +01:00
Masahiro Yamada 0f3dd4e09a
ASoC: ti: rename CONFIG_SND_SOC_DM365_VOICE_CODEC_MODULE
Kconfig generates include/generated/autoconf.h to make CONFIG options
available to the pre-processor. Symbols with the value 'm' are suffixed
with '_MODULE'

Here is a conflict; CONFIG_FOO=m results in '#define CONFIG_FOO_MODULE 1',
but CONFIG_FOO_MODULE=y also results in the same define.

Also, CONFIG options that end with '_MODULE' confuse the Kconfig/fixdep
interaction; fixdep always assumes CONFIG_FOO_MODULE comes from
CONFIG_FOO=m, so the dependency is not properly tracked for symbols
that end with '_MODULE'.

For these reasons, CONFIG options that end with '_MODULE' should be
avoided in general. (I am planning on adding a check in Kconfig.)

This is the only case in the current kernel.

The new option name was suggested by Péter Ujfalusi. [1]

[1] https://lore.kernel.org/all/d9e777dc-d274-92ee-4d77-711bfd553611@gmail.com/

Fixes: 147162f575 ("ASoC: ti: fix SND_SOC_DM365_VOICE_CODEC dependencies")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210901164009.1546967-1-masahiroy@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:07 +01:00
Pierre-Louis Bossart 6ade849e30
ASoC: SOF: core: allow module parameter to override dma trace Kconfig
Most distributions do not enable the SOF developer options and
specifically the DMA trace. This is problematic for end-user/community
support since the sof-logger tool cannot extract valuable information.

Conversely in rare cases the DMA trace can lead to Heisenbugs by
creating more traffic to system memory and more interrupts.

This patch changes the logic so that the Kconfig value is used as a
default value for a module parameter, but this value can be changed as
needed. Users can override the distro DMA trace selection.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210907184648.33306-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:06 +01:00
Cai Huoqing c6b1b57469
ASoC: mediatek: mt8195: Make use of the helper function devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210901132742.31714-1-caihuoqing@baidu.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:05 +01:00
Peter Ujfalusi 8facf84bcf
ASoC: soc-topology: Move template info print soc_tplg_dapm_widget_create()
A DAPM widget now can have different types of controls, it is no longer
correct to print the type as it is just the type of the first control.

Move it after the loop where we create the controls and print the number
of the control types.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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>
Link: https://lore.kernel.org/r/20210902112301.22657-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:04 +01:00
Pierre-Louis Bossart 198433023e
ASoC: amd: acp: declare and add prefix to 'bt_uart_enable' symbol
Sparse reports the following warning:

sound/soc/amd/acp-pcm-dma.c:39:6: error: symbol 'bt_uart_enable' was
not declared. Should it be static?

It's not very good practice to export such symbols that can easily
conflict, add the acp_ prefix and add declaration in header file.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210907184216.33067-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:03 +01:00
Sebastian Andrzej Siewior c3815f8bc7
ASoC: mediatek: mt8195: Remove unsued irqs_lock.
irqs_lock is not used, never was.

Remove irqs_lock.

Fixes: 283b612429 ("ASoC: mediatek: implement mediatek common structure")
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20210910094847.3430413-1-bigeasy@linutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:59:02 +01:00
David Rhodes 6450ef5590
ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
SoC Audio driver for the Cirrus Logic CS35L41 amplifier

Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210907225719.2018115-2-drhodes@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:45:11 +01:00
Sugar Zhang 13e6e042a6
ASoC: rockchip: pdm: Add support for path map
This patch adds property 'rockchip,path-map' for path mapping.

e.g.

"rockchip,path-map = <3 2 1 0>" means the mapping as follows:

  path0 <-- sdi3
  path1 <-- sdi2
  path2 <-- sdi1
  path3 <-- sdi0

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1630675410-3354-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-13 01:44:10 +01:00