linux-2.6-block.git
5 months agoASoC: Intel: ssp-common: relocate header file
Brent Lu [Wed, 27 Mar 2024 16:23:52 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: relocate header file

Moving ssp-common header file from sound/soc/intel/common directory to
include/sound directory and rename the file. Keep file content
unchanged for tracking purpose.

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://msgid.link/r/20240327162408.63953-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: ssp-common: relocate source file
Brent Lu [Wed, 27 Mar 2024 16:23:51 +0000 (11:23 -0500)]
ASoC: Intel: ssp-common: relocate source file

Moving ssp-common source and header files from sound/soc/intel/boards
directory to sound/soc/intel/common directory and rename the source
file. Keep file content unchanged for tracking purpose.

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://msgid.link/r/20240327162408.63953-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sun8i-codec: Fix build with CONFIG_SND_JACK_INPUT_DEV disabled
Ondrej Jirman [Wed, 27 Mar 2024 08:05:34 +0000 (09:05 +0100)]
ASoC: sun8i-codec: Fix build with CONFIG_SND_JACK_INPUT_DEV disabled

When CONFIG_SND_JACK_INPUT_DEV is disabled, struct snd_jack doesn't
have 'type' field. We can't rely on this field being always present,
so store the jack_type in the codec driver itself.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403261243.kcXCPAYs-lkp@intel.com/
Link: https://msgid.link/r/20240327080542.3649840-1-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: boards: updates for 6.10 - part2
Mark Brown [Tue, 26 Mar 2024 20:21:16 +0000 (20:21 +0000)]
ASoC: Intel: boards: updates for 6.10 - part2

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

This second part provides SoundWire-related cleanups and extensions
required by Realtek RT722 and Cirrus Logic codecs.

Also included is a cleanup of the RT715-sdca DAI naming and new tables
for ACPI-based board detections.

5 months agoASoC: soc-jack: Get rid of legacy GPIO support
Andy Shevchenko [Tue, 26 Mar 2024 17:09:48 +0000 (19:09 +0200)]
ASoC: soc-jack: Get rid of legacy GPIO support

No more users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240326171134.1414462-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output
Charles Keepax [Tue, 26 Mar 2024 16:04:29 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Add support for cs42l43 optional speaker output

Add support for the optional speaker output on the cs42l43, this uses
the new SOF_CODEC_SPKR quirk to conditional include the speaker DAI
link. It is worth noting that currently no systems are included that
utilise this feature, but the feature is added as several systems are on
the horizon. As part of this SOF_SDW_MAX_DAI_NUM must be increased, it
is currently 3 but cs42l43 will now have 4 DAI links. This value is
increased to 8 to give some head room for future devices.

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://msgid.link/r/20240326160429.13560-35-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Add quirk for optional codec speakers
Charles Keepax [Tue, 26 Mar 2024 16:04:28 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Add quirk for optional codec speakers

Some codecs have speaker drivers that may or may not be used in a
given system. Add a quirk (SOF_CODEC_SPKR) that defines if a system
uses the codec speaker, this is kept generic such that any codec
with such a speaker DAI can reuse the quirk.

For implementation of this, add a quirk field into the
sof_sdw_dai_info structure. This field is not used to specify
if a system uses a particular quirk, that is still done through
the sof_sdw_quirk variable, this field is used to flag a DAI as
conditional on a certain quirk. This means the DAI will only be
included in the card if sof_sdw_quirk and the DAI quirk field have
a matching set bit.

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://msgid.link/r/20240326160429.13560-34-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Remove redundant initialisations
Charles Keepax [Tue, 26 Mar 2024 16:04:27 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Remove redundant initialisations

Unspecified fields are by default initialised to zero, remove redundant
init pointer initialisations.

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://msgid.link/r/20240326160429.13560-33-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Don't pass acpi_link_adr to init functions
Charles Keepax [Tue, 26 Mar 2024 16:04:26 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Don't pass acpi_link_adr to init functions

There is no need to pass the snd_soc_acpi_link_adr structure to the init
functions, it conveys no specific information about the codec. Remove
this parameter from the callbacks

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://msgid.link/r/20240326160429.13560-32-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: change cs35l56 name_prefix
Bard Liao [Tue, 26 Mar 2024 16:04:25 +0000 (11:04 -0500)]
ASoC: Intel: change cs35l56 name_prefix

To use sequential amp numbers. I,e, AMP1, AMP2, AMP3, AMP4

Reviewed-by: Chao Song <chao.song@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://msgid.link/r/20240326160429.13560-31-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: change rt715-sdca dai name
Bard Liao [Tue, 26 Mar 2024 16:04:24 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: change rt715-sdca dai name

As rt715-sdca dai name has been changed in codec driver, we should
change it in machine driver, too. Changing the dai name in
codec_info_list[] also help sof_sdw_rtd_init() to run .rtd_init()
from the same codec.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-30-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: rt715-sdca: rename dai name with rt715-sdca prefix
Bard Liao [Tue, 26 Mar 2024 16:04:23 +0000 (11:04 -0500)]
ASoC: rt715-sdca: rename dai name with rt715-sdca prefix

The dai name are the same as rt715 codec. Rename them with rt715-sdca
prefix allow machine driver to distinguish rt715 and rt715-sdca from
dai name.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-29-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw_rt722_sdca: use rt_dmic_rtd_init
Bard Liao [Tue, 26 Mar 2024 16:04:22 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw_rt722_sdca: use rt_dmic_rtd_init

rt_dmic_rtd_init() can be used for rt722 dmic, too.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-28-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw_rt722_sdca: set rtd_init in codec_info_list[]
Bard Liao [Tue, 26 Mar 2024 16:04:21 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw_rt722_sdca: set rtd_init in codec_info_list[]

Add rt722 into rt_sdca_jack_rtd_init() supported list, and set
rtd_init callback directly in codec_info_list[]. No need to use a
init callback to set the rtd_init callback.
Besides, sof_sdw_rt_sdca_jack_init() doesn't set .rtd_init anymore.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-27-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: remove unused rt dmic rtd_init
Bard Liao [Tue, 26 Mar 2024 16:04:20 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: remove unused rt dmic rtd_init

Some Realtek SDW DMIC codecs use the generic rt_dmic_rtd_init callback now.
Remove unused rtd_init callbacks.

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-26-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs
Bard Liao [Tue, 26 Mar 2024 16:04:19 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs

The only thing that the rt_xxx_rtd_init() functions do is to set
card->components. And we can set card->components with name_prefix
as rt712_sdca_dmic_rtd_init() does.
And sof_sdw_rtd_init() will always select the first dai with the
given dai->name from codec_info_list[]. Unfortunately, we have
different codecs with the same dai name. For example, dai name of
rt715 and rt715-sdca are both "rt715-aif2". Using a generic rtd_init
allow sof_sdw_rtd_init() run the rtd_init() callback from a similar
codec dai.

Fixes: 8266c73126b7 ("ASoC: Intel: sof_sdw: add common sdw dai link init")
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@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://msgid.link/r/20240326160429.13560-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Factor out SoundWire DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:18 +0000 (11:04 -0500)]
ASoC: intel: sof_sdw: Factor out SoundWire DAI creation

Factor out the creation of the SoundWire DAI links into a helper
function. No functional change.

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://msgid.link/r/20240326160429.13560-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move generation of DAI links to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:17 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move generation of DAI links to new parsing

The only part left using the old parsing code is now the generation of
the actual DAI links. Move this generation over to being based on the
new parsing, which allows the removal of the last of the old parsing
code.

The new DAI link generation is a simple matter of creating a new DAI
link for each sof_sdw_dailink struct, and adding a cpu, a codec, and
a mapping for each sof_sdw_endpoint contained in that sof_sdw_dailink.
Note that the CPUs can be inferred as the endpoint list is iterated,
because the endpoints were added into the list sorted by link.

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://msgid.link/r/20240326160429.13560-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move append_dai_type to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:16 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move append_dai_type to new parsing

append_dai_type should be set to true in any situation that would
result in multiple DAI links existing on a single SoundWire bus,
because the legacy naming used only the bus number to make things
unique. The current code handles this by looking for codecs with
multiple dai_info structs and looking for buses that include multiple
types of device on them. The first of these assumes that all DAIs on a
given device would be in use. The second, with dissimilar aggregation
now being supported, isn't really an accurate check either since those
devices could be aggregated into a single DAI link.

Move the handling for this flag over to the new parsing code and
simplify things a little by looking directly for SoundWire links
that will contain multiple DAI links to set the flag. These changes
should not cause any change in behaviour for any currently supported
systems.

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://msgid.link/r/20240326160429.13560-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move ignore_pch_dmic to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:15 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move ignore_pch_dmic to new parsing

Trivial move of the handling of ignore_pch_dmic over to the new parsing
code.

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://msgid.link/r/20240326160429.13560-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move counting and codec_conf to new parsing
Charles Keepax [Tue, 26 Mar 2024 16:04:14 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move counting and codec_conf to new parsing

Use the output of the new snd_soc_acpi struct parsing for the purposes
of counting the number of SoundWire DAI links and physical devices
attached to the SoundWire. These counts are already returned by the
parser so those can just be used directly. But the population of the
codec_conf structures, is moved from the old parsing code over to the
new. As the two parsers currently co-exist it is better to not have
them both attempt to modify the same structures.

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://msgid.link/r/20240326160429.13560-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs
Charles Keepax [Tue, 26 Mar 2024 16:04:13 +0000 (11:04 -0500)]
ASoC: Intel: sof-sdw: Add new code for parsing the snd_soc_acpi structs

The current machine driver code has a lot of loops parsing through
the ACPI structs (snd_soc_acpi_link_adr, snd_soc_acpi_adr_device,
snd_soc_acpi_endpoint), this makes it hard to understand exactly
what information is being extracted and for what purposes. As well
as being slightly inefficient, as the same information is looked
up multiple times. There are also some issues with the handling
of multiple endpoints on a single device, only the first of the
snd_soc_acpi_endpoint structures is currently fully processed by the
driver. This means doing things like aggregating the second endpoint
on a device with another device are not currently possible.

Add new parsing code that will count the devices and endpoints, parse
them into an intermediate datastructure, and then use that to create
the DAI links. This patch does not actually utilise the results of
the parsing, items will be moved across in the following patches.

This parsing is based around two new structures which are temporarily
allocated whilst parsing. Firstly, sof_sdw_endpoint, which represents
a specific endpoint for audio on a device and is more or less directly
equivalent to snd_soc_acpi_endpoint. Secondly, sof_sdw_dailink
which represents a DAI link and contains a linked list of one or
more sof_sdw_endpoints. A single trip through the snd_soc_acpi data
structures is used to populate these.

One important point to note here is the use of the num field in
snd_soc_acpi_endpoint to address sof_sdw_dai_info array in the
sof_sdw_codec_info struct. This expects a one to one mapping between
endpoints on a device and dai infos. It would be fine for a specific
system to not specify an endpoint for all of the dai infos available,
but two endpoints mapping to the same dai info would make not sense.

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://msgid.link/r/20240326160429.13560-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: soc-acpi: Add missing cs42l43 endpoints
Charles Keepax [Tue, 26 Mar 2024 16:04:12 +0000 (11:04 -0500)]
ASoC: intel: soc-acpi: Add missing cs42l43 endpoints

Currently the cs42l43 just specifies a single endpoint, as the current
machine driver only looks at the first endpoint specified. Future
refactoring will process all endpoints, as such proper specification
should be added for all the cs42l43 endpoints.

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://msgid.link/r/20240326160429.13560-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Remove no longer supported quirk
Charles Keepax [Tue, 26 Mar 2024 16:04:11 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Remove no longer supported quirk

The SOF_SDW_NO_AGGREGATION quirk is mostly for debug and no longer works
correctly with the current state of the machine driver. Remove it from
the code and add an error message if someone uses it.

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://msgid.link/r/20240326160429.13560-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: soc-acpi-intel-arl-match: Add rt711 sdca codec support
Balamurugan C [Tue, 26 Mar 2024 16:04:10 +0000 (11:04 -0500)]
ASoC: Intel: soc-acpi-intel-arl-match: Add rt711 sdca codec support

Adding rt711 sdca codec support for arl boards.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Chao Song <chao.song@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://msgid.link/r/20240326160429.13560-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out codec name generation
Charles Keepax [Tue, 26 Mar 2024 16:04:09 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out codec name generation

In preparation for future refactoring pull out a helper specifically for
generating the codec name.

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://msgid.link/r/20240326160429.13560-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out BlueTooth DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:08 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out BlueTooth DAI creation

Factor out the creation of the BlueTooth DAI links into a helper
function.  No functional change.

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://msgid.link/r/20240326160429.13560-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out HDMI DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:07 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out HDMI DAI creation

Factor out the creation of the HDMI DAI links into a helper function.
No functional change.

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://msgid.link/r/20240326160429.13560-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out DMIC DAI creation.
Charles Keepax [Tue, 26 Mar 2024 16:04:06 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out DMIC DAI creation.

Factor out the creation of the DMIC DAI links into a helper function.
No functional change.

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://msgid.link/r/20240326160429.13560-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Factor out SSP DAI creation
Charles Keepax [Tue, 26 Mar 2024 16:04:05 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Factor out SSP DAI creation

Factor out the creation of the SSP DAI links into a helper function. No
functional change.

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://msgid.link/r/20240326160429.13560-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Use for_each_set_bit
Charles Keepax [Tue, 26 Mar 2024 16:04:04 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Use for_each_set_bit

Rather than open coding a loop to process each bit use for_each_set_bit.

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://msgid.link/r/20240326160429.13560-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Only pass dai_link pointer around
Charles Keepax [Tue, 26 Mar 2024 16:04:03 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Only pass dai_link pointer around

Rather than passing around a pointer to the dai_link array and
an index into this array, simply pass a pointer to the current
dai_link. Also move the DAI link pointer sanity check to the end
of the DAI link creation, and change it to a warn on. This check
should only be hit if there is a serious bug in the machine driver,
so checking it on each iteration is excessive.

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://msgid.link/r/20240326160429.13560-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move flags to private struct
Charles Keepax [Tue, 26 Mar 2024 16:04:02 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move flags to private struct

Move the flags ignore_pch_dmic and append_dai_type into the drivers
private structure rather than passing them around between functions.

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://msgid.link/r/20240326160429.13560-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_sdw: Move get_codec_dai_by_name() into sof_sdw itself
Charles Keepax [Tue, 26 Mar 2024 16:04:01 +0000 (11:04 -0500)]
ASoC: Intel: sof_sdw: Move get_codec_dai_by_name() into sof_sdw itself

Currently sof_sdw relies on sof_board_helpers to provide
get_codec_dai_by_name(), but that is the only function from
sof_board_helpers it uses and no other machine driver requires
that function. There is no reason for sof_sdw to select SSP_COMMON
but more and more functions in sof_board_helpers are gaining
dependencies on functions that would require stubs for sof_sdw to
build without it.  Firstly it was sof_ssp_get_codec_name(), as was
fixed in commit c1469c3a8a30 ("ASoC: Intel: ssp-common: Add stub for
sof_ssp_get_codec_name"), now it is:

ERROR: modpost: "sof_ssp_detect_amp_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!
ERROR: modpost: "sof_ssp_detect_codec_type"
[sound/soc/intel/boards/snd-soc-intel-sof-board-helpers.ko] undefined!

Rather than adding more stubs, simply move the affected function
to the sof_sdw machine driver itself and no longer select
SND_SOC_INTEL_SOF_BOARD_HELPERS at all. This should allow work on
SSP_COMMON to progress without affecting sof_sdw.

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://msgid.link/r/20240326160429.13560-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Set channel map directly from endpoints
Charles Keepax [Tue, 26 Mar 2024 16:04:00 +0000 (11:04 -0500)]
ASoC: intel: sof_sdw: Set channel map directly from endpoints

The current code evenly distributes the CODEC DAIs across the CPU
DAIs in the DAI link, but this is just an assumption about how the
devices are connected to the host. All the information about which
CODEC is connected to which CPU DAI is contained in the endpoints
datastructures and those structures are already parsed to work out
which CODECs to include in the DAI link. Simply fill in the mapping
from CPUs -> CODECs as we parse through the endpoints structures,
this will ensure that mapping matches the physical layout.

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://msgid.link/r/20240326160429.13560-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Only pass codec_conf pointer around
Charles Keepax [Tue, 26 Mar 2024 16:03:59 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Only pass codec_conf pointer around

Rather than passing around a pointer to the codec_conf array, an index
into it and a size, simply pass around a pointer to the current codec_conf.
This reduces the amount of state moving around.

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://msgid.link/r/20240326160429.13560-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_dai() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:58 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_dai() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide. And move the function such that it is
located with the other find_codec_info_*() functions.

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://msgid.link/r/20240326160429.13560-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_acpi() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:57 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_acpi() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

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://msgid.link/r/20240326160429.13560-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: intel: sof_sdw: Make find_codec_info_part() return a pointer
Charles Keepax [Tue, 26 Mar 2024 16:03:56 +0000 (11:03 -0500)]
ASoC: intel: sof_sdw: Make find_codec_info_part() return a pointer

Rather than returning an index simply return a pointer to the
located codec info, this simplifies all the callers which only
want to access the codec info structure. Also remove the inline
specifier the function is fairly large for an inline function,
let the compiler decide.

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://msgid.link/r/20240326160429.13560-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: Add RK3308 internal audio codec driver
Luca Ceresoli [Tue, 5 Mar 2024 14:36:31 +0000 (15:36 +0100)]
ASoC: codecs: Add RK3308 internal audio codec driver

Add driver for the internal audio codec of the Rockchip RK3308 SoC.

Initially based on the vendor kernel driver [0], with lots of cleanups,
fixes, improvements, conversion to DAPM and removal of some features.

[0] https://github.com/rockchip-linux/kernel/blob/develop-4.19/sound/soc/codecs/rk3308_codec.c

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-4-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro
Luca Ceresoli [Tue, 5 Mar 2024 14:36:30 +0000 (15:36 +0100)]
ASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro

No macro currently allows handling a stereo control that has left and right
in the same register and whose minimum register value is not zero. Add one
that does that.

Note that even though the snd_soc_*_volsw_range() look more appropriate
given the _range suffix, they are not suitable because they don't honor the
two shift values. The snd_soc_*_volsw() look more generic and are suitable
for the task.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-3-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: Add Rockchip RK3308 internal audio codec
Luca Ceresoli [Tue, 5 Mar 2024 14:36:29 +0000 (15:36 +0100)]
ASoC: dt-bindings: Add Rockchip RK3308 internal audio codec

Add device tree bindings document for the internal audio codec of the
Rockchip RK3308 SoC.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://msgid.link/r/20240305-rk3308-audio-codec-v4-2-312acdbe628f@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoAdd support for jack detection to codec present in
Mark Brown [Tue, 26 Mar 2024 14:11:34 +0000 (14:11 +0000)]
Add support for jack detection to codec present in

Merge series from Ondřej Jirman <megi@xff.cz>:

This series adds support for jack detection to this codec. I used
and tested this on Pinephone. It works quite nicely. I tested it
against Android headset mic button resistor specification.

The patches are a rewritten and debugged version of the original
ones from Arnaud Ferraris and Samuel Holland, improved to better
handle headset button presses and with more robust plug-in/out
event debouncing, and to use set_jack API instead of sniffing
the sound card widget names, to detect the type of jack connector.

5 months agoASoC: codecs: ES8326: Reducin powerconsumption and
Mark Brown [Tue, 26 Mar 2024 14:11:23 +0000 (14:11 +0000)]
ASoC: codecs: ES8326: Reducin powerconsumption and

Merge series from Zhang Yi <zhangyi@everest-semi.com>:

We changed the configuration related to hibernation.
and delete the REG_SUPPLY to cover mute issue.

5 months agoASoC: dmaengine_pcm: Allow passing component name via config
Mark Brown [Tue, 26 Mar 2024 14:11:12 +0000 (14:11 +0000)]
ASoC: dmaengine_pcm: Allow passing component name via config

Merge series from Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>:

At the moment we cannot instantiate two dmaengine_pcms with the same
parent device, as the components will be named the same, leading to
conflicts.

Add 'name' field to the snd_dmaengine_pcm_config, and use that (if
defined) as the component name instead of deriving the component name
from the device.

5 months agoASoC: Harden DAPM route checks and Intel fixes
Mark Brown [Tue, 26 Mar 2024 14:11:00 +0000 (14:11 +0000)]
ASoC: Harden DAPM route checks and Intel fixes

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

Set of loosely connected patches. Most impactful change is dropping any
permisiveness when snd_soc_dapm_add_routes() fails in soc-topology.c To
do it safely, disable route checks for all skylake-driver boards.

Relevant background:

Since commit daa480bde6b3 ("ASoC: soc-core: tidyup for
snd_soc_dapm_add_routes()") route checks are no longer permissive. Probe
failures for Intel boards have been partially addressed by commit
a22ae72b86a4 ("ASoC: soc-core: isable route checks for legacy devices")
and its follow up but only skl_nau88l25_ssm4567.c is patched. The rest
of the boards still need fixing.

After that, removal of copy-pastas found in ssm4567.c and redundant code
in i2s_test.c for avs-boards.

Changes in v2:
- glk_rt5682_max98357a.c and skl_hda_dsp_generic.c now disable route
  checks only for the skylake-drvier
- asoc now logs failures of snd_soc_dapm_add_routes() in soc-topology.c

Amadeusz Sławiński (1):
  ASoC: Intel: avs: i2s_test: Remove redundant dapm routes

Cezary Rojewski (4):
  ASoC: Intel: Disable route checks for Skylake boards
  ASoC: topology: Do not ignore route checks when parsing graphs
  ASoC: Intel: avs: ssm4567: Do not ignore route checks
  ASoC: Intel: avs: ssm4567: Board cleanup

 sound/soc/intel/avs/boards/i2s_test.c         | 79 -------------------
 sound/soc/intel/avs/boards/ssm4567.c          |  5 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |  1 +
 sound/soc/intel/boards/bxt_rt298.c            |  1 +
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  2 +
 sound/soc/intel/boards/kbl_da7219_max98357a.c |  1 +
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  4 +
 sound/soc/intel/boards/kbl_rt5660.c           |  1 +
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  2 +
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |  1 +
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |  2 +
 .../soc/intel/boards/skl_nau88l25_max98357a.c |  1 +
 sound/soc/intel/boards/skl_rt286.c            |  1 +
 sound/soc/soc-topology.c                      | 11 ++-
 14 files changed, 27 insertions(+), 85 deletions(-)

--
2.25.1

5 months agoASoC: fsl: Support register and unregister rpmsg
Mark Brown [Tue, 26 Mar 2024 14:10:50 +0000 (14:10 +0000)]
ASoC: fsl: Support register and unregister rpmsg

Merge series from Chancel Liu <chancel.liu@nxp.com>:

echo /lib/firmware/fw.elf > /sys/class/remoteproc/remoteproc0/firmware
(A) echo start > /sys/class/remoteproc/remoteproc0/state
(B) echo stop > /sys/class/remoteproc/remoteproc0/state

The rpmsg sound card is registered in (A) and unregistered in (B).
After "start", imx-audio-rpmsg registers devices for ASoC platform driver
and machine driver. Then sound card is registered. After "stop",
imx-audio-rpmsg unregisters devices for ASoC platform driver and machine
driver. Then sound card is unregistered.

5 months agoASoC: Intel: boards: updates for 6.10 - part1
Mark Brown [Tue, 26 Mar 2024 14:10:38 +0000 (14:10 +0000)]
ASoC: Intel: boards: updates for 6.10 - part1

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

This series from Brent Lu adds common helpers and board configurations
to reduce the number of quirks.

5 months agoSoC: Cleanup MediaTek soundcard machine drivers
Mark Brown [Tue, 26 Mar 2024 14:10:27 +0000 (14:10 +0000)]
SoC: Cleanup MediaTek soundcard machine drivers

Merge series from AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:

This is the start of a series cleaning up the Mediatek drivers with some
preparatory cleanups and improvements.

5 months agoASoC: soc-dai: Note valid values of sysclock direction
John Watts [Tue, 26 Mar 2024 11:48:00 +0000 (22:48 +1100)]
ASoC: soc-dai: Note valid values of sysclock direction

Clock direction is marked as 'unsigned int' but only two values are
currently used in practice. Note these down in the documentation.

Signed-off-by: John Watts <contact@jookia.org>
Link: https://msgid.link/r/20240326-dai_mclk_hint-v1-1-653cbd2d78d9@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: hdac_hda: improve error logs
Pierre-Louis Bossart [Mon, 25 Mar 2024 22:19:25 +0000 (17:19 -0500)]
ASoC: hdac_hda: improve error logs

We have a couple of duplicate logs and missing information, add
__func__ consistently and make sure useful error codes are logged.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/20240325221925.206507-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: imx-es8328: Remove leftover gpio initialisation
Andy Shevchenko [Mon, 25 Mar 2024 19:13:41 +0000 (21:13 +0200)]
ASoC: fsl: imx-es8328: Remove leftover gpio initialisation

The gpio field is not used anymore, remove the leftover.
This also fixes the compilation error after the ...

Fixes: 9855f05e5536 ("ASoC: fsl: imx-es8328: Switch to using gpiod API")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240325191341.3977321-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: board id cleanup for cml boards
Brent Lu [Mon, 25 Mar 2024 22:10:59 +0000 (17:10 -0500)]
ASoC: Intel: sof_rt5682: board id cleanup for cml boards

Introduce "cml_rt5682_def" for cml boards which implement headphone
codec on SSP0 and speaker amplifiers on SSP1.

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://msgid.link/r/20240325221059.206042-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: remove sof_nau8825 board id
Brent Lu [Mon, 25 Mar 2024 22:10:58 +0000 (17:10 -0500)]
ASoC: Intel: sof_nau8825: remove sof_nau8825 board id

Remove sof_nau8825 board id and use adl_nau8825_def instead since SSP
port assignment is the same.

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://msgid.link/r/20240325221059.206042-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_ssp_amp: remove unnecessary idisp HDMI quirk
Brent Lu [Mon, 25 Mar 2024 22:10:57 +0000 (17:10 -0500)]
ASoC: Intel: sof_ssp_amp: remove unnecessary idisp HDMI quirk

Remove SOF_NUM_IDISP_HDMI(3) from board quirks since the value is 3 if
not defined.

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://msgid.link/r/20240325221059.206042-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: remove unnecessary idisp HDMI quirk
Brent Lu [Mon, 25 Mar 2024 22:10:56 +0000 (17:10 -0500)]
ASoC: Intel: sof_rt5682: remove unnecessary idisp HDMI quirk

Remove SOF_NUM_IDISP_HDMI(3) from board quirks since the value is 3 if
not defined.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@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://msgid.link/r/20240325221059.206042-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: board id cleanup for rpl boards
Brent Lu [Mon, 25 Mar 2024 22:10:55 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: board id cleanup for rpl boards

Introduce "rpl_da7219_def" board to reduce the number of rpl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

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://msgid.link/r/20240325221059.206042-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: board id cleanup for adl boards
Brent Lu [Mon, 25 Mar 2024 22:10:54 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: board id cleanup for adl boards

Introduce "adl_da7219_def" board to reduce the number of jsl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

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://msgid.link/r/20240325221059.206042-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: board id cleanup for jsl boards
Brent Lu [Mon, 25 Mar 2024 22:10:53 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: board id cleanup for jsl boards

Introduce "jsl_da7219_def" board to reduce the number of jsl board
configs. This config could support all boards which implement
headphone codec on SSP0 and speaker amplifiers on SSP1.

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://msgid.link/r/20240325221059.206042-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: add SOF_DA7219_MCLK_EN quirk
Brent Lu [Mon, 25 Mar 2024 22:10:52 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: add SOF_DA7219_MCLK_EN quirk

PLL bypass mode requires mclk to be present. However, mclk pin is not
connected in JSL boards. Here we add the SOF_DA7219_MCLK_EN quirk to
improve driver readability.

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://msgid.link/r/20240325221059.206042-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: add codec exit function
Brent Lu [Mon, 25 Mar 2024 22:10:51 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: add codec exit function

Add exit function to headphone codec 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://msgid.link/r/20240325221059.206042-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: use common module for DAI link generation
Brent Lu [Mon, 25 Mar 2024 22:10:50 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: use common module for DAI link generation

Use intel_board module to generate DAI link array and update num_links
field in snd_soc_card structure.

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://msgid.link/r/20240325221059.206042-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_ssp_amp: use common module for sof_card_private initialization
Brent Lu [Mon, 25 Mar 2024 22:10:49 +0000 (17:10 -0500)]
ASoC: Intel: sof_ssp_amp: use common module for sof_card_private initialization

Use intel_board module to initialize sof_card_private structure.

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://msgid.link/r/20240325221059.206042-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: use common module for sof_card_private initialization
Brent Lu [Mon, 25 Mar 2024 22:10:48 +0000 (17:10 -0500)]
ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization

Use intel_board module to initialize sof_card_private structure

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://msgid.link/r/20240325221059.206042-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_nau8825: use common module for sof_card_private initialization
Brent Lu [Mon, 25 Mar 2024 22:10:47 +0000 (17:10 -0500)]
ASoC: Intel: sof_nau8825: use common module for sof_card_private initialization

Use intel_board module to initialize sof_card_private structure.

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://msgid.link/r/20240325221059.206042-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: use common module for sof_card_private initialization
Brent Lu [Mon, 25 Mar 2024 22:10:46 +0000 (17:10 -0500)]
ASoC: Intel: sof_cs42l42: use common module for sof_card_private initialization

Use intel_board module to initialize sof_card_private structure.

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://msgid.link/r/20240325221059.206042-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: board_helpers: support sof_card_private initialization
Brent Lu [Mon, 25 Mar 2024 22:10:45 +0000 (17:10 -0500)]
ASoC: Intel: board_helpers: support sof_card_private initialization

Add a helper function for machine drivers to initialize common part of
sof_card_private structure. Also unify the macros of board quirks for
the 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://msgid.link/r/20240325221059.206042-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_cs42l42: rename BT offload quirk
Brent Lu [Mon, 25 Mar 2024 22:10:44 +0000 (17:10 -0500)]
ASoC: Intel: sof_cs42l42: rename BT offload quirk

Rename the quirk in preparation for future changes: common quriks will
be defined and handled in board helper module.

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://msgid.link/r/20240325221059.206042-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_rt5682: support ALC5650 on RPL boards
Brent Lu [Mon, 25 Mar 2024 22:10:43 +0000 (17:10 -0500)]
ASoC: Intel: sof_rt5682: support ALC5650 on RPL boards

This commit supports RPL boards which implement ALC5650 dual I2S
interface codec.

SSP port usage:
  HP:  SSP0 -> AIF1
  SPK: SSP1 -> AIF2
  BT:  SSP2 -> BT

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://msgid.link/r/20240325221059.206042-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_da7219: add rpl_mx98360_da7219 board config
Brent Lu [Mon, 25 Mar 2024 22:10:42 +0000 (17:10 -0500)]
ASoC: Intel: sof_da7219: add rpl_mx98360_da7219 board config

This configuration supports RPL boards which implement DA7219 on SSP0
and MAX98360A on SSP1. DA7219 uses PLL bypass mode to avoid WCLK
locking problem. To use this mode, the MCLK frequency must be 12.288
or 24.576MHz in the topology binary.

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://msgid.link/r/20240325221059.206042-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: board_helpers: change dai link helpers to static function
Brent Lu [Mon, 25 Mar 2024 22:10:41 +0000 (17:10 -0500)]
ASoC: Intel: board_helpers: change dai link helpers to static function

Since there is a helper function to generate entire DAI link array, we
switch individual dai link helpers to static function. No functional
change in this commit.

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://msgid.link/r/20240325221059.206042-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: sof_ssp_amp: use common module for DAI link generation
Brent Lu [Mon, 25 Mar 2024 22:10:40 +0000 (17:10 -0500)]
ASoC: Intel: sof_ssp_amp: use common module for DAI link generation

Use intel_board module to generate DAI link array and update num_links
field in snd_soc_card structure.

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://msgid.link/r/20240325221059.206042-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: board_helpers: support DAI link ID customization
Brent Lu [Mon, 25 Mar 2024 22:10:39 +0000 (17:10 -0500)]
ASoC: Intel: board_helpers: support DAI link ID customization

Add an new field link_id_overwrite to sof_card_private structure to
support machine drivers which DAI link ID is fixed number or
discontinue (i.e. no-codec boards). If this field is zero, DAI array
index will be used as link ID. Otherwise the value extracted from
link_id_overwrite will be used.

The field link_id_overwrite is supposed to be initialized by
SOF_LINK_IDS macro like following example.

ctx->link_id_overwrite = SOF_LINK_IDS(HEADPHONE_BE_ID,  \
      DMIC01_BE_ID,     \
      DMIC16K_BE_ID,    \
      IDISP_HDMI_BE_ID, \
      SPK_BE_ID,        \
      BT_OFFLOAD_BE_ID, \
      HDMI_IN_BE_ID)

An exception is that, if you use link_order_overwrite to overwrite
DAI link order, then you need to use the same order to build
link_id_overwrite variable as well.

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://msgid.link/r/20240325221059.206042-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: wm8974: Convert to dtschema
Kartik Agarwala [Mon, 25 Mar 2024 18:19:42 +0000 (23:49 +0530)]
ASoC: dt-bindings: wm8974: Convert to dtschema

Convert WM8974 audio CODEC bindings from text to dtschema.

Signed-off-by: Kartik Agarwala <agarwala.kartik@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240325181943.116733-1-agarwala.kartik@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl-esai: Convert fsl,esai.txt to yaml
Frank Li [Fri, 22 Mar 2024 14:54:05 +0000 (10:54 -0400)]
ASoC: dt-bindings: fsl-esai: Convert fsl,esai.txt to yaml

Convert fsl,esai.txt to yaml. So DTB_CHECK tools can verify dts file about
esai part.

clock-names 'spba' is optional according to description. So minItems of
clocks and clock-names is 3.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20240322145406.2613256-1-Frank.Li@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: mediatek: Assign dummy when codec not specified for a DAI link
AngeloGioacchino Del Regno [Wed, 13 Mar 2024 11:01:29 +0000 (12:01 +0100)]
ASoC: mediatek: Assign dummy when codec not specified for a DAI link

MediaTek sound card drivers are checking whether a DAI link is present
and used on a board to assign the correct parameters and this is done
by checking the codec DAI names at probe time.

If no real codec is present, assign the dummy codec to the DAI link
to avoid NULL pointer during string comparison.

Fixes: 4302187d955f ("ASoC: mediatek: common: add soundcard driver common code")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/20240313110147.1267793-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: mediatek: Commonize ADDA rate transform functions and enums
AngeloGioacchino Del Regno [Wed, 13 Mar 2024 11:01:28 +0000 (12:01 +0100)]
ASoC: mediatek: Commonize ADDA rate transform functions and enums

Both the enumerations for UL/DL rates, delay data and the functions
adda_{dl,ul}_rate_transform were duplicated for each MediaTek SoC
dai-adda driver: move the common bits to a new mtk-dai-adda-common
file and its header.
While at it, also add the "mtk_" prefix to the exported functions.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/20240313110147.1267793-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: mediatek: mt8192-afe-pcm: Simplify with dev_err_probe()
AngeloGioacchino Del Regno [Wed, 13 Mar 2024 11:01:27 +0000 (12:01 +0100)]
ASoC: mediatek: mt8192-afe-pcm: Simplify with dev_err_probe()

Simplify the probe function by switching error prints to return
dev_err_probe(), lowering the lines count; while at it, also
beautify some messages and change some others' level from warn
to error.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://msgid.link/r/20240313110147.1267793-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: mediatek: mt8192-afe-pcm: Convert to devm_pm_runtime_enable()
AngeloGioacchino Del Regno [Wed, 13 Mar 2024 11:01:26 +0000 (12:01 +0100)]
ASoC: mediatek: mt8192-afe-pcm: Convert to devm_pm_runtime_enable()

Switch from pm_runtime_enable() to devm_pm_runtime_enable(), allowing
to remove all gotos from the probe function.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://msgid.link/r/20240313110147.1267793-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: imx-es8328: Switch to using gpiod API
Andy Shevchenko [Mon, 18 Mar 2024 20:07:56 +0000 (22:07 +0200)]
ASoC: fsl: imx-es8328: Switch to using gpiod API

This updates the driver to gpiod API, and removes yet another use of
of_get_named_gpio().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240318200804.181516-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: fsl_ssi: Add dev_err_probe if PCM DMA init fails
Alexander Stein [Thu, 14 Mar 2024 14:16:42 +0000 (15:16 +0100)]
ASoC: fsl: fsl_ssi: Add dev_err_probe if PCM DMA init fails

This happens especially if this driver is built-in, but SDMA driver
is configured as module.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://msgid.link/r/20240314141642.2943605-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: wm8776: Convert to dtschema
Kartik Agarwala [Sun, 17 Mar 2024 20:02:02 +0000 (01:32 +0530)]
ASoC: dt-bindings: wm8776: Convert to dtschema

Convert WM8776 audio CODEC bindings from text to dtschema.

Signed-off-by: Kartik Agarwala <agarwala.kartik@gmail.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240317200201.119233-1-agarwala.kartik@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: amd: simplify soundwire dependencies for legacy stack
Vijendar Mukunda [Fri, 22 Mar 2024 11:20:15 +0000 (16:50 +0530)]
ASoC: amd: simplify soundwire dependencies for legacy stack

The CONFIG_SOUNDWIRE_AMD is a user-visible option, it should be never
selected by another driver.
So replace the extra complexity with a normal Kconfig dependency in
SND_SOC_AMD_SOUNDWIRE.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://msgid.link/r/20240322112018.3063344-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dt-bindings: fsl-audmix: Convert fsl,audmix.txt to yaml
Frank Li [Thu, 21 Mar 2024 15:04:00 +0000 (11:04 -0400)]
ASoC: dt-bindings: fsl-audmix: Convert fsl,audmix.txt to yaml

Convert fsl,audmix.txt to yaml to let dtb check tools check audmix part.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://msgid.link/r/20240321150401.2464783-1-Frank.Li@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: dmaengine_pcm: Allow passing component name via config
Tomi Valkeinen [Tue, 19 Mar 2024 08:22:36 +0000 (10:22 +0200)]
ASoC: dmaengine_pcm: Allow passing component name via config

At the moment we cannot instantiate two dmaengine_pcms with the same
parent device, as the components will be named the same, leading to
conflicts.

Add 'name' field to the snd_dmaengine_pcm_config, and use that (if
defined) as the component name instead of deriving the component name
from the device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://msgid.link/r/20240319-xilinx-dp-audio-v2-1-92d6d3a7ca7e@ideasonboard.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Delete unused REG_SUPPLY
Zhang Yi [Wed, 20 Mar 2024 08:30:12 +0000 (16:30 +0800)]
ASoC: codecs: ES8326: Delete unused REG_SUPPLY

REG_SUPPLY mutes the DAC when switching between
HDMI and speaker, so remove it to fix the mute issues

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240320083012.4282-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: codecs: ES8326: Reducing power consumption
Zhang Yi [Wed, 20 Mar 2024 08:30:11 +0000 (16:30 +0800)]
ASoC: codecs: ES8326: Reducing power consumption

For lower power consumption during hibernation, the configuration of
es8326_suspend and es8326_remove will be adjusted.
Adding es8326_i2c_shutdown and es8326_i2c_remove to cover different
situations

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://msgid.link/r/20240320083012.4282-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: imx-rpmsg: Update to correct DT node
Chancel Liu [Mon, 11 Mar 2024 11:13:49 +0000 (20:13 +0900)]
ASoC: fsl: imx-rpmsg: Update to correct DT node

In order to support register and unregister rpmsg sound card through
remoteproc platform device for card to probe is registered in
imx-audio-rpmsg. ASoC machine driver no longer can get DT node of ASoC
CPU DAI device through parent device.

ASoC machine driver can get DT node of ASoC CPU DAI device with rpmsg
channel name acquired from platform specific data.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-6-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: fsl_rpmsg: Register CPU DAI with name of rpmsg channel
Chancel Liu [Mon, 11 Mar 2024 11:13:48 +0000 (20:13 +0900)]
ASoC: fsl: fsl_rpmsg: Register CPU DAI with name of rpmsg channel

Each rpmsg sound card sits on one rpmsg channel. Register CPU DAI with
name of rpmsg channel so that ASoC machine driver can easily link CPU
DAI with rpmsg channel name.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-5-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: Let imx-audio-rpmsg register platform device for card
Chancel Liu [Mon, 11 Mar 2024 11:13:47 +0000 (20:13 +0900)]
ASoC: fsl: Let imx-audio-rpmsg register platform device for card

Let imx-audio-rpmsg register platform device for card. So that card
register and unregister can be controlled by rpmsg driver's register
and unregister.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-4-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: imx-audio-rpmsg: Register device with rpmsg channel name
Chancel Liu [Mon, 11 Mar 2024 11:13:46 +0000 (20:13 +0900)]
ASoC: fsl: imx-audio-rpmsg: Register device with rpmsg channel name

This rpmsg driver registers device for ASoC platform driver. To align
with platform driver use rpmsg channel name to create device.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-3-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: fsl: imx-pcm-rpmsg: Register component with rpmsg channel name
Chancel Liu [Mon, 11 Mar 2024 11:13:45 +0000 (20:13 +0900)]
ASoC: fsl: imx-pcm-rpmsg: Register component with rpmsg channel name

Machine driver uses rpmsg channel name to link this platform component.
However if the component is re-registerd card will not find this new
created component in snd_soc_try_rebind_card().

Explicitly register this component with rpmsg channel name so that
card can always find this component.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240311111349.723256-2-chancel.liu@nxp.com
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: i2s_test: Remove redundant dapm routes
Amadeusz Sławiński [Fri, 8 Mar 2024 09:05:02 +0000 (10:05 +0100)]
ASoC: Intel: avs: i2s_test: Remove redundant dapm routes

Remove unnecessary widgets and routes as they are created by
snd_soc_dapm_connect_dai_link_widgets() automatically.

Link: https://lore.kernel.org/all/20230612110958.592674-1-brent.lu@intel.com/
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: ssm4567: Board cleanup
Cezary Rojewski [Fri, 8 Mar 2024 09:05:01 +0000 (10:05 +0100)]
ASoC: Intel: avs: ssm4567: Board cleanup

The card-name suffix and the DP-widgets are an unintended copy-paste
from skl_nau88215_ssm4567.c. Both are redundant.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: avs: ssm4567: Do not ignore route checks
Cezary Rojewski [Fri, 8 Mar 2024 09:05:00 +0000 (10:05 +0100)]
ASoC: Intel: avs: ssm4567: Do not ignore route checks

A copy-paste from intel/boards/skl_nau88l25_ssm4567.c made the avs's
equivalent disable route checks as well. Such behavior is not desired.

Fixes: 69ea14efe99b ("ASoC: Intel: avs: Add ssm4567 machine board")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: topology: Do not ignore route checks when parsing graphs
Cezary Rojewski [Fri, 8 Mar 2024 09:04:59 +0000 (10:04 +0100)]
ASoC: topology: Do not ignore route checks when parsing graphs

One of the framework responsibilities is to ensure that the enumerated
DPCMs are valid i.e.: a valid BE is connected to a valid FE DAI. While
the are checks in soc-core.c and soc-pcm.c that verify this, a component
driver may attempt to workaround this by loading an invalid graph
through the topology file.

Be strict and fail topology loading when invalid graph is encountered.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-3-cezary.rojewski@intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: Intel: Disable route checks for Skylake boards
Cezary Rojewski [Fri, 8 Mar 2024 09:04:58 +0000 (10:04 +0100)]
ASoC: Intel: Disable route checks for Skylake boards

Topology files that are propagated to the world and utilized by the
skylake-driver carry shortcomings in their SectionGraphs.

Since commit daa480bde6b3 ("ASoC: soc-core: tidyup for
snd_soc_dapm_add_routes()") route checks are no longer permissive. Probe
failures for Intel boards have been partially addressed by commit
a22ae72b86a4 ("ASoC: soc-core: disable route checks for legacy devices")
and its follow up but only skl_nau88l25_ssm4567.c is patched. Fix the
problem for the rest of the boards.

Link: https://lore.kernel.org/all/20200309192744.18380-1-pierre-louis.bossart@linux.intel.com/
Fixes: daa480bde6b3 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-2-cezary.rojewski@intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sun8i-codec: Implement jack and accessory detection
Arnaud Ferraris [Sat, 2 Mar 2024 14:00:38 +0000 (15:00 +0100)]
ASoC: sun8i-codec: Implement jack and accessory detection

Add support for the jack detection functionality in the A64 variant,
which uses a pair of IRQs; and microphone accessory (button) detection,
which uses an ADC with an IRQ trigger.

IRQs will only be triggered if the JACKDETEN, HMICBIASEN, and MICADCEN
bits are set appropriately in the analog codec component
(sun50i-codec-analog), but there is no direct software dependency
between the two components.

Setup ADC so that it samples with period of 16ms, disable smoothing
and enable MDATA threshold (should be below idle voltage/HMIC_DATA
value). Also enable HMIC_N, which makes sure we get HMIC_N samples
after HMIC_DATA crosses the threshold.

This allows us to perform steady state detection of HMIC_DATA, by
comparing current and previous ADC samples, to detect end of the
transient when the user de-presses the button. Otherwise ADC could
sample anywhere within the transient, and the driver may mis-issue
key-press events for other buttons attached to the resistor ladder.

[Ondrej: Almost complete rewrite of the patch, change to use set_jack
API. Better de-bounce, fix mic button handling, better interrupt
processing.]

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
[Samuel: Decouple from analog codec, fixes]
Co-developed-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Co-developed-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Link: https://msgid.link/r/20240302140042.1990256-5-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sun50i-codec-analog: Enable jack detection on startup
Arnaud Ferraris [Sat, 2 Mar 2024 14:00:37 +0000 (15:00 +0100)]
ASoC: sun50i-codec-analog: Enable jack detection on startup

This commit adds the necessary setup to enable jack detection on startup
as well as the callback function enabling the microphone ADC when
headset bias is enabled. The microphone ADC is also disabled in suspend.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
[Samuel: Moved MICADCEN setup to HBIAS event, added bias hooks]
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Ondřej Jirman <megi@xff.cz>
Link: https://msgid.link/r/20240302140042.1990256-4-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
5 months agoASoC: sun8i-codec: Enable bus clock at STANDBY and higher bias
Samuel Holland [Sat, 2 Mar 2024 14:00:36 +0000 (15:00 +0100)]
ASoC: sun8i-codec: Enable bus clock at STANDBY and higher bias

For codec variants that have a bus clock, that clock must be running to
receive interrupts. Since jack and mic accessory detection should work
even when no audio is playing, that means the bus clock should be
enabled any time the system is on.

Accomplish that by tying the bus clock to the runtime PM state, which is
then tied to the bias level not being OFF. Since the codec sets
idle_bias_on, bias will generally never be OFF. However, we can set
suspend_bias_off to maintain the power savings of gating the bus clock
during suspend, when we don't expect jack/accessory detection to work.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Ondřej Jirman <megi@xff.cz>
Link: https://msgid.link/r/20240302140042.1990256-3-megi@xff.cz
Signed-off-by: Mark Brown <broonie@kernel.org>