Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2901271pxb; Mon, 18 Oct 2021 04:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygQ3DgsUgbtICOQ9b1/IfJihq670yT+YUFpJDL+345sM/FpVuhQwL7znOlgBX2BJ/54flS X-Received: by 2002:a63:7f0e:: with SMTP id a14mr16764360pgd.390.1634556391211; Mon, 18 Oct 2021 04:26:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1634556391; cv=pass; d=google.com; s=arc-20160816; b=EadMVw7Lo39eX0uVq8jJH9aKDAWkOt9aaSeLZnMAuus0XWm+n6xfMewkqcpFhQtB8N vSwqUadxOLAZpZurJOKWG4MoP8Uva49lbQuFt87r9f6raawLt4hXFyxrgunK5QNEjv/8 2NJ2ZyNbnwVdgFhPQX9UTVNaMDUFufax0qPbVzHdTqewHmqa2klq3tlTX1JSj0TfYTHP zLQ0i+ddk7cWx9p+ZtTLQgNsaLNHvhXufq1lHpzfOYoxjbrw9vrqdDEQqo8NhZ6NpmCM 7iGIWqokD/8E4dg82F1hoWx3TPgCYjq4GAmdAd2MgXEmR0JSZrXhQbxbDAGiCL17wlBq EvcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8rFDP/8DCqKdY7EzJr3kT6tj+uUbNQ7OayWPaO28MwM=; b=URQEvGjyGxBUMQPb49MKcvjkgfNOHy3QawJ+X6/zmZtPsHsHzRPRImtJGN4dvfVgYs H0N1wT81JvZeTY2BmDGajUF0x7oxXaADUOayZ/82+aDinB8byyBV3o/mQ6GXdMF9jubt quOrtK0W1WSClEZ1u4ImCBe1tI3ODTfzDWToWMlOKvdJNWJCbza04/1DZ5sIxJwGrPUb B3OurT9SvRrI+UvS20fY6ytr8sXVihuL90Q0yUNMq0JbRRURngQGMuq8gG/n44v6dzMX owGNj6QOVL8RYL89yYN70lJAR8IkqMzoufB00Uhuaptb1ouYZ2z+zBQyo6u4AzcWiMyd tpcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=nYXwQU5+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si12295684pfu.123.2021.10.18.04.26.18; Mon, 18 Oct 2021 04:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=nYXwQU5+; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbhJRLZZ (ORCPT + 99 others); Mon, 18 Oct 2021 07:25:25 -0400 Received: from mail-co1nam11on2083.outbound.protection.outlook.com ([40.107.220.83]:13505 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231352AbhJRLZW (ORCPT ); Mon, 18 Oct 2021 07:25:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AnjgXOH5iK+k8SEjO1MysWQdMXHLQzOStpqEb0Jbc1/EQAHTR5pll0b7uyrsFulLxmdlKMzyQw9xbrFDrWVPV0SdcIgJmLLuz21nqzz+h7zIX2d7AFlsSytlNJ6dhaUBs98PN9e6Bu1dJrwPQ6iUaf0WSxZOZo//svd2r7Q/ptucCIrocif5AOUIi7fyVFwdaIApHbvyUrdOZJGXPRTwFkZa4eM1lISEvHoQVJ5aGqvLcRenMRhNXE3j3KZNndkImj0SmPQg/BFkfjAQUqiUrc+VZn6dfBReX4oojL+hGkTVzAQQyK8Cy+U+oCXFdLRQIowKktHMh6d7NlrxYOSwYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8rFDP/8DCqKdY7EzJr3kT6tj+uUbNQ7OayWPaO28MwM=; b=YMW8pLB71SY1GPdV7COo7KldhY8srm24/9NLIXfV/ShcrxawcoVPt/YsuSfm3W8MLrMNilzXrkRAtSOvovfiiY5Zlui+1Rcwqks41m0wwZBGRon4Ai6pyPGftvSywU8OHcM8wky8+i7HPBpCFCQVkyXs2/0rlaMFuzGeUq3luCTtMdsiEBEBRK0AtqbxEXmwgqlZ/kgjJF+5BaObplEooJckVSG9M0MbPYuuABllpEqY9jxOrGiQ5K0j7041VSCH9Stou75QgV5NQMUPSk0Ayjul2vVKTO6nYIp9UEXmnZFr5GBo61Vbs14UMdJ7PtFjfCfK58bF3hX8TKt4ZmsWJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8rFDP/8DCqKdY7EzJr3kT6tj+uUbNQ7OayWPaO28MwM=; b=nYXwQU5+xWaHj0p6gWoR07DOvvh7G5UHk9rg5WsdhfIix5+PXRY9AeLj+QyriiFnpujdsDAHQ9yUFs6hKKWl5MRify1Yd599J6dyyHS5fluTNswxbSzkOggnZwtL/ixSgFaW+xRzVvgqtXwwPq3PPS1YFQiKkXhHxJOj3JxDQ24= Received: from DM5PR2001CA0004.namprd20.prod.outlook.com (2603:10b6:4:16::14) by BYAPR12MB4600.namprd12.prod.outlook.com (2603:10b6:a03:112::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 11:23:09 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:4:16:cafe::6e) by DM5PR2001CA0004.outlook.office365.com (2603:10b6:4:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Mon, 18 Oct 2021 11:23:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 11:23:09 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 18 Oct 2021 06:23:09 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 18 Oct 2021 06:23:08 -0500 Received: from vijendar-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.15 via Frontend Transport; Mon, 18 Oct 2021 06:23:05 -0500 From: Vijendar Mukunda To: , CC: , , , , , Vijendar Mukunda , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list Subject: [PATCH V2 12/13] ASoC: amd: add YC machine driver using dmic Date: Mon, 18 Oct 2021 16:50:43 +0530 Message-ID: <20211018112044.1705805-13-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211018112044.1705805-1-Vijendar.Mukunda@amd.com> References: <20211018112044.1705805-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ef60f3c-6988-4b77-a37d-08d99229aa17 X-MS-TrafficTypeDiagnostic: BYAPR12MB4600: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WPMhEtrSES5EyqjxD8GIOsN3Oqn6Kp93AALb78Z6evT4HJSmKQGGKD8w4Ls5Ny7CwiLvtIUYr02zeBiUfRboy+a00hzydW6bNiNZmEKwgwHpw5/ZMok/GGP1pZIsaTgbmbVUf8HurORRN3K/Bj1ugMQJbObvJGmE6A80W50kEXjco6nBfoPhJy5K7RsvrhjlLm8WAHK85R7j+o51mfyyjJxH1iBwiLCV+MjDI0ikDSTP08zS9dOvYfwNNZzDDspa+yt9eYmiZfr/x1wShXJRPWMO1l+8C1uRb8czvxZZnfH3+e1r6IE08Mx1hEsnB5XgrrhQFT1XQc+RPyw7eGBCA8+E5qRSoGY1uqTWZs0+Qa+HBrgpRNv4RfqrnOCBqNIeH4r16kqvKey01N2K+EHrabwYGkYZlaiAGKYA/6T8/GVpCublzrdenYC/IKNDb9qablN9m8NivSq7rA5ZqgpSurkTL4Qp+m0ieP+/Hz7xRVzj7shrJ3qgvkFjx8AibFbO3DGGrBE+8KzxWnRZ/D0jGA6MbppTUoNus66D0pfFkgjVsFrS3bHqbzeg40awqXyS1DcFElYbsLobaSp/n35xuCzw4rUURy/RV3B66zDudfhA//wGD0GyINwnuiFtPN9vG/YigqzQKUAHVfVEqltFbrGPNgrJT8fC04SqrCugAb225TzS/4zhVoytMDkU6ihybtRgUHz/e/tV6MGHQa4vtgIMsAiyNMSzsyTV+7D5UY0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(1076003)(86362001)(356005)(26005)(82310400003)(316002)(47076005)(4326008)(426003)(2616005)(7696005)(186003)(70586007)(70206006)(336012)(6666004)(8676002)(36860700001)(508600001)(2906002)(8936002)(36756003)(54906003)(110136005)(5660300002)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 11:23:09.3836 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ef60f3c-6988-4b77-a37d-08d99229aa17 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4600 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add Yellow Carp platform machine driver using dmic. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x-mach.c | 194 ++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sound/soc/amd/yc/acp6x-mach.c diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c new file mode 100644 index 000000000000..9a767f47b89f --- /dev/null +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Machine driver for AMD Yellow Carp platform using DMIC + * + * Copyright 2021 Advanced Micro Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "acp6x.h" + +#define DRV_NAME "acp_yc_mach" + +SND_SOC_DAILINK_DEF(acp6x_pdm, + DAILINK_COMP_ARRAY(COMP_CPU("acp_yc_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_yc_pdm_dma.0"))); + +static struct snd_soc_dai_link acp6x_dai_pdm[] = { + { + .name = "acp6x-dmic-capture", + .stream_name = "DMIC capture", + .capture_only = 1, + SND_SOC_DAILINK_REG(acp6x_pdm, dmic_codec, pdm_platform), + }, +}; + +static struct snd_soc_card acp6x_card = { + .name = "acp6x", + .owner = THIS_MODULE, + .dai_link = acp6x_dai_pdm, + .num_links = 1, +}; + +static const struct dmi_system_id yc_acp_quirk_table[] = { + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D4"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D5"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CR"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21AW"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21AX"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21BN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21BQ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CH"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CK"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D8"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D9"), + } + }, + {} +}; + +static int acp6x_probe(struct platform_device *pdev) +{ + struct acp6x_pdm *machine = NULL; + struct snd_soc_card *card; + int ret; + const struct dmi_system_id *dmi_id; + + dmi_id = dmi_first_match(yc_acp_quirk_table); + if (!dmi_id) + return -ENODEV; + card = &acp6x_card; + acp6x_card.dev = &pdev->dev; + + platform_set_drvdata(pdev, card); + 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 acp6x_mach_driver = { + .driver = { + .name = "acp_yc_mach", + .pm = &snd_soc_pm_ops, + }, + .probe = acp6x_probe, +}; + +module_platform_driver(acp6x_mach_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -- 2.25.1