History log of /linux-master/sound/soc/intel/boards/sof_sdw_rt711.c
Revision Date Author Comments
# 8266c731 08-Feb-2024 Bard Liao <yung-chuan.liao@linux.intel.com>

ASoC: Intel: sof_sdw: add common sdw dai link init

Currently, we set sdw dai link .init callback in the codec_info_list's
dais.init function. This works fine if all codecs in the dai link are
the same. However, we need to do all the .init stuff for all different
codecs in the dai link if not all codecs in the dai link are the same.
Use a common dai link .init callback to call the new rtd_init callback
in sof_sdw_dai_info{} to do rtd_init for each dai.
Some codec init callback will become empty after this change. They will
be removed in the follow up patch.

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/20240208165545.93811-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 91a959d8 08-Feb-2024 Bard Liao <yung-chuan.liao@linux.intel.com>

ASoC: Intel: sof_sdw_rt711: use helper to get codec dai by name

Use helper to get codec dai by name.

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/20240208165545.93811-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a2c1125e 26-Sep-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: intel: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg19fo4o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 752d4de4 02-Jun-2023 Bard Liao <yung-chuan.liao@linux.intel.com>

ASoC: Intel: sof_sdw: rename SOF_RT711_JDSRC to SOF_JACK_JDSRC

Jack Detection source can be applied to all jacks, not only rt711.
No function changes.

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/20230602202225.249209-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 81164834 15-Jul-2022 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw: avoid oops in error handling

While tinkering with ACPI work-arounds for the HP Omen 16 support, we
identified a corner case where the headset codec device properties are
not set in the codec .init when -EPROBE_DEFER is returned, but
released unconditionally in the .exit().

This leads to a kernel oops

[ 4.186891] sof_sdw sof_sdw: snd_soc_register_card failed -517
[ 4.186896] BUG: kernel NULL pointer dereference, address: 00000000000003f0
[ 4.186914] Oops: 0000 [#1] PREEMPT SMP NOPTI
[ 4.186926] RIP: 0010:dev_fwnode+0x5/0x20
[ 4.186974] device_remove_software_node+0x10/0x80
[ 4.186982] sof_sdw_rt711_exit+0x19/0x30 [snd_soc_sof_sdw]
[ 4.186990] mc_dailink_exit_loop+0x94/0xc0 [snd_soc_sof_sdw]
[ 4.186996] ? rt711_rtd_init+0x170/0x170 [snd_soc_sof_sdw]

A similar error case can occur if the addition of the device property
fails. We need to test if the property was successfully added before
removing it.

BugLink: https://github.com/thesofproject/linux/issues/3727
Fixes: 768ad6d80db2d ("ASoC: Intel: sof_sdw: handle errors on card registration")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220715144144.274770-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 19aed2d6 07-Apr-2022 Akihiko Odaki <akihiko.odaki@gmail.com>

ASoC: soc-card: Create jack kcontrol without pins

snd_soc_card_jack_new() allowed to create jack kcontrol without pins,
but did not create kcontrols. The jack would not have kcontrols if pins
were not going to be added.

This renames the old snd_soc_card_jack_new() to
snd_soc_card_jack_new_pins() for use when pins are provided or will be
added later. The new snd_soc_card_jack_new() appropriately creates a
jack for use without pins and adds a kcontrol.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e5a292d3 13-Aug-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: use software node API in SoundWire machines

The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 82027585 13-Aug-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove

Follow the example of Intel Atom drivers and keep a reference to the
headset codec until the properties are removed.

There is no guarantee that the module for the codec driver is loaded
before the machine driver probe, the use of the deferred probe
mechanism is required.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# cdf99c9a 13-Aug-2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw: pass card information to init/exit functions

If we want to handle a context in init/exit function, we have to pass
the card information. This will be necessary to better deal with
device properties in the follow-up commits.

No functional change other than prototype update.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3f2c6564 21-Aug-2020 Bard Liao <yung-chuan.liao@linux.intel.com>

ASoC: Intel: sof_sdw: clean-up inclusion of header files

"struct snd_soc_dapm_widget" and "struct snd_kcontrol_new" are used in most
of these .c files. Adding the header files to prevent from depending on
<sound/soc.h>

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# cf0418cd 17-Jul-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw_rt711: remove properties in card remove

The rt711 jack detection properties are set from the machine drivers
during the card probe, as done in other ASoC examples.

KASAN reports a use-after-free error when unbinding drivers due to a
confusing sequence between the ACPI core, the device core and the
SoundWire device cleanups.

Rather than fixing this sequence, follow the recommendation to have
the same caller add and remove properties, add an explicit
device_remove_properties() in the card .remove() callback.

In future patches the use of device_add/remove_properties will be
replaced by a direct handling of a swnode, but the sequence will
remain the same.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200717211337.31956-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1f891055 17-Jul-2020 Bard Liao <yung-chuan.liao@linux.intel.com>

ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name

We can get codec name from dai link.

Suggested-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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200717211337.31956-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1f64a08b 15-May-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw_rt711: remap buttons

Use same mapping as in all other machine drivers:

BTN_0 : KEY_PLAYPAUSE
BTN_1 : KEY_VOICECOMMAND
BTN_2 : KEY_VOLUMEUP
BTN_3 : KEY_VOLUMEDOWN

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200515210731.10942-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e149ca29 01-May-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only

Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only
tag.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 30e3edfb 09-Apr-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: sof_sdw_rt711: remove codec_dai use

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 52db12d1 25-Mar-2020 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

ASoC: Intel: boards: add sof_sdw machine driver

This machine driver provides support for different configurations:

RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI

To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.

Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.

For each configuration, the card component string is updated so that UCM
can select the relevant parts.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>