linux.git
18 months agoASoC: Intel: avs: Allow for dumping FW_REGS area
Cezary Rojewski [Fri, 2 Dec 2022 15:28:40 +0000 (16:28 +0100)]
ASoC: Intel: avs: Allow for dumping FW_REGS area

SRAM0 window begins with a block of memory, usually of size PAGE_SIZE,
dedicated to the base firmware registers. When debugging firmware, it is
desirable to be able to dump them at will.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-16-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Gather remaining logs on strace_release()
Cezary Rojewski [Fri, 2 Dec 2022 15:28:39 +0000 (16:28 +0100)]
ASoC: Intel: avs: Gather remaining logs on strace_release()

When user closes the tracer, some logs may still remain in the tail of
the buffer as firmware sends LOG_BUFFER_STATUS notification only when
certain threshold of data is reached. Add whatever is left to already
gathered logs so no information is lost.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-15-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Probing and firmware tracing over debugfs
Cezary Rojewski [Fri, 2 Dec 2022 15:28:38 +0000 (16:28 +0100)]
ASoC: Intel: avs: Probing and firmware tracing over debugfs

Define debugfs subdirectory delegated for IPC communication with DSP.
Input format: uint,uint,(...) which are later translated into DWORDS
sequence and further into instances of struct of interest given the IPC
type.

For Extractor probes, following have been enabled:
- PROBE_POINT_ADD (echo <..> probe_points)
- PROBE_POINT_REMOVE (echo <..> probe_points_remove)
- PROBE_POINT_INFO (cat probe_points)

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-14-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Add probe machine board
Cezary Rojewski [Fri, 2 Dec 2022 15:28:37 +0000 (16:28 +0100)]
ASoC: Intel: avs: Add probe machine board

Stub machine board driver with no custom DAPM routes and single FE DAI
link for userspace to interact with.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-13-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Data probing soc-component
Cezary Rojewski [Fri, 2 Dec 2022 15:28:36 +0000 (16:28 +0100)]
ASoC: Intel: avs: Data probing soc-component

Define stub component for data probing. Stub as most operations from
standard PCM case do not apply here. Specific bits are CPU DAIs and
compress_ops. FE DAIs can link against these new CPU DAI to create new
compress devices.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Probe compress operations
Cezary Rojewski [Fri, 2 Dec 2022 15:28:35 +0000 (16:28 +0100)]
ASoC: Intel: avs: Probe compress operations

Add compress operations handlers for data extraction through probes. A
single HDAudio stream is enlisted for said purpose. Operations follow
same protocol as for standard PCM streaming on HOST side.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Add data probing requests
Cezary Rojewski [Fri, 2 Dec 2022 15:28:34 +0000 (16:28 +0100)]
ASoC: Intel: avs: Add data probing requests

Data probing is a cAVS firmware functionality that allows for data
extraction and injection directly from or to DMA stream. To support it,
new functions and types are added. These facilitate communication
with the firmware.

Total of eight IPCs:
- probe module initialization and cleanup
- addition and removal of probe points
- addition and removal of injection DMAs
- dumping list of currently connected probe points or enlisted DMAs

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Drop usage of debug members in non-debug code
Cezary Rojewski [Fri, 2 Dec 2022 15:28:33 +0000 (16:28 +0100)]
ASoC: Intel: avs: Drop usage of debug members in non-debug code

Switch to debug-context aware wrappers instead of accessing debug
members directly allowing for readable separation of debug and non-debug
related code. Duplicates are removed along the way.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Make enable_logs() dependent on DEBUG_FS
Cezary Rojewski [Fri, 2 Dec 2022 15:28:32 +0000 (16:28 +0100)]
ASoC: Intel: avs: Make enable_logs() dependent on DEBUG_FS

Without debug filesystem present, this code is redundant.
Operations: log_buffer_status and log_buffer_offset are left as is as
EXCEPTION_CAUGHT and even unexpected LOG_BUFFER_STATUS notifications may
occur without user ever touching debugfs.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Introduce debug-context aware helpers
Cezary Rojewski [Fri, 2 Dec 2022 15:28:31 +0000 (16:28 +0100)]
ASoC: Intel: avs: Introduce debug-context aware helpers

Debug-related fields and log-dumping are useful when debugfs is enabled.
Define them under CONFIG_DEBUG_FS and provide stubs when the config is
disabled so that the code that makes use of these needs not to be
complicated unnecessarily.

Members that are duplicated by this patch will be removed by the follow
up changes.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Drop fifo_lock
Cezary Rojewski [Fri, 2 Dec 2022 15:28:30 +0000 (16:28 +0100)]
ASoC: Intel: avs: Drop fifo_lock

Log gathering is already locked, thanks to ->trace_lock.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Introduce avs_log_buffer_status_locked()
Cezary Rojewski [Fri, 2 Dec 2022 15:28:29 +0000 (16:28 +0100)]
ASoC: Intel: avs: Introduce avs_log_buffer_status_locked()

Simplify locking of firmware log gathering by providing single location
for such purpose.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221202152841.672536-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoALSA: hda: Interrupt servicing and BDL setup for compress streams
Cezary Rojewski [Fri, 2 Dec 2022 15:28:28 +0000 (16:28 +0100)]
ALSA: hda: Interrupt servicing and BDL setup for compress streams

Account for compress streams when receiving and servicing buffer
completed interrupts. In case of compress stream enlisting hdac_stream
for data transfer, setup BDL entries much like it is the case for PCM
streams.

Signed-off-by: Divya Prakash <divya1.prakash@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20221202152841.672536-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoALSA: hda: Prepare for compress stream support
Cezary Rojewski [Fri, 2 Dec 2022 15:28:27 +0000 (16:28 +0100)]
ALSA: hda: Prepare for compress stream support

Before introducing compress specific changes, adjust BDL and parameters
setup functions so these are not tightly coupled with PCM streams.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20221202152841.672536-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoALSA: hda: Allow for compress stream to hdac_ext_stream assignment
Cezary Rojewski [Fri, 2 Dec 2022 15:28:26 +0000 (16:28 +0100)]
ALSA: hda: Allow for compress stream to hdac_ext_stream assignment

Currently only PCM streams can enlist hdac_stream for their data
transfer. Add cstream field to hdac_ext_stream to expose possibility of
compress stream assignment in place of PCM one.
Limited to HOST-type only as there no other users on the horizon.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20221202152841.672536-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC/tda998x: Fix reporting of nonexistent capture streams
Mark Brown [Sun, 4 Dec 2022 17:01:50 +0000 (17:01 +0000)]
ASoC/tda998x: Fix reporting of nonexistent capture streams

Merge series from Mark Brown <broonie@kernel.org>:

The recently added pcm-test selftest has pointed out that systems with
the tda998x driver end up advertising that they support capture when in
reality as far as I can see the tda998x devices are transmit only.  The
DAIs registered through hdmi-codec are bidirectional, meaning that for
I2S systems when combined with a typical bidrectional CPU DAI the
overall capability of the PCM is bidirectional.  In most cases the I2S
links will clock OK but no useful audio will be returned which isn't so
bad but we should still not advertise the useless capability, and some
systems may notice problems for example due to pinmux management.

This is happening due to the hdmi-codec helpers not providing any
mechanism for indicating unidirectional audio so add one and use it in
the tda998x driver.  It is likely other hdmi-codec users are also
affected but I don't have those systems to hand.

Mark Brown (2):
  ASoC: hdmi-codec: Allow playback and capture to be disabled
  drm: tda99x: Don't advertise non-existent capture support

 drivers/gpu/drm/i2c/tda998x_drv.c |  2 ++
 include/sound/hdmi-codec.h        |  4 ++++
 sound/soc/codecs/hdmi-codec.c     | 30 +++++++++++++++++++++++++-----
 3 files changed, 31 insertions(+), 5 deletions(-)

base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
--
2.30.2

18 months agodrm: tda99x: Don't advertise non-existent capture support
Mark Brown [Wed, 30 Nov 2022 18:46:44 +0000 (18:46 +0000)]
drm: tda99x: Don't advertise non-existent capture support

As far as I can tell none of the tda998x devices support audio capture so
don't advertise support for it, ensuring that we don't confuse userspace.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20221130184644.464820-3-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: hdmi-codec: Allow playback and capture to be disabled
Mark Brown [Wed, 30 Nov 2022 18:46:43 +0000 (18:46 +0000)]
ASoC: hdmi-codec: Allow playback and capture to be disabled

Currently the hdmi-codec driver always registers both playback and capture
capabilities but for most systems there's no actual capture capability,
usually HDMI is transmit only. Provide platform data which allows the users
to indicate what is supported so that we don't end up advertising things
to userspace that we can't actually support.

In order to avoid breaking existing users the flags in platform data are
a bit awkward and specify what should be disabled rather than doing the
perhaps more expected thing and defaulting to not supporting capture.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20221130184644.464820-2-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: da7219: Fix pole orientation detection on OMTP headsets when playing music
David Rau [Mon, 21 Nov 2022 05:07:44 +0000 (05:07 +0000)]
ASoC: da7219: Fix pole orientation detection on OMTP headsets when playing music

The OMTP pin define headsets can be mis-detected as line out
instead of OMTP, causing obvious issues with audio quality.
This patch is to put increased resistances within
the device at a suitable point.

To solve this issue better, the new mechanism setup
ground switches with conditional delay control
and these allow for more stabile detection process
to operate as intended. This conditional delay control
will not impact the hardware process
but use extra system resource.

This commit improves control of ground switches in the AAD logic.

Signed-off-by: David Rau <david.rau.zg@renesas.com>
Link: https://lore.kernel.org/r/20221121050744.2278-1-david.rau.zg@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: amd: yc: Add Xiaomi Redmi Book Pro 14 2022 into DMI table
Artem Lukyanov [Wed, 30 Nov 2022 08:52:47 +0000 (11:52 +0300)]
ASoC: amd: yc: Add Xiaomi Redmi Book Pro 14 2022 into DMI table

This model requires an additional detection quirk to enable the
internal microphone - BIOS doesn't seem to support AcpDmicConnected
(nothing in acpidump output).

Signed-off-by: Artem Lukyanov <dukzcry@ya.ru>
Link: https://lore.kernel.org/r/20221130085247.85126-1-dukzcry@ya.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: mediatek: add shutdown callback
Ricardo Ribalda [Sun, 27 Nov 2022 20:04:15 +0000 (21:04 +0100)]
ASoC: SOF: mediatek: add shutdown callback

If we do not shutdown the peripheral properly at shutdown, the whole system
crashes after kexec() on the first io access.

Let's implement the appropriate callback.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221127-mtk-snd-v1-0-b7886faa612b@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt5682: Refactor jack handling
Mark Brown [Tue, 29 Nov 2022 19:29:05 +0000 (19:29 +0000)]
ASoC: Intel: avs: rt5682: Refactor jack handling

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Leftover from recent series [1].
Following changes are proposed for the rt5682 sound card driver:

1) Move jack unassignment from platform_device->remove() to
   dai_link->exit(). This is done to make jack init and deinit flows
   symmetric
2) Remove platform_device->remove() function
3) Simplify card->suspend_pre() and card->resume_post() by making use of
   snd_soc_card_get_codec_dai() helper

18 months agoASoC: Intel: avs: rt5682: Refactor jack handling
Amadeusz Sławiński [Tue, 29 Nov 2022 18:07:38 +0000 (19:07 +0100)]
ASoC: Intel: avs: rt5682: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221129180738.2866290-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt5682: Add define for codec DAI name
Amadeusz Sławiński [Tue, 29 Nov 2022 18:07:37 +0000 (19:07 +0100)]
ASoC: Intel: avs: rt5682: Add define for codec DAI name

Following commits will make use of it to find codec DAI, define it
first.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221129180738.2866290-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
Zhang Qilong [Wed, 28 Sep 2022 16:04:02 +0000 (00:04 +0800)]
ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by going to
err_pm instead of err_clk.

Fixes:f086ba9d5389c ("ASoC: pcm512x: Support mastering BCLK/LRCLK using the PLL")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160402.126140-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: Refactor jack handling
Mark Brown [Tue, 29 Nov 2022 16:56:44 +0000 (16:56 +0000)]
ASoC: Intel: avs: Refactor jack handling

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

For all the boards included in this patchset, a similar set of changes
is proposed:

1) Move jack unassignment from platform_device->remove() to
   dai_link->exit(). This is done to make jack init and deinit flows
   symmetric
2) Remove platform_device->remove() function
3) Simplify card->suspend_pre() and card->resume_post() by making use of
   snd_soc_card_get_codec_dai() helper

While bdw_rt286 board - which is utilized by the catpt-driver - is
definitely not part of "avs", same treatment applies. And thus decided
to make it part of this series instead of sending it separately.

18 months agoASoC: qcom: lpass-sc7180: Add maybe_unused tag for system PM ops
Srinivasa Rao Mandadapu [Tue, 29 Nov 2022 12:53:48 +0000 (18:23 +0530)]
ASoC: qcom: lpass-sc7180: Add maybe_unused tag for system PM ops

Add __maybe_unused tag for system PM ops suspend and resume.
This is required to fix allmodconfig compilation issue.

Fixes: a3a96e93cc88 ("ASoC: qcom: lpass-sc7280: Add system suspend/resume PM ops")
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Link: https://lore.kernel.org/r/1669726428-3140-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: Add DAI configuration support for AMD platforms.
V sujith kumar Reddy [Tue, 29 Nov 2022 10:00:59 +0000 (15:30 +0530)]
ASoC: SOF: Add DAI configuration support for AMD platforms.

Add support for configuring sp and hs DAI from topology.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20221129100102.826781-1-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Merge up fixes
Mark Brown [Tue, 29 Nov 2022 12:55:12 +0000 (12:55 +0000)]
ASoC: Merge up fixes

Merge the fixes branch up so we can apply further AMD work.

18 months agoASoC: Intel: avs: rt298: Refactor jack handling
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:30 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt298: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt298: Add define for codec DAI name
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:29 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt298: Add define for codec DAI name

Following commits will make use of it to find codec DAI, define it
first.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt286: Refactor jack handling
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:28 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt286: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt286: Add define for codec DAI name
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:27 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt286: Add define for codec DAI name

Following commits will make use of it to find codec DAI, define it
first.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt274: Refactor jack handling
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:26 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt274: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: rt274: Refer to DAI name through a constant
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:25 +0000 (19:40 +0100)]
ASoC: Intel: avs: rt274: Refer to DAI name through a constant

There is existing define for codec DAI name, make use of it when setting
codec DAI name.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: nau8825: Refactor jack handling
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:24 +0000 (19:40 +0100)]
ASoC: Intel: avs: nau8825: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: avs: da7219: Refactor jack handling
Amadeusz Sławiński [Fri, 25 Nov 2022 18:40:23 +0000 (19:40 +0100)]
ASoC: Intel: avs: da7219: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: Intel: bdw_rt286: Refactor jack handling
Cezary Rojewski [Fri, 25 Nov 2022 18:40:22 +0000 (19:40 +0100)]
ASoC: Intel: bdw_rt286: Refactor jack handling

Use link->exit() rather than pdev->remove() to unassign jack during card
unbind procedure so codec link initialization and exit procedures are
symmetrical.

Also, there is no need to perform search for codec dai in suspend_pre()
and resume_post() ourselves. Use snd_soc_card_get_codec_dai() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221125184032.2565979-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: qcom: lpass-sc7180: Delete redundant error log from _resume()
Matthias Kaehlcke [Tue, 29 Nov 2022 00:16:54 +0000 (00:16 +0000)]
ASoC: qcom: lpass-sc7180: Delete redundant error log from _resume()

sc7180_lpass_dev_resume() logs an error if clk_bulk_prepare_enable()
fails. The clock framework already generates error logs if anything
goes wrong, so the logging in _resume() is redundant, drop it.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20221129001633.v2.1.I8d1993f41f0da1eac0ecba321678ac489f9c0b9b@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: qcom: lpass-sc7280: Add system suspend/resume PM ops
Srinivasa Rao Mandadapu [Tue, 29 Nov 2022 06:36:24 +0000 (12:06 +0530)]
ASoC: qcom: lpass-sc7280: Add system suspend/resume PM ops

Update lpass sc7280 platform driver with PM ops, such as
system supend and resume callbacks.
This update is required to disable clocks during supend and
avoid XO shutdown issue.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Rahul Ajmeriya <quic_rajmeriy@quicinc.com>
Link: https://lore.kernel.org/r/1669703784-27589-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: mediatek: mt8173: Enable IRQ when pdata is ready
Ricardo Ribalda [Mon, 28 Nov 2022 10:49:16 +0000 (11:49 +0100)]
ASoC: mediatek: mt8173: Enable IRQ when pdata is ready

If the device does not come straight from reset, we might receive an IRQ
before we are ready to handle it.

Fixes:

[    2.334737] Unable to handle kernel read from unreadable memory at virtual address 00000000000001e4
[    2.522601] Call trace:
[    2.525040]  regmap_read+0x1c/0x80
[    2.528434]  mt8173_afe_irq_handler+0x40/0xf0
...
[    2.598921]  start_kernel+0x338/0x42c

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Fixes: ee0bcaff109f ("ASoC: mediatek: Add AFE platform driver")
Link: https://lore.kernel.org/r/20221128-mt8173-afe-v1-0-70728221628f@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: Rework Qualcomm APR/GPR Sound nodes for SM8450
Mark Brown [Mon, 28 Nov 2022 16:38:18 +0000 (16:38 +0000)]
ASoC: dt-bindings: Rework Qualcomm APR/GPR Sound nodes for SM8450

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Adding sound support for Qualcomm SM8450 SoC (and later for SC8280XP) brought
some changes to APR/GPR services bindings.  These bindings are part of
qcom,apr.yaml:

  apr-or-gpr-device-node <- qcom,apr.yaml
    apr-gpr-service@[0-9] <- qcom,apr.yaml
      service-specific-components <- /schemas/sound/qcom,q6*.yaml

The schema for services (apr-gpr-service@[0-9]) was not complete and is still
quite not specific.  It allows several incorrect combinations, like adding a
clock-controller to a APM device.  Restricting it would complicate the schema
even more.  Bringing new support for sound on Qualcomm SM8450 and SC8280XP SoC
would grow it as well.

Refactor the bindings before extending them for Qualcomm SM8450 SoC.

18 months agoASoC: qcom: lpass-sc7180: Add system suspend/resume PM ops
Srinivasa Rao Mandadapu [Mon, 28 Nov 2022 07:49:02 +0000 (13:19 +0530)]
ASoC: qcom: lpass-sc7180: Add system suspend/resume PM ops

Update lpass sc7180 platform driver with PM ops, such as
system supend and resume callbacks.
This update is required to disable clocks during supend and
avoid XO shutdown issue.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Rahul Ajmeriya <quic_rajmeriy@quicinc.com>
Link: https://lore.kernel.org/r/1669621742-28524-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt5640: Fix Jack work after system suspend
Oder Chiou [Mon, 28 Nov 2022 07:08:25 +0000 (15:08 +0800)]
ASoC: rt5640: Fix Jack work after system suspend

We found an corner case in RT5640 codec driver which schedules jack work
after system suspend as IRQ was enabled. Due to this, hitting the error
as register access happening after suspend as jack worker thread getting
scheduled in irq handler. The patch disables the irq during the suspend
to prevent the corner case happening.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Reported-by: Mohan Kumar D <mkumard@nvidia.com>
Link: https://lore.kernel.org/r/20221128070825.91215-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: Drop obsolete dependency on COMPILE_TEST
Jean Delvare [Sun, 27 Nov 2022 18:35:49 +0000 (19:35 +0100)]
ASoC: SOF: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20221127193549.211bf8f7@endymion.delvare
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: max9867: Implement exact integer mode
Pavel Dobias [Wed, 23 Nov 2022 15:38:18 +0000 (16:38 +0100)]
ASoC: max9867: Implement exact integer mode

For 8kHz and 16kHz sample rates and certain PCLK values
the codec can be programmed to operate in exact integer
mode. If available, use it to achieve the exact sample rate.

Signed-off-by: Pavel Dobias <dobias@2n.com>
Link: https://lore.kernel.org/r/20221123153818.24650-1-dobias@2n.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rsnd: adg: use __clk_get_name() instead of local clk_name[]
Kuninori Morimoto [Mon, 28 Nov 2022 05:46:28 +0000 (05:46 +0000)]
ASoC: rsnd: adg: use __clk_get_name() instead of local clk_name[]

Current rsnd_adg_clk_dbg_info() is using locak clk_name[] to ndicating
clk name, but we don't want to use local clk_name[] everywhere when we
support R-Car Gen4 sound to handling non compatible clk naming.

This patch uses __clk_get_name() instead of local clk_name[] for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8mz8wcs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: sdw-mockup: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:32 +0000 (16:54 +0000)]
ASoC: sdw-mockup: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt715: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:31 +0000 (16:54 +0000)]
ASoC: rt715: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-8-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt711: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:30 +0000 (16:54 +0000)]
ASoC: rt711: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt700: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:29 +0000 (16:54 +0000)]
ASoC: rt700: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt5682-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:28 +0000 (16:54 +0000)]
ASoC: rt5682-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt1316-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:27 +0000 (16:54 +0000)]
ASoC: rt1316-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rt1308-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:26 +0000 (16:54 +0000)]
ASoC: rt1308-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: max98373-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:25 +0000 (16:54 +0000)]
ASoC: max98373-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agosound: sdw: Add hw_params to SoundWire config helper function
Charles Keepax [Wed, 23 Nov 2022 16:54:24 +0000 (16:54 +0000)]
sound: sdw: Add hw_params to SoundWire config helper function

The vast majority of the current users of the SoundWire framework
have almost identical code for converting from hw_params to SoundWire
configuration. Whilst complex devices might require more, it is very
likely that most new devices will follow the same pattern. Save a
little code by factoring this out into a helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221123165432.594972-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rsnd: Drop obsolete dependency on COMPILE_TEST
Jean Delvare [Sun, 27 Nov 2022 18:34:41 +0000 (19:34 +0100)]
ASoC: rsnd: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20221127193441.0b54484d@endymion.delvare
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: amd: ADD HS and SP virtual DAI.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:10 +0000 (17:49 +0530)]
ASoC: SOF: amd: ADD HS and SP virtual DAI.

ADD HS and SP virtual DAI driver to support AMD platforms.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20221123121911.3446224-4-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: amd: Fix for selecting clock source as external clock.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:09 +0000 (17:49 +0530)]
ASoC: SOF: amd: Fix for selecting clock source as external clock.

By default clock source is selected as internal clock of 96Mhz
which is not configurable. Now we select the clock source to
external clock (ACLK) which can be configurable to different clock
ranges depending on usecase.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20221123121911.3446224-3-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: SOF: amd: Fix for reading position updates from stream box.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:08 +0000 (17:49 +0530)]
ASoC: SOF: amd: Fix for reading position updates from stream box.

By default the position updates are read from dsp box when streambox
size is not defined.if the streambox size is defined to some value
then position updates can be read from the streambox.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20221123121911.3446224-2-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6apm: Add SM8450 bedais node
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:35 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6apm: Add SM8450 bedais node

On SM8450 and SC8280XP, the Q6APM is a bit different:
1. It is used as a platform DAI link, so it needs #sound-dai-cells.
2. It has two DAI children, so add new "bedais" node.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-12-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6apm-lpass-dais: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:34 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6apm-lpass-dais: Split to separate schema

The Qualcomm DSP LPASS Audio DAIs are a bit different than Qualcomm DSP
Audio FrontEnd (Q6AFE) DAIs - they do not use children nodes for each
DAI.  None of other properties from qcom,q6dsp-lpass-ports.yaml apply
here as well, so move the qcom,q6apm-lpass-dais compatible to its own
binding.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6core: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:33 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6core: Split to separate schema

The APR/GPR bindings with services got complicated so move out the
Q6Core service to its own binding.  Previously the compatible was
documented in qcom,apr.yaml.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6prm: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:32 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6prm: Split to separate schema

The APR/GPR bindings with services got complicated so move out the Q6PRM
service to its own binding.  Previously the compatible was documented in
qcom,apr.yaml.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6asm: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:31 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6asm: Split to separate schema

The APR/GPR bindings with services got complicated so move out the Q6ASM
service to its own binding.  Previously the compatible was documented in
qcom,apr.yaml.  Move most of the examples from its children to this new
file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6adm: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:30 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6adm: Split to separate schema

The APR/GPR bindings with services got complicated so move out the Q6ADM
service to its own binding.  Previously the compatible was documented in
qcom,apr.yaml.  Move most of the examples from its children to this new
file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6apm: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:29 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6apm: Split to separate schema

The APR/GPR bindings with services got complicated so move out the Q6APM
service to its own binding.  Previously the compatible was documented in
qcom,apr.yaml.  Move most of the examples from its children to this new
file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,q6afe: Split to separate schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:28 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,q6afe: Split to separate schema

The APR/GPR bindings with services got complicated so move out the Q6AFE
service to its own binding.  Previously the compatible was documented in
qcom,apr.yaml.  Move most of the examples from its children to this new
file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,apr: Correct and extend example
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:27 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,apr: Correct and extend example

Correct the APR/GPR example:
1. Use consistent 4-space indentation,
2. Add required properties to services nodes, so the binding check
   passes once schema for these services is improved,
3. Add few other properties as APR/GPR is part of a GLINK edge:
   qcom,glink-channels and qcom,intents.
4. Drop unnecessary services, to make the example compact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,apr: Split services to shared schema
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:26 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,apr: Split services to shared schema

The APR/GPR nodes are organized like:

  apr-or-gpr-device-node <- qcom,apr.yaml
    apr-gpr-service@[0-9] <- qcom,apr.yaml
      service-specific-components <- /schemas/sound/qcom,q6*.yaml

The schema for services (apr-gpr-service@[0-9]) already grows
considerably and is still quite not specific.  It allows several
incorrect combinations, like adding a clock-controller to a APM device.
Restricting it would complicate the schema even more.  Bringing new
support for sound on Qualcomm SM8450 and SC8280XP SoC would grow it as
well.

Simplify the qcom,apr.yaml by splitting the services to a shared file
which will be:
1. Referenced by qcom,apr.yaml with additionalProperties:true,
2. Referenced by specific bindings for services with
   additionalProperties:false (not yet in this commit).

While moving the code, add also required 'reg' and
'qcom,protection-domain' to further constrain the bindings.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: qcom,apr: Add GLINK channel name for SM8450
Krzysztof Kozlowski [Tue, 15 Nov 2022 12:02:25 +0000 (13:02 +0100)]
ASoC: dt-bindings: qcom,apr: Add GLINK channel name for SM8450

On SM8450 and SC8280XP with Qualcomm GPR, the GLINK channel name
(qcom,glink-channels) for ADSP is "adsp_apps".

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221115120235.167812-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoRK3588 Audio Support
Mark Brown [Fri, 25 Nov 2022 21:39:20 +0000 (21:39 +0000)]
RK3588 Audio Support

Merge series from Nicolas Frattaroli <frattaroli.nicolas@gmail.com>:

This patchset refactors the Rockchip I2S/TDM driver in order to
support the RK3588 SoC, and then adds the necessary compatible
string to load the driver for it.

Patch 1 rectifies a problem with the bindings where we were too
strict about requiring the rockchip,grf property. Most features
of this audio device don't need access to the GRF to function.

Patch 2 modifies the driver to adjust its behaviour to what the
changed bindings now allow, namely using most things without the
GRF.

Patch 3 and 4 are boring compatible string stuff that enables
RK3588 support. No special data is needed to initialise the
driver for this instance of the I2S/TDM IP.

18 months agoASoC: adau1372: fixes after debugging custom board
Mark Brown [Fri, 25 Nov 2022 21:26:21 +0000 (21:26 +0000)]
ASoC: adau1372: fixes after debugging custom board

Merge series from Maarten Zanders <maarten.zanders@mind.be>:

A collection of fixes and improvements for the adau1372 driver.

18 months agoASoC: adau1372: add support for S24_LE mode
Maarten Zanders [Fri, 28 Oct 2022 15:26:24 +0000 (17:26 +0200)]
ASoC: adau1372: add support for S24_LE mode

The ADAU1372 contains 24bit ADCs and DACs. Allow the driver to use
its native mode which uses the same settings as the current 32 bit
mode.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028152626.109603-3-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: adau1372: correct PGA enable & mute bit
Maarten Zanders [Fri, 28 Oct 2022 15:26:25 +0000 (17:26 +0200)]
ASoC: adau1372: correct PGA enable & mute bit

The DAPM control for PGAx uses the PGA mute bit for
power management. This bit is active high but is set to
non-inverted (ie when powering, it will mute).
The ALSA control "PGA x Capture Switch" uses the active
high PGA_ENx bit, but is set to inverted. So when
enabling this switch, the PGA gets disabled.

To correct the behaviour, invert both these bits.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028152626.109603-4-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: adau1372: fix mclk
Maarten Zanders [Fri, 28 Oct 2022 15:26:23 +0000 (17:26 +0200)]
ASoC: adau1372: fix mclk

"mclk" is retrieved from the configuration and assigned to adau1372->clk.
However adau1372->mclk (==NULL) is used for clk_prepare_enable() and
clk_disable_unprepare() which don't have any effect.

Remove .clk from struct adau1372 and use .mclk throughout.
This change ensures that the input clock is switched on/off when the
bias level is changed.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028152626.109603-2-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
Jiasheng Jiang [Wed, 16 Nov 2022 03:07:50 +0000 (11:07 +0800)]
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd

As the mtk_btcvsd_snd_write and mtk_btcvsd_snd_read may return error,
it should be better to catch the exception.

Fixes: 4bd8597dc36c ("ASoC: mediatek: add btcvsd driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20221116030750.40500-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: wcd9335: fix reset line polarity in example
Dmitry Torokhov [Thu, 27 Oct 2022 07:46:48 +0000 (00:46 -0700)]
ASoC: dt-bindings: wcd9335: fix reset line polarity in example

When resetting the block, the reset line is being driven low and then
high, which means that the line in DTS should be annotated as "active
low".

Fixes: 1877c9fda1b7 ("ASoC: dt-bindings: add dt bindings for wcd9335 audio codec")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221027074652.1044235-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rockchip: i2s_tdm: Add support for RK3588
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:32 +0000 (14:41 +0200)]
ASoC: rockchip: i2s_tdm: Add support for RK3588

This adds support for the RK3588 SoC to the I2S/TDM driver.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20221025124132.399729-5-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:31 +0000 (14:41 +0200)]
ASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible

This adds the compatible string for the RK3588 SoC.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221025124132.399729-4-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: rockchip: i2s_tdm: Make the grf property optional
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:30 +0000 (14:41 +0200)]
ASoC: rockchip: i2s_tdm: Make the grf property optional

Only IO Multiplex and two TRCM modes need access to the GRF, so
making it a hard requirement is not a wise idea, as it complicates
support for newer SoCs which do not do these things.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20221025124132.399729-3-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:29 +0000 (14:41 +0200)]
ASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional

Turns out most things don't require the GRF, so making the property
optional is the obvious move.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221025124132.399729-2-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: cs42l51: Correct PGA Volume minimum value
Charles Keepax [Fri, 25 Nov 2022 16:23:48 +0000 (16:23 +0000)]
ASoC: cs42l51: Correct PGA Volume minimum value

The table in the datasheet actually shows the volume values in the wrong
order, with the two -3dB values being reversed. This appears to have
caused the lower of the two values to be used in the driver when the
higher should have been, correct this mixup.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221125162348.1288005-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agoASoC: ops: Correct bounds check for second channel on SX controls
Charles Keepax [Fri, 25 Nov 2022 16:23:47 +0000 (16:23 +0000)]
ASoC: ops: Correct bounds check for second channel on SX controls

Currently the check against the max value for the control is being
applied after the value has had the minimum applied and been masked. But
the max value simply indicates the number of volume levels on an SX
control, and as such should just be applied on the raw value.

Fixes: 97eea946b939 ("ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx()")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221125162348.1288005-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agofirmware: cs_dsp: Switch to using namespaced exports
Mark Brown [Fri, 25 Nov 2022 14:36:56 +0000 (14:36 +0000)]
firmware: cs_dsp: Switch to using namespaced exports

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Use EXPORT_SYMBOL_NS_GPL() instead of EXPORT_SYMBOL_GPL() and patch the
three drivers that use cs_dsp to add the MODULE_IMPORT_NS().

To make the namespace more specific the KConfig symbol for cs_dsp is
changed from CS_DSP to FW_CS_DSP.

18 months agoASoC/soundwire: revisit interrupt and lcount handling
Mark Brown [Fri, 25 Nov 2022 14:23:11 +0000 (14:23 +0000)]
ASoC/soundwire: revisit interrupt and lcount handling

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

The code in drivers/soundwire/intel_init.c is hardware-dependent and the
code does not apply to new generations starting with MeteorLake. Refactor
and clean-up the code to make this intel_init.c hardware-agnostic and
move all hardware-dependencies in the SOF driver using chip descriptors.

18 months agoASoC: wm_adsp: Report when a control write changes the value
Mark Brown [Fri, 25 Nov 2022 14:23:03 +0000 (14:23 +0000)]
ASoC: wm_adsp: Report when a control write changes the value

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Writing a firmware control should be returning 1 if the control value
changed, so these two patches add that.

Though this is an ALSA requirement it is also useful for non-ALSA clients
of cs_dsp to know if the control value changed, so the main handling is
implemented in cs_dsp. TLV controls are specifically an ALSA thing so they
are handled specially in wm_adsp.

Simon Trimmer (2):
  firmware: cs_dsp: cs_dsp_coeff_write_ctrl() should report changed
  ASoC: wm_adsp: Return whether changed when writing controls

 drivers/firmware/cirrus/cs_dsp.c | 17 ++++++++++++-----
 sound/soc/codecs/wm_adsp.c       | 27 ++++++++++++++++++---------
 2 files changed, 30 insertions(+), 14 deletions(-)

--
2.30.2

18 months agofirmware: cs_dsp: Make the exports namespaced
Richard Fitzgerald [Thu, 24 Nov 2022 13:45:56 +0000 (13:45 +0000)]
firmware: cs_dsp: Make the exports namespaced

Move all the exports into a namespace.
This also adds the MODULE_IMPORT_NS to the 3 drivers that use the
exported functions.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221124134556.3343784-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
18 months agofirmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP
Richard Fitzgerald [Thu, 24 Nov 2022 13:45:55 +0000 (13:45 +0000)]
firmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP

Qualify the KConfig symbol for cs_dsp by adding a FW_ prefix so that
it is more explicit what is being referred to. This is preparation for
using the symbol to namespace the exports.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221124134556.3343784-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: src4xxx-i2c: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:37 +0000 (23:45 +0100)]
ASoC: codecs: src4xxx-i2c: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221118224540.619276-604-uwe@kleine-koenig.org
Reviewed-by: Matt Flax <flatmax@flatmax.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: max98396: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:36 +0000 (23:45 +0100)]
ASoC: max98396: Convert to i2c's .probe_new()

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221118224540.619276-603-uwe@kleine-koenig.org
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: tas2780: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:38 +0000 (23:45 +0100)]
ASoC: codecs: tas2780: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221118224540.619276-605-uwe@kleine-koenig.org
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: codecs: es8326: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:35 +0000 (23:45 +0100)]
ASoC: codecs: es8326: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221118224540.619276-602-uwe@kleine-koenig.org
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoMerge branch 'i2c/client_device_id_helper-immutable' of https://git.kernel.org/pub...
Mark Brown [Thu, 24 Nov 2022 19:20:09 +0000 (19:20 +0000)]
Merge branch 'i2c/client_device_id_helper-immutable' of https://git./linux/kernel/git/wsa/linux into HEAD

so we can apply I2C cleanups.

19 months agoASoC: mediatek: mt8186: Correct I2S shared clocks
Jiaxin Yu [Thu, 24 Nov 2022 02:30:50 +0000 (10:30 +0800)]
ASoC: mediatek: mt8186: Correct I2S shared clocks

In mt8186 platform, I2S2 should be the main I2S port that provide
the clock, on the contrary I2S3 should be the second I2S port that
use this clock.

Fixes: 9986bdaee477 ("ASoC: mediatek: mt8186: Configure shared clocks")
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221124023050.4470-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: dt-bindings: add compatible string for NAU8318
David Lin [Thu, 24 Nov 2022 05:56:58 +0000 (13:56 +0800)]
ASoC: dt-bindings: add compatible string for NAU8318

The audio amplifier NAU8318 is almost functionally identical to NAU8315.
Adds compatible string "nuvoton,nau8318" for driver reuse.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20221124055658.53828-2-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: nau8315: add new acpi id and compatible id
David Lin [Thu, 24 Nov 2022 05:56:57 +0000 (13:56 +0800)]
ASoC: nau8315: add new acpi id and compatible id

Add new acpi id and compatible id for nau8315.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20221124055658.53828-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: qcom: cleanup and fix dependency of QCOM_COMMON
Srinivas Kandagatla [Thu, 24 Nov 2022 14:03:51 +0000 (14:03 +0000)]
ASoC: qcom: cleanup and fix dependency of QCOM_COMMON

SND_SOC_QCOM_COMMON depends on SOUNDWIRE for some symbols but this
is not explicitly specified using Kconfig depends. On the other hand
SND_SOC_QCOM_COMMON is also directly selected by the sound card
Kconfigs, this could result in various combinations and some symbols
ending up in modules and soundcard that uses those symbols as in-build
driver.

Fix these issues by explicitly specifying the dependencies of
SND_SOC_QCOM_COMMON and also use imply a to select SND_SOC_QCOM_COMMON
so that the symbol is selected based on its dependencies.

Also remove dummy stubs in common.c around CONFIG_SOUNDWIRE

Fixes: 3bd975f3ae0a ("ASoC: qcom: sm8250: move some code to common")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221124140351.407506-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: qcom: Add checks for devm_kcalloc
Yuan Can [Thu, 24 Nov 2022 14:05:10 +0000 (14:05 +0000)]
ASoC: qcom: Add checks for devm_kcalloc

As the devm_kcalloc may return NULL, the return value needs to be checked
to avoid NULL poineter dereference.

Fixes: 24caf8d9eb10 ("ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221124140510.63468-1-yuancan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
19 months agoASoC: Merge dropped fixes from v5.18
Mark Brown [Thu, 24 Nov 2022 13:19:02 +0000 (13:19 +0000)]
ASoC: Merge dropped fixes from v5.18

These fixes were queued for v5.18 but due to me changing my scripting
they never actually got merged - pulling them up now.