Commit graph

453 commits

Author SHA1 Message Date
Xiaoyan Li
4df5b13dec
ASoC: amd: yc: Add ASUS UM5302TA into DMI table
ASUS Zenbook S 13 OLED (UM5302TA) needs this quirk to get the built-in
microphone working properly.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216270
Signed-off-by: Xiaoyan Li <lxy.lixiaoyan@gmail.com>
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220920201436.19734-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-20 21:33:50 +01:00
Kuninori Morimoto
3989ade2d1
ASoC: soc.h: remove num_cpus/codecs
Current rtd has both dai_link pointer (A) and num_cpus/codecs (B).

(A)	rtd->dai_link	= dai_link;
(B)	rtd->num_cpus	= dai_link->num_cpus;
(B)	rtd->num_codecs	= dai_link->num_codecs;

But, we can get num_cpus/codecs (B) via dai_link (A).
This means we don't need to keep num_cpus/codecs on rtd.
This patch removes these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfkmv9n3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-20 12:19:30 +01:00
ye xingchen
f047199e6f
ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc()
Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-19 17:52:40 +01:00
ye xingchen
8e34d743f9
ASoC: amd: acp: use devm_kcalloc() instead of devm_kzalloc()
Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220916061906.152434-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-09-19 17:52:37 +01:00
Syed Saba kareem
ced579dcaa
ASoC: amd: fix spelling mistake: "i.e" -> "i.e."
trivial fix to spelling mistake in Kconfig File.

Reported by : Randy Dunlap <rdunlap@infradead.org>

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20220830132259.7759-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-30 18:59:12 +01:00
Mark Brown
fd609e8c28
Add Pink Sardine platform ASoC driver
Merge series from Syed Saba Kareem <Syed.SabaKareem@amd.com>:

Pink Sardine platform is new APU series based on acp6.2 design.
This patch set adds an ASoC driver for the ACP (Audio CoProcessor) block
on AMD Pink Sardine APU with DMIC endpoint support.
2022-08-30 11:08:12 +01:00
Syed Saba Kareem
2a09cef652
ASoC: amd: enable Pink sardine platform machine driver build.
This patch enables Pink Sardine platform machine driver build.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-14-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:17 +01:00
Syed Saba Kareem
0c8327c07b
ASoC: amd: add Pink Sardine machine driver using dmic
Add Pink Sardine platform machine driver using dmic.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-13-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:16 +01:00
Syed Saba Kareem
76dd567591
ASoC: amd: create platform device for acp6.2 machine driver
Create platform device for acp6.2 machine driver.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-12-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:15 +01:00
Syed Saba Kareem
1e4366489e
ASoC: amd: enable Pink Sardine acp6.2 drivers build
Pink Sardine ACP6.2 drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-11-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:14 +01:00
Syed Saba Kareem
28023a7879
ASoC: amd: add acp6.2 pdm driver pm ops
Add acp6.2 pdm driver pm ops.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-10-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:13 +01:00
Syed Saba Kareem
3a543d56e3
ASoC: amd: add acp6.2 pci driver pm ops
Add acp6.2 pci driver pm ops.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-9-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:13 +01:00
Syed Saba Kareem
5137305662
ASoC: amd: add acp6.2 pdm driver dma ops
This patch adds PDM driver DMA operations for Pink Sardine Platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-8-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:12 +01:00
Syed Saba Kareem
5bbeca60a5
ASoC: amd: add acp6.2 irq handler
Add ACP6.2 irq handler for handling irq events for ACP IP.
Add pdm irq events handling.
Whenever audio data equal to the PDM watermark level are consumed,
interrupt is generated. Acknowledge the interrupt.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-7-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:11 +01:00
Syed Saba Kareem
33cea6bbe4
ASoC: amd: add acp6.2 pdm platform driver
PDM platform driver binds to the platform device created by
ACP6.2 PCI device. PDM driver registers ALSA DMA and CPU DAI
components with ASoC framework.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-6-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:10 +01:00
Syed Saba Kareem
515ee2574a
ASoC: amd: add platform devices for acp6.2 pdm driver and dmic driver
ACP6.2 IP has PDM decoder block.
Create a platform device for it, so that the PDM platform driver
can be bound to this device.
Pass PCI resources like MMIO to this platform device.

Create a platform device for generic dmic codec driver.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-5-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:09 +01:00
Syed Saba Kareem
9766bb62cf
ASoC: amd: add acp6.2 init/de-init functions
Add Pink Sardine platform ACP6.2 PCI driver init/deinit functions.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-4-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:08 +01:00
Syed Saba Kareem
95e43a170b
ASoC: amd: add Pink Sardine ACP PCI driver
ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources for Pink Sardine Platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220827165657.2343818-3-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-29 23:14:07 +01:00
Venkata Prasad Potturu
99a387c781
ASoC: amd: acp: Modify dai_id macros to be more generic
Change dai_id macros to make I2S instances in order.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20220826064250.3302260-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-28 22:04:03 +01:00
Dan Carpenter
a74ec0bf5b
ASoC: amd: acp: remove unnecessary NULL checks
The list iterator can never be NULL.  Delete the bogus NULL checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yv8ePUuBfzaRu6xV@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-19 13:20:00 +01:00
Yang Yingliang
fd8ec75207
ASoC: amd: acp: add a label to make error path more clean
Move platform_device_unregister() to a new label to make code more clean.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-19 13:19:58 +01:00
Yang Yingliang
f89a8c5bb3
ASoC: amd: acp: switch to use dev_err_probe()
Use dev_err_probe() to simplify code and print error code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-19 13:19:57 +01:00
Yang Yingliang
6a4ce20fd7
ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
Add missing platform_device_unregister() in error path in acp_pci_probe().

Fixes: c49f5e74a1 ("ASoC: amd: acp: Add error handling cases")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-19 13:19:56 +01:00
Venkata Prasad Potturu
12229b7e50
ASoC: amd: acp: Add TDM support for acp i2s stream
Add callback and code changes to enable ACP I2S controller in TDM
mode. Add new fields in acp_stream and acp_dev_data struct to configure
tdm related registers for ACP i2s controllers.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20220810132913.1181247-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-15 01:19:42 +01:00
Ajit Kumar Pandey
7929985cfe
ASoC: amd: acp: Initialize list to store acp_stream during pcm_open
We are currently allocating acp_stream during pcm_open and saving
it in static array corresponds to array index calculated based on
cpu dai->driver id. This approach will fail if we have single dai
linked to multiple pcm device as we will have same dai->driver id
or array index for multiple pcm open. Initialize new linked list
stream_list to store opened pcm stream info dynamically.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220810132913.1181247-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-15 01:19:41 +01:00
syed sabakareem
c0fc96fed7
ASoC: amd: yc: Update DMI table entries for AMD platforms
Updated DMI entries 21EM, 21EN, 21J5 and 21J6 for
AMD platforms P15v Gen 3 and P14s Gen 3.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216267
Signed-off-by: syed saba kareem <Syed.SabaKareem@amd.com>
Reported-by: Pananchikkal Renjith <renjith.pananchikkal@amd.com>
Link: https://lore.kernel.org/r/20220802062503.159328-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-08-02 14:38:21 +01:00
Nathan Chancellor
d81677410f
ASoC: amd: acp: Fix initialization of ext_intr_stat1 in i2s_irq_handler()
Clang warns:

  ../sound/soc/amd/acp/acp-platform.c:117:19: error: variable 'ext_intr_stat1' is uninitialized when used here [-Werror,-Wuninitialized]
                          if (stream && (ext_intr_stat1 & stream->irq_bit)) {
                                         ^~~~~~~~~~~~~~
  ../sound/soc/amd/acp/acp-platform.c:97:35: note: initialize the variable 'ext_intr_stat1' to silence this warning
          u32 ext_intr_stat, ext_intr_stat1, i;
                                           ^
                                            = 0
  1 error generated.

The variable was not properly renamed, correct it to resolve the
warning.

Fixes: 93f5388147 ("ASoC: amd: acp: Modify local variables name to generic")
Link: https://github.com/ClangBuiltLinux/linux/issues/1675
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20220725180539.1315066-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-26 13:02:25 +01:00
syed sabakareem
be0aa8d4b0
ASoC: amd: yc: Update DMI table entries
Removed intel DMI product id's 21AW/21AX/21D8/21D9/21BN/21BQ
in DMI table and updated DMI entry for AMD platform X13 Gen 3
platform 21CM/21CN.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216267

Signed-off-by: syed sabakareem <Syed.SabaKareem@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reported-by: David Korth <gerbilsoft@gerbilsoft.com>
Fixes: fa991481b8 ("ASoC: amd: add YC machine driver using dmic")
Link: https://lore.kernel.org/r/20220722134603.316668-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-22 21:27:57 +01:00
Cristian Ciocaltea
b340128432
ASoC: amd: vangogh: Use non-legacy DAI naming for cs35l41
Unlike most CODEC drivers, the CS35L41 driver did not have the
non_legacy_dai_naming set, meaning the corresponding DAI has been
traditionally registered using the legacy naming: spi-VLV1776:0x

The recent migration to the new legacy DAI naming style has implicitly
corrected that behavior and DAI gets now registered via the non-legacy
naming, i.e. cs35l41-pcm.

The problem is the acp5x platform driver is now broken as it continues
to refer to the above mentioned codec using the legacy DAI naming in
function acp5x_cs35l41_hw_params() and, therefore, the related setup
is not being executed anymore.

Let's fix that by replacing the obsolete DAI name with the correct one.

Fixes: 129f055a21 ("ASoC: core: Switch core to new DAI naming flag")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220722092700.8269-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-22 13:40:01 +01:00
Syed Saba Kareem
4fb35936a3
ASoC: amd: enable RPL Platform acp drivers build
RPL Platform drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721061035.91139-5-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:25:19 +01:00
Syed Saba Kareem
bc1100f29d
ASoC: amd: add RPL Platform pci driver pm-ops
Add RPL Platform ACP PCI driver pm ops.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721061035.91139-4-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:25:18 +01:00
Syed Saba Kareem
1059920541
ASoC: amd: add RPL Platform init/de-init functions
Add RPL Platform ACP init/de-init functions.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721061035.91139-3-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:25:17 +01:00
Syed Saba Kareem
003b9a96f2
ASoC: amd: add ACP PCI driver for RPL platform
ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721061035.91139-2-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:25:16 +01:00
Syed Saba Kareem
d6a2cc9a80
ASoC: amd: add RPL Platform acp header file
Add ACP register header file for RPL platform.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721061035.91139-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:25:15 +01:00
Venkata Prasad Potturu
c49f5e74a1
ASoC: amd: acp: Add error handling cases
Add error handling in acp pci driver probe function.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721062043.3016985-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:24:15 +01:00
Venkata Prasad Potturu
96b008a1c2
ASoC: amd: acp: Modify const resource struct variable to generic
Change platform specific constant resource structure variable
to generic name.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721062043.3016985-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 23:24:14 +01:00
Venkata Prasad Potturu
afde6727a9
ASoC: amd: acp: Drop superfluous mmap callback
Remove mmap callback as ASoC AMD drivers just call
the standard mmap handler.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721062043.3016985-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 13:38:57 +01:00
Venkata Prasad Potturu
93f5388147
ASoC: amd: acp: Modify local variables name to generic
Change local variables name to be generic in irq handler.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220721062043.3016985-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21 13:38:56 +01:00
Mario Limonciello
393a40b50f
ASoC: amd: yc: Decrease level of error message
On a number of platforms that contain acp3x controller a new ERR level
message is showing up:

`acp6x pci device not found`

This is because ACP3x and ACP6x share same PCI ID but can be identified
by PCI revision.  As this is expected behavior for a system with ACP3x
decrease message to debug.

Fixes: b1630fcbfd ("ASoC: amd: yc: add new YC platform varaint support")
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220718213402.19497-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-19 14:54:25 +01:00
Randy Dunlap
1795c16a43
ASoC: amd: fix Jadeite kconfig warning and build errors
Since SND_SOC_ES8316 has a hard dependency on I2C and since 'select'
does not follow any dependency chains, SND_SOC_AMD_ST_ES8336_MACH
also needs to have a hard dependency on I2C.

Fixes a kconfig warning and subsequent build errors:

WARNING: unmet direct dependencies detected for SND_SOC_ES8316
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=n]
  Selected by [y]:
  - SND_SOC_AMD_ST_ES8336_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP [=y] && ACPI [=y] && (I2C [=n] || COMPILE_TEST [=y])

sound/soc/codecs/es8316.c:866:1: warning: data definition has no type or storage class
  866 | module_i2c_driver(es8316_i2c_driver);
sound/soc/codecs/es8316.c:866:1: error: type defaults to ‘int’ in declaration of ‘module_i2c_driver’ [-Werror=implicit-int]
sound/soc/codecs/es8316.c:866:1: warning: parameter names (without types) in function declaration
sound/soc/codecs/es8316.c:857:26: warning: ‘es8316_i2c_driver’ defined but not used [-Wunused-variable]
  857 | static struct i2c_driver es8316_i2c_driver = {

Fixes: f94fa84058 ("ASoC: amd: enable machine driver build for Jadeite platform")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Link: https://lore.kernel.org/r/20220712183348.31046-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-13 13:48:55 +01:00
Dan Carpenter
73acfba792
ASoC: amd: Fix error pointer dereference
The "gpio_pa" pointer is an error pointer, there is no need to try
put it.  Calling gpiod_put() on it will lead to an error pointer
dereference.

Fixes: 02527c3f23 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Ys2IRPHWGIwuVs21@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-13 13:48:53 +01:00
Mark Brown
61b23b6b7b
ADD legacy audio driver support for rembrandt
Merge series from V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>:

Add Generic driver to support multiple platform,
ADD HS control instance for Rembrandt platform.
Add nau8825,max98560 and rt5682s,rt1019 combination support for legacy
platform.
2022-07-11 16:18:15 +01:00
V sujith kumar Reddy
e8a33a9407
ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform
Add i2s and dmic support for Rembrandt platform,
Add machine support for nau8825, max98360 and rt5682s,rt1019 codec
in legacy driver for rembrandt platform.
Here codec is in a slave mode.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-4-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:15 +01:00
V sujith kumar Reddy
b24484c18b
ASoC: amd: acp: ACP code generic to support newer platforms
ADD Generic code to support to newer platforms, add
control threshold, irq control macros ,added structure for register
offset differences.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-3-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:14 +01:00
V sujith kumar Reddy
ac2606df8a
ASoC: amd: acp: Remove rt1019_1 codec conf from machine driver
Remove rt1019_1 codec configuration which has i2c-10EC1019:01 and
i2c-10EC1019:02 codec components, Now Using default i2c-10EC1019:00
and i2c-10EC1019:01 codec components.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-2-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:13 +01:00
Yang Li
657efd9c98
ASoC: amd: Remove duplicated include in acp-es8336.c
Fix following includecheck warning:
./sound/soc/amd/acp-es8336.c: linux/module.h is included more than once.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220707232540.22589-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:52:54 +01:00
Vijendar Mukunda
0de876c125
ASoC: amd: fix for variable set but not used warning
Fix below kernel warning.
>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>> not used [-Wunused-but-set-variable]

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:50 +01:00
Vijendar Mukunda
8d9cd3ead4
ASoC: amd: drop machine driver remove function
Drop machine driver remove() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:49 +01:00
Vijendar Mukunda
d7e5d8d24c
ASoC: amd: remove unused header file inclusion
Removed unused header file inclusion from Jadeite platform machine
driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:48 +01:00
Pierre-Louis Bossart
f460e3a974
ASoC: amd: acp-es8336: use static variables
Sparse warnings:

sound/soc/amd/acp-es8336.c:36:15: error: symbol 'codec_dev' was not
declared. Should it be static?

sound/soc/amd/acp-es8336.c:37:18: error: symbol 'gpio_pa' was not
declared. Should it be static?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220707214614.61081-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:47 +01:00
Vijendar Mukunda
ab34403db2
ASoC: amd: fix ACPI dependency compile errors and warnings
Fixed ACPI dependency complie errors and warnings as listed below.

All warnings (new ones prefixed by >>):

sound/soc/soc-acpi.c:34:1: error: redefinition of 'snd_soc_acpi_find_machine'
  34 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
     | ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/soc/soc-acpi.c:9:
include/sound/soc-acpi.h:38:1: note: previous definition of
'snd_soc_acpi_find_machine'
with type 'struct snd_soc_acpi_mach *(struct snd_soc_acpi_mach *)'
38 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
   | ^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-acpi.c: In function 'snd_soc_acpi_find_package':
sound/soc/soc-acpi.c:58:36: error: implicit declaration of function
'acpi_fetch_acpi_dev';
did you mean 'device_match_acpi_dev'?
[-Werror=implicit-function-declaration]
58 | struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
   |                            ^~~~~~~~~~~~~~~~~~~
   |                            device_match_acpi_dev
>> sound/soc/soc-acpi.c:58:36: warning: initialization of
   'struct acpi_device *' from 'int' makes pointer from integer
   without a cast [-Wint-conversion]
sound/soc/soc-acpi.c:64:25: error: invalid use of undefined type
'struct acpi_device'

64 |  if (adev && adev->status.present && adev->status.functional) {
   |                  ^~
sound/soc/soc-acpi.c:64:49: error: invalid use of undefined type
'struct acpi_device'
64 |  if (adev && adev->status.present && adev->status.functional) {
   |                                          ^~
sound/soc/soc-acpi.c:80:26: error: implicit declaration of function
'acpi_extract_package'  [-Werror=implicit-function-declaration]
 80 | status = acpi_extract_package(myobj,
    |          ^~~~~~~~~~~~~~~~~~~~
 sound/soc/soc-acpi.c: At top level:
 sound/soc/soc-acpi.c:95:6: error: redefinition of
 'snd_soc_acpi_find_package_from_hid'
 95 | bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
    |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 In file included from sound/soc/soc-acpi.c:9:
 include/sound/soc-acpi.h:44:1: note: previous definition of
 'snd_soc_acpi_find_package_from_hid'
   with type 'bool(const u8 *, struct snd_soc_acpi_package_context *)'
   {aka '_Bool(const unsigned char *,
               struct snd_soc_acpi_package_context *)'}
   44 | snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/soc-acpi.c:109:27: error: redefinition of
   'snd_soc_acpi_codec_list'
   109 | struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg)
       |                           ^~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/soc/soc-acpi.c:9:
include/sound/soc-acpi.h:51:41: note: previous definition of
'snd_soc_acpi_codec_list' with type 'struct snd_soc_acpi_mach *(void *)'
51 | static inline struct snd_soc_acpi_mach
     *snd_soc_acpi_codec_list(void *arg)
   | ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20220706205515.2485601-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 12:16:51 +01:00
Vijendar Mukunda
f94fa84058
ASoC: amd: enable machine driver build for Jadeite platform
Enable machine driver build for Jadeite platform using ES8336 Codec.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:46 +01:00
Vijendar Mukunda
02527c3f23
ASoC: amd: add Machine driver for Jadeite platform
Add Machine driver for Jadeite platform which uses ES8336 codec.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:45 +01:00
Vijendar Mukunda
3eb8440d0d
ASoC: amd: add I2S MICSP instance support
Add I2S MICSP instance support for Stoney variant.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:44 +01:00
Charles Keepax
0bc1e7d1fc
ASoC: amd: Migrate to new style legacy DAI naming flag
Change the legacy DAI naming flag from opting in to the new scheme
(non_legacy_dai_naming), to opting out of it (legacy_dai_naming).
These drivers appear to be on the CPU side of the DAI link and
currently uses the legacy naming, so add the new flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-19-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-27 13:16:30 +01:00
Uwe Kleine-König
0deb003933
ASoC: amd: acp: Fix error handling in .remove()
Even in the presence of problems (here: rn_acp_deinit() might fail), it's
important to unregister all resources acquired during .probe() because
even if .remove() returns an error code, the device is removed.

As .remove() is only called after .probe() returned success, platdata
must be valid, so the first check in .remove() can just be dropped.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220622061739.225966-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-22 13:39:36 +01:00
Mark Brown
d3d8feadcc
Specify clock provider directly to CPU DAIs
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Currently the set_fmt callback always passes clock provider/consumer
with respect to the CODEC. This made sense when the framework was
directly broken down into platforms and CODECs. However, as things
are now broken down into components which can be connected as either
the CPU or CODEC side of a DAI link it simplifies things if each
side of the link is just told if it is provider or consumer of the
clocks. Making this change allows us to remove one of the last parts
of the ASoC core that needs to know if a driver is a CODEC driver,
where it flips the clock format specifier if a CODEC driver is used on
the CPU side of a DAI link, as well as just being conceptually more
consistent with componentisation.

The basic idea of this patch chain is to change the set_fmt callback
from specifying if the CODEC is provider/consumer into directly
specifying if the component is provider/consumer. To do this we add
some new defines, and then to preserve bisectability, the migration is
done by adding a new callback, converting over all existing CPU side
drivers, converting the core, and then finally reverting back to the
old callback.

Converting the platform drivers makes sense as the existing defines
are from the perspective of the CODEC and there are more CODEC drivers
than platform drivers.

Obviously a fair amount of this patch chain I was only able to build
test, so any testing that can be done would be greatly appreciated.
2022-06-09 11:56:32 +01:00
Mark Brown
7ede9c4c16
Add Machine driver support for nau8825, max98560 and rt5682s, rt1019
Merge series from V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>:

Add support for some new AMD machines.
2022-06-07 11:54:03 +01:00
Julia Lawall
b661a848a5
ASoC: amd: acp: fix typo in comment
Spelling mistake (triple letters) in comment.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20220521111145.81697-79-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:38:31 +01:00
V sujith kumar Reddy
4dc6737cfe
ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance
We have new platform with rt5682s as a primary codec and rt1019 as an
amp codec. Add machine struct to register sof audio based sound card
on such Chrome machine.

Here we are configuring as a soc mclk master and codec slave.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220531120813.47116-3-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:35:01 +01:00
V sujith kumar Reddy
0439eb4d94
ASoC: amd: acp: Add support for nau8825 and max98360 card
We have new platform with nau8825 as a primary codec and max98360 as an
amp codec. Add machine struct to register sof audio based sound card
on such Chrome machine.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220531120813.47116-2-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:35:00 +01:00
Charles Keepax
346f47e784
ASoC: amd: vangogh: Rename set_fmt_new back to set_fmt
Now the core has been migrated across to the new direct clock
specification we can move the drivers back to the normal set_fmt
callback.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-30-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:33:54 +01:00
Charles Keepax
ab890e0f83
ASoC: amd: vangogh: Update to use set_fmt_new callback
As part of updating the core to directly tell drivers if they are clock
provider or consumer update this CPU side driver to use the new direct
callback.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06 12:33:26 +01:00
Syed Saba kareem
803a1f7272
ASoC: SOF: amd: Fixed Build error
Add linux/module.h in acp-pci.c to solve the below dependency

All error/warnings (new ones prefixed by >>):

>> sound/soc/amd/acp/acp-pci.c:148:1: warning: data definition has no type or storage class
148 | MODULE_DEVICE_TABLE(pci, acp_pci_ids);
| ^~~~~~~~~~~~~~~~~~~
>> sound/soc/amd/acp/acp-pci.c:148:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
...

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Syed Saba Kareem<ssabakar@amd.com>
Link: https://lore.kernel.org/r/20220523112956.3087604-1-ssabakar@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-23 18:33:13 +01:00
V sujith kumar Reddy
17572892e3
ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver.
RT1019 codec has two ways of controlling the en_spkr.  one way is
controlling through gpio pin method the another way is through codec
register update through driver.

Now Speaker enable/disable is controlled  through codec register updated
by codec driver.  This patch reverts gpio logic.

This reverts commit 5c5f08f7fc ("ASoC:
amd: acp: Power on/off the speaker enable gpio pin based on DAPM
callback.")

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220516160619.17832-2-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-19 16:46:43 +01:00
V sujith kumar Reddy
6107fb6607
ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver
RT1019 codec has two ways of controlling the en_spkr.  one way is
controlling through gpio pin method the another way is through codec
register update through driver.

Now Speaker enable/disable is controlled  through codec register updated
by codec driver.  This patch reverts gpio logic.

This reverts commit 7fa5c33d04 ("ASoC:
amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine
driver").

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220516160619.17832-1-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-19 16:44:52 +01:00
YueHaibing
d91835655c
ASoC: amd: vangogh: Remove duplicate include files
Remove duplicated includes.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20220514023806.34768-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-16 12:58:37 +01:00
Ajit Kumar Pandey
fbae863de8
ASoC: amd: acp: Add pm ops callback in machine driver
Add alsa snd_soc_pm_ops callback in ACP machine driver to support
suspend and resume operation of sound card components

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220420094442.1352717-1-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-20 14:25:13 +01:00
Akihiko Odaki
19aed2d6cd
ASoC: soc-card: Create jack kcontrol without pins
snd_soc_card_jack_new() allowed to create jack kcontrol without pins,
but did not create kcontrols. The jack would not have kcontrols if pins
were not going to be added.

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

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-14 17:37:21 +01:00
Mark Brown
2f7f0994cc
Allow detecting ACP6x DMIC via _DSD
Merge series from Mario Limonciello <mario.limonciello@amd.com>:

It's not possible to probe for the presence of a DMIC, so the ACP6x
machine driver currently has a hardcoded list of all the systems known
to have a DMIC connected to the ACP.

Although this design works it means that the acp6x driver needs to always
grow with more systems and worse, if an OEM introduces a new system there
will be a mismatch in time that even if the driver (otherwise) works fine
it needs their system added to the list to work.

So this series introduces a _DSD that OEMs can populate into the BIOS to
indicate presence of a DMIC.
2022-04-12 17:16:51 +01:00
Vijendar Mukunda
b1630fcbfd
ASoC: amd: yc: add new YC platform varaint support
Update PCI revision id check for the new YC platform varaint.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220411134119.1767646-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-11 19:19:49 +01:00
Mario Limonciello
5426f506b5
ASoC: amd: Add support for enabling DMIC on acp6x via _DSD
Currently the acp6x machine driver requires a hardcoded list of systems
that physically have DMIC connected.

To avoid having to continually add to an evergrowing list of systems add
support for a _DSD that can advertise this.

OEMs can add this _DSD to their BIOS under the ACP device to automatically
add the device to this driver without requiring any driver modifications.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220411134532.13538-3-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-11 19:18:06 +01:00
Mario Limonciello
e521f08778
ASoC: amd: Add driver data to acp6x machine driver
Currently all of the quirked systems use the same card and so the
DMI quirk list doesn't contain driver data.

Add driver data to these quirks and then check the data was present
or not.  This will allow potentially setting quirks for systems with
faulty firmware that claims to have a DMIC but doesn't really.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220411134532.13538-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-11 19:18:05 +01:00
Takashi Iwai
646b907e15 ASoC: Updates for v5.18
Quite a quiet release for ASoC, lots of work on drivers and platforms
 but nothing too groundbreaking but not much on the core itself:
 
  - Start of moving SoF to support multiple IPC mechanisms.
  - Use of NHLT ACPI table to reduce the amount of quirking required for
    Intel systems.
  - Some building blocks for use in forthcoming Intel AVS driver for
    legacy Intel DSP firmwares.
  - Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with
    TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek
    MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas
    RZ/V2L, Texas Instruments TAS585M
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmI4aDoACgkQJNaLcl1U
 h9BPKgf/XSKCt67IzrbnI9UXp1Q13C54z57e+nGr4LBSRraT/WwdXFevefC6JZDq
 bYQWhigFrQyyYSyxVJYIvtywXXpMzJ1ypzHqcBGmqCufoX0zoaRwTFYg60yiYqdy
 cDsX82/1bhI9Dp3RWaEKaMyaa9FI0Kr3WTA6EKdo592u0hxj4UcK51r7qsp1JpsR
 tQWGMYqqwtajhamFgrIlKiJDDVnv2qEhrWdho5W/FPAby+fsJ6VJBMhwEx/F7cXu
 Mjfa0k2MoMAlNX9DxtIHweVECaN32HJsytrbgUAdYnBoGaZNkXwLwvyp9RIeDAMP
 NZ+w3lwFLw1N8S2ho6kqtDpO+tJU0Q==
 =Y6/E
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v5.18

Quite a quiet release for ASoC, lots of work on drivers and platforms
but nothing too groundbreaking but not much on the core itself:

 - Start of moving SoF to support multiple IPC mechanisms.
 - Use of NHLT ACPI table to reduce the amount of quirking required for
   Intel systems.
 - Some building blocks for use in forthcoming Intel AVS driver for
   legacy Intel DSP firmwares.
 - Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with
   TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek
   MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas
   RZ/V2L, Texas Instruments TAS585M
2022-03-21 16:19:21 +01:00
Meng Tang
54e1bf9f61
ASoC: amd: Fix reference to PCM buffer address
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer.  The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.

Fixes: cab396d8b2 ("ASoC: amd: add ACP5x pcm dma driver ops")
Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Link: https://lore.kernel.org/r/20220316091303.9745-1-tangmeng@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-16 16:39:27 +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
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
Dan Carpenter
9a33f5632c
ASoC: amd: pcm-dma: Fix signedness bug in acp3x_audio_probe()
The "adata->i2s_irq" variable is unsigned so this error handling
code 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/20220304131534.GD28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:49 +00:00
Dan Carpenter
00925272f1
ASoC: amd: pcm-dma: Fix signedness bug in acp_pdm_audio_probe()
The "adata->pdm_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/20220304131335.GB28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:48 +00:00
Dan Carpenter
899a9a7f62
ASoC: amd: acp: Fix signedness bug in renoir_audio_probe()
The "adata->i2s_irq" is unsigned so this error handling will not
work.

Fixes: 3304a242f4 ("ASoC: amd: Use platform_get_irq_byname() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131449.GC28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:47 +00:00
Zhen Ni
a2253ec7ae
ASoC: amd: use asoc_substream_to_rtd()
Uses asoc_substream_to_rtd() helper.

Signed-off-by: Zhen Ni <nizhen@uniontech.com>
Link: https://lore.kernel.org/r/20220302081502.25367-1-nizhen@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-02 13:45:23 +00:00
Vijendar Mukunda
6f98980063
ASoC: amd: vangogh: fix uninitialized symbol warning in machine driver
Fixed below smatch static checker warning.
sound/soc/amd/vangogh/acp5x-mach.c:190 acp5x_cs35l41_hw_params()
error: uninitialized symbol 'ret'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220225193054.24916-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28 13:33:50 +00:00
Vijendar Mukunda
728a592619
ASoC: amd: vg: remove warnings and errors pointed out by checkpatch pl
Fix checkpatch pl errors and warnings in vangogh machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220225193054.24916-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28 13:33:49 +00:00
Vijendar Mukunda
5363d7304e
ASoC: amd: vg: update DAI link name
Update DAI link name as "acp5x-8821-play".

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220225193054.24916-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28 13:33:48 +00:00
Vijendar Mukunda
83b713619e
ASoC: amd: vg: fix for pm resume callback sequence
The previous condition is used to cross check only the active
stream status for I2S HS instance playback and capture use cases.

Modified logic to invoke sequence for two i2s controller instances.

This also fixes warnings reported by kernel robot:
"warning: variable 'frmt_val' set but not used"
"warning: variable 'reg_val' set but not used"

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220225193054.24916-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28 13:33:47 +00:00
Meng Tang
87d71a1287
ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Link: https://lore.kernel.org/r/20220227050928.32270-1-tangmeng@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28 13:33:35 +00:00
Jia-Ju Bai
431f9a77a4
ASoC: acp: check the return value of devm_kzalloc() in acp_legacy_dai_links_create()
The function devm_kzalloc() in acp_legacy_dai_links_create() can fail,
so its return value should be checked.

Fixes: d4c750f2c7 ("ASoC: amd: acp: Add generic machine driver support for ACP cards")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20220225131645.27556-1-baijiaju1990@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-25 13:45:41 +00:00
Meng Tang
3304a242f4
ASoC: amd: Use platform_get_irq_byname() to get the interrupt
platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_byname().

Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Link: https://lore.kernel.org/r/20220225112358.19403-1-tangmeng@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-25 13:45:37 +00:00
Ajit Kumar Pandey
1f197351b3
ASoC: amd: acp: Add DMIC machine driver ops
Add dmic ops and startup callback to add snd_pcm_hw_constraint for
pdm related device node.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220222124213.721224-4-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 17:44:01 +00:00
Ajit Kumar Pandey
eee33bac9e
ASoC: amd: acp-legacy: Add legacy card support for new machines
We have newer renoir platforms with different codecs combinations.
Add struct in legacy machine driver and add to list of supported
renoir machine to support sound card registration on platform with
rt5682s as primary headset codec and max98360 and rt1019 as speaker
amp codec.

This also fixes error reported by kernel robot:
"error: 'EN_SPKR_GPIO_DW' undeclared here"

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220222124213.721224-3-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 17:44:00 +00:00
Ajit Kumar Pandey
abdcf7282f
ASoC: amd: acp: Change card name for Guybrush Machine
Change sound card name for guybrush machine with rt5682 as primary
codec and rt1019 amp to align with names given in UCM config.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220222124213.721224-2-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 17:43:59 +00:00
Vijendar Mukunda
a9230ccc0c
ASoC: amd: vg: update acp init and deinit sequence
As part of ACP programming sequence, ACP_CONTROL and ACP_CLKMUX_SEL
registers should be updated during acp init and de-init sequence.
This patch updates register sequence during ACP init and
deinit.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220223071959.13539-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 02:04:30 +00:00
Vijendar Mukunda
0c38cc1dd1
ASoC: amd: vg: apply sample bits pcm constraint
ACP I2S controller has limitation to program different BCLK
for TX and RX paths.
Headset path uses I2S SP controller instance.
As per requirement, Restricted 32 bits as sample bits by
applying pcm constraint in startup calabck for Headset path.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220223071959.13539-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 02:04:29 +00:00
Vijendar Mukunda
9a617f0e10
ASoC: amd: vg: update platform clock control sequence
Add pre power on widget event.
Based on this event update platform clock control sequence.

This will fix Codec clock and pll restoration issue during
system level resume.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220223071959.13539-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 02:04:28 +00:00
Vijendar Mukunda
5ca4cf2c83
ASoC: amd: vangogh: refactor i2s master mode clock sequence code
Refactor I2S Master mode clock programming sequence code.
This will also fix the i2s clocks restore issue during system level
resume.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220223071959.13539-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-24 02:04:26 +00:00
V sujith kumar Reddy
7fa5c33d04
ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio
hence remove such gpio access control from machine driver to avoid conflict

Signed-off-by: V sujith kumar Reddy <vsujithkumar.reddy@amd.com>
Link: https://lore.kernel.org/r/20220131203225.1418648-1-vsujithkumar.reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-02 16:09:23 +00:00
Ajit Kumar Pandey
2d7d9f36b5
ASoC: amd: renoir: Add check for acp configuration flags
We have SOF and generic ACP support enabled for Renoir platforms
on some machines. Since we have same PCI id used for probing, add
check for machine configuration flag to avoid conflict with newer
pci drivers. Such machine flag has been initialized via dmi match
on few Chrome machines. If no flag is specified probe and register
older platform device.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-7-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:35 +00:00
Ajit Kumar Pandey
611ba05e8b
ASoC: amd: acp: acp-legacy: Add DMIC dai link support for Renoir
Add DMIC related dai link for pdm-dmic dai on Renoir platform with
generic dmic codec dai.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-6-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:34 +00:00
Ajit Kumar Pandey
6a75585a3d
ASoC: amd: acp: Add ACP init()/deinit() callback for Renoir.
ACP hardware has PGFSM control registers that can be configured to
power On/Off the ACP IP block. Add acp init()/de_init() callbacks
in renoir platform driver probe()/remove() respectively to power
on and off ACP IP block on ACP3X device.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-5-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:32 +00:00