From patchwork Wed Sep 14 05:16:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 1677655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=om1+/gtr; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MS7sN4MqYz1ync for ; Wed, 14 Sep 2022 15:18:32 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oYKn2-0002kZ-PK; Wed, 14 Sep 2022 05:18:24 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oYKmK-0000jD-VM for kernel-team@lists.ubuntu.com; Wed, 14 Sep 2022 05:17:41 +0000 Received: from localhost.localdomain (unknown [124.160.154.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 3DA2B3F9F4 for ; Wed, 14 Sep 2022 05:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1663132657; bh=C6mbUkk0UF0d0H69GG6s11XFsxrFS5TgT3BmiCucbuE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=om1+/gtrWhdVuLocdxQ0m+ZIVaxiR+WNHxADPKvBFj0TWBib75ulR35zHvFIu/XcQ m3kdCV5qUdwItC2hpsYa0n9va5+42EKfMyJKTYJDHH06rnDUy8p4TDrjPAhiY4qUWM +PMYRqSg3TCXowiUqd0+SOxq6cDHueW7DHsdAlJmfZNwAJjWoq4MCQa6gNdx+VS6qf qJ98MO0BbuGt+uKxRG3e++8nZ3CleNBMDEiWa9ujalxyJQXnURu1/S0CPtjL9SeG4C GdN11O3LyXQ9RPeG73pPeOqgAtnqUFpIaiZZ0Cbvw9ZR7gZlNSuOpf5NhZ5PvzhLEI 03PU+Z/jKoe6A== From: Hui Wang To: kernel-team@lists.ubuntu.com Subject: [SRU][Kinetic][PATCH 12/14] ASoC: amd: add Pink Sardine machine driver using dmic Date: Wed, 14 Sep 2022 13:16:31 +0800 Message-Id: <20220914051633.20418-27-hui.wang@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914051633.20418-1-hui.wang@canonical.com> References: <20220914051633.20418-1-hui.wang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Syed Saba Kareem BugLink: https://bugs.launchpad.net/bugs/1989518 Add Pink Sardine platform machine driver using dmic. Signed-off-by: Syed Saba Kareem Reviewed-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220827165657.2343818-13-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown (cherry picked from commit 0c8327c07b2ecc4a4443b1dae407f0d4854b5ae1 linux-next) Signed-off-by: Hui Wang --- sound/soc/amd/ps/ps-mach.c | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sound/soc/amd/ps/ps-mach.c diff --git a/sound/soc/amd/ps/ps-mach.c b/sound/soc/amd/ps/ps-mach.c new file mode 100644 index 000000000000..b3e97093481d --- /dev/null +++ b/sound/soc/amd/ps/ps-mach.c @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Machine driver for AMD Pink Sardine platform using DMIC + * + * Copyright 2022 Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "acp62.h" + +#define DRV_NAME "acp_ps_mach" + +SND_SOC_DAILINK_DEF(acp62_pdm, + DAILINK_COMP_ARRAY(COMP_CPU("acp_ps_pdm_dma.0"))); + +SND_SOC_DAILINK_DEF(dmic_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0", + "dmic-hifi"))); + +SND_SOC_DAILINK_DEF(pdm_platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_ps_pdm_dma.0"))); + +static struct snd_soc_dai_link acp62_dai_pdm[] = { + { + .name = "acp62-dmic-capture", + .stream_name = "DMIC capture", + .capture_only = 1, + SND_SOC_DAILINK_REG(acp62_pdm, dmic_codec, pdm_platform), + }, +}; + +static struct snd_soc_card acp62_card = { + .name = "acp62", + .owner = THIS_MODULE, + .dai_link = acp62_dai_pdm, + .num_links = 1, +}; + +static int acp62_probe(struct platform_device *pdev) +{ + struct acp62_pdm *machine = NULL; + struct snd_soc_card *card; + int ret; + + platform_set_drvdata(pdev, &acp62_card); + card = platform_get_drvdata(pdev); + acp62_card.dev = &pdev->dev; + + snd_soc_card_set_drvdata(card, machine); + ret = devm_snd_soc_register_card(&pdev->dev, card); + if (ret) { + return dev_err_probe(&pdev->dev, ret, + "snd_soc_register_card(%s) failed\n", + card->name); + } + + return 0; +} + +static struct platform_driver acp62_mach_driver = { + .driver = { + .name = "acp_ps_mach", + .pm = &snd_soc_pm_ops, + }, + .probe = acp62_probe, +}; + +module_platform_driver(acp62_mach_driver); + +MODULE_AUTHOR("Syed.SabaKareem@amd.com"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME);