From patchwork Tue Jul 28 16:02:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11689489 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B60A1138C for ; Tue, 28 Jul 2020 16:07:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D16C220792 for ; Tue, 28 Jul 2020 16:07:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="KwEqK48U"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="Gs12OxdJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D16C220792 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 889C616CF; Tue, 28 Jul 2020 18:06:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 889C616CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595952455; bh=rA3Bzxer0lVR73NrgUjMWUxrv7U9bxXd7mAd26yx7fU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KwEqK48UG4oJG/IZh6cOcavgalPJ4tmYiAwIEVdvrNrOO83WJrxi5aHQa0W1dzS4Z ZTPBcz2f5CUHdEdsk/LfwnADTN4VXKnbotE9SKoLwTy34solmlP5JGwqaHn/SE7eOa rsrjw19Z1n6F/srJ4gt74TPJf62Po7qnQb0EEwTE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1814AF8021C; Tue, 28 Jul 2020 18:06:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50E9CF8021E; Tue, 28 Jul 2020 18:06:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-sn1nam04on0618.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4c::618]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C7D3AF8012F for ; Tue, 28 Jul 2020 18:06:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C7D3AF8012F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="Gs12OxdJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A1X7j1DHFm0PcaXCE+5f84DcAxEO1U+/H/K5zQdDLwj6p3ubKzMP3YRf5FuXcguWREL/QO0pETSm63ZwAn0qyQDhOFqXzZXQX4b9W0Ntq2ukoEPCqspVho9qIsRyEN1kTdiLSR+8Tqa7RcGznU7zidQu1RHT2zaG5ZrWTI9vd1EC/bogMqyuv+9HWJiexsgTIIIIdCfrR1EEZtXd6RYo4jJqplT6W8q2+99D27/WRkyn/Jj3kb8OAVqrDcTd9VZ0OiCFZ6zRamJ/LRldxc8sFhRlggJbU68VEjbqHdXJs15+g8xuYixQSsOacFNExOzOxqbhl+2NRAxcPRaAffDNFg== 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-SenderADCheck; bh=c+Bq6dBJaEwdEvTToJIyqtBNqxHpOJm5uLebIh7lLYw=; b=FSVDVEjC359EaVtflMv07FFNhrdNcD7AnPllXtrpV5bdsByDlGntbE2y1F/yX3D9BtnszOJ5XBfynJlCNhBvN4KWxYjtW+aHpjY1jx4Fp52KSCcXlELY/WBP0Lgce6k6achAhk6OzoWnBgYHlu7sGMzqqMkaJU5jR9nRWJdcVgHNzenlPFVsHmlOOOyxqJnoJzH3gPvA+dEC+OiNXYihwPQnybfe7uY+zcXpz82yOxC3zX+DvVYfqsutiStHsReBIQ5uRSmQSoyJxDR3rTHO1qUwE3F3O9PJ7i9ZJS8NIo2w4E4GHosCi7pOuDduQXSyQBncD6rqfQhQeI5rEXpniQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+Bq6dBJaEwdEvTToJIyqtBNqxHpOJm5uLebIh7lLYw=; b=Gs12OxdJsm6rVa4odil7V3/i0z4W9cd5yojSiQyA8o4V1jr9z4/zTtEe28QemXO6/2Fpg9mI2SmB5mBog/iZhKLLJD7xt3PiY12AX+LtSa5DAkzsaMzmHkbGsElEDPUT1Ey+Gu8pURsF719dOMLPWaW+F9PPFgNp9JyLEJRfvr4= Received: from BN6PR13CA0014.namprd13.prod.outlook.com (2603:10b6:404:10a::24) by CY4PR12MB1318.namprd12.prod.outlook.com (2603:10b6:903:38::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Tue, 28 Jul 2020 16:06:29 +0000 Received: from BN8NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:404:10a:cafe::6a) by BN6PR13CA0014.outlook.office365.com (2603:10b6:404:10a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.9 via Frontend Transport; Tue, 28 Jul 2020 16:06:29 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT012.mail.protection.outlook.com (10.13.177.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3216.10 via Frontend Transport; Tue, 28 Jul 2020 16:06:28 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:28 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:28 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 28 Jul 2020 11:06:24 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH v2 1/5] ASoC: amd: Renaming snd-soc-card structure and fields Date: Tue, 28 Jul 2020 21:32:51 +0530 Message-ID: <20200728160255.31020-2-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 921352b3-f828-4713-9f68-08d833102fd7 X-MS-TrafficTypeDiagnostic: CY4PR12MB1318: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1169; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hQyCVcV0gMP2xW/JKWDecm0b7E7QQ/XxZjzEUDpTZZKBdrzzCNLwYXpv1as85MaORyfB7stNTkYpxdjenUK+/q+3v+InjM0140ILcyEO/ous1zIOtr57P8enyK9ix7isiFAorN5Eo4L8IfINFg+kuifu7gRhYgJ2mX8hoyy7oE+dr1QY9C1hdJnlq3gUb9hjFGO/rB9ndFIG9SJdTEqCDLws+pdB7bV6gh+N3BpYeHMv9TDGtzPStcxtObTrH36Q7Z6NuVz4Gu3kziowNZAD6rLZxSV+2N4afvcGzL1dHOCRSBnRkI1Vmb+9Lej14uIdCK7YXxJUupUs4X6mT78x8BCOoq+yM0zOatAk8On9s0GuhQYVZEwPk94wpI7rRCvC5418DOx/vqedonfks7VEJ4ehtvb73fCRnKCmESGgLYw= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(46966005)(4326008)(426003)(86362001)(70206006)(26005)(70586007)(7696005)(8676002)(2906002)(186003)(109986005)(478600001)(8936002)(2616005)(82740400003)(81166007)(356005)(316002)(36756003)(47076004)(336012)(1076003)(5660300002)(83380400001)(6666004)(82310400002)(54906003)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 16:06:28.7618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 921352b3-f828-4713-9f68-08d833102fd7 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1318 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , YueHaibing , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Alexander.Deucher@amd.com, Akshu Agrawal X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" As in future our machine driver supports multiple codecs So changing naming convention of snd_soc_card struct and its fields. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/acp3x-rt5682-max9836.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index 6009e444b858..8b5af064864f 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -290,7 +290,7 @@ static const struct snd_kcontrol_new acp3x_dmic_mux_control = SOC_DAPM_ENUM_EXT("DMIC Select Mux", acp3x_dmic_enum, dmic_get, dmic_set); -static const struct snd_soc_dapm_widget acp3x_widgets[] = { +static const struct snd_soc_dapm_widget acp3x_5682_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_SPK("Spk", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), @@ -298,7 +298,7 @@ static const struct snd_soc_dapm_widget acp3x_widgets[] = { &acp3x_dmic_mux_control), }; -static const struct snd_soc_dapm_route acp3x_audio_route[] = { +static const struct snd_soc_dapm_route acp3x_5682_audio_route[] = { {"Headphone Jack", NULL, "HPOL"}, {"Headphone Jack", NULL, "HPOR"}, {"IN1P", NULL, "Headset Mic"}, @@ -307,23 +307,23 @@ static const struct snd_soc_dapm_route acp3x_audio_route[] = { {"Dmic Mux", "Rear Mic", "DMIC"}, }; -static const struct snd_kcontrol_new acp3x_mc_controls[] = { +static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Spk"), SOC_DAPM_PIN_SWITCH("Headset Mic"), }; -static struct snd_soc_card acp3x_card = { +static struct snd_soc_card acp3x_5682 = { .name = "acp3xalc5682m98357", .owner = THIS_MODULE, .dai_link = acp3x_dai_5682_98357, .num_links = ARRAY_SIZE(acp3x_dai_5682_98357), - .dapm_widgets = acp3x_widgets, - .num_dapm_widgets = ARRAY_SIZE(acp3x_widgets), - .dapm_routes = acp3x_audio_route, - .num_dapm_routes = ARRAY_SIZE(acp3x_audio_route), - .controls = acp3x_mc_controls, - .num_controls = ARRAY_SIZE(acp3x_mc_controls), + .dapm_widgets = acp3x_5682_widgets, + .num_dapm_widgets = ARRAY_SIZE(acp3x_5682_widgets), + .dapm_routes = acp3x_5682_audio_route, + .num_dapm_routes = ARRAY_SIZE(acp3x_5682_audio_route), + .controls = acp3x_5682_mc_controls, + .num_controls = ARRAY_SIZE(acp3x_5682_mc_controls), }; static int acp3x_probe(struct platform_device *pdev) @@ -336,8 +336,8 @@ static int acp3x_probe(struct platform_device *pdev) if (!machine) return -ENOMEM; - card = &acp3x_card; - acp3x_card.dev = &pdev->dev; + card = &acp3x_5682; + acp3x_5682.dev = &pdev->dev; platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); @@ -348,11 +348,11 @@ static int acp3x_probe(struct platform_device *pdev) return PTR_ERR(dmic_sel); } - ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_card); + ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_5682); if (ret) { dev_err(&pdev->dev, "devm_snd_soc_register_card(%s) failed: %d\n", - acp3x_card.name, ret); + acp3x_5682.name, ret); return ret; } return 0; From patchwork Tue Jul 28 16:02:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11689493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAE8C138A for ; Tue, 28 Jul 2020 16:09:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 519532078E for ; Tue, 28 Jul 2020 16:09:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="dkhrE/3g"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="LGRQc5/I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 519532078E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C5D5D16DC; Tue, 28 Jul 2020 18:08:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C5D5D16DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595952557; bh=kvihKaNz3bH5NuxjLBRFh8JnBVqRV88cRTEe5fdzPqs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dkhrE/3gulvRK2pX4C8jKOL4O/3Qh/39IG59/1OarmHM9ujqG86mR1/XzGboyqQf0 ZXga8ceCvely6+0a3zdRDWbY8kwSPiKev4OSAp8um86mvPgEqGk94SxrX+zYQwmkQH nuvamIyneHD0QdTLKPdWQDMtGhCU+7OnBTLxp08E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A7773F802C3; Tue, 28 Jul 2020 18:07:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 55FD3F802C4; Tue, 28 Jul 2020 18:07:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C6FCAF802C2 for ; Tue, 28 Jul 2020 18:07:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C6FCAF802C2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="LGRQc5/I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPvGCRe5P9nBapf6806p1LQvS0U38F4aAZbSoHlHy48FV9uzyT+Jh2YFl4PLlvE98KTg+Wiw1Q0MKONxrbZ8T9ohcS4F0gYSZWQLHpHEgjIHm2drzy2qWMA+an/6VwW8KWd8MDVbxgKxKUlQ5HuxFEJHLlaz9oPu/WQq+hCYJRildgRz6YYXrdBckm3qJXwOafrlszTktTvv5404uVhI1DxbApa+HT9jB1Iy27JPStrFKVBrUmueMDEZqJQ2a7QeVvIlJ2zdjHl+Ov+VE70ttlmjMmhx4TMqIblE0sPhXqbdv16MQH1KFnSxR7ZjX+qA0nZM1qNEh4JcvjpI5HiBxw== 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-SenderADCheck; bh=qY49mVqWzL7K+XU1k+rbMbfs53B5hKFiNB+VvldRQEM=; b=b8HtHHvxVJJOZbJPlBevvIYh6odv66CCzr4RNKp5LPbjFb4wbsdBy93/0j3a/SRqKhEoT/I97WnH1gBTvB4hFRc1wBGkWs0VspObP+AzWeV6J/dxgEUMebdz+xKfvURlf/Mpih1L68GLtCvfbXYD8zUkeyHZD5WnW7dbWzwwGxyGkCMUwwdWMB7OTnhCp07b0F+lZJywQ7Z3AAM47YGec4DnBoGVysVFe0dGnwU8r7XOSrrWEvWB8sVGQ/DERQSVNJOOU9ZcEoVi42GiOveEo9/A1xkyqDlRJE+ydhyYmoV4me0bupKkwK3zmCp4bMc1Dxqgzl/dejKIrKtBsEZpoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qY49mVqWzL7K+XU1k+rbMbfs53B5hKFiNB+VvldRQEM=; b=LGRQc5/I4pLTuVr65IjZXpx5Wv5TuiK1dJzpJ014C9Lu71/iBA0487h0Rk5sWKULo5lT1JLJ8iQ9dsSLWvYZ1V4R6MYRRcanmj8DcdU09VgdbE3pE5nsqdeJQempLIS/8pkb9cb7s5CL9+/gkmpBdVZKmWF79/aUIvhAvTatWDM= Received: from MWHPR12CA0032.namprd12.prod.outlook.com (2603:10b6:301:2::18) by BL0PR12MB2481.namprd12.prod.outlook.com (2603:10b6:207:40::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Tue, 28 Jul 2020 16:07:04 +0000 Received: from CO1NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::93) by MWHPR12CA0032.outlook.office365.com (2603:10b6:301:2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Tue, 28 Jul 2020 16:07:03 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT007.mail.protection.outlook.com (10.13.174.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3216.10 via Frontend Transport; Tue, 28 Jul 2020 16:07:03 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:34 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:34 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 28 Jul 2020 11:06:31 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH v2 2/5] ASoC: amd: Passing card structure based on codec Date: Tue, 28 Jul 2020 21:32:52 +0530 Message-ID: <20200728160255.31020-3-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e29f64a-aafd-47d5-da56-08d8331044ba X-MS-TrafficTypeDiagnostic: BL0PR12MB2481: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vd8RA2Rzk5WZsa8NMBpH7qYxRHbvtEk3hamBMslUc0Njbs6eLE/4SHclknjTIlScVTFA2/bnRbKyMi6zaVt9Tayr3nR5OWCjY8XJF+2R0cXFatyq8TsN5vJnYGX6ByVIAZ38k75oeehQYXU2IClfKPQxfKkL5GkX3DDvCyl5QM6dnpyhNGHwOTD7aiVob07wUD2t7vGwNEzZyy2vBw8WAM6tLp9zlW5iz6d7jV4/QI6302JUWygGHmO6H5+Mw62fC4rCDCFI4QrJ9+EP2ze7KEz1uigQ5Fi1qEm8E25n5hHMV0/1TFpYI3BZyotpm78S7Hu8fuX63UWwkOpKg0uIo81q6MhiWEcEMP8u6CA0Ju9kLABzihlxpOpN84D/J8htz3u8e9Ixgljom/svp76Htcy23cpRsLhC5zxJA7Ou3Kg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(346002)(376002)(136003)(396003)(46966005)(82740400003)(47076004)(316002)(1076003)(186003)(8936002)(336012)(356005)(81166007)(70586007)(70206006)(109986005)(7696005)(86362001)(54906003)(426003)(4326008)(8676002)(2616005)(478600001)(6666004)(26005)(83380400001)(5660300002)(82310400002)(2906002)(36756003)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 16:07:03.6915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e29f64a-aafd-47d5-da56-08d8331044ba 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2481 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , YueHaibing , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Alexander.Deucher@amd.com, Akshu Agrawal X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Passing specific snd_soc_card structure depending on the ACPI ID. In future we can add other IDs in the ACPI table and pass the structure. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/acp3x-rt5682-max9836.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index 8b5af064864f..2c672657d139 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -30,6 +30,7 @@ static struct snd_soc_jack pco_jack; static struct clk *rt5682_dai_wclk; static struct clk *rt5682_dai_bclk; static struct gpio_desc *dmic_sel; +void *soc_is_rltk_max(struct device *dev); static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) { @@ -326,18 +327,32 @@ static struct snd_soc_card acp3x_5682 = { .num_controls = ARRAY_SIZE(acp3x_5682_mc_controls), }; +void *soc_is_rltk_max(struct device *dev) +{ + const struct acpi_device_id *match; + + match = acpi_match_device(dev->driver->acpi_match_table, dev); + if (!match) + return NULL; + return (void *)match->driver_data; +} + static int acp3x_probe(struct platform_device *pdev) { int ret; struct snd_soc_card *card; struct acp3x_platform_info *machine; + struct device *dev = &pdev->dev; + + card = (struct snd_soc_card *)soc_is_rltk_max(dev); + if (!card) + return -ENODEV; machine = devm_kzalloc(&pdev->dev, sizeof(*machine), GFP_KERNEL); if (!machine) return -ENOMEM; - card = &acp3x_5682; - acp3x_5682.dev = &pdev->dev; + card->dev = &pdev->dev; platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); @@ -348,18 +363,18 @@ static int acp3x_probe(struct platform_device *pdev) return PTR_ERR(dmic_sel); } - ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_5682); + ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret) { dev_err(&pdev->dev, "devm_snd_soc_register_card(%s) failed: %d\n", - acp3x_5682.name, ret); + card->name, ret); return ret; } return 0; } static const struct acpi_device_id acp3x_audio_acpi_match[] = { - { "AMDI5682", 0 }, + { "AMDI5682", (unsigned long)&acp3x_5682}, {}, }; MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match); From patchwork Tue Jul 28 16:02:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11689497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29E93138A for ; Tue, 28 Jul 2020 16:10:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B44AA207F5 for ; Tue, 28 Jul 2020 16:10:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="JuK72ljJ"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="IhFtprQg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B44AA207F5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5299916D7; Tue, 28 Jul 2020 18:09:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5299916D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595952624; bh=t9qNB7uMKwpjMPn8TntS1MQM3l6ygNtuvF4Jzzra9+o=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JuK72ljJx/ZYbt1V8NOEBkiI2ds/BtuHe7Js2opsM4HKY4QB5IFOKO2x2aNwrKFqK ISadvivVHvlL6NXJ6aO0Tqj2WUETKQSIfKyPgA2t7oZM2+wfHy8J2uTMLozwIdUu0U VP/Pvo5mcC3Kmpcs/UsVbq5p6GtWxhd+ycm/e/1c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9A768F80240; Tue, 28 Jul 2020 18:07:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A66EF802E8; Tue, 28 Jul 2020 18:07:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770078.outbound.protection.outlook.com [40.107.77.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5676FF8021C for ; Tue, 28 Jul 2020 18:07:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5676FF8021C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="IhFtprQg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CAoj85SkXzl3UCLX8B7sK5tF3XDTZUiXhzQzs47PotBeXnGlecmVEdM39UlAkzWEvAHWZkukeBC8XsfwgIaOfTRsjgWGEqWXqvxQWBVMhgcZzsiekGs5Z7a/Gm4Rgj3WLtnKOx7g+8Priw7ixpNgao8mZflqT6bo+TPn+nxu1hUoZMo3im3b+awr05H3TMZlFI3XH1pHH6Ka98KEp5JYb2IFG8+Yf2gQPhnROzgou+ja3GjUfKUSTujPDaA+e1+XwaU9LoQnzpaQf6rsFJyUDhaAT/Vnj2VR+tkTEkij5/F6y63qC/vr07Yzh+k+DcnkGOqd3rVoRYX+Awx9+CT6Ew== 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-SenderADCheck; bh=zEkczVNO0HrT0CFuTOKrW+xHvnxLTwPjo3atDKYT87o=; b=aQ/8+1KxXA35msC6GSmI2IAdt28z0ofAu3y+KrBZgx6NSbpBiKQi9h/2zi2KyE9ywWdgdH8bmteHDasvoIm69Duh+VEP02Ry1fTscjpDWNHiYlbwc9OCDEcagY0HpW6uZM1GQs/IA4G06cWhE8f/bF2cUoDpIPFV4KIXfvZq8ALNJhSwuEBcIODU7WawNCxvvEU7IvjQZp2XZwOmSFnfFunUN/qQ+rLJylwQ+97XYpqSGMWoy3YEiQd4OCNBtvsZNbN7w3GUQmFtvBX3D/cbKlLxhB/ZYGBIHQpNehygEsTUXN/yVqhhWsbsEDedd94ecPFLTF0iGgHrQkZFyUXiIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zEkczVNO0HrT0CFuTOKrW+xHvnxLTwPjo3atDKYT87o=; b=IhFtprQg6aEpH/suv21LIy/5H7vaRrhD3KWmlJHv5x0z8EHe+iye0mWdLBZrDXrA77F62CVybMGRCLoEL258pf6Nf2yVF8+8VCKrAAHHTAg7ztLa7O4jWLw0rsv45fqLtEQxplU0Hv5qlXPuZKnXFgf74KV5dvo5k0i6W+ZUCn8= Received: from CO2PR18CA0064.namprd18.prod.outlook.com (2603:10b6:104:2::32) by BN8PR12MB3201.namprd12.prod.outlook.com (2603:10b6:408:6c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.33; Tue, 28 Jul 2020 16:07:09 +0000 Received: from CO1NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:104:2:cafe::63) by CO2PR18CA0064.outlook.office365.com (2603:10b6:104:2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24 via Frontend Transport; Tue, 28 Jul 2020 16:07:08 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT007.mail.protection.outlook.com (10.13.174.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3216.10 via Frontend Transport; Tue, 28 Jul 2020 16:07:08 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:43 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) 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.1713.5; Tue, 28 Jul 2020 11:06:42 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 28 Jul 2020 11:06:38 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH v2 3/5] ASoC: amd: Adding support for ALC1015 codec in machine driver Date: Tue, 28 Jul 2020 21:32:53 +0530 Message-ID: <20200728160255.31020-4-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fbeeff1e-a729-4732-45cd-08d833104782 X-MS-TrafficTypeDiagnostic: BN8PR12MB3201: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ed9T6JJiLlKG9v7tP57dIgqOLR3l3SeDPJW6zgccuKmYHC7gjPunN2QmIXjBfzULmRMfznNHux2UilMZTDWWjAI1xltXcLO+fE6YONQ7xQY+KbvZWJl2qoyCSsbtOonpS7fsI+M/Z7pZfT4rIannArDVEkR2OoLzYhGtqQwhc6oYR9TMUjzwN+yvtSashk/9jKA31mHGCtRGo1s6JTTNh1l05p8c/nzfMHHmZnrBAOjs0lgrgOF0NYV5xxPkUnZRBo9ggBiT2FN3GHAPXNVFoFZnVo9EdctzARggAxPhncpdiuixN7E6OeQE6nQuEuMelby87o4R4dvt0FeyFiPS3VKUlNm2KMrwoP6hERLu0neHtHxqom6spqyUgRy8SJnnXrgx1FS7WmT/F+YyhkLlhR4ry11S1fA/oKzOn4rZPO4= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966005)(5660300002)(4326008)(26005)(316002)(70206006)(186003)(70586007)(8936002)(54906003)(7416002)(8676002)(478600001)(7696005)(36756003)(47076004)(82740400003)(356005)(81166007)(83380400001)(426003)(336012)(6666004)(109986005)(2616005)(86362001)(1076003)(2906002)(82310400002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 16:07:08.3529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbeeff1e-a729-4732-45cd-08d833104782 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3201 Cc: Pierre-Louis Bossart , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , Arnd Bergmann , open list , YueHaibing , Takashi Iwai , Enric Balletbo i Serra , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com, Akshu Agrawal X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adding support for ALC1015 RTK codec in machine driver. Passing specific card structure based on its ACPI ID. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/Kconfig | 1 + sound/soc/amd/acp3x-rt5682-max9836.c | 63 ++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index e37cf72f2bab..a6ce000fac3f 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -33,6 +33,7 @@ config SND_SOC_AMD_RV_RT5682_MACH select SND_SOC_MAX98357A select SND_SOC_CROS_EC_CODEC select I2C_CROS_EC_TUNNEL + select SND_SOC_RT1015 depends on SND_SOC_AMD_ACP3x && I2C && CROS_EC help This option enables machine driver for RT5682 and MAX9835. diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index 2c672657d139..015b6a3312f5 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -21,6 +21,7 @@ #include "raven/acp3x.h" #include "../codecs/rt5682.h" +#include "../codecs/rt1015.h" #define PCO_PLAT_CLK 48000000 #define RT5682_PLL_FREQ (48000 * 512) @@ -247,7 +248,18 @@ SND_SOC_DAILINK_DEF(cros_ec, SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("acp3x_rv_i2s_dma.0"))); -static struct snd_soc_dai_link acp3x_dai_5682_98357[] = { +static struct snd_soc_codec_conf rt1015_conf[] = { + { + .dlc = COMP_CODEC_CONF("i2c-10EC1015:00"), + .name_prefix = "Left", + }, + { + .dlc = COMP_CODEC_CONF("i2c-10EC1015:01"), + .name_prefix = "Right", + }, +}; + +static struct snd_soc_dai_link acp3x_dai[] = { { .name = "acp3x-5682-play", .stream_name = "Playback", @@ -317,8 +329,8 @@ static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = { static struct snd_soc_card acp3x_5682 = { .name = "acp3xalc5682m98357", .owner = THIS_MODULE, - .dai_link = acp3x_dai_5682_98357, - .num_links = ARRAY_SIZE(acp3x_dai_5682_98357), + .dai_link = acp3x_dai, + .num_links = ARRAY_SIZE(acp3x_dai), .dapm_widgets = acp3x_5682_widgets, .num_dapm_widgets = ARRAY_SIZE(acp3x_5682_widgets), .dapm_routes = acp3x_5682_audio_route, @@ -327,6 +339,47 @@ static struct snd_soc_card acp3x_5682 = { .num_controls = ARRAY_SIZE(acp3x_5682_mc_controls), }; +static const struct snd_soc_dapm_widget acp3x_1015_widgets[] = { + SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MUX("Dmic Mux", SND_SOC_NOPM, 0, 0, + &acp3x_dmic_mux_control), + SND_SOC_DAPM_SPK("Left Spk", NULL), + SND_SOC_DAPM_SPK("Right Spk", NULL), +}; + +static const struct snd_soc_dapm_route acp3x_1015_route[] = { + {"Headphone Jack", NULL, "HPOL"}, + {"Headphone Jack", NULL, "HPOR"}, + {"IN1P", NULL, "Headset Mic"}, + {"Dmic Mux", "Front Mic", "DMIC"}, + {"Dmic Mux", "Rear Mic", "DMIC"}, + {"Left Spk", NULL, "Left SPO"}, + {"Right Spk", NULL, "Right SPO"}, +}; + +static const struct snd_kcontrol_new acp3x_mc_1015_controls[] = { + SOC_DAPM_PIN_SWITCH("Headphone Jack"), + SOC_DAPM_PIN_SWITCH("Headset Mic"), + SOC_DAPM_PIN_SWITCH("Left Spk"), + SOC_DAPM_PIN_SWITCH("Right Spk"), +}; + +static struct snd_soc_card acp3x_1015 = { + .name = "acp3xalc56821015", + .owner = THIS_MODULE, + .dai_link = acp3x_dai, + .num_links = ARRAY_SIZE(acp3x_dai), + .dapm_widgets = acp3x_1015_widgets, + .num_dapm_widgets = ARRAY_SIZE(acp3x_1015_widgets), + .dapm_routes = acp3x_1015_route, + .num_dapm_routes = ARRAY_SIZE(acp3x_1015_route), + .codec_conf = rt1015_conf, + .num_configs = ARRAY_SIZE(rt1015_conf), + .controls = acp3x_mc_1015_controls, + .num_controls = ARRAY_SIZE(acp3x_mc_1015_controls), +}; + void *soc_is_rltk_max(struct device *dev) { const struct acpi_device_id *match; @@ -375,6 +428,7 @@ static int acp3x_probe(struct platform_device *pdev) static const struct acpi_device_id acp3x_audio_acpi_match[] = { { "AMDI5682", (unsigned long)&acp3x_5682}, + { "AMDI1015", (unsigned long)&acp3x_1015}, {}, }; MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match); @@ -391,5 +445,6 @@ static struct platform_driver acp3x_audio = { module_platform_driver(acp3x_audio); MODULE_AUTHOR("akshu.agrawal@amd.com"); -MODULE_DESCRIPTION("ALC5682 & MAX98357 audio support"); +MODULE_AUTHOR("Vishnuvardhanrao.Ravulapati@amd.com"); +MODULE_DESCRIPTION("ALC5682 ALC1015 & MAX98357 audio support"); MODULE_LICENSE("GPL v2"); From patchwork Tue Jul 28 16:02:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11689491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14B86138A for ; Tue, 28 Jul 2020 16:08:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FF272078E for ; Tue, 28 Jul 2020 16:08:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EGmRFW0D"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="B3mG/0jb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FF272078E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 22CED16E7; Tue, 28 Jul 2020 18:07:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 22CED16E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595952516; bh=VBnvRVmbd0nRMgXxFVN+84T7VwQ5sKFmgVdUNOD/zOY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EGmRFW0DyEpWFJ8UQBw91I1LAGCzdxDj9255pa0FxneIp6PjzjzEpt6tNitEaKcQq MgxCl+dY4uB/bZCEAG4b/58BZ+1ldjcOdhnPCsg+srk/yC2ZyLgpucHp0lr0V/Jw24 NCqeTqH+xK6Z9y2NJjKvGqmGFGis1io391LfJMq8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A7BE3F8029B; Tue, 28 Jul 2020 18:07:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2CE1EF802BD; Tue, 28 Jul 2020 18:07:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2056.outbound.protection.outlook.com [40.107.243.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 07E82F80256 for ; Tue, 28 Jul 2020 18:06:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 07E82F80256 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="B3mG/0jb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbgFZUn2kkJt2hokIxtDfbE/x42G9EbY4GL6H4uILJiWwq2bqhnkkRzBhBVwaCZp08t6VLmkUVtbY1mt9ezeg3Tdk5l5egnrwDmiQlp/vBmViI6aU8hSp6iXwEJnv5AM9uuijn/18Zhhox6A8UZVKxNSbYFW+O90mcHPrU1V6/CP8TyymL6DoUgioYuSBskhIgaIfi1+/s1NbRE4lnYLensYaomUehmdFF6hCzefPa0NQv9SLhxbsJ/fTyIkT9g1Fy6OyzY5oQEkKbYD3kZDj8176V7/1th9RisoBmVumh+rYhIqiGVJ2WWuDiI5nxsvnRVH5gVAsQbEHdlKeA/siA== 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-SenderADCheck; bh=tCB1Vrsx+8WOuq91iNN5qiwdDikZp2WxyhLIUAVJ2Bs=; b=Y8gRcOo1QrC6wO5oo8mCBbzYzcBQVgCRPoqTtbSdN3eUEwOyHycr5+DTEgPgnISsjyspbri83TmLDlRZ8FWt4gUcjgD/Ph89pSPM14+RZZn7ozowXAz5+Aj6qVjYIVo7dZxa6/s82MAlLEHuaJlRNO7cO5n3y1Ht99KWgbhfiHF3ol0EuyiVK7iki3KthSYSe1K9rYZiEzUyqGd6sCKZdgxtPemb9DIjoD47xWnxGc3aKi+zYfjkYtc3fXueEuZCrLPpYKDeSh88sxb+dTd5z8dDBHWPnRtoTq4bsufV5gAcgDc97x4Yw3Nib/VKRW1ZhfkoAJzK5wG0aACopzzqkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tCB1Vrsx+8WOuq91iNN5qiwdDikZp2WxyhLIUAVJ2Bs=; b=B3mG/0jbROq1jfM7S+DRl6CE3DC036mDogAXEm93HkmBBNHporjnPbBrKFUmpF2AQtQhf4eTlcjl8XV94SfFVM1hzLNPoqTn2erMjMLDfFBzqgQL3Y8hqpXNvhBcy/cF8eoTj1EExLpM6Rvy3lGP4njCBf4KM16CaPXpObHLs50= Received: from BN6PR04CA0101.namprd04.prod.outlook.com (2603:10b6:404:c9::27) by MN2PR12MB3005.namprd12.prod.outlook.com (2603:10b6:208:c5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Tue, 28 Jul 2020 16:06:51 +0000 Received: from BN8NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:404:c9:cafe::7c) by BN6PR04CA0101.outlook.office365.com (2603:10b6:404:c9::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Tue, 28 Jul 2020 16:06:51 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT055.mail.protection.outlook.com (10.13.177.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3216.10 via Frontend Transport; Tue, 28 Jul 2020 16:06:51 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:50 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) 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.1713.5; Tue, 28 Jul 2020 11:06:49 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 28 Jul 2020 11:06:46 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH v2 4/5] ASoC: amd: Adding DAI LINK for rt1015 codec Date: Tue, 28 Jul 2020 21:32:54 +0530 Message-ID: <20200728160255.31020-5-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f90de723-b87d-477d-ed45-08d833103d8c X-MS-TrafficTypeDiagnostic: MN2PR12MB3005: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nl4p0J/TdIQKwhJioUgSqRBHiDNcsXKutt8BoUc4c+mUrj/qHdYMrgDdlxImaPgULXMZlbL8m7HaZ67NKXX+rrbsSoPtMDxblOvbmJmetuXzrskwWbGgiMNoxwcRpIbjWSSCyKeR/Li7m5yjcg5nUbfbGIsdi5DJBFK9AHCvYBf0jC1uJsOoCnEk4Po4oBtv62xXJ2VxT9Nx+y+VEDxKpvZ83wOYX5do4UY6tHvJevnfngMYzFa1qXprE6+pKmIV4QwNmZ1fGdw9ieq5E7LorVLirqZtWMMCIovgdZQcc6f/88lxfo8JDHi9cqQ4SUg36Dn4wkrAryU7cmygsb9amGaV7otY1Xx0qw0ZQ+nkVg0o7hSJPxw9dJ+w+ZCnrdvtfzVihQplzuIfi/gedj4wo/g+QxXrU2Ebky9C38+9bLA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(346002)(376002)(136003)(39860400002)(46966005)(82310400002)(86362001)(83380400001)(82740400003)(47076004)(336012)(2616005)(5660300002)(81166007)(426003)(356005)(70206006)(36756003)(70586007)(1076003)(109986005)(54906003)(4326008)(8936002)(478600001)(8676002)(186003)(6666004)(26005)(7696005)(316002)(2906002)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 16:06:51.7614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f90de723-b87d-477d-ed45-08d833103d8c 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3005 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , YueHaibing , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Alexander.Deucher@amd.com, Akshu Agrawal X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" DAI link support for RTK 1015 and providing the codec details depending on the snd_soc_card selected by ACPI ID. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/acp3x-rt5682-max9836.c | 35 ++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index 015b6a3312f5..e0c767716b9a 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -33,6 +33,12 @@ static struct clk *rt5682_dai_bclk; static struct gpio_desc *dmic_sel; void *soc_is_rltk_max(struct device *dev); +enum { + RT5682 = 0, + MAX, + EC, +}; + static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) { int ret; @@ -242,6 +248,9 @@ SND_SOC_DAILINK_DEF(rt5682, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1"))); SND_SOC_DAILINK_DEF(max, DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00", "HiFi"))); +SND_SOC_DAILINK_DEF(rt1015, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC1015:00", "rt1015-aif"), + COMP_CODEC("i2c-10EC1015:01", "rt1015-aif"))); SND_SOC_DAILINK_DEF(cros_ec, DAILINK_COMP_ARRAY(COMP_CODEC("GOOG0013:00", "EC Codec I2S RX"))); @@ -260,7 +269,7 @@ static struct snd_soc_codec_conf rt1015_conf[] = { }; static struct snd_soc_dai_link acp3x_dai[] = { - { + [RT5682] = { .name = "acp3x-5682-play", .stream_name = "Playback", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF @@ -271,16 +280,19 @@ static struct snd_soc_dai_link acp3x_dai[] = { .ops = &acp3x_5682_ops, SND_SOC_DAILINK_REG(acp3x_i2s, rt5682, platform), }, - { + [MAX] = { .name = "acp3x-max98357-play", .stream_name = "HiFi Playback", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF - | SND_SOC_DAIFMT_CBM_CFM, + | SND_SOC_DAIFMT_CBS_CFS, .dpcm_playback = 1, .ops = &acp3x_max_play_ops, - SND_SOC_DAILINK_REG(acp3x_bt, max, platform), + .cpus = acp3x_bt, + .num_cpus = ARRAY_SIZE(acp3x_bt), + .platforms = platform, + .num_platforms = ARRAY_SIZE(platform), }, - { + [EC] = { .name = "acp3x-ec-dmic0-capture", .stream_name = "Capture DMIC0", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF @@ -390,6 +402,18 @@ void *soc_is_rltk_max(struct device *dev) return (void *)match->driver_data; } +static void card_spk_dai_link_present(struct snd_soc_dai_link *links, + const char *card_name) +{ + if (!strcmp(card_name, "acp3xalc56821015")) { + links[1].codecs = rt1015; + links[1].num_codecs = ARRAY_SIZE(rt1015); + } else { + links[1].codecs = max; + links[1].num_codecs = ARRAY_SIZE(max); + } +} + static int acp3x_probe(struct platform_device *pdev) { int ret; @@ -405,6 +429,7 @@ static int acp3x_probe(struct platform_device *pdev) if (!machine) return -ENOMEM; + card_spk_dai_link_present(card->dai_link, card->name); card->dev = &pdev->dev; platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); From patchwork Tue Jul 28 16:02:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11689495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0378722 for ; Tue, 28 Jul 2020 16:09:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6406A20792 for ; Tue, 28 Jul 2020 16:09:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="t5Ig4piV"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="XaEKRuRU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6406A20792 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D61F916EF; Tue, 28 Jul 2020 18:08:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D61F916EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1595952575; bh=LBiyfcXEIxECOMwxAeZi5ogxxrXvwdnfybTDtRAlWHg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=t5Ig4piVBQfTxdOOPB2M2W2MTrwz1kC07jaw82gH/0xnNSiU0DLyficfYpuuRJ6dK aWRfq0CChBL0DONxH2tOeLdh5v+V4/5ZF/2tAj/bmCQcg+jisouQYVeWz88UlnJtyw B9IH7wBAYMtH5zD4DSvL00O+yv2EoakcVarZLNoA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C4B26F802DC; Tue, 28 Jul 2020 18:07:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 51E98F802DC; Tue, 28 Jul 2020 18:07:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1F0D8F802D2 for ; Tue, 28 Jul 2020 18:07:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1F0D8F802D2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="XaEKRuRU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+ggUp3nQDWx5ejosCMEz43sYxpaPjUnmlJ0lYysNecPxAMuaGD6ZFQPcjVTb9PvJnSI1iiCwE+feOIMqOy2D9wLufSsz+sg2NRXukgQvaGLgjI78rqgsNA+udsI1enAbbqKTFKoH+Jm5P0MAH0NOIg7If4EPwODvu/Yr2zjcO1LO8C54Sg/lPOWwJuq6kSeFDJ2bsY7iAtCHhsqzf9ESxWaBbnWsV9EgBf81169o2a42k5OfNFapDPaklriPHNybfzMXnGAPw10612hldMQMs4Igyua5vULTGvnUa8gYRwx3di2PndbHXWOiW5x67lLNnst4F/KGDKyqleu13mDGw== 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-SenderADCheck; bh=aNpz+z3esX/SgjiE1EFqtHCjhQAq/ZVf8laIuRzdBs0=; b=O++mVuZDaXTeTCBqH2+Al38xfvKxC5FDvM2J4D1c0WvxWpxVWBAsTiqdh32jQu/M3eCW2mWV0bM5sXPyW1e2MICk9iwqiNbFNn4mP9d08fK2hod1BvKtRSStN4AvGcctclUTg/0XJF12BjR/evHxRYCXFNzkkAizCpkuhSZvOHMebWsJfNk7wno+uUjhDMmw9FBakCi4OsAPDGw+99d8msGhFugr8i7a00PkzxIoEwCnEiCdx318oAkxogriF07lot5/IxOqUgpdxnzBGR4lHT2WWycebYkahthGH+AFH6LFigM5rtGSH55Gdg4pVJzoEDcpVXb8ffPSNSKLSizu4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aNpz+z3esX/SgjiE1EFqtHCjhQAq/ZVf8laIuRzdBs0=; b=XaEKRuRUTju41jcku1iBZgjL7lJ7zDLYWqXqO46twjGJwrCtfCW1t+rjYbX678s9YOQfFKXUX3N5Zjd8i8feCOSG55ZTIIsL/qPu6vopakpJa4UFdcnWhiJikqeISw1PNVj6OLMhydtpUQT/AKr9LWWQNCNr9g4a9kydTK93S4k= Received: from CO2PR18CA0062.namprd18.prod.outlook.com (2603:10b6:104:2::30) by DM6PR12MB3658.namprd12.prod.outlook.com (2603:10b6:5:1c8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Tue, 28 Jul 2020 16:07:24 +0000 Received: from CO1NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:104:2:cafe::ec) by CO2PR18CA0062.outlook.office365.com (2603:10b6:104:2::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Tue, 28 Jul 2020 16:07:24 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by CO1NAM11FT007.mail.protection.outlook.com (10.13.174.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3216.10 via Frontend Transport; Tue, 28 Jul 2020 16:07:24 +0000 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 28 Jul 2020 11:06:56 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 28 Jul 2020 11:06:52 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH v2 5/5] ASoC: amd: Added hw_params support for ALC1015 Date: Tue, 28 Jul 2020 21:32:55 +0530 Message-ID: <20200728160255.31020-6-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20200728160255.31020-1-Vishnuvardhanrao.Ravulapati@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 455012e3-defe-4900-660c-08d833105107 X-MS-TrafficTypeDiagnostic: DM6PR12MB3658: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ewi8U+P7GD+YnprYU3X2r1YdX0vir/qOCO4Vjq/tMNoG2k/QYP5url3MEJpLFPeUITEey8mL4yvsx6bHMnc3HLQ2vy70E3+J5SoW8/jPiK6sdsUR2K+NO913NOPiLZa7v5cqQ4U4tt2yXYHqeZXMma1OhJOHobdFXpV6ozydqWFiifRS/gQP7n2zOSGAFS3V0edfHNIK+HYV1LZQO4LCcWcrCokb00Ob08duPycwBWl8SA2wwLmos2LpwsylJcvWFVj1eh9juSibtFe0zcIw/bGvC/1USqPlivS0+fTaR3EMzHKZoRpfCxJruhnJooJie0c2PsUKXtWYcR3qTRQKu8sJknNgTdpNrj0XFe3Sq1hNsU4WhHXyfy6ilq3VoQGmsvlkCheGe/p0AttC6wzexbDe2mupIptwG0kDcDzWcfk= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(136003)(376002)(396003)(39860400002)(346002)(46966005)(1076003)(356005)(2906002)(82310400002)(8936002)(109986005)(7696005)(81166007)(26005)(82740400003)(5660300002)(186003)(36756003)(4326008)(336012)(8676002)(83380400001)(70586007)(478600001)(86362001)(47076004)(54906003)(426003)(2616005)(316002)(70206006)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2020 16:07:24.3238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 455012e3-defe-4900-660c-08d833105107 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3658 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , YueHaibing , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Alexander.Deucher@amd.com, Akshu Agrawal X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Adding rt1015 hw_params which set Bit-clock ratio, PLL and appropriate sys clk specific with RTK1015. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/acp3x-rt5682-max9836.c | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index e0c767716b9a..55815fdaa1aa 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -127,6 +127,34 @@ static int rt5682_clk_enable(struct snd_pcm_substream *substream) return ret; } +static int acp3x_1015_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *codec_dai; + int srate, i, ret; + + ret = 0; + srate = params_rate(params); + + for_each_rtd_codec_dais(rtd, i, codec_dai) { + if (strcmp(codec_dai->component->name, "rt1015-aif")) + continue; + ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64); + if (ret < 0) + return ret; + ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK, + 64 * srate, 256 * srate); + if (ret < 0) + return ret; + ret = snd_soc_dai_set_sysclk(codec_dai, RT1015_SCLK_S_PLL, + 256 * srate, SND_SOC_CLOCK_IN); + if (ret < 0) + return ret; + } + return ret; +} + static void rt5682_clk_disable(void) { clk_disable_unprepare(rt5682_dai_wclk); @@ -232,6 +260,7 @@ static const struct snd_soc_ops acp3x_5682_ops = { static const struct snd_soc_ops acp3x_max_play_ops = { .startup = acp3x_max_startup, .shutdown = rt5682_shutdown, + .hw_params = acp3x_1015_hw_params, }; static const struct snd_soc_ops acp3x_ec_cap0_ops = {