linux-2.6-block.git
11 months agoALSA: azt3328: Replace with __packed attribute
Takashi Iwai [Wed, 25 Oct 2023 13:23:07 +0000 (15:23 +0200)]
ALSA: azt3328: Replace with __packed attribute

Replace the old __attribute__((packed)) with the new __packed.
Only cleanup, no functional changes.

Link: https://lore.kernel.org/r/20231025132314.5878-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: rawmidi: Replace with __packed attribute
Takashi Iwai [Wed, 25 Oct 2023 13:23:06 +0000 (15:23 +0200)]
ALSA: rawmidi: Replace with __packed attribute

Replace the old __attribute__((packed)) with the new __packed.
Only cleanup, no functional changes.

Link: https://lore.kernel.org/r/20231025132314.5878-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: pcm: Replace with __packed attribute
Takashi Iwai [Wed, 25 Oct 2023 13:23:05 +0000 (15:23 +0200)]
ALSA: pcm: Replace with __packed attribute

Replace the old __attribute__((packed)) with the new __packed.
Only cleanup, no functional changes.

Link: https://lore.kernel.org/r/20231025132314.5878-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: control: Replace with __packed attribute
Takashi Iwai [Wed, 25 Oct 2023 13:23:04 +0000 (15:23 +0200)]
ALSA: control: Replace with __packed attribute

Replace the old __attribute__((packed)) with the new __packed.
Only cleanup, no functional changes.

Link: https://lore.kernel.org/r/20231025132314.5878-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: Make return of remove_late void, too
Takashi Iwai [Mon, 23 Oct 2023 15:36:05 +0000 (17:36 +0200)]
ASoC: SOF: Make return of remove_late void, too

Like the change we've done for remove callback, the newly introduced
remove_late callback should be changed to void return, too.

Fixes: 17baaa1f950b ("ASoC: SOF: core: Add probe_early and remove_late callbacks")
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231023153605.863-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoMAINTAINERS: ALSA: change mailing list to linux-sound on vger
Jaroslav Kysela [Fri, 20 Oct 2023 07:12:47 +0000 (09:12 +0200)]
MAINTAINERS: ALSA: change mailing list to linux-sound on vger

As discussed on alsa-devel mailing list [1], it is useful to have an open
mailing list to avoid moderation delays for the kernel patch work. Use
linux-sound mailing list for kernel driver related threads.

In the first stage, change the list for the ALSA core, ASoC and tests.

[1] https://lore.kernel.org/alsa-devel/20231019-posture-cache-fe060b@meerkat/

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Acked-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://lore.kernel.org/r/20231020071247.973909-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoMerge tag 'asoc-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Sat, 21 Oct 2023 07:49:15 +0000 (09:49 +0200)]
Merge tag 'asoc-v6.7' of https://git./linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.7

This is quite a large set of changes but mostly due to API cleanups and
in driver specific ways rather than due to anything subsystem wide.
Highlights include:

 - Standardisation of API prefixes on snd_soc_, removing asoc_.
 - GPIO API usage improvements.
 - Support for HDA patches.
 - Lots of work on SOF, including crash dump support.
 - Support for AMD platforms with es83xx, Awinc AT87390, many Intel
   platforms, many Mediatek platforms, Qualcomm SM6115,  Richtek RTQ9128
   and Texas Instruments TAS575x.

[ the merge conflicts around SOF Intel HD-audio and CS35L41 subcodec
  drivers are resolved here -- tiwai ]

11 months agoASoC: Intel: more machine driver updates for 6.7
Mark Brown [Thu, 19 Oct 2023 20:02:18 +0000 (21:02 +0100)]
ASoC: Intel: more machine driver updates for 6.7

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Two nice cleanups from Brent Lu and Charles Keepax, and one RaptorLake
update.

11 months agoASoC: Intel: sof_ssp_amp: use common module for DMIC links
Brent Lu [Thu, 19 Oct 2023 17:34:11 +0000 (12:34 -0500)]
ASoC: Intel: sof_ssp_amp: use common module for DMIC links

Use intel_board module for dmic01 and dmic16k DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_rt5682: use common module for DMIC links
Brent Lu [Thu, 19 Oct 2023 17:34:10 +0000 (12:34 -0500)]
ASoC: Intel: sof_rt5682: use common module for DMIC links

Use intel_board module for dmic01 and dmic16k DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_nau8825: use common module for DMIC links
Brent Lu [Thu, 19 Oct 2023 17:34:09 +0000 (12:34 -0500)]
ASoC: Intel: sof_nau8825: use common module for DMIC links

Use intel_board module for dmic01 and dmic16k DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_cs42l42: use common module for DMIC links
Brent Lu [Thu, 19 Oct 2023 17:34:08 +0000 (12:34 -0500)]
ASoC: Intel: sof_cs42l42: use common module for DMIC links

Use intel_board module for dmic01 and dmic16k DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: board_helpers: support dmic link initialization
Brent Lu [Thu, 19 Oct 2023 17:34:07 +0000 (12:34 -0500)]
ASoC: Intel: board_helpers: support dmic link initialization

Add functions for machine drivers to initialize dmic01 and dmic16k DAI
links.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_nau8825: add RPL support for MAX98360A amp
Terry Cheong [Thu, 19 Oct 2023 17:34:06 +0000 (12:34 -0500)]
ASoC: Intel: sof_nau8825: add RPL support for MAX98360A amp

Adding support back to RPL devices that lost audio after the RPL/ADL
split. The hardware configuration is:

SSP0: NAU88L25/NAU88L25YGB codec
SSP1: MAX98360A amplifier

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: intel: sof_sdw: Move the builtin microphones to dataport 1
Charles Keepax [Thu, 19 Oct 2023 17:34:05 +0000 (12:34 -0500)]
ASoC: intel: sof_sdw: Move the builtin microphones to dataport 1

cs42l43 supports 4 hardwired microphones, but only supports up to 2
microphone headsets. Only dataport 1 can support 4 channel capture,
but that is currently used for the headset microphone. Switch things
around such that DP1 is used for the builtin mics and DP2 is used for
the headset microphones.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: intel: sof_sdw_cs42l43: Create separate jacks for hp and mic
Charles Keepax [Thu, 19 Oct 2023 17:34:04 +0000 (12:34 -0500)]
ASoC: intel: sof_sdw_cs42l43: Create separate jacks for hp and mic

It makes sense to report the microphone separately from the headphones,
that way ALSA UCM can differentiate between switching the playback and
the capture. For example, still using the built-in microphone path when
a 3-pole headset is inserted.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: intel: sof_sdw_cs42l43: Some trivial formatting clean ups
Charles Keepax [Thu, 19 Oct 2023 17:34:03 +0000 (12:34 -0500)]
ASoC: intel: sof_sdw_cs42l43: Some trivial formatting clean ups

No functional change, just some trivial whitespace fixups.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: intel: sof_sdw: Stop processing CODECs when enough are found
Charles Keepax [Thu, 19 Oct 2023 17:34:02 +0000 (12:34 -0500)]
ASoC: intel: sof_sdw: Stop processing CODECs when enough are found

When adding CODECs to a DAI link, the code should stop processing more
CODECs when the expected number of CODECs are discovered. This fixes a
small corner case issue introduced when support for different devices
on the same SoundWire link was added. In the case of aggregated
devices everything is fine, as all devices intended for the DAI link
will be marked with the same group and any not intended for that DAI
are skipped by the group check. However for non-aggregated devices the
group check is bypassed and the current code does not stop after it
has found the first device. Meaning if additional non-aggregated devices
are present on the same SoundWire link they will be erroneously added
into the DAI link.

Fix this issue, and provide a small optimisation by ceasing to process
devices once we have reached the required number of devices for the
current DAI link.

Fixes: 317dcdecaf7a ("ASoC: intel: sof_sdw: Allow different devices on the same link")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231019173411.166759-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: tlv320aic31xx: switch to gpiod_set_value_cansleep
Marco Felsch [Thu, 19 Oct 2023 13:18:06 +0000 (15:18 +0200)]
ASoC: tlv320aic31xx: switch to gpiod_set_value_cansleep

Switch to gpiod_set_value_cansleep() to support gpiochips which can
sleep like i2c gpio expanders.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20231019131806.381280-1-m.felsch@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add
Mark Brown [Thu, 19 Oct 2023 13:46:48 +0000 (14:46 +0100)]
ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add

Merge series from xiazhengqiao <xiazhengqiao@huaqin.corp-partner.google.com>:

To use RT5650 as the codec and the amp, add a new
sound card named mt8186_rt5650.

11 months agoALSA: hda: i915: Remove extra argument from snd_hdac_i915_init
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:37 +0000 (13:54 +0200)]
ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init

Now that all drivers have moved from modprobe loading to
handling -EPROBE_DEFER, we can remove the argument again.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-14-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: Intel: Move binding to display driver outside of deferred probe
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:36 +0000 (13:54 +0200)]
ASoC: SOF: Intel: Move binding to display driver outside of deferred probe

Now that we can use -EPROBE_DEFER, it's no longer required to spin off
the snd_hdac_i915_init into a workqueue.

Use the -EPROBE_DEFER mechanism instead, which must be returned in the
probe function.

The previously added probe_early can be used for this,
and we also use the newly added remove_late for unbinding afterwards.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-13-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: Intel: Skylake: Move snd_hdac_i915_init to before probe_work.
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:35 +0000 (13:54 +0200)]
ASoC: Intel: Skylake: Move snd_hdac_i915_init to before probe_work.

Now that we can use -EPROBE_DEFER, it's no longer required to spin off
the snd_hdac_i915_init into a workqueue. It's likely the whole workqueue
can be destroyed, but I don't have the means to test this.

Removing the workqueue would simplify init even further, but is left
as exercise for the reviewer.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-12-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda: Intel: Move snd_hdac_i915_init to before probe_work.
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:34 +0000 (13:54 +0200)]
ALSA: hda: Intel: Move snd_hdac_i915_init to before probe_work.

Now that we can use -EPROBE_DEFER, it's no longer required to spin off
the snd_hdac_i915_init into a workqueue.

Use the -EPROBE_DEFER mechanism instead, which must be returned in the
probe function.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@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/20231009115437.99976-11-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work.
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:33 +0000 (13:54 +0200)]
ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work.

Now that we can use -EPROBE_DEFER, it's no longer required to spin off
the snd_hdac_i915_init into a workqueue. It's likely the whole workqueue
can be destroyed, but I don't have the means to test this.

Removing the workqueue would simplify init even further, but is left
as exercise for the reviewer.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-10-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda: i915: Allow xe as match for i915_component_master_match
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:32 +0000 (13:54 +0200)]
ALSA: hda: i915: Allow xe as match for i915_component_master_match

Xe is a new driver for intel GPU's that shares the sound related code
with i915.

The modprobe mechanism is being replaced by the -EPROBE_DEFER mechanism,
so we don't need to add a modprobe xe call. Adding this would have
required a telepathy module to correctly guess whether to load i915 or
xe.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-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>
Link: https://lore.kernel.org/r/20231009115437.99976-9-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda: i915: Add an allow_modprobe argument to snd_hdac_i915_init
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:31 +0000 (13:54 +0200)]
ALSA: hda: i915: Add an allow_modprobe argument to snd_hdac_i915_init

Xe is a new GPU driver that re-uses the display (and sound) code from
i915. It's no longer possible to load i915, as the GPU can be driven
by the xe driver instead.

The new behavior will return -EPROBE_DEFER, and wait for a compatible
driver to be loaded instead of modprobing i915.

Converting all drivers at the same time is a lot of work, instead we
will convert each user one by one.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@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/20231009115437.99976-8-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda: i915: Allow override of gpu binding.
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:30 +0000 (13:54 +0200)]
ALSA: hda: i915: Allow override of gpu binding.

Selecting CONFIG_DRM selects CONFIG_VIDEO_NOMODESET, which exports
video_firmware_drivers_only(). This can be used as a first
approximation on whether i915 will be available. It's safe to use as
this is only built when CONFIG_SND_HDA_I915 is selected by CONFIG_I915.

It's not completely fool proof, as you can boot with "nomodeset
i915.modeset=1" to make i915 load regardless, or use
"i915.force_probe=!*" to never load i915, but the common case of
booting with nomodeset to disable all GPU drivers this will work as
intended.

Because of this, we add an extra module parameter,
snd_hda_core.gpu_bind that can be used to signal users intent.
-1 follows nomodeset, 0 disables binding, 1 forces wait/-EPROBE_DEFER
on binding.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-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>
Link: https://lore.kernel.org/r/20231009115437.99976-7-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda: Intel: Fix error handling in azx_probe()
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:29 +0000 (13:54 +0200)]
ALSA: hda: Intel: Fix error handling in azx_probe()

Add missing pci_set_drv to NULL call on error.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-6-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: Intel: Fix error handling in hda_init()
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:28 +0000 (13:54 +0200)]
ASoC: SOF: Intel: Fix error handling in hda_init()

The hda_codec_i915_init() errors are ignored in
hda_init() so it can never return -EPROBE_DEFER.

Fix this before we move the call to hda_init() from the
deferred probe to early probe.

While at it, also fix error handling when hda_dsp_ctrl_get_caps
fails.

Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-5-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: Intel: hda: start splitting the probe
Pierre-Louis Bossart [Mon, 9 Oct 2023 11:54:27 +0000 (13:54 +0200)]
ASoC: SOF: Intel: hda: start splitting the probe

This patch moves the initial parts of the probe to the probe_early()
callback, which provides a much faster decision on whether the SOF
driver shall deal with a specific platform or yield to other Intel
drivers.

This is a limited functionality change, the bigger change is to move
the i915/Xe initialization to the probe_early().

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-4-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: core: Add probe_early and remove_late callbacks
Pierre-Louis Bossart [Mon, 9 Oct 2023 11:54:26 +0000 (13:54 +0200)]
ASoC: SOF: core: Add probe_early and remove_late callbacks

The existing DSP probe may be handled in a workqueue to allow for
extra time, typically for the i915 request_module and HDAudio codec
handling.

With the upcoming changes for i915/Xe driver relying on the
-EPROBE_DEFER mechanism, we need to have a first pass of the probe
which cannot be pushed to a workqueue. Introduce 2 new optional
callbacks.

probe_early is called before the workqueue runs. remove_late may be
called from the workqueue if load is unsuccesful, but will otherwise
be called on module unload.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-3-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.
Maarten Lankhorst [Mon, 9 Oct 2023 11:54:25 +0000 (13:54 +0200)]
ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran.

In an effort to not call sof_ops_free twice, we stopped running it when
probe was aborted.

Check the result of cancel_work_sync to see if this was the case.

Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful")
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://lore.kernel.org/r/20231009115437.99976-2-maarten.lankhorst@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoMerge branch 'for-linus' into for-next
Takashi Iwai [Thu, 19 Oct 2023 12:51:07 +0000 (14:51 +0200)]
Merge branch 'for-linus' into for-next

For applying HD-audio EPROBE_DEFER series cleanly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support
xiazhengqiao [Thu, 19 Oct 2023 10:03:22 +0000 (18:03 +0800)]
ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support

To use RT5650 as the codec and the amp, add a new
sound card named mt8186_rt5650.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: xiazhengqiao <xiazhengqiao@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20231019100322.25425-3-xiazhengqiao@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support
xiazhengqiao [Thu, 19 Oct 2023 10:03:21 +0000 (18:03 +0800)]
ASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support

Add new sound card "mt8186_rt5650". RT5650 comes with amp and
earphone codec.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: xiazhengqiao <xiazhengqiao@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20231019100322.25425-2-xiazhengqiao@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoMerge tag 'asoc-fix-v6.6-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Wed, 18 Oct 2023 18:02:46 +0000 (20:02 +0200)]
Merge tag 'asoc-fix-v6.6-rc6' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.6

A fairly large set of fixes here but all driver specific, the biggest
block is Johan's work shaking out issues with device setup and teardown
for the wcd938x driver which is a relatively large but clearly broken
down set of changes.

There is one core helper function added as part of a fix for wsa-macro.

11 months agoASoC: da7213: Add new kcontrol for tonegen
David Rau [Wed, 18 Oct 2023 06:44:44 +0000 (14:44 +0800)]
ASoC: da7213: Add new kcontrol for tonegen

Add new kcontrol for tone generator

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20231018064444.23186-1-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: tas2781: make const read-only array magic_number static
Colin Ian King [Tue, 17 Oct 2023 17:04:36 +0000 (18:04 +0100)]
ASoC: tas2781: make const read-only array magic_number static

Don't populate the const read-only array magic_number on the stack,
instead make it static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20231017170436.176615-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: amd: ps: enable wake capability for acp pci driver
Vijendar Mukunda [Tue, 17 Oct 2023 07:19:36 +0000 (12:49 +0530)]
ASoC: amd: ps: enable wake capability for acp pci driver

Enable wake capability for acp pci driver for Pink Sardine
platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20231017071939.953343-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dt-bindings: tas5805m: Disallow undefined properties
Rob Herring [Mon, 16 Oct 2023 15:55:47 +0000 (10:55 -0500)]
ASoC: dt-bindings: tas5805m: Disallow undefined properties

Device specific bindings should not allow undefined properties. This is
accomplished in json-schema with 'additionalProperties: false'.

Examples should be last in the schema, so move additionalProperties up
while we're here.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231016155547.2973853-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: da7219: Correct the process of setting up Gnd switch in AAD
David Rau [Tue, 17 Oct 2023 02:12:58 +0000 (10:12 +0800)]
ASoC: da7219: Correct the process of setting up Gnd switch in AAD

Enable Gnd switch to improve stability when Jack insert event
occurs, and then disable Gnd switch after Jack type detection
is finished.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20231017021258.5929-1-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoALSA: hda/realtek - Fixed ASUS platform headset Mic issue
Kailang Yang [Tue, 17 Oct 2023 07:30:24 +0000 (15:30 +0800)]
ALSA: hda/realtek - Fixed ASUS platform headset Mic issue

ASUS platform Headset Mic was disable by default.
Assigned verb table for Mic pin will enable it.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1155d914c20c40569f56d36c79254879@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV
Artem Borisov [Sat, 14 Oct 2023 07:50:42 +0000 (10:50 +0300)]
ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZV

Enables the SPI-connected Cirrus amp and the required pins
for headset mic detection.

As of BIOS version 313 it is still necessary to modify the
ACPI table to add the related _DSD properties:
  https://gist.github.com/Flex1911/1bce378645fc95a5743671bd5deabfc8

Signed-off-by: Artem Borisov <dedsa2002@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20231014075044.17474-1-dedsa2002@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx
Luka Guzenko [Mon, 16 Oct 2023 22:13:28 +0000 (00:13 +0200)]
ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxx

This HP Laptop uses ALC236 codec with COEF 0x07 controlling the
mute LED. Enable existing quirk for this device.

Signed-off-by: Luka Guzenko <l.guzenko@web.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20231016221328.1521674-1-l.guzenko@web.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 months agoASoC: SOF: misc updates for 6.7
Mark Brown [Mon, 16 Oct 2023 14:41:55 +0000 (15:41 +0100)]
ASoC: SOF: misc updates for 6.7

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

New PCI ID, one fix for a delayed IRQ thread causing issues, one
update for debug and one follow-up cleanup for the .remove callback.

11 months agoASoC: codecs: rt715*: update misleading error log
Mark Brown [Mon, 16 Oct 2023 14:41:47 +0000 (15:41 +0100)]
ASoC: codecs: rt715*: update misleading error log

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Improve two errors logs which report bad information.

11 months agoASoC: Intel: boards: updates for 6.7
Mark Brown [Mon, 16 Oct 2023 14:41:40 +0000 (15:41 +0100)]
ASoC: Intel: boards: updates for 6.7

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

A couple of new boards, one DMI quirk fix and a nice cleanup from
Brent Lu to make all HDMI stuff common across drivers.

11 months agoASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()
Gustavo A. R. Silva [Mon, 9 Oct 2023 21:24:23 +0000 (15:24 -0600)]
ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

While there, use struct_size() and size_sub() helpers, instead of the
open-coded version, to calculate the size for the allocation of the
whole flexible structure, including of course, the flexible-array
member.

This code was found with the help of Coccinelle, and audited and
fixed manually.

Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/ZSRvh1j2MVVhuOUv@work
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dwc: Fix non-DT instantiation
Mark Brown [Fri, 13 Oct 2023 17:37:33 +0000 (18:37 +0100)]
ASoC: dwc: Fix non-DT instantiation

Commit d6d6c513f5d2 ("ASoC: dwc: Use ops to get platform data")
converted the DesignWare I2S driver to use a DT specific function to
obtain platform data but this breaks at least non-DT systems such as
AMD.  Revert it.

Fixes: d6d6c513f5d2 ("ASoC: dwc: Use ops to get platform data")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231013-asoc-fix-dwc-v1-1-63211bb746b9@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: codecs: tas2780: Fix log of failed reset via I2C.
Roy Chateau [Fri, 13 Oct 2023 11:02:39 +0000 (13:02 +0200)]
ASoC: codecs: tas2780: Fix log of failed reset via I2C.

Correctly log failures of reset via I2C.

Signed-off-by: Roy Chateau <roy.chateau@mep-info.com>
Link: https://lore.kernel.org/r/20231013110239.473123-1-roy.chateau@mep-info.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: rt5650: fix the wrong result of key button
Shuming Fan [Fri, 13 Oct 2023 09:45:25 +0000 (17:45 +0800)]
ASoC: rt5650: fix the wrong result of key button

The RT5650 should enable a power setting for button detection to avoid the wrong result.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20231013094525.715518-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: fsl-asoc-card: Add comment for mclk in the codec_priv
Hui Wang [Sat, 7 Oct 2023 04:01:17 +0000 (12:01 +0800)]
ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv

Otherwise a warning will be detected as below:
warning: Function parameter or member 'mclk' not described in
'codec_priv'

Fixes: 1075df4bdeb3 ("ASoC: fsl-asoc-card: add nau8822 support")
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20231007040117.22446-1-hui.wang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: rt715: reorder the argument in error log
Bard Liao [Thu, 12 Oct 2023 19:13:15 +0000 (15:13 -0400)]
ASoC: rt715: reorder the argument in error log

"Failed to set private value: ffffffea <= 6100000 24832" is confusing.
It should be "Failed to set private value: 6100000 <= 24832 -22"

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191315.145411-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: rt715-sdca: reorder the argument in error log
Bard Liao [Thu, 12 Oct 2023 19:13:14 +0000 (15:13 -0400)]
ASoC: rt715-sdca: reorder the argument in error log

"Failed to set private value: ffffffea <= 6100000 24832" is confusing.
It should be "Failed to set private value: 6100000 <= 24832 -22"

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191315.145411-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: SOF: make .remove callback return void
Pierre-Louis Bossart [Thu, 12 Oct 2023 19:18:50 +0000 (15:18 -0400)]
ASoC: SOF: make .remove callback return void

We don't use the returned value and return 0 anyways, let's follow the
example of platform drivers and simplify the definitions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191850.147140-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: SOF: ipc4: Dump the notification payload
Peter Ujfalusi [Thu, 12 Oct 2023 19:18:49 +0000 (15:18 -0400)]
ASoC: SOF: ipc4: Dump the notification payload

Now that we have notifications with payload (kcontrol change
notifications), it is time to add the payload dump on the rx path as well.

Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191850.147140-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend
Peter Ujfalusi [Thu, 12 Oct 2023 19:18:48 +0000 (15:18 -0400)]
ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend

In the existing IPC support, the reply to each IPC message is handled in
an IRQ thread. The assumption is that the IRQ thread is scheduled without
significant delays.

On an experimental (iow, buggy) kernel, the IRQ thread dealing with the
reply to the last IPC message before powering-down the DSP can be delayed
by several seconds. The IRQ thread will proceed with register accesses
after the DSP is powered-down which results in a kernel crash.

While the bug which causes the delay is not in the audio stack, we must
handle such cases with defensive programming to avoid such crashes.

Call synchronize_irq() before proceeding to power down the DSP to make
sure that no irq thread is pending execution.

Closes: https://github.com/thesofproject/linux/issues/4608
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191850.147140-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
Arun T [Thu, 12 Oct 2023 19:18:47 +0000 (15:18 -0400)]
ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions

Split out firmware definitions for Intel Arrow Lake platforms.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Arun T <arun.t@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012191850.147140-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_ssp_amp: use common module for HDMI link
Brent Lu [Thu, 12 Oct 2023 19:08:26 +0000 (15:08 -0400)]
ASoC: Intel: sof_ssp_amp: use common module for HDMI link

Use intel_board module for Intel HDMI DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_rt5682: use common module for HDMI link
Brent Lu [Thu, 12 Oct 2023 19:08:25 +0000 (15:08 -0400)]
ASoC: Intel: sof_rt5682: use common module for HDMI link

Use intel_board module for Intel HDMI DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_nau8825: use common module for HDMI link
Brent Lu [Thu, 12 Oct 2023 19:08:24 +0000 (15:08 -0400)]
ASoC: Intel: sof_nau8825: use common module for HDMI link

Use intel_board module for Intel HDMI DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_cs42l42: use common module for HDMI link
Brent Lu [Thu, 12 Oct 2023 19:08:23 +0000 (15:08 -0400)]
ASoC: Intel: sof_cs42l42: use common module for HDMI link

Use intel_board module for Intel HDMI DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: board_helpers: new module for common functions
Brent Lu [Thu, 12 Oct 2023 19:08:22 +0000 (15:08 -0400)]
ASoC: Intel: board_helpers: new module for common functions

Create a new module to host common functions for machine drivers. This
patch supports Intel HDMI DAI link initialization.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_ssp_amp: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:21 +0000 (15:08 -0400)]
ASoC: Intel: sof_ssp_amp: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_sdw: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:20 +0000 (15:08 -0400)]
ASoC: Intel: sof_sdw: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_rt5682: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:19 +0000 (15:08 -0400)]
ASoC: Intel: sof_rt5682: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_nau8825: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:18 +0000 (15:08 -0400)]
ASoC: Intel: sof_nau8825: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_da7219: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:17 +0000 (15:08 -0400)]
ASoC: Intel: sof_da7219: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_cs42l42: use sof_hdmi_private to init HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:16 +0000 (15:08 -0400)]
ASoC: Intel: sof_cs42l42: use sof_hdmi_private to init HDMI

Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm
structure for HDMI dai link initialization since hdac-hdmi support is
removed.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_hdmi: add common header for HDMI
Brent Lu [Thu, 12 Oct 2023 19:08:15 +0000 (15:08 -0400)]
ASoC: Intel: sof_hdmi: add common header for HDMI

Add a common header for Intel HDMI dai link (idisp) initialization.
Declare the sof_hdmi_private structure in machine driver private data
and use it to initialize dai link.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_ssp_amp: remove hdac-hdmi support
Brent Lu [Thu, 12 Oct 2023 19:08:14 +0000 (15:08 -0400)]
ASoC: Intel: sof_ssp_amp: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_rt5682: remove hdac-hdmi support
Brent Lu [Thu, 12 Oct 2023 19:08:13 +0000 (15:08 -0400)]
ASoC: Intel: sof_rt5682: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_nau8825: remove hdac-hdmi support
Brent Lu [Thu, 12 Oct 2023 19:08:12 +0000 (15:08 -0400)]
ASoC: Intel: sof_nau8825: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_da7219: remove hdac-hdmi support
Brent Lu [Thu, 12 Oct 2023 19:08:11 +0000 (15:08 -0400)]
ASoC: Intel: sof_da7219: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_cs42l42: remove hdac-hdmi support
Brent Lu [Thu, 12 Oct 2023 19:08:10 +0000 (15:08 -0400)]
ASoC: Intel: sof_cs42l42: remove hdac-hdmi support

Remove hdac-hdmi support code since we are now using
snd-hda-codec-hdmi codec driver for hdmi.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_sdw_rt712_sdca: construct cards->components by name_prefix
Bard Liao [Thu, 12 Oct 2023 19:08:09 +0000 (15:08 -0400)]
ASoC: Intel: sof_sdw_rt712_sdca: construct cards->components by name_prefix

sof_sdw_rt712_sdca is used by rt712 and rt713. Using different
cards->components string allow UCM distinguish the two codecs.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: MTL: Add entry for HDMI-In capture support to non-I2S codec boards.
Balamurugan C [Thu, 12 Oct 2023 19:08:08 +0000 (15:08 -0400)]
ASoC: Intel: MTL: Add entry for HDMI-In capture support to non-I2S codec boards.

Adding HDMI-In capture support for the MTL products which doesn't have
onboard I2S codec. But need to support HDMI-In capture via I2S and
audio playback through HDMI/DP monitor.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_sdw_rt_sdca_jack_common: add rt713 support
Bard Liao [Thu, 12 Oct 2023 19:08:07 +0000 (15:08 -0400)]
ASoC: Intel: sof_sdw_rt_sdca_jack_common: add rt713 support

Adding rt713 support to sof_sdw_rt_sdca_jack_common.c.

Fixes: fbaaf80d8cf6 ("ASoC: Intel: sof_sdw: add rt713 support")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: soc-acpi-intel-mtl-match: add rt713 rt1316 config
Bard Liao [Thu, 12 Oct 2023 19:08:06 +0000 (15:08 -0400)]
ASoC: Intel: soc-acpi-intel-mtl-match: add rt713 rt1316 config

Adding rt713 jack + rt1316 amp + rt1713 dmic configuration support.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: soc-acpi-intel-rpl-match: add rt711-l0-rt1316-l12 support
Bard Liao [Thu, 12 Oct 2023 19:08:05 +0000 (15:08 -0400)]
ASoC: Intel: soc-acpi-intel-rpl-match: add rt711-l0-rt1316-l12 support

Another configuration that doesn't support DMIC.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: sof_sdw: update HP Omen match
Pierre-Louis Bossart [Thu, 12 Oct 2023 19:08:04 +0000 (15:08 -0400)]
ASoC: Intel: sof_sdw: update HP Omen match

New platforms have a slightly different DMI product name, remove
trailing characters/digits to handle all cases.

Closes: https://github.com/thesofproject/linux/issues/4611
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20231012190826.142619-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoHarden SSP boards and add TDM support
Mark Brown [Thu, 12 Oct 2023 16:51:49 +0000 (17:51 +0100)]
Harden SSP boards and add TDM support

Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

In quite a few places in code there are checks for number of SSPs
present on system, to reduce maintenance burden introduce helper
functions allowing to get SSP and TDM from machine board configuration.

Current mechanism replaces "%d" present in some routes and widget names
with SSP number. However there are also configurations which make use of
of TDM number, in which case expected behavior would be to have string
in form of SSP:TDM - see implementation of avs_i2s_platform_register()
in sound/soc/intel/avs/pcm.c. Implement custom function, which parses
string and make use of it when parsing topology. While at it make sure
that we generate dynamic names only if there is no multiple SSPs or TDMs
defined.

Migrate all boards to handle TDM if requested.

11 months agoASoC: tegra: Fix -Wuninitialized in tegra210_amx_platform_probe()
Nathan Chancellor [Wed, 11 Oct 2023 20:21:51 +0000 (13:21 -0700)]
ASoC: tegra: Fix -Wuninitialized in tegra210_amx_platform_probe()

Clang warns (or errors with CONFIG_WERROR=y):

  sound/soc/tegra/tegra210_amx.c:553:10: error: variable 'soc_data' is uninitialized when used here [-Werror,-Wuninitialized]
    553 |                                             soc_data->regmap_conf);
        |                                             ^~~~~~~~

A refactoring removed the initialization of this variable but its use
was not updated. Use the soc_data value in the amx variable to resolve
the warning and remove the soc_data variable, as it is now entirely
unused.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1943
Fixes: 9958d85968ed ("ASoC: Use device_get_match_data()")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20231011-asoc-tegra-fix-uninit-soc_data-v1-1-0ef0ab44cf48@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: ssm4567: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:14 +0000 (10:35 +0200)]
ASoC: Intel: avs: ssm4567: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-17-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: rt5663: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:13 +0000 (10:35 +0200)]
ASoC: Intel: avs: rt5663: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-16-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: rt286: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:12 +0000 (10:35 +0200)]
ASoC: Intel: avs: rt286: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-15-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: nau8825: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:11 +0000 (10:35 +0200)]
ASoC: Intel: avs: nau8825: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-14-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: max98927: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:10 +0000 (10:35 +0200)]
ASoC: Intel: avs: max98927: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-13-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: max98373: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:09 +0000 (10:35 +0200)]
ASoC: Intel: avs: max98373: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-12-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: es8336: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:08 +0000 (10:35 +0200)]
ASoC: Intel: avs: es8336: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-11-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: da7219: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:07 +0000 (10:35 +0200)]
ASoC: Intel: avs: da7219: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-10-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: rt298: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:06 +0000 (10:35 +0200)]
ASoC: Intel: avs: rt298: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-9-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: max98357a: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:05 +0000 (10:35 +0200)]
ASoC: Intel: avs: max98357a: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-8-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: rt5682: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:04 +0000 (10:35 +0200)]
ASoC: Intel: avs: rt5682: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: rt274: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:03 +0000 (10:35 +0200)]
ASoC: Intel: avs: rt274: Validate machine board configuration

Allow for board to be used with TDMs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: i2s_test: Validate machine board configuration
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:02 +0000 (10:35 +0200)]
ASoC: Intel: avs: i2s_test: Validate machine board configuration

I2S test board can be used in any SSP and TDM configuration.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: Improve topology parsing of dynamic strings
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:01 +0000 (10:35 +0200)]
ASoC: Intel: avs: Improve topology parsing of dynamic strings

Current mechanism replaces "%d" present in some routes and widget names
with SSP number. However there are also configurations which make use of
TDM number, in which case expected behavior would be to have string in
form of SSP:TDM - see implementation of avs_i2s_platform_register() in
sound/soc/intel/avs/pcm.c.

Implement custom function, which parses string and make use of it when
parsing topology. While at it make sure that we generate dynamic names
only if there is no multiple SSPs or TDMs defined.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: Introduce helper functions for SSP and TDM handling
Amadeusz Sławiński [Thu, 12 Oct 2023 08:35:00 +0000 (10:35 +0200)]
ASoC: Intel: avs: Introduce helper functions for SSP and TDM handling

In quite a few places in code there are checks for number of SSPs
present on system, to reduce maintenance burden introduce helper
functions allowing to get SSP and TDM from machine board configuration.

Additionally in boards we use SSP and TDM to generate quite a few
strings, it could be done like:
if (tdms)
dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d:%d-Codec",
ssp_port, tdm_slot);
else
dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec",
ssp_port);

but quite quickly code ends up with spaghetti of similar if elses.
Instead introduce macro which can be used to generate correct string,
allowing to minimize code to something like:
dl->name = devm_kasprintf(dev, GFP_KERNEL, AVS_STRING_FMT("SSP", "-Codec",
ssp_port, tdm_slot));

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Intel: avs: Only create SSP%d snd_soc_dai_driver when requested
Amadeusz Sławiński [Thu, 12 Oct 2023 08:34:59 +0000 (10:34 +0200)]
ASoC: Intel: avs: Only create SSP%d snd_soc_dai_driver when requested

When using TDM configuration some other device may be using SSP%d, so
don't create snd_soc_dai_driver configuration for it unless requested
by TDM configuration.

While at it adjust tdf8532 board to explicitly describe TDM
configuration.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>