Commit graph

1072442 commits

Author SHA1 Message Date
Pierre-Louis Bossart
70b519e5ca
ASoC: Intel: sof_es8336: extend machine driver to support ES8326 codec
The ES8326 requires a different codec driver than ES8316/8336, fixup
the codec name and dai name depending on the ACPI _HID exposed in the
DSDT.

Also add the select in Kconfig

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://lore.kernel.org/r/20220308192610.392950-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:36 +00:00
Pierre-Louis Bossart
8e5db49182
ASoC: Intel: sof_es8336: add support for JD inverted quirk
The codec driver exposes a set of properties that can be set from the
machine driver - as done in bytcht_es8316.c

Start by adding the JD_INVERTED quirk.

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://lore.kernel.org/r/20220308192610.392950-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:31 +00:00
Pierre-Louis Bossart
d94c11a9b0
ASoC: Intel: sof_es8336: move comment to the right place
Additional code was added and the comment on the speaker GPIO needs to
be moved before we actually try to get the GPIO.

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://lore.kernel.org/r/20220308192610.392950-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:30 +00:00
Pierre-Louis Bossart
9c818d8491
ASoC: Intel: sof_es8336: log all quirks
We only logged the SSP quirk, make sure the GPIO and DMIC quirks are
exposed.

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://lore.kernel.org/r/20220308192610.392950-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:29 +00:00
Pierre-Louis Bossart
651c304df7
ASoC: Intel: sof_es8336: use NHLT information to set dmic and SSP
Since we see a proliferation of devices with various configurations,
we want to automatically set the DMIC and SSP information. This patch
relies on the information extracted from NHLT and partially reverts
existing DMI quirks added by commit a164137ce9 ("ASoC: Intel: add
machine driver for SOF+ES8336")

Note that NHLT can report multiple SSPs, choosing from the
ssp_link_mask in an MSB-first manner was found experimentally to work
fine.

The only thing that cannot be detected is the GPIO type, and users may
want to use the quirk override parameter if the 'wrong' solution is
provided.

Tested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
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://lore.kernel.org/r/20220308192610.392950-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:27 +00:00
Pierre-Louis Bossart
1b5283483a
ASoC: Intel: Revert "ASoC: Intel: sof_es8336: add quirk for Huawei D15 2021"
This reverts commit ce6a70bfce.

The next patch will add run-time detection of the required SSP and
this hard-coded quirk is not needed.

Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>
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://lore.kernel.org/r/20220308192610.392950-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:26 +00:00
Pierre-Louis Bossart
42302b205f
ASoC: Intel: sof_es8336: get codec device with ACPI instead of bus search
We have an existing 'adev' handle from which we can find the codec
device, no need for an I2C bus search.

This change aligns this driver will all other I2S-based machine
drivers.

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://lore.kernel.org/r/20220308192610.392950-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:25 +00:00
Pierre-Louis Bossart
5a6cfba555
ASoC: Intel: sof_es8336: make gpio optional
Do not fail if the GPIO used for speakers is not present, at least the
headphone, headset and internal mics should work.

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://lore.kernel.org/r/20220308192610.392950-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:24 +00:00
Nikolai Kostrigin
b3d6a07236
ASoC: Intel: soc-acpi: add ESSX8336 support on Cannon Lake machines
Add the support for all ES83x6 devices

Signed-off-by: Nikolai Kostrigin <nickel@altlinux.org>
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://lore.kernel.org/r/20220308192610.392950-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:23 +00:00
Pierre-Louis Bossart
cded07a2dc
ALSA: intel-dspconfig: add ES8336 support for CNL
We're missing this check for the CNL PCI id

Reported-by: Nikolai Kostrigin <nickel@altlinux.org>
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>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220308192610.392950-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:22 +00:00
Pierre-Louis Bossart
1cedb6eabf
ASoC: Intel: soc-acpi: add more ACPI HIDs for ES83x6 devices
We only saw ESSX8336 so far, but now with reports of 'ESSX8326' we
need to expand to a full list. Let's reuse the 'snd_soc_acpi_codecs'
structure to store the information.

Note that ES8326 will need a dedicated codec driver, but the plan is
to use the same machine driver for all Everest Audio devices.

Reported-by: anthony tonitch <d.tonitch@gmail.com>
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://lore.kernel.org/r/20220308192610.392950-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:21 +00:00
Pierre-Louis Bossart
de24d97fb8
ALSA: intel-dsp-config: add more ACPI HIDs for ES83x6 devices
We only saw ESSX8336 so far, but now with reports of 'ESSX8326' we
need to expand to a full list. Let's reuse the 'snd_soc_acpi_codecs'
structure to store the information.

Reported-by: anthony tonitch <d.tonitch@gmail.com>
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>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220308192610.392950-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:19 +00:00
Pierre-Louis Bossart
4694b8382d
ASoC: Intel: soc-acpi: quirk topology filename dynamically
Different topology filenames may be required depending on which SSP is
used, and whether or not digital mics are present.

This patch adds a tplg_quirk_mask and in the case of the SOF driver
adds the relevant configurations.

This is a short-term solution to the ES8336 support issues.

In a long-term solution, we would need an interface where the machine
driver or platform driver have the ability to alter the topology
hard-coded low-level hardware support, e.g. by substituting an
interface for another, or disabling an interface that is not supported
on a given skew.

BugLink: https://github.com/thesofproject/linux/issues/3248
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://lore.kernel.org/r/20220308192610.392950-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:18 +00:00
Pierre-Louis Bossart
bd015f633b
ASoC: SOF: Intel: hda: report SSP link mask to machine driver
For devices designed for Windows, the SSP information should be listed
in the NHLT, and when present can be used to set quirks automatically
in the machine driver.

The NHLT information exposes BT and analog audio connections
separately, for now we are only interested in the analog audio parts.

The use of dev_info() for the SSP mask is intentional so that we can
immediately flag devices with an ES8336 codec. Since NHLT is not used
for recent Chromebooks these messages should be rare.

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://lore.kernel.org/r/20220308192610.392950-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:17 +00:00
Pierre-Louis Bossart
0c470db039
ALSA: intel-nhlt: add helper to detect SSP link mask
The NHLT information can be used to figure out which SSPs are enabled
in a platform.

The 'SSP' link type is too broad for machine drivers, since it can
cover the Bluetooth sideband and the analog audio codec connections,
so this helper exposes a parameter to filter with the device
type (DEVICE_I2S refers to analog audio codec in NHLT parlance).

The helper returns a mask, since more than one SSP may be used for
analog audio, e.g. the NHLT spec describes the use of SSP0 for
amplifiers and SSP1 for headset codec. Note that if more than one bit
is set, it's impossible to determine which SSP is connected to what
external component. Additional platform-specific information based on
e.g. DMI quirks would still be required in the machine driver to
configure the relevant dailinks.

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>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220308192610.392950-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:16 +00:00
Pierre-Louis Bossart
92c1b7c0f7
ASoC: SOF: Intel: hda: retrieve DMIC number for I2S boards
We currently extract the DMIC number only for HDaudio or SoundWire
platforms. For I2S/TDM platforms, this wasn't necessary until now, but
with devices with ES8336 we need to find a solution to detect dmics
more reliably than with a DMI quirk.

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://lore.kernel.org/r/20220308192610.392950-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:15 +00:00
Pierre-Louis Bossart
679aa83a0f
ASoC: soc-acpi: add information on I2S/TDM link mask
The platform driver may have information on which I2S/TDM link(s) to
enable in the machine driver. In the case of Intel devices, this may
be extracted from NHLT tables in platform firmware. This link
information is necessary to make sure machine driver and topology are
aligned.

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://lore.kernel.org/r/20220308192610.392950-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:14 +00:00
Pierre-Louis Bossart
1174442b82
ASoC: soc-acpi: fix kernel-doc descriptor
Add missing dmic_num mention and clarify that 'links' mean 'SoundWire
links', not to be used for other links.

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://lore.kernel.org/r/20220308192610.392950-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:13 +00:00
Mark Brown
73d9cf7ca1
Clean ups and preparation for IPC abstraction in the SOF driver
Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

In preparation for adding support for the new IPC version that has been
introduced in the SOF firmware, this patch set includes some clean ups
and necessary modifications to commonly used functions that will be
re-used across different IPC-specific code.
2022-03-08 17:19:21 +00:00
Mark Brown
6b1b0f7d7d
Add driver for SAMA7G5's PDMC
Merge series from Codrin Ciubotariu <codrin.ciubotariu@microchip.com>:

This patch series adds support for Pulse Density Microphone Controller
(PDMC), present on Microchip's SAMA7G5.
The PDMC interfaces up to 4 digital microphones having Pulse Density
Modulated (PDM) outputs. It generates a single clock line and samples 1 or
2 data lines. The signal path includes an audio grade programmable
decimation filter and outputs 24-bit audio words.
The source of each channel can be independently defined as PDMC_DS0 or
PDMC_DS1, sampled at the rising or falling edge of PDMC_CLK.

The patch series starts with a fix on the ASoC DMA engine support. Then
continues with the bindings and the driver of PDMC. It is followed by the
DT nodes for SAMA7G5 and SAMA7G5-EK. In the end, the drivers for PDMC
and PDM microphones are enabled in sama7_defconfig.
2022-03-08 17:19:20 +00:00
Miaoqian Lin
6ae0a4d8fe
ASoC: mxs: Fix error handling in mxs_sgtl5000_probe
This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
For example, when codec_np is NULL, saif_np[0] and saif_np[1]
are not NULL, it will cause leaks.

of_node_put() will check if the node pointer is NULL, so we can
call it directly to release the refcount of regular pointers.

Fixes: e968194b45 ("ASoC: mxs: add device tree support for mxs-sgtl5000")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220308020146.26496-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:41:15 +00:00
Codrin Ciubotariu
50291652af
ASoC: atmel: mchp-pdmc: add PDMC driver
The Pulse Density Microphone Controller (PDMC) interfaces up to 4 digital
microphones having Pulse Density Modulated (PDM) outputs. It generates a
single clock line and samples 1 or 2 data lines. The signal path includes
an audio grade programmable decimation filter and outputs 24-bit audio
words on the APB bus.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307122202.2251639-4-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:38:59 +00:00
Codrin Ciubotariu
015044e961
ASoC: dt-bindings: Document Microchip's PDMC
Add DT bindings for the new Microchip PDMC embedded in sama7g5 SoCs.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20220307122202.2251639-3-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:38:58 +00:00
Codrin Ciubotariu
9a1e13440a
ASoC: dmaengine: do not use a NULL prepare_slave_config() callback
Even if struct snd_dmaengine_pcm_config is used, prepare_slave_config()
callback might not be set. Check if this callback is set before using it.

Fixes: fa654e0853 ("ASoC: dmaengine-pcm: Provide default config")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307122202.2251639-2-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:38:56 +00:00
Miaoqian Lin
a6b44a2518
ASoC: rk817: Fix missing clk_disable_unprepare() in rk817_platform_probe
Fix the missing clk_disable_unprepare() before return
from rk817_platform_probe() in the error handling case.

Fixes: 0d6a04da9b ("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20220307090146.4104-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:32:01 +00:00
Miaoqian Lin
e45ac7831f
ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Fixes: 4e28491a7a ("ASoC: mediatek: mt8192-mt6359: fix device_node leak")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220308015224.23585-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:59 +00:00
Miaoqian Lin
5575f7f491
ASoC: SOF: Add missing of_node_put() in imx8m_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

Fixes: afb93d7165 ("ASoC: SOF: imx: Add i.MX8M HW support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220308023325.31702-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:58 +00:00
Miaoqian Lin
f725d20579
ASoC: rockchip: i2s: Fix missing clk_disable_unprepare() in rockchip_i2s_probe
Fix the missing clk_disable_unprepare() before return
from rockchip_i2s_probe() in the error handling case.

Fixes: 01605ad128 ("ASoC: rockchip-i2s: enable "hclk" for rockchip I2S controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220307083553.26009-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:57 +00:00
YueHaibing
6f6f28bf5d
ASoC: amd: acp3x: Fix signedness bug in acp3x
In acp3x_audio_probe() platform_get_irq() may return error, but i2s_irq now
is unsigned int so the error handling is never triggered.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20220305123613.6324-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:56 +00:00
YueHaibing
954e615497
ASoC: amd: acp5x-pcm-dma: Fix signedness bug
In acp5x_audio_probe() platform_get_irq() may return error, but i2s_irq now
is unsigned int so the error handling is never triggered.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20220305123705.3708-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:55 +00:00
Jiaxin Yu
5ea14bf62e
ASoC: mediatek: mt8183: support wb bt audio
Use "bt-sco-pcm-wb" codec dai driver for wb bt audio.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220307033056.11463-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:53 +00:00
Lianjie Zhang
51996ca26f
ASoC: Intel: catpt: use asoc_substream_to_rtd()
Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220307151939.32870-1-zhanglianjie@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:52 +00:00
Miaoqian Lin
b0bfaf0544
ASoC: atmel: Fix error handling in snd_proto_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Fixes: a45f8853a5 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220308013949.20323-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:51 +00:00
Ranjani Sridharan
40bdb2fd6b
ASoC: SOF: change comp_dai to a pointer in struct snd_sof_dai
This will avoid having to add the extended data for DAI components during
sof_widget_setup() as an extra step.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-11-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:49 +00:00
Ranjani Sridharan
ea7e5ee67f
ASoC: SOF: topology: expose some get_token ops
These will be used later on by IPC-specific code.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-10-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:48 +00:00
Ranjani Sridharan
5ef969e2f8
ASoC: SOF: topology: Modify the get_token op for string tokens
Modify the get_token op for string type tokens to pass the string as the
argument instead of a pointer to struct snd_soc_tplg_vendor_string_elem.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-9-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:46 +00:00
Ranjani Sridharan
6a6b5727f8
ASoC: SOF: topology: Drop the size parameter from struct sof_topology_token
It is always 0 and never used while parsing.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-8-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:45 +00:00
Ranjani Sridharan
9911ce06db
ASoC: SOF: topology: remove redundant code in sof_link_afe_load()
Looks like a copy-paste error. The CPU DAI is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:44 +00:00
Ranjani Sridharan
fb763299bd
ASoC: SOF: topology: remove redundant code
With the change in the commit:
"ASoC: SOF: Intel: hda: assign link DMA channel at run-time",
there is no need to find the CPU DAI in sof_link_hda_load().

Fixes: bdf4ad3fd0 ('ASoC: SOF: Intel: hda: assign link DMA channel at
run-time')

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:43 +00:00
Pierre-Louis Bossart
c99b70a2d2
ASoC: SOF: sof-audio: removed unused function
cppcheck warning:

sound/soc/sof/sof-audio.c:884:0: style: The function
'snd_sof_find_spcm_pcm_id' is never used. [unusedFunction]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:42 +00:00
Ranjani Sridharan
3a790f3a7c
ASoC: SOF: set swidget's core for scheduler widget
Set the swidget's core for scheduler type widgets to match that of the
pipeline core. This simplifies the flow for core get/put during widget
setup/free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:41 +00:00
Ranjani Sridharan
80df222626
ASoC: SOF: simplify snd_sof_device_remove()
The commit "ASoC: SOF: core: Unregister machine driver before IPC and
debugfs" moved the call to unregister the machine driver to be done
before freeing the IPC. With this change, we can safely move the call to
snd_sof_remove() inside the same if() block just above.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:40 +00:00
Ranjani Sridharan
5187357e45
ASoC: SOF: remove snd_sof_pipeline_find()
It is not used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:39 +00:00
Mark Brown
9fce18ab0b
ASoC: fsl_sai: Cleanups and 1:1 bclk:mclk ratio support
Merge series from Sascha Hauer <s.hauer@pengutronix.de>:

This series has some updates for the fsl_sai driver: Some general
cleanup patches, a bugfix in the ip revision checking and finally
the mclk setting is made more accurate and support for 1:1 bclk:mclk
setting is added.
2022-03-07 20:37:00 +00:00
Mark Brown
5e36946abc
ASoC: SOF: updates for 5.18
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

A couple of updates for Intel and AMD hardware, along with minor
cleanups

Ajit Kumar Pandey (4):
  ASoC: SOF: amd: Flush cache after ATU_BASE_ADDR_GRP register update
  ASoC: SOF: amd: Use semaphore register to synchronize ipc's irq
  ASoC: SOF: amd: Move group register configuration to acp-loader
  ASoC: SOF: amd: Increase ACP_HW_SEM_RETRY_COUNT value

Curtis Malainey (1):
  ASoC: SOF: fix 32 signed bit overflow

Gongjun Song (1):
  ASoC: SOF: Intel: pci-tgl: add RPL-S support

Peter Ujfalusi (2):
  ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime
  ASoC: SOF: amd: Do not set ipc_pcm_params ops as it is optional

Pierre-Louis Bossart (2):
  ASoC: SOF: debug: clarify operator precedence
  ASoC: SOF: Intel: hda: clarify operator precedence

 include/sound/sof/header.h         |  2 +-
 include/uapi/sound/sof/abi.h       |  2 +-
 sound/soc/sof/amd/acp-dsp-offset.h |  1 +
 sound/soc/sof/amd/acp-ipc.c        | 22 ++++++++++++++--------
 sound/soc/sof/amd/acp-loader.c     |  9 +++++++++
 sound/soc/sof/amd/acp-pcm.c        |  7 ++++---
 sound/soc/sof/amd/acp-stream.c     |  3 +++
 sound/soc/sof/amd/acp.c            | 29 ++++++++++++++---------------
 sound/soc/sof/amd/acp.h            |  3 +--
 sound/soc/sof/amd/renoir.c         |  1 -
 sound/soc/sof/debug.c              |  2 +-
 sound/soc/sof/intel/hda.c          |  2 +-
 sound/soc/sof/intel/pci-tgl.c      |  2 ++
 13 files changed, 52 insertions(+), 33 deletions(-)

--
2.30.2
2022-03-07 20:36:58 +00:00
Mark Brown
2f4d6de533
ASoC: Intel: boards: cleanups for 5.18
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Updates to clean-up the GPIOLIB dependency and a quirk for HP
SoundWire devices.
2022-03-07 20:36:57 +00:00
Mark Brown
3066987e11
ASoC: audio_graph_card2: Support variable slot widths
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This adds support for I2S/TDM links where the slot width varies
depending on the sample width, in a way that cannot be guessed by
component hw_params().

A typical example is:

- 16-bit samples use 16-bit slots
- 24-bit samples use 32-bit slots

There is no way for a component hw_params() to deduce from the information
it is passed that 24-bit samples will be in 32-bit slots.

Some audio hardware cannot support a fixed slot width or a slot width
equal to the sample width in all cases. This is usually due either to
limitations of the audio serial port or system clocking restrictions.
2022-03-07 20:36:55 +00:00
Mark Brown
fc14fac286
ASoC: codecs: Add Awinic AW8738 audio amplifier driver
Merge series from Stephan Gerhold <stephan@gerhold.net>:

This series adds a simple driver and DT schema for the Awinic AW8738
audio amplifier. It's fairly simple - the main difference to
simple-amplifier is that there is a "one-wire pulse control" that
allows configuring the amplifier to one of a few pre-defined modes.
This can be used to configure the speaker-guard function (primarily
the power limit for the amplifier).
2022-03-07 20:36:54 +00:00
Dan Carpenter
468f252930
ASoC: amd: vg: fix signedness bug in acp5x_audio_probe()
The "adata->i2s_irq" variable is unsigned so the error handling
will not work.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131256.GA28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 15:45:56 +00:00
Richard Fitzgerald
71a6254c8b
ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START
DETECT_MODE and PLL_START must be zero while HP_PDN and ADC_PDN are
both 1. If this condition is broken it can discharge FILT+ and it
can then take up to 1 second for FILT+ to recharge.

There is no workaround required for this, simply avoiding settings
and sequences that would break the requirement. The driver already
meets the requirement.

But it is not obvious from reading the code that this requirement
exists, or what is ensuring it is met. So it would not currently be
obvious to someone changing the code that there is certain special
behaviour that must be maintained.

To avoid accidental breakage in the future:

- Add comments into the register definitions to warn about this so
  that anyone changing the code around DETECT_MODE and PLL_START is
  aware of this requirement.

- Add a comment where PLL_START is written to 1 to highlight the
  requirement and why it is satisfied.

- Add a comment in cs42l42_setup_hs_type_detect() when DETECT_MODE is
  initialized.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304144015.398656-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:59 +00:00