From: Syed Saba Kareem <Syed.SabaKareem@amd.com>
To: <broonie@kernel.org>, <alsa-devel@alsa-project.org>
Cc: <Vijendar.Mukunda@amd.com>, <Basavaraj.Hiregoudar@amd.com>,
<Sunil-kumar.Dommati@amd.com>, <mario.limonciello@amd.com>,
<venkataprasad.potturu@amd.com>, <arungopal.kondaveeti@amd.com>,
<mastan.katragadda@amd.com>, <juan.martinez@amd.com>,
Syed Saba Kareem <Syed.SabaKareem@amd.com>,
Liam Girdwood <lgirdwood@gmail.com>,
"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Marian Postevca <posteuca@mutex.one>,
Alper Nebi Yasak <alpernebiyasak@gmail.com>,
"Claudiu Beznea" <claudiu.beznea@microchip.com>,
Gaosheng Cui <cuigaosheng1@huawei.com>,
Jarkko Nikula <jarkko.nikula@bitmer.com>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH 09/13] ASoC: amd: acp: add machine driver support for pdm use case
Date: Sat, 21 Oct 2023 20:20:50 +0530 [thread overview]
Message-ID: <20231021145110.478744-9-Syed.SabaKareem@amd.com> (raw)
In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com>
add pdm use case machine driver support
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
---
sound/soc/amd/acp/acp-legacy-mach.c | 12 ++++++++++++
sound/soc/amd/acp/acp-platform.c | 29 ++++++++++++++++++-----------
2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c
index 1ab3edffe0ce..47c3b5f167f5 100644
--- a/sound/soc/amd/acp/acp-legacy-mach.c
+++ b/sound/soc/amd/acp/acp-legacy-mach.c
@@ -84,6 +84,11 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = {
.tdm_mode = false,
};
+static struct acp_card_drvdata acp_dmic_data = {
+ .dmic_cpu_id = DMIC,
+ .dmic_codec_id = DMIC,
+};
+
static bool acp_asoc_init_ops(struct acp_card_drvdata *priv)
{
bool has_ops = false;
@@ -165,6 +170,8 @@ static int acp_asoc_probe(struct platform_device *pdev)
card->name, ret);
goto out;
}
+ if (!strcmp(pdev->name, "acp-pdm-mach"))
+ acp_card_drvdata->platform = *((int *)dev->platform_data);
dmi_id = dmi_first_match(acp_quirk_table);
if (dmi_id && dmi_id->driver_data)
@@ -214,6 +221,10 @@ static const struct platform_device_id board_ids[] = {
.name = "rmb-rt5682s-rt1019",
.driver_data = (kernel_ulong_t)&rt5682s_rt1019_rmb_data,
},
+ {
+ .name = "acp-pdm-mach",
+ .driver_data = (kernel_ulong_t)&acp_dmic_data,
+ },
{ }
};
static struct platform_driver acp_asoc_audio = {
@@ -235,4 +246,5 @@ MODULE_ALIAS("platform:acp3xalc5682s1019");
MODULE_ALIAS("platform:acp3x-es83xx");
MODULE_ALIAS("platform:rmb-nau8825-max");
MODULE_ALIAS("platform:rmb-rt5682s-rt1019");
+MODULE_ALIAS("platform:acp-pdm-mach");
MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c
index f516daf6fef4..aaac8aa744cb 100644
--- a/sound/soc/amd/acp/acp-platform.c
+++ b/sound/soc/amd/acp/acp-platform.c
@@ -21,6 +21,8 @@
#include <linux/dma-mapping.h>
#include "amd.h"
+#include "../mach-config.h"
+#include "acp-mach.h"
#define DRV_NAME "acp_i2s_dma"
@@ -69,20 +71,25 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = {
int acp_machine_select(struct acp_dev_data *adata)
{
struct snd_soc_acpi_mach *mach;
- int size;
-
- size = sizeof(*adata->machines);
- mach = snd_soc_acpi_find_machine(adata->machines);
- if (!mach) {
- dev_err(adata->dev, "warning: No matching ASoC machine driver found\n");
- return -EINVAL;
+ int size, platform;
+
+ if (adata->flag == FLAG_AMD_LEGACY_ONLY_DMIC) {
+ platform = adata->platform;
+ adata->mach_dev = platform_device_register_data(adata->dev, "acp-pdm-mach",
+ PLATFORM_DEVID_NONE, &platform,
+ sizeof(platform));
+ } else {
+ size = sizeof(*adata->machines);
+ mach = snd_soc_acpi_find_machine(adata->machines);
+ if (!mach) {
+ dev_err(adata->dev, "warning: No matching ASoC machine driver found\n");
+ return -EINVAL;
+ }
+ adata->mach_dev = platform_device_register_data(adata->dev, mach->drv_name,
+ PLATFORM_DEVID_NONE, mach, size);
}
-
- adata->mach_dev = platform_device_register_data(adata->dev, mach->drv_name,
- PLATFORM_DEVID_NONE, mach, size);
if (IS_ERR(adata->mach_dev))
dev_warn(adata->dev, "Unable to register Machine device\n");
-
return 0;
}
EXPORT_SYMBOL_NS_GPL(acp_machine_select, SND_SOC_ACP_COMMON);
--
2.25.1
next prev parent reply other threads:[~2023-10-21 14:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-21 14:50 [PATCH 01/13] ASoC: amd: acp: Add acp6.3 pci legacy driver support Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 02/13] ASoC: amd: acp: refactor acp i2s clock generation code Syed Saba Kareem
2023-10-23 7:37 ` Amadeusz Sławiński
2023-10-21 14:50 ` [PATCH 03/13] ASoC: amd: acp: add i2s clock generation support for acp6.3 based platforms Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 04/13] ASoC: amd: acp: add machine driver support for acp6.3 platform Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 05/13] ASoC: amd: acp: add Kconfig options for acp6.3 based platform driver Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 06/13] ASoC: amd: acp: add code for scanning acp pdm controller Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 07/13] ASoC: amd: acp: add platform and flag data to acp data structure Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 08/13] ASoC: amd: acp: add condition check for i2s clock generation Syed Saba Kareem
2023-10-21 14:50 ` Syed Saba Kareem [this message]
2023-10-27 8:49 ` [PATCH 09/13] ASoC: amd: acp: add machine driver support for pdm use case Krzysztof Kozlowski
[not found] ` <3ec97548-1f91-49d0-adfb-4f8051ca9a97@amd.com>
[not found] ` <f8f8017c-4e76-4d70-918f-d7cb45186184@kernel.org>
[not found] ` <c0ea139c-9861-4ea1-b547-6e3c380301b3@amd.com>
[not found] ` <ZTvkCAYsrS62/82u@finisterre.sirena.org.uk>
2023-10-27 17:32 ` syed saba kareem
2023-10-28 9:14 ` Krzysztof Kozlowski
2023-10-21 14:50 ` [PATCH 10/13] ASoC: amd: acp: change acp-deinit function arguments Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 11/13] ASoC: amd: acp: change acp power on mask macro value Syed Saba Kareem
2023-10-21 14:50 ` [PATCH 12/13] ASoC: amd: acp: Add pci legacy driver support for acp7.0 platform Syed Saba Kareem
2023-10-23 7:50 ` Amadeusz Sławiński
2023-10-26 10:04 ` syed saba kareem
2023-10-21 14:50 ` [PATCH 13/13] ASoC: amd: acp: add machine driver support for acp7.0 Syed Saba Kareem
2023-10-23 8:01 ` [PATCH 01/13] ASoC: amd: acp: Add acp6.3 pci legacy driver support Krzysztof Kozlowski
[not found] ` <12c8c0f3-8364-4f25-976e-8cca29b5e17f@amd.com>
2023-10-26 15:00 ` Krzysztof Kozlowski
2023-10-25 16:50 ` Mark Brown
2023-10-26 9:44 ` syed saba kareem
2023-10-26 15:12 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231021145110.478744-9-Syed.SabaKareem@amd.com \
--to=syed.sabakareem@amd.com \
--cc=Basavaraj.Hiregoudar@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=alpernebiyasak@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=arungopal.kondaveeti@amd.com \
--cc=broonie@kernel.org \
--cc=claudiu.beznea@microchip.com \
--cc=cuigaosheng1@huawei.com \
--cc=jarkko.nikula@bitmer.com \
--cc=juan.martinez@amd.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mastan.katragadda@amd.com \
--cc=perex@perex.cz \
--cc=posteuca@mutex.one \
--cc=tiwai@suse.com \
--cc=venkataprasad.potturu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®