From patchwork Fri Jul 7 12:07:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: potturu venkata prasad X-Patchwork-Id: 13304836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8215BEB64D9 for ; Fri, 7 Jul 2023 12:09:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0669A83B; Fri, 7 Jul 2023 14:08:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0669A83B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688731775; bh=utAW1agJ5LyRilSHRNdl1T1vTEfLw2o6xG+J4FxkUM4=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KdY9ZSH0xAsMcwmzsyU7eL9cD75Ks1wnf+jrq6eOEZ8aqErnl+V9WKq5ZqggFRzqg jHizQkHfeszGk7NuoPHp8Ayy85YSnDRyyEtoHNLTEFdb4w+V3RlQAB7WWLOuNHWLSA cGF17mnJ7L78o3ChG9Ll8hUFkB9Bo+0Pnzc0gIAU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B03FF80551; Fri, 7 Jul 2023 14:08:09 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E5F55F80549; Fri, 7 Jul 2023 14:08:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 317B3F80549; Fri, 7 Jul 2023 14:08:05 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on20626.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eb2::626]) (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 C94C1F8025F for ; Fri, 7 Jul 2023 14:07:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C94C1F8025F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=BSX72Jto ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jr/hb+tfEa+FYvBKEkQnwQig3df2tvJ5VlAz1rrxXG/0lILi8UJk7NOtUevBEfYT2ZWXeBOCUv5+8nafzjcJR29UE4uXDg6u89581GFCg5Bf2zcwlicQC2BUadOwZ4h5cYFOQSmDFFyrUHj9Qu9AFbRpQodOCLh557IBVn7LVkm66lFyoRxaguXM9kWqN1xG8lApCQ5/w+xT0BVkz8sT1Fco5803GJVN3T/vy70yWSA+iEt2ZQdzCknjSZgVOsjs0NoHS7vGC4thasBYJFaan2U11VkgeGz9jAlKM/1xQ7+YwitZDXfC1znUB0rhJytMXMZ4zYXdrrpTXf/9hE7fLg== 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=PNdmyhn7zUaGrD9Lw16oYD+BcahXH7C57xq5kGjUVho=; b=BEH36JoZ5gCyjSgeS0N1rCkXXMK07nGeTJfQy5C8+v912FkKo/k6udtcXWvNqtFvo5psfPMiKczTrHwRJXeAK50Yzn925aiyTBP2Mo0t6zc17kTnASXPp6H7ncGrQwtC1YXFcfURAmDCO/N1Aboy5NNLwY3n32nC5tVvd26azB/+oQBj9J/FyBhk4wOrWaRj5OJC2Ly4drzeMj+2E0nSDPhroG/ccQKz707Uz7PMniYnTAH68FTFIAcZUDVNZVHTucVPAZHbuXq+mCf+6o1gIButEN8f2QXHVx5SHofso6/xr8LRXpshPiSOjkU56Z/NlfncFgGmUjX1iAmqYEUG0g== 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=PNdmyhn7zUaGrD9Lw16oYD+BcahXH7C57xq5kGjUVho=; b=BSX72JtobmQxgeUMbYVK7Z//jzaKa5Py0fEY5fHO8Yi4gdnzL70wSXjSdMHHdyUUuzEfbRB6naxxicLGEjOcUr1Yf+h0YzwkE82qMh4CPlNg8+e963hDm1GrDjRUA/nHKbIt8K1Z8duNJ0ANo/aB1A4RQg896I8LrVEpetAZHjk= Received: from MW4PR03CA0331.namprd03.prod.outlook.com (2603:10b6:303:dc::6) by CH0PR12MB5203.namprd12.prod.outlook.com (2603:10b6:610:ba::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul 2023 12:07:49 +0000 Received: from CO1NAM11FT111.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::4b) by MW4PR03CA0331.outlook.office365.com (2603:10b6:303:dc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25 via Frontend Transport; Fri, 7 Jul 2023 12:07:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT111.mail.protection.outlook.com (10.13.174.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6500.47 via Frontend Transport; Fri, 7 Jul 2023 12:07:49 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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.2507.23; Fri, 7 Jul 2023 07:07:48 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 7 Jul 2023 05:07:48 -0700 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 7 Jul 2023 07:07:38 -0500 From: Venkata Prasad Potturu To: , CC: , , , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Kuninori Morimoto , Peter Ujfalusi , ye xingchen , "open list" Subject: [PATCH 1/4] ASoC: amd: acp: Add machine driver support for nau8821 codec Date: Fri, 7 Jul 2023 17:37:27 +0530 Message-ID: <20230707120730.1948445-2-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> References: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT111:EE_|CH0PR12MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b62d635-1c57-4990-3677-08db7ee2c868 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ex8tNdNyTRg2Zjj27pvcOB30rqaf7c3j60zY4tvKqogXF6r7gu0GLTone2XUmXQifFEyiUaMczRh4Vr3HCl1q3pTveNf05FrT9Y81SMnvrNRyexo6sM6A+XM2YT3nnfY31W6WQTYQnZrhzGI4DjBYZCkxABWIYvNlHc5qFXnYTIUqAz+eCn22hUt2mTqRWvnjFkvELGmhDSCcikOkJcELAVzIvs6UNi2sFvnQvoRpnZ1zCuPA+J/7ZDJhThsH/xV8xciAOzZE55uX1I0Y14Nwas4+iI6jC5tPYbjWxT0dEPQt8hyOxSLOhSh0oGPGgJelOxEmZGSZB/xGrSeP+krUrQgICrsEcnMnnjGtqdpaozHo/jj1C0hDuEgf6TDD91sACtiydNBmsN0Qu+m0BhFAD1DIsO4rDdNZrLjGnguxgxhd/+lIKrDTX3F19t4P3DKfw7n85YsZMv9jVhvA/y5/6TdwqsWYh63yEQmwtEbYw5anOFrNCgUlRuordsVqPAYEVA8rNQ/+N0DJb7tAcN3jgnKTqgT5pTUADCJxYmfAOPSrZ+S4F1nCqWNQ8Kom30qu0SmsxIkwCegp/3rzbTIFYFrsAPCACeon3tLQW049WeoVEoY3viKq+mKEVLn+TvpqrU4sa0H9PPNU1d6y/VmmHgVVYOv92k/AdmYjJB/eUJxJijqMXX0C1fHjb22KLoBF8FS4Ch+qLCXUE6w2Bj/eSbWg1vUJOTAStAXBVPBkay00qc82F32/wwzWynjEFyxFLkUIpdjcviTJVGOcN8uUA== 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:(13230028)(4636009)(396003)(376002)(346002)(39860400002)(136003)(451199021)(36840700001)(46966006)(40470700004)(40460700003)(70206006)(70586007)(82740400003)(4326008)(2616005)(81166007)(356005)(82310400005)(186003)(336012)(86362001)(26005)(1076003)(36860700001)(83380400001)(47076005)(426003)(36756003)(6666004)(478600001)(7696005)(40480700001)(110136005)(54906003)(41300700001)(5660300002)(8936002)(8676002)(2906002)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 12:07:49.1476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b62d635-1c57-4990-3677-08db7ee2c868 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: CO1NAM11FT111.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5203 Message-ID-Hash: ZHF5PAY7IU4FUMHN6MVZYS2HC6E36WC6 X-Message-ID-Hash: ZHF5PAY7IU4FUMHN6MVZYS2HC6E36WC6 X-MailFrom: venkataprasad.potturu@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In newer variants nau8821 as primary codec. Add support for nau8821 codec in generic machine driver. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/Kconfig | 1 + sound/soc/amd/acp/acp-mach-common.c | 167 ++++++++++++++++++++++++++++ sound/soc/amd/acp/acp-mach.h | 1 + 3 files changed, 169 insertions(+) diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index ce0037810743..a68bbe106b73 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -61,6 +61,7 @@ config SND_SOC_AMD_MACH_COMMON select SND_SOC_MAX98357A select SND_SOC_RT5682S select SND_SOC_NAU8825 + select SND_SOC_NAU8821 help This option enables common Machine driver module for ACP. diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 6da17140beea..48abb8e9665d 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -25,12 +25,17 @@ #include "../../codecs/rt1019.h" #include "../../codecs/rt5682s.h" #include "../../codecs/nau8825.h" +#include "../../codecs/nau8821.h" #include "acp-mach.h" +static struct snd_soc_jack vg_headset; #define PCO_PLAT_CLK 48000000 #define RT5682_PLL_FREQ (48000 * 512) #define DUAL_CHANNEL 2 #define FOUR_CHANNEL 4 +#define NAU8821_CODEC_DAI "nau8821-hifi" +#define NAU8821_BCLK 1536000 +#define NAU8821_FREQ_OUT 12288000 #define TDM_MODE_ENABLE 1 @@ -790,6 +795,162 @@ static const struct snd_soc_ops acp_card_nau8825_ops = { .hw_params = acp_nau8825_hw_params, }; +static int platform_clock_control(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *k, int event) +{ + struct snd_soc_dapm_context *dapm = w->dapm; + struct snd_soc_card *card = dapm->card; + struct snd_soc_dai *codec_dai; + int ret = 0; + + codec_dai = snd_soc_card_get_codec_dai(card, NAU8821_CODEC_DAI); + if (!codec_dai) { + dev_err(card->dev, "Codec dai not found\n"); + return -EIO; + } + + if (SND_SOC_DAPM_EVENT_OFF(event)) { + ret = snd_soc_dai_set_sysclk(codec_dai, NAU8821_CLK_INTERNAL, + 0, SND_SOC_CLOCK_IN); + if (ret < 0) { + dev_err(card->dev, "set sysclk err = %d\n", ret); + return -EIO; + } + } else { + ret = snd_soc_dai_set_sysclk(codec_dai, NAU8821_CLK_FLL_BLK, 0, + SND_SOC_CLOCK_IN); + if (ret < 0) + dev_err(codec_dai->dev, "can't set FS clock %d\n", ret); + ret = snd_soc_dai_set_pll(codec_dai, 0, 0, NAU8821_BCLK, + NAU8821_FREQ_OUT); + if (ret < 0) + dev_err(codec_dai->dev, "can't set FLL: %d\n", ret); + } + return ret; +} + +static const struct snd_soc_dapm_widget nau8821_widgets[] = { + SND_SOC_DAPM_HP("Headphone jack", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Int Mic", NULL), + SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, + platform_clock_control, SND_SOC_DAPM_PRE_PMU | + SND_SOC_DAPM_POST_PMD), +}; + +static const struct snd_soc_dapm_route nau8821_audio_route[] = { + /* HP jack connectors - unknown if we have jack detection */ + { "Headphone jack", NULL, "HPOL" }, + { "Headphone jack", NULL, "HPOR" }, + { "MICL", NULL, "Headset Mic" }, + { "MICR", NULL, "Headset Mic" }, + { "DMIC", NULL, "Int Mic" }, + { "Headphone jack", NULL, "Platform Clock" }, + { "Headset Mic", NULL, "Platform Clock" }, + { "Int Mic", NULL, "Platform Clock" }, +}; + +static const unsigned int nau8821_format[] = {16}; + +static struct snd_pcm_hw_constraint_list constraints_sample_bits = { + .list = nau8821_format, + .count = ARRAY_SIZE(nau8821_format), +}; + +static int acp_8821_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); + struct snd_soc_component *component = codec_dai->component; + int ret; + + dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); + + ret = snd_soc_dapm_new_controls(&card->dapm, nau8821_widgets, + ARRAY_SIZE(nau8821_widgets)); + if (ret) { + dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); + // Don't need to add routes if widget addition failed + return ret; + } + + ret = snd_soc_card_jack_new(card, "Headset Jack", + SND_JACK_HEADSET | SND_JACK_LINEOUT | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3, + &vg_headset); + if (ret) { + dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret); + return ret; + } + snd_jack_set_key(vg_headset.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); + snd_jack_set_key(vg_headset.jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); + snd_jack_set_key(vg_headset.jack, SND_JACK_BTN_2, KEY_VOLUMEUP); + snd_jack_set_key(vg_headset.jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); + + nau8821_enable_jack_detect(component, &vg_headset); + + return snd_soc_dapm_add_routes(&rtd->card->dapm, nau8821_audio_route, + ARRAY_SIZE(nau8821_audio_route)); +} + +static int acp_8821_startup(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + + runtime->hw.channels_max = DUAL_CHANNEL; + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_SAMPLE_BITS, + &constraints_sample_bits); + return 0; +} + +static int acp_nau8821_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_soc_card *card = rtd->card; + struct acp_card_drvdata *drvdata = card->drvdata; + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); + int ret; + unsigned int fmt; + + if (drvdata->soc_mclk) + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; + else + fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP; + + ret = snd_soc_dai_set_fmt(codec_dai, fmt); + if (ret < 0) { + dev_err(rtd->card->dev, "Failed to set dai fmt: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_sysclk(codec_dai, NAU8821_CLK_FLL_BLK, 0, + SND_SOC_CLOCK_IN); + if (ret < 0) + dev_err(card->dev, "can't set FS clock %d\n", ret); + ret = snd_soc_dai_set_pll(codec_dai, 0, 0, snd_soc_params_to_bclk(params), + params_rate(params) * 256); + if (ret < 0) + dev_err(card->dev, "can't set FLL: %d\n", ret); + + return ret; +} + +static const struct snd_soc_ops acp_8821_ops = { + .startup = acp_8821_startup, + .hw_params = acp_nau8821_hw_params, +}; + +SND_SOC_DAILINK_DEF(nau8821, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-NVTN2020:00", + "nau8821-hifi"))); + /* Declare DMIC codec components */ SND_SOC_DAILINK_DEF(dmic_codec, DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); @@ -920,6 +1081,12 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) links[i].init = acp_card_rt5682s_init; links[i].ops = &acp_card_rt5682s_ops; } + if (drv_data->hs_codec_id == NAU8821) { + links[i].codecs = nau8821; + links[i].num_codecs = ARRAY_SIZE(nau8821); + links[i].init = acp_8821_init; + links[i].ops = &acp_8821_ops; + } i++; } diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index 165f407697c0..f2b44a6189a6 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -41,6 +41,7 @@ enum codec_endpoints { MAX98360A, RT5682S, NAU8825, + NAU8821, }; enum platform_end_point { From patchwork Fri Jul 7 12:07:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: potturu venkata prasad X-Patchwork-Id: 13304837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9814BEB64D9 for ; Fri, 7 Jul 2023 12:09:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D4DCB852; Fri, 7 Jul 2023 14:08:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4DCB852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688731779; bh=M+BxNqCdeFb+4i6CzAmYslr+NL1yJWPPhKh4sGL36eY=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TQLe24MFgk0wJIT/1W1PWmfdX93Ld8n+S6jupRpW7dVQP8ZO0Opr2hsmmcSCkbxb6 cvsTrrR0/wzISXRceprE6Vcm4FUjk/wgCJNySbOsz4AAw5caiB9hvVnNn78+Nz73tu 4Zs0fWI3DYoFUtnebVvd74L3p74F+/9dt39nUsDE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33497F80549; Fri, 7 Jul 2023 14:08:21 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9EA5EF80568; Fri, 7 Jul 2023 14:08:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9431BF80570; Fri, 7 Jul 2023 14:08:16 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::607]) (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 40E1CF80564 for ; Fri, 7 Jul 2023 14:08:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 40E1CF80564 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=ZLKC2z/h ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJg5LpfzuRWw5eFxjiRYR0NkMnHzSXLM+53LJDpsZmGhsf/pgn8ZgFUC5qE/96XQjJ2ncl+znh+GdDFZXG+VDAesIms+xiB9OO7353/owQNFZoon9YP2edeIxnJALXYITXmSZEvTZRoIVo4stGwXLr6362xLEAhKOLuTKIkfmR8gPAmqUN1W79w6wPjzN087SSoHEWDn6m+JK5rUPyXeAUmf1t4UNi4pmuaXCw6ahjDmNbEFLMM2z0dXm1chhaonh8edLIIFfLK/6OXHcTGY7njriOFXb1TczwWwuLuIkKYI2935cAStsZZGLPswfOUfsPTI1m9JnkwO9UnQ5YZROg== 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=gCn8FglKTYIilpz6R0Gkp41+EE/dijPY1zYQTuZTIek=; b=GDtxS9SJwxkpLcFo5zUMGSgKw78wPXKHtkiOHJ5hhqaQoPtl525HPGsa0zpvGMwgonR1/JiFHiIK3GdGKMO4rRYTZMNAQ5oJesN7/wum5LnALFwtKKqOem0mfetesbRVGcL+bTjK5oUVhEH0WahSlADhTTBfhKVhar54oKaldpfkbSF+GsgPNfwXlCPDavM4bLBP+E97oR1aChio/tf86mJcPaISsvV6ctNT5NVjturCCrUD75kpQTM4I4ZP3X+9+tq0CzpIkl2lhGY4iBZVMbrI6J6W2gmegVTwXF1gToLhRWoOhoGDFLjv54+cUE9wJ1StlT9FJ5+DwpPtNepozw== 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=gCn8FglKTYIilpz6R0Gkp41+EE/dijPY1zYQTuZTIek=; b=ZLKC2z/hc2mlqTZTR3gegvahVWc/03bFdhIbT8rtjJcU5D39n3vyFXe1hNQXEfd5PAfKR2TGWwD7PEMS/yZWnqRX9GVDK+TwXysVOdJI38TJUHQ19n9gvssvbjSjkjZMWCwjg615tz5arxHhjTAmKyyhEbZin7PMgODpaF94IhA= Received: from DM6PR21CA0026.namprd21.prod.outlook.com (2603:10b6:5:174::36) by DM4PR12MB5746.namprd12.prod.outlook.com (2603:10b6:8:5d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul 2023 12:08:05 +0000 Received: from DM6NAM11FT100.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::35) by DM6PR21CA0026.outlook.office365.com (2603:10b6:5:174::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.13 via Frontend Transport; Fri, 7 Jul 2023 12:08:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT100.mail.protection.outlook.com (10.13.172.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 12:08:04 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.23; Fri, 7 Jul 2023 07:08:01 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 7 Jul 2023 07:08:01 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 7 Jul 2023 07:07:50 -0500 From: Venkata Prasad Potturu To: , CC: , , , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Peter Ujfalusi , Kuninori Morimoto , ye xingchen , open list Subject: [PATCH 2/4] ASoC: amd: acp: Add machine driver support for max98388 codec Date: Fri, 7 Jul 2023 17:37:28 +0530 Message-ID: <20230707120730.1948445-3-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> References: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT100:EE_|DM4PR12MB5746:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e41b665-b885-4167-41cb-08db7ee2d166 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zkBpl+wkQ7yT3eqwbxtidmXdGNPp2BNwkr/fxm5FooznWjUDT/rYjzDfCCOMSEjgdL6viLTRj2ifzUvHcEUalucVRf3QMV617ycmGiwictFJf37HaAYBVYD/+xazHTlL9EQLu3VT/kSH23WgWxzDF+g+gOKwynYfPVZn95EdkjfAg1WWmVCvo0UlDJlRjT+so2a33XpJc8p54PIA8guXLqrJNlOVvtEdIzgjph1AcQyAnQNe4NDiVpPNeLvo+npDytp9YPcAJttYeF9MwQ99ogTEmH11+UAPVYtmydirAzI/vcN5BetGYyVaV6qYjy1cQIF+BP/cM+QsTPc0bD6sr7xp9D+xXnOylTCEky6Dk31bMh0zeE+fsSTL2L5+HxjZpoEOSRUiDS4GoN+V6Zm+UYd4ggrb62Smx/NZD5wJ8HKQTksV2Ls0ZYss07R9bGdyC47VL9cagEKj/A72vyMTQ1Rjt8BhLNJgofYANyfeIQGlOmAh4aAad/14y/byiz3m3wVEt5PNYeQ+ZYoKbRuCFJuZjtUMbtkRRv/yrljKeVcZrfiL83BiNsOSZhLaAop9KVwbC0UWYn9M/CEUE6lhKeaFUU9MZ2/z3Ahh0ziefOS8DTca7f1VZQ0XnykUiFEG0IwqhytC93BfOGhu4SqKL0Ww2rsUcK46eZmsxJbdvtN2ifA/YbmU4e/C+i2s1kSf568h1KTWyqIwlo3wqdiviFiBKCCnNHTReF00mAmY48G3hxSDXW4vxpwiYD8if/bJcJClktBOjtEWP1v+QFAr+g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199021)(36840700001)(46966006)(40470700004)(7696005)(6666004)(478600001)(110136005)(54906003)(70586007)(36860700001)(47076005)(426003)(2616005)(36756003)(86362001)(40480700001)(40460700003)(2906002)(82310400005)(186003)(1076003)(26005)(336012)(70206006)(81166007)(82740400003)(356005)(4326008)(41300700001)(316002)(8936002)(8676002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 12:08:04.3124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e41b665-b885-4167-41cb-08db7ee2d166 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT100.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5746 Message-ID-Hash: 4UX74L4NO75CS7OBKT7JM4OINSB3BY2H X-Message-ID-Hash: 4UX74L4NO75CS7OBKT7JM4OINSB3BY2H X-MailFrom: venkataprasad.potturu@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In newer platforms max98388 codec as amplifier codec. Add support for maxim codec in generic machine driver. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp/Kconfig | 1 + sound/soc/amd/acp/acp-mach-common.c | 100 ++++++++++++++++++++++++++++ sound/soc/amd/acp/acp-mach.h | 1 + 3 files changed, 102 insertions(+) diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index a68bbe106b73..d7f1c3c90484 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -62,6 +62,7 @@ config SND_SOC_AMD_MACH_COMMON select SND_SOC_RT5682S select SND_SOC_NAU8825 select SND_SOC_NAU8821 + select SND_SOC_MAX98388 help This option enables common Machine driver module for ACP. diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 48abb8e9665d..ff5cbc4a6427 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -36,6 +36,7 @@ static struct snd_soc_jack vg_headset; #define NAU8821_CODEC_DAI "nau8821-hifi" #define NAU8821_BCLK 1536000 #define NAU8821_FREQ_OUT 12288000 +#define MAX98388_CODEC_DAI "max98388-aif1" #define TDM_MODE_ENABLE 1 @@ -666,6 +667,97 @@ static const struct snd_soc_ops acp_card_maxim_ops = { .hw_params = acp_card_maxim_hw_params, }; +SND_SOC_DAILINK_DEF(max98388, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-ADS8388:00", "max98388-aif1"), + COMP_CODEC("i2c-ADS8388:01", "max98388-aif1"))); + +static const struct snd_soc_dapm_widget max98388_widgets[] = { + SND_SOC_DAPM_SPK("SPK", NULL), +}; + +static const struct snd_soc_dapm_route max98388_map[] = { + { "SPK", NULL, "Left BE_OUT" }, + { "SPK", NULL, "Right BE_OUT" }, +}; + +static struct snd_soc_codec_conf max98388_conf[] = { + { + .dlc = COMP_CODEC_CONF("i2c-ADS8388:00"), + .name_prefix = "Left", + }, + { + .dlc = COMP_CODEC_CONF("i2c-ADS8388:01"), + .name_prefix = "Right", + }, +}; + +static const unsigned int max98388_format[] = {16}; + +static struct snd_pcm_hw_constraint_list constraints_sample_bits_max = { + .list = max98388_format, + .count = ARRAY_SIZE(max98388_format), +}; + +static int acp_card_max98388_startup(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + + runtime->hw.channels_max = DUAL_CHANNEL; + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, + &constraints_sample_bits_max); + + return 0; +} + +static int acp_card_max98388_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + struct acp_card_drvdata *drvdata = card->drvdata; + int ret; + + if (drvdata->amp_codec_id != MAX98388) + return -EINVAL; + + ret = snd_soc_dapm_new_controls(&card->dapm, max98388_widgets, + ARRAY_SIZE(max98388_widgets)); + + if (ret) { + dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret); + /* Don't need to add routes if widget addition failed */ + return ret; + } + return snd_soc_dapm_add_routes(&rtd->card->dapm, max98388_map, + ARRAY_SIZE(max98388_map)); +} + +static int acp_max98388_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_card *card = rtd->card; + struct snd_soc_dai *codec_dai = + snd_soc_card_get_codec_dai(card, + MAX98388_CODEC_DAI); + int ret; + + ret = snd_soc_dai_set_fmt(codec_dai, + SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF); + if (ret < 0) + return ret; + + return ret; +} + +static const struct snd_soc_ops acp_max98388_ops = { + .startup = acp_card_max98388_startup, + .hw_params = acp_max98388_hw_params, +}; + /* Declare nau8825 codec components */ SND_SOC_DAILINK_DEF(nau8825, DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10508825:00", "nau8825-hifi"))); @@ -1174,6 +1266,14 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) links[i].ops = &acp_card_maxim_ops; links[i].init = acp_card_maxim_init; } + if (drv_data->amp_codec_id == MAX98388) { + links[i].codecs = max98388; + links[i].num_codecs = ARRAY_SIZE(max98388); + links[i].ops = &acp_max98388_ops; + links[i].init = acp_card_max98388_init; + card->codec_conf = max98388_conf; + card->num_configs = ARRAY_SIZE(max98388_conf); + } if (drv_data->amp_codec_id == RT1019) { links[i].codecs = rt1019; links[i].num_codecs = ARRAY_SIZE(rt1019); diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index f2b44a6189a6..2b3ec6594023 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -42,6 +42,7 @@ enum codec_endpoints { RT5682S, NAU8825, NAU8821, + MAX98388, }; enum platform_end_point { From patchwork Fri Jul 7 12:07:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: potturu venkata prasad X-Patchwork-Id: 13304838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E4CE2EB64D9 for ; Fri, 7 Jul 2023 12:10:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0D8DF1D9; Fri, 7 Jul 2023 14:09:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0D8DF1D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688731803; bh=DC23fhHbynYjaAb74a+WXHgBHMhzCJ+9WDkkSBYflP0=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VLCo3Gc4jyGRqGlPWEV+yBKeS0v9NJFOmxvVjaMbr2NvrM8e8oZfBEKMRqVchA4Lo Jl9lAJmfmIbf+L8G7RnQ8a7hecevvyv9ybNU0yIVdDdgrJoWrWrQsAV19ubzOuS98z zte/3ouJbWfbXKh7fZx7Ea4a6S3sy9bMQAkxtaiM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 90B04F80589; Fri, 7 Jul 2023 14:08:23 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 44830F8057C; Fri, 7 Jul 2023 14:08:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E839F80568; Fri, 7 Jul 2023 14:08:20 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20614.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::614]) (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 BCF01F80549 for ; Fri, 7 Jul 2023 14:08:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BCF01F80549 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=H9KOJgVA ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FoyKEgMwGAjGiad8b2nnvyNE78FP/NVLUTsckHsAO2nYtBWO7WmXjXt0FiPsQvZxplI4jie27MfTkhlwqx90N6TPNp0dnHa1gKH7lyjtrFvIsBHtSCOfU5LVcGrH9iSgRKE8tz/vFLWAOjPEeEXJcZpl+K/7ldkV9IRI9HqHIdNjiZXcShyX/lfdxwOYmoTlzafkeUMiuLIepbPo/uo8BJXWH15s3A9K0EHovpoCXY6Tfjr9ELM1tqTg4g2IXkX14rwrHhzGxbelLlOeE8W1oQIL4fS5uL3cMN/+8vW5etVeAsfSb8bCLWhmaZQcUfuVJCT4a//j+uzFV5A6GlAtfA== 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=A9S1tAAkfGSYREcf+q5bUfKtloPJMGR4TCOmv5xku3Q=; b=IOC4hOGbVvNjpdfa4Lkqy0neRNB9zYUFe/WL8/SzaiGGpkC2qSSc/aNLRrEwSX946iXOyxSlROmJgjsh3QH9CH9QvNfo4onhznu8z1OfIS9WiU9X8JB/kvgzrFAd0Uy1Ij0GqEuLXOphpFup4REhdnmGbdb9JHh1wW3O4dOF196UyH8nPBioEP7WCV8FH5RyBHmPPToeIniIvZcaUqCW7J27Fi9BpkRhvDnPX2+DH7eTKsznIhHu8cLA/rUZ093Lpah8syINc+IlbIwphktpAfaANUlC617cVhyhxAjCiWavnkcOW32iP6PV66Zz/zAvwGTqpVpb2YsAQcZNpCv0Ww== 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=A9S1tAAkfGSYREcf+q5bUfKtloPJMGR4TCOmv5xku3Q=; b=H9KOJgVAWSDhCigMwD3idInk8TVhtuJQG9fC/stxE0GUr15NH8nh8eGaoGGpJ5KRi/L0Mxqpi9YNCcDABXJ1otl+lvoauyg98HoPTXNH0Qp56rd6drLbCHQnNA2VlVGguPHFGmVv6gG0Bfa/xyuo16FItts0MLpCyF8gm9qZgYA= Received: from DS7PR06CA0031.namprd06.prod.outlook.com (2603:10b6:8:54::11) by SJ2PR12MB7846.namprd12.prod.outlook.com (2603:10b6:a03:4c9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul 2023 12:08:08 +0000 Received: from DM6NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::e6) by DS7PR06CA0031.outlook.office365.com (2603:10b6:8:54::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25 via Frontend Transport; Fri, 7 Jul 2023 12:08:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT008.mail.protection.outlook.com (10.13.172.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 12:08:08 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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.2507.23; Fri, 7 Jul 2023 07:08:07 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 7 Jul 2023 05:08:07 -0700 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 7 Jul 2023 07:08:03 -0500 From: Venkata Prasad Potturu To: , CC: , , , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list Subject: [PATCH 3/4] ASoC: amd: Add acpi machine id's for vangogh platform Date: Fri, 7 Jul 2023 17:37:29 +0530 Message-ID: <20230707120730.1948445-4-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> References: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT008:EE_|SJ2PR12MB7846:EE_ X-MS-Office365-Filtering-Correlation-Id: 21fd59af-12af-44b1-9d7b-08db7ee2d3c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0OpC3i11fpTLQ8n6/Iu21tmgDRfjeAn838BzhEI2BoBB4C4F+Qr2HOHhUTPxX6Q4c7aGxRgvlmZTPsYEWZC3skcO453ptZjgJfmNDE985khD4VmLf5SqdzcFM6DVyhOcIQbIIH5L+Q4ODVPOpK76nHzj9Ib7jSmUV+eMK+2LYTunf2Uamyr+sEoYMwHVCJ0RCFc6JjLMtRXhBMcbFS0KG4anPkUQeJiPa7atY4PRCpWwzL7TJkehXetgE/ImOVGSdB5IasoqY00kg6NPCNneg4vWYK4RnXUpsbsY9uvV+6s6Io5toIi8HKB0BLzCnBQGmc2QF942JbCwVZT/L/MfgMCjClsQCMl9qPV43gSDfYGyfy02dF+xDQUncoTu8cftB9LyCS3QJ9wVdH8QXIfxAfMJjhfTTS3DGCl7E7MAF9qqQ/zN/av/EkXAmLqtpVFpeSKxQuFD8mhgbvPVwmlpvZdFPvtWp/n31rkr2mZMKH3UA2hcWA4Sgk61E2dLjNt56YjsJU5CFXLHt+456XKYLNsCzZ0cPACJOsw+w7dnKx/1xF/WY0Yh5FNpkJNErSaQYqVABmNsLzJJI9qG8XOU5tK8VvGIy/Njd/V5lAq/euLt841y8+P86AIS+nKelwx+/HczegEEhwkmw+dZ2Fb/hXmCxcSxoIeBhvAi7EFCoXrIeAmjAEedNrzGCAq3coIdBWnkGeafBfLxpf8007cquP/c7HJevo9hiKohb68tSC5MHCEqGB1mLuRH9AEDtypbINxrLCo2Tvsxx20DdXdYxw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199021)(36840700001)(46966006)(40470700004)(6666004)(40460700003)(70206006)(70586007)(82740400003)(4326008)(2616005)(356005)(81166007)(82310400005)(186003)(336012)(86362001)(26005)(1076003)(36860700001)(47076005)(426003)(36756003)(478600001)(7696005)(40480700001)(110136005)(54906003)(41300700001)(5660300002)(8936002)(8676002)(2906002)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 12:08:08.2731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21fd59af-12af-44b1-9d7b-08db7ee2d3c2 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7846 Message-ID-Hash: Q3VLSUOXWGGKECQV7XFT2VBKN7LRYP72 X-Message-ID-Hash: Q3VLSUOXWGGKECQV7XFT2VBKN7LRYP72 X-MailFrom: venkataprasad.potturu@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add acpi machine id's for vangogh platform and configure driver data to enable SOF sound card support on newer boards. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp-config.c | 19 +++++++++++++++++++ sound/soc/amd/acp/acp-sof-mach.c | 16 ++++++++++++++++ sound/soc/amd/mach-config.h | 1 + 3 files changed, 36 insertions(+) diff --git a/sound/soc/amd/acp-config.c b/sound/soc/amd/acp-config.c index 0932473b6394..f002397caeef 100644 --- a/sound/soc/amd/acp-config.c +++ b/sound/soc/amd/acp-config.c @@ -82,6 +82,11 @@ static struct snd_soc_acpi_codecs amp_max = { .codecs = {"MX98360A"} }; +static struct snd_soc_acpi_codecs amp_max98388 = { + .num_codecs = 1, + .codecs = {"ADS8388"} +}; + struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = { { .id = "10EC5682", @@ -130,6 +135,20 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = { }; EXPORT_SYMBOL(snd_soc_acpi_amd_sof_machines); +struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[] = { + { + .id = "NVTN2020", + .drv_name = "nau8821-max", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_max98388, + .fw_filename = "sof-vangogh.ri", + .sof_tplg_filename = "sof-vangogh-nau8821-max.tplg", + }, + {}, +}; +EXPORT_SYMBOL(snd_soc_acpi_amd_vangogh_sof_machines); + struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { { .id = "AMDI1019", diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c index 99a7d3879340..a1c893f33f74 100644 --- a/sound/soc/amd/acp/acp-sof-mach.c +++ b/sound/soc/amd/acp/acp-sof-mach.c @@ -83,6 +83,17 @@ static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { .tdm_mode = false, }; +static struct acp_card_drvdata sof_nau8821_max98388_data = { + .hs_cpu_id = I2S_SP, + .amp_cpu_id = I2S_HS, + .dmic_cpu_id = NONE, + .hs_codec_id = NAU8821, + .amp_codec_id = MAX98388, + .dmic_codec_id = NONE, + .soc_mclk = true, + .tdm_mode = false, +}; + static const struct snd_kcontrol_new acp_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headset Mic"), @@ -166,6 +177,10 @@ static const struct platform_device_id board_ids[] = { .name = "rt5682s-hs-rt1019", .driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data }, + { + .name = "nau8821-max", + .driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data + }, { } }; static struct platform_driver acp_asoc_audio = { @@ -187,4 +202,5 @@ MODULE_ALIAS("platform:rt5682s-max"); MODULE_ALIAS("platform:rt5682s-rt1019"); MODULE_ALIAS("platform:nau8825-max"); MODULE_ALIAS("platform:rt5682s-hs-rt1019"); +MODULE_ALIAS("platform:nau8821-max"); MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h index 7b4c625da40d..d392e6d6e6e1 100644 --- a/sound/soc/amd/mach-config.h +++ b/sound/soc/amd/mach-config.h @@ -20,6 +20,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[]; struct config_entry { u32 flags; From patchwork Fri Jul 7 12:07:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: potturu venkata prasad X-Patchwork-Id: 13304839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3CA83EB64DA for ; Fri, 7 Jul 2023 12:10:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BA5DE857; Fri, 7 Jul 2023 14:09:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA5DE857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688731825; bh=QsAYhwLrPHrrOxjVVceomW3bqICMUVOZzBv6bLIHRW4=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sp3UUDFqTj3NpKv/9l45LZY99VvQuEDKVbkaEsULlwPfN0c2+9NbcZUe/qhK//FNO oNGol21xG/JNHwOVBog36XEwhTfeifuvigaCXDP665dEL10CabduajfvHtyiiyX/Ur zR5r7wJWAxaFEsgCMgfBeAdf8Px2QX48XlJ9W2dM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1593FF805AC; Fri, 7 Jul 2023 14:08:29 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A0550F8059F; Fri, 7 Jul 2023 14:08:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17FD8F8059F; Fri, 7 Jul 2023 14:08:26 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::604]) (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 5DA7BF8058C for ; Fri, 7 Jul 2023 14:08:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5DA7BF8058C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=wUG+hcFE ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gZ5llYbATF2kBRHBSxfdgYQo2pTnWvLai2aI61T3yH9aFcCxcy1EWWBgQGzUUr7HPZPT9Men78YGXYMZggWVlB6lWUwamrqkQMs8DA8yxe9tpImajjTfrgNLkQda6/4VWb5POfNAuCxu2Is6vPJ79WVsJh7GTBztUb5IJULrrhcVIcvfyQwnOOeA9EPO/hZoe4PWVpYZhbnCVCdMJuEnlWJCzLb0SZumFHHRYAbCEMpTyfUI+yVW61I78mIfB67XIOq+bD+A9kARSmFJ2Qw81XU30dhl7CxS3e7+Ds4kGRZUSlZwaGchwtSTNbNCkP20VFbT3rU0xxYCkJzyGQmoCA== 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=SzDNMqHIO6N9sjf2jUWkjtjZrLFx1DR2BU84ssyzPoA=; b=R1Soc1f7O5A8jsldNt9mchxEQPx9WsuA94E4yH2auZmH+b9om2R3LqD+r8ZEhCKoPLMzojrHsLUS0AX8ssi5g9q1wkeVKZ5/5ODMDIxwQmM1xN2wlGeia+UVIeK7zrkw3KoVY3SvREsKyCAUoF/pyQJuE1L/cEJ3oPNjKZsoEuw/LYTiuWMzNIojGskk69L2hVlJgVXptl2M1IOrLyu1/2mxplZ/Up3TmXpqIZSxTVslIJ8qvXcgtv57sOb9am8gh5G0eQlXOu71/5PQRwQpPzj8tMkqb8lgQQJ2RhnAELKOt5hj36fdVyjizMwuwf/f/iGgW9UDd9TTc9cgimFW0g== 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=SzDNMqHIO6N9sjf2jUWkjtjZrLFx1DR2BU84ssyzPoA=; b=wUG+hcFEzKxNidqHYiZ3giJOB+h20H0EZELBWdlfosCRaVlKC3Ukh4C7NiKa8RMdbvRgCjGhXlmDBo+SYTR7KwIxFAo2WIioHMHZxkkItHUZOcTgRzYr+R59inpqUoCkPrr55cep/6sehzJ9xqCYPtb9S6yB1PCcZV98YHIzpsk= Received: from SJ0PR03CA0182.namprd03.prod.outlook.com (2603:10b6:a03:2ef::7) by MN0PR12MB5836.namprd12.prod.outlook.com (2603:10b6:208:37b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Fri, 7 Jul 2023 12:08:16 +0000 Received: from CO1NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:a03:2ef:cafe::e7) by SJ0PR03CA0182.outlook.office365.com (2603:10b6:a03:2ef::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend Transport; Fri, 7 Jul 2023 12:08:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT005.mail.protection.outlook.com (10.13.174.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 12:08:14 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.23; Fri, 7 Jul 2023 07:08:12 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 7 Jul 2023 07:08:12 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 7 Jul 2023 07:08:08 -0500 From: Venkata Prasad Potturu To: , CC: , , , , , , , Venkata Prasad Potturu , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list Subject: [PATCH 4/4] ASoC: amd: Add new dmi entries to config entry Date: Fri, 7 Jul 2023 17:37:30 +0530 Message-ID: <20230707120730.1948445-5-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> References: <20230707120730.1948445-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT005:EE_|MN0PR12MB5836:EE_ X-MS-Office365-Filtering-Correlation-Id: 443abc46-ef26-479e-cfb8-08db7ee2d7b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dsk3sb7QJBGHUbDLAfxL+Q2yRyeoXmtHbVCx24g8/Z3Szn9g0LgtB6q7OHaJGgDJmi5M7GGaOPZpzrhfpFd7u/owFvdTG3RPmoDNJs9ggiAXtMNsNurFfMkqw7USzXSa6hWvcuH5wcSxeAYo08B2rEKILY4i/fOMIofD1KmHSr4EnbP7FqHrO8/1x0I5v6mEUwuMxnGPDuZKBptW0nqrhT7kpzAsQXjfVnzW5RbxqHsY8m77J6G2XeB3Iwij0suWNCbRO12JtdlG8kv0BL2Qq4zQV/FkWx7pyoGv5UnlcjIaScmfogyWGbRbZFm8fzDOXYYWGPRC7mbCjhAHaqRbekZ+uZmAi/5K9V+9Ef8UcsyviqFTyesaTSlBXjNpuQi6pHse36lIqT93rStOpUEIrevNeOMr37NNxIHp5m9BkS8EFOLCYlRSgnrvQPz6NLiTknsuIGVV8QrVqS9K7lC4cLTo57ITfrO3ghcJCqBu7B5RBWfkWiEV0Tyxrm4iiKszwueK5Jov12JSrqN9v3UIIf0xuqVu/FDjnFk0oSJsRz/zplmEfEPbfCJG2azx7KqVnKyHRhDpeH4weZQ2GYfwdRz9al0DVn2tUGjUP/DgZFtuMdCkUFruhyRs5DUO+KvOj4QwJqQlsKt6jYzQ0rDoXrOW9xq/2yYQyzq6dbU36rPqw9zfteKy40c+//ZDSSrCfieOUtnL2RsIYJ6fkGHekDHeRYkwC589ceNTPqeiwWqwDjkPagOEnYcxvAJBCUktDPQMIaiYa9532J9APFjatg== 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:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(478600001)(82310400005)(70586007)(54906003)(110136005)(2906002)(4744005)(36756003)(41300700001)(8936002)(70206006)(4326008)(82740400003)(426003)(47076005)(81166007)(336012)(40460700003)(7696005)(6666004)(2616005)(356005)(316002)(26005)(186003)(86362001)(1076003)(36860700001)(8676002)(40480700001)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 12:08:14.8260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 443abc46-ef26-479e-cfb8-08db7ee2d7b8 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: CO1NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5836 Message-ID-Hash: U3XUWHMPQQQVLHB65Z3J6I7CPXDIFUOU X-Message-ID-Hash: U3XUWHMPQQQVLHB65Z3J6I7CPXDIFUOU X-MailFrom: venkataprasad.potturu@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add new dmi sys vendor, product name and product family to config entry table to enable audio for valve boards. Signed-off-by: Venkata Prasad Potturu --- sound/soc/amd/acp-config.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/amd/acp-config.c b/sound/soc/amd/acp-config.c index f002397caeef..f27c27580009 100644 --- a/sound/soc/amd/acp-config.c +++ b/sound/soc/amd/acp-config.c @@ -47,6 +47,20 @@ static const struct config_entry config_table[] = { {} }, }, + { + .flags = FLAG_AMD_SOF, + .device = ACP_PCI_DEV_ID, + .dmi_table = (const struct dmi_system_id []) { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Valve"), + DMI_MATCH(DMI_PRODUCT_NAME, "Galileo"), + DMI_MATCH(DMI_PRODUCT_FAMILY, "Sephiroth"), + }, + }, + {} + }, + }, }; int snd_amd_acp_find_config(struct pci_dev *pci)