Message ID | 20221221112611.1373278-1-Vijendar.Mukunda@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3467770wrn; Wed, 21 Dec 2022 03:24:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXunjAJJTH5NaEWpkgbon7bLDO9Wak4nWCuJrtDQWqBDHCDTpV8cd7CDn8+T/HSMeVG4b7rb X-Received: by 2002:a17:90a:8c01:b0:219:4b5:1775 with SMTP id a1-20020a17090a8c0100b0021904b51775mr17177675pjo.39.1671621866010; Wed, 21 Dec 2022 03:24:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671621865; cv=pass; d=google.com; s=arc-20160816; b=Ey89eeE6OzqaXcsP6Jszhcnyb3+UIRje6+k16R9oS00u8R2r4ClV6lkYBTwdUoKzpB rWO7nbMpKfdxdx/yBPDfyhQsOP9lE4q6+bsdTBVafCCFxGOdLJsRVYeHI5CdoMngU7/h Ptt3LuFOMfllkcGaeWvCJbAcDynQY4/uhGtMfgwHDd8mt/rhyDYK9fHbxPkpReI7FrCq J7QKXn8GpN6R/62aXhBXGdicC/9ddzccnnOTvLa6Fr4V9iUd3Yf4ZDV9CA7lhKRbPSIR TNGvuIPNnI76plWk8f6MIVUQCjak/sy6w7l1ljNM/hvG/zyrlZ1eCESctS9lcCjIneF+ PmKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=m1GVwBYvoHa0SIGmiUy1ZqDZSdZAxyh1wI56roI5VLg=; b=oco/0DtkHA7vjPuTGdCKhL9//ON7u15WJjbi5ukZn0IiuQXNvYpExLNUSgQSsk7vKA aelcwNNSt0FcmCqnvKJrA37iz+PoVEcTfVaU5TpC081CBbRY5txP78xnMG7w7xAU6wmZ TccbRwCdExZR+FmTq8g8l1T9qIiv1jiEopIJCYutv37oyIQqWuZ59e8cIcEsUO/KBAEm aNEifapITjDJjfA+iXCCG3Ujq8mIC5PxRyA8o60p/mu4tOyElHUgi9tcxVTR6VUAx/3B RYvYr+E+W41qRr8rWPx8HGUO2oQ3hoWALrFROUOdE1rP4SXHAqn3x2a+UFxeb9bILTAk tPYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=JnX2uD5q; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a635843000000b004776a50bd21si17330826pgm.579.2022.12.21.03.24.12; Wed, 21 Dec 2022 03:24:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=JnX2uD5q; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233998AbiLULXj (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Wed, 21 Dec 2022 06:23:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbiLULXf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Dec 2022 06:23:35 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1702BD2 for <linux-kernel@vger.kernel.org>; Wed, 21 Dec 2022 03:23:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoRts4uqDTRP9vOGFppuiA5hisI2VK80bTocIzcrLGbMwIDyeR0c7YRRu7aoTVl+4GA9gxkxCSJkYsHPZdpEvmNwV+XJqZ77BVyRr0N8XibVGpc7aGyh7XIDvQgmHWSZDsuEysnX4bBCr2ks9CzsI69bYLUNPrD/BNBkKeypqjh587/KZVKvLQ9EJuMJ4wccU3QIJfmlLQSxjdpJN1BqeH1ZjzQnlPE+0fJXZFWTmOZFcSelaeeSx/JeYZlU18Uqo42EPLMGixjtNZr9U7LI7eB4qhT7PR/LAMya+bZQQYh2Gh86Z2KgFhxYBSXNMtp3q4yaKhaoUdtrnMEyHTNhug== 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=m1GVwBYvoHa0SIGmiUy1ZqDZSdZAxyh1wI56roI5VLg=; b=nAjTCUVbxuVS70wErjUb+EHFyHu2ld8c4iMepabvWo0dAcfR9u9IoE0aLgxJYF9lBO7+Agf6XAOyyCOC5VEsBbkL5Qi6fAPfEYQPn/Y+k0DC/vdAlRKGkUV98i8V1Me/Q9EgXT4p4DnWuSigz/oYXbpQK1ORE2hGP0hHTtQ7G8qT+ISkDUWvoDqs7XM6R0I8PJj0R/KWY0wSYV0mcxm9HHJV0YIAXdbHtP64nJIkj2CLcu9CHa6j31eFdlAddIEEMDHMu9EHIj6SeDDKeg2jvMzVEMdJ0iQA14qxwNj0yQHohA1CoABW3HrDZ7h+826W8O8ejBeoFTwEyX8w6Z9Ebg== 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=m1GVwBYvoHa0SIGmiUy1ZqDZSdZAxyh1wI56roI5VLg=; b=JnX2uD5qWe4Rakc8Rr+GcPrgjLzf+UDKyx0t+/jfeKQ32eXxlScohXvg+pPn/IHRGq9RgzJ75ddtiqfKiwC20Dwba8oFQKZk8lF6uI+qESE6cP54JG3DIaJzPaNNGY46vCs9NC+ijmtxF5G6XpqyfaAH4/eOUx6ZJe2UMpSCOJ0= Received: from DM6PR01CA0027.prod.exchangelabs.com (2603:10b6:5:296::32) by SJ1PR12MB6195.namprd12.prod.outlook.com (2603:10b6:a03:457::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 11:23:32 +0000 Received: from DM6NAM11FT094.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::60) by DM6PR01CA0027.outlook.office365.com (2603:10b6:5:296::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11 via Frontend Transport; Wed, 21 Dec 2022 11:23:32 +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 DM6NAM11FT094.mail.protection.outlook.com (10.13.172.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.6 via Frontend Transport; Wed, 21 Dec 2022 11:23:32 +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.2375.34; Wed, 21 Dec 2022 05:23:31 -0600 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.2375.34; Wed, 21 Dec 2022 05:23:31 -0600 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Wed, 21 Dec 2022 05:23:28 -0600 From: Vijendar Mukunda <Vijendar.Mukunda@amd.com> To: <broonie@kernel.org>, <alsa-devel@alsa-project.org> CC: <Basavaraj.Hiregoudar@amd.com>, <Sunil-kumar.Dommati@amd.com>, <Mario.Limonciello@amd.com>, Vijendar Mukunda <Vijendar.Mukunda@amd.com>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Syed Saba Kareem <Syed.SabaKareem@amd.com>, open list <linux-kernel@vger.kernel.org> Subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config Date: Wed, 21 Dec 2022 16:56:03 +0530 Message-ID: <20221221112611.1373278-1-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT094:EE_|SJ1PR12MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f7bf640-ee03-448d-92b0-08dae345cae1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ox0+U49w6OrcDT9z8dAXH14la9lOq5AfV2ZQFBdB9vTGR/Go9/9FhPt7+9prZMfrHkT5z7FAc/yuae7T3TiBCq7Ps/sqgtk9w9j7L1iv3VWCuYqJH8jawe/Xx68r5nUnN91C3MYk7DNRmaugmFS9QXoGyPhHPZKXGFr8BDLrBuOUIk1LkkLc5huEPc6s5hEE5jGkH2tpN0yOyZlaJov62Dk52VXOqPmTbeVF4HVi97I+LCYyQxQ9Us1Vt/ZF4aVX7kQsKdcj8CrpQRdbAD32i+CxcPzB9k40fLtJO0ZDu01EjMVP7qAwb4D4pKY1j6ZgG72uSsByDRbd8D8S85dNDvmcvSK7VxuVKM1cJ6Lb6BxlZReVXvLz8ZQm3JzA/i+tGJiJfHy8WCMP1L52oKvtXsWuqyeCaPGlpJTTTxq/j/88KBZ0u4k4aOpmEkMaNWCMkq5qmaLFcGN1NbyRxhKVNl0SlY/tiuAq+hQJQqaoPxSPjbEzxS8Lui1PwxOXWuInSDoUmuUMd4ZL6VIdiMdYAeZL9kDIkE+9l5lql7aGYyzxpG6WzDMnyHTk9+lKNg7Qjx80kQBkwpr1Cmzdg/dJxT7SNWrh71EhhhNRLMF+OULZGCwjV1EGWMFkzPRFYlntPYlYF5TP9k+OyDP5S5ojjO9LN8WCde7vwes0WXx7gy7WRznk/5+CMxn9CRgetJzNsozGrap+xsp9PZhmiVomnvH4b0VDbce/Y6Ec4x4Wcys= 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:(13230022)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(7696005)(478600001)(36756003)(2906002)(186003)(336012)(26005)(40460700003)(110136005)(81166007)(41300700001)(1076003)(82310400005)(8676002)(70206006)(70586007)(47076005)(5660300002)(83380400001)(426003)(4326008)(316002)(8936002)(40480700001)(54906003)(356005)(86362001)(36860700001)(82740400003)(2616005)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 11:23:32.1594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f7bf640-ee03-448d-92b0-08dae345cae1 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: DM6NAM11FT094.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6195 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752822569305061049?= X-GMAIL-MSGID: =?utf-8?q?1752822569305061049?= |
Series |
[V2,1/4] ASoC: amd: ps: implement api to retrieve acp device config
|
|
Commit Message
Mukunda,Vijendar
Dec. 21, 2022, 11:26 a.m. UTC
Implement API to retrieve acp device config and calculate platform
device count and dev mask for platform device node creation.
Currently for DMIC configuration, mask and dev count are calculated.
Same api will be used to extend support for different ACP device
configurations.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
v1->v2:
- used ACP_DMIC_DEV macro instead of hard coded value
- changed is_dmic_dev variable initialization
- changed debug level
sound/soc/amd/ps/acp63.h | 7 +++++++
sound/soc/amd/ps/pci-ps.c | 37 +++++++++++++++++++++++++++++++++++--
2 files changed, 42 insertions(+), 2 deletions(-)
Comments
On 21/12/22 16:56, Vijendar Mukunda wrote: > Implement API to retrieve acp device config and calculate platform > device count and dev mask for platform device node creation. > > Currently for DMIC configuration, mask and dev count are calculated. > Same api will be used to extend support for different ACP device > configurations. By mistake, patch series was sent as V2 instead of V1. > > Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> > --- > v1->v2: > - used ACP_DMIC_DEV macro instead of hard coded value > - changed is_dmic_dev variable initialization > - changed debug level > > sound/soc/amd/ps/acp63.h | 7 +++++++ > sound/soc/amd/ps/pci-ps.c | 37 +++++++++++++++++++++++++++++++++++-- > 2 files changed, 42 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h > index 5e7f9c1c1b0e..b015e845e5fa 100644 > --- a/sound/soc/amd/ps/acp63.h > +++ b/sound/soc/amd/ps/acp63.h > @@ -54,6 +54,11 @@ > /* time in ms for runtime suspend delay */ > #define ACP_SUSPEND_DELAY_MS 2000 > > +#define ACP63_DMIC_ADDR 2 > +#define ACP63_PDM_MODE_DEVS 3 > +#define ACP63_PDM_DEV_MASK 1 > +#define ACP_DMIC_DEV 2 > + > enum acp_config { > ACP_CONFIG_0 = 0, > ACP_CONFIG_1, > @@ -102,4 +107,6 @@ struct acp63_dev_data { > struct resource *res; > bool acp63_audio_mode; > struct platform_device *pdev[ACP63_DEVS]; > + u16 pdev_mask; > + u16 pdev_count; > }; > diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c > index 489f01a20699..9066a625e501 100644 > --- a/sound/soc/amd/ps/pci-ps.c > +++ b/sound/soc/amd/ps/pci-ps.c > @@ -132,6 +132,38 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) > return IRQ_NONE; > } > > +void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > +{ > + struct acpi_device *dmic_dev; > + const union acpi_object *obj; > + bool is_dmic_dev = false; > + > + dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); > + if (dmic_dev) { > + if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", > + ACPI_TYPE_INTEGER, &obj) && > + obj->integer.value == ACP_DMIC_DEV) > + is_dmic_dev = true; > + } > + > + switch (config) { > + case ACP_CONFIG_0: > + case ACP_CONFIG_1: > + case ACP_CONFIG_2: > + case ACP_CONFIG_3: > + case ACP_CONFIG_9: > + case ACP_CONFIG_15: > + dev_dbg(&pci->dev, "Audio Mode %d\n", config); > + break; > + default: > + if (is_dmic_dev) { > + acp_data->pdev_mask = ACP63_PDM_DEV_MASK; > + acp_data->pdev_count = ACP63_PDM_MODE_DEVS; > + } > + break; > + } > +} > + > static int snd_acp63_probe(struct pci_dev *pci, > const struct pci_device_id *pci_id) > { > @@ -183,6 +215,7 @@ static int snd_acp63_probe(struct pci_dev *pci, > if (ret) > goto release_regions; > val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); > + get_acp63_device_config(val, pci, adata); > switch (val) { > case ACP_CONFIG_0: > case ACP_CONFIG_1: > @@ -195,14 +228,14 @@ static int snd_acp63_probe(struct pci_dev *pci, > default: > > /* Checking DMIC hardware*/ > - adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0); > + adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); > > if (!adev) > break; > > if (!acpi_dev_get_property(adev, "acp-audio-device-type", > ACPI_TYPE_INTEGER, &obj) && > - obj->integer.value == 2) { > + obj->integer.value == ACP_DMIC_DEV) { > adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); > if (!adata->res) { > ret = -ENOMEM;
Hi Vijendar, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next patch link: https://lore.kernel.org/r/20221221112611.1373278-1-Vijendar.Mukunda%40amd.com patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: x86_64-randconfig-a015-20221219 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/a47d6a455ff7716688a8c7efaae89f07cebf118d git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/soc/amd/ps/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for function 'get_acp63_device_config' [-Wmissing-prototypes] void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ sound/soc/amd/ps/pci-ps.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ static sound/soc/amd/ps/pci-ps.c:231:60: error: use of undeclared identifier 'ACP_DMIC_ADDR' adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); ^ 1 warning and 1 error generated. vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c 134 > 135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) 136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
On 21/12/22 22:10, kernel test robot wrote: > Hi Vijendar, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on broonie-sound/for-next] > [also build test WARNING on linus/master next-20221220] > [cannot apply to v6.1] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-format-patch%23_base_tree_information&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376572895135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SgBlnpPN56oK62ky0JU8azh3nuEXn6tMz3xZbOejY5Q%3D&reserved=0] > > url: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux%2Fcommits%2FVijendar-Mukunda%2FASoC-amd-ps-implement-api-to-retrieve-acp-device-config%2F20221221-192703&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376572895135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UGJ84JSzprAvXAfmo2OXhrWT3CBFgJ12CzIArUgBEfM%3D&reserved=0 > base: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fbroonie%2Fsound.git&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4LZbNCMAz%2BCGrAgM%2FsBDxgRx7ose4EyopgsQkM4W8NU%3D&reserved=0 for-next > patch link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fr%2F20221221112611.1373278-1-Vijendar.Mukunda%2540amd.com&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=o%2B9ZhXvww%2FKDjm2sfVskOK0pNibVP%2BMO4sJnv6%2FAwRI%3D&reserved=0 > patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config > config: x86_64-randconfig-a015-20221219 > compiler: clang version 14.0.6 (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-project&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4xoUOqgeepbVj6xehXIOmWaRcR6FhKKmlHnxO0l1HBU%3D&reserved=0 f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): > wget https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.cross&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=65DwVdNjRWKIxNSxqtpFyF0%2FFldAeix1%2FTnZGYSj6L4%3D&reserved=0 -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux%2Fcommit%2Fa47d6a455ff7716688a8c7efaae89f07cebf118d&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=U9Ko4HNfl%2FfQTaPrCPVH7R%2FG5MIXydh5xtoNbyDNX8Q%3D&reserved=0 > git remote add linux-review https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux&data=05%7C01%7CVijendar.Mukunda%40amd.com%7Cf724439b0cd34a8d51da08dae3722149%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072376573051377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pEWhdrTN6tbqt22WvlgMAlVJKo43ont0s9fIuFaav0M%3D&reserved=0 > git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 > git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/soc/amd/ps/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > > All warnings (new ones prefixed by >>): > >>> sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for function 'get_acp63_device_config' [-Wmissing-prototypes] > void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > ^ > sound/soc/amd/ps/pci-ps.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > ^ > static > sound/soc/amd/ps/pci-ps.c:231:60: error: use of undeclared identifier 'ACP_DMIC_ADDR' > adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); > ^ > 1 warning and 1 error generated. > > will fix it and respin the patch series. > vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c > > 134 > > 135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > 136 { > 137 struct acpi_device *dmic_dev; > 138 const union acpi_object *obj; > 139 bool is_dmic_dev = false; > 140 > 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); > 142 if (dmic_dev) { > 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", > 144 ACPI_TYPE_INTEGER, &obj) && > 145 obj->integer.value == ACP_DMIC_DEV) > 146 is_dmic_dev = true; > 147 } > 148 > 149 switch (config) { > 150 case ACP_CONFIG_0: > 151 case ACP_CONFIG_1: > 152 case ACP_CONFIG_2: > 153 case ACP_CONFIG_3: > 154 case ACP_CONFIG_9: > 155 case ACP_CONFIG_15: > 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); > 157 break; > 158 default: > 159 if (is_dmic_dev) { > 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; > 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; > 162 } > 163 break; > 164 } > 165 } > 166 >
Hi Vijendar, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next patch link: https://lore.kernel.org/r/20221221112611.1373278-1-Vijendar.Mukunda%40amd.com patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: i386-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/a47d6a455ff7716688a8c7efaae89f07cebf118d git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 olddefconfig make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash sound/soc/amd/ps/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for 'get_acp63_device_config' [-Wmissing-prototypes] 135 | void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) | ^~~~~~~~~~~~~~~~~~~~~~~ sound/soc/amd/ps/pci-ps.c: In function 'snd_acp63_probe': sound/soc/amd/ps/pci-ps.c:231:74: error: 'ACP_DMIC_ADDR' undeclared (first use in this function); did you mean 'ACP63_DMIC_ADDR'? 231 | adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); | ^~~~~~~~~~~~~ | ACP63_DMIC_ADDR sound/soc/amd/ps/pci-ps.c:231:74: note: each undeclared identifier is reported only once for each function it appears in vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c 134 > 135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) 136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
On 21/12/22 23:10, kernel test robot wrote: > Hi Vijendar, > > Thank you for the patch! Perhaps something to improve: Issue is already fixed and updated patch series as V2 version. Because of version mismatch , test robot picked older patch series. -- Vijendar > [auto build test WARNING on broonie-sound/for-next] > [also build test WARNING on linus/master next-20221220] > [cannot apply to v6.1] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-format-patch%23_base_tree_information&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pREy1cj%2FssW267IS2cjwj1HM%2Fz%2FtFwMuFFAPsyEojso%3D&reserved=0] > > url: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux%2Fcommits%2FVijendar-Mukunda%2FASoC-amd-ps-implement-api-to-retrieve-acp-device-config%2F20221221-192703&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FsiiH4axp%2FR%2F2SoClKiyisUtDb3kR18d%2BnsgjYhjUiA%3D&reserved=0 > base: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fbroonie%2Fsound.git&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mhxTUjZwUkE6qSX2E%2FFdeNkvcxeUUGGLa0TiawEKcUA%3D&reserved=0 for-next > patch link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fr%2F20221221112611.1373278-1-Vijendar.Mukunda%2540amd.com&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ITTW3FXkEw0X7GdiqzG1dvdrS4VcemqldLWkFJah%2FU8%3D&reserved=0 > patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config > config: i386-allyesconfig > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > reproduce (this is a W=1 build): > # https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux%2Fcommit%2Fa47d6a455ff7716688a8c7efaae89f07cebf118d&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WP%2FmbWI4Ry4pbUBfh6lx%2B4PxXz1TpjaXf6YIx7J71Nk%3D&reserved=0 > git remote add linux-review https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux&data=05%7C01%7CVijendar.Mukunda%40amd.com%7C77e7d774bd4b4dd1165308dae37aa5a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638072413166143017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=koa4GqupLUfcvkCsQ2MD%2FUNkkF7vhYoBXMYzKg8k%2Bus%3D&reserved=0 > git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 > git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d > # save the config file > mkdir build_dir && cp config build_dir/.config > make W=1 O=build_dir ARCH=i386 olddefconfig > make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash sound/soc/amd/ps/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > > All warnings (new ones prefixed by >>): > >>> sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for 'get_acp63_device_config' [-Wmissing-prototypes] > 135 | void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > | ^~~~~~~~~~~~~~~~~~~~~~~ > sound/soc/amd/ps/pci-ps.c: In function 'snd_acp63_probe': > sound/soc/amd/ps/pci-ps.c:231:74: error: 'ACP_DMIC_ADDR' undeclared (first use in this function); did you mean 'ACP63_DMIC_ADDR'? > 231 | adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); > | ^~~~~~~~~~~~~ > | ACP63_DMIC_ADDR > sound/soc/amd/ps/pci-ps.c:231:74: note: each undeclared identifier is reported only once for each function it appears in > > > vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c > > 134 > > 135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) > 136 { > 137 struct acpi_device *dmic_dev; > 138 const union acpi_object *obj; > 139 bool is_dmic_dev = false; > 140 > 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); > 142 if (dmic_dev) { > 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", > 144 ACPI_TYPE_INTEGER, &obj) && > 145 obj->integer.value == ACP_DMIC_DEV) > 146 is_dmic_dev = true; > 147 } > 148 > 149 switch (config) { > 150 case ACP_CONFIG_0: > 151 case ACP_CONFIG_1: > 152 case ACP_CONFIG_2: > 153 case ACP_CONFIG_3: > 154 case ACP_CONFIG_9: > 155 case ACP_CONFIG_15: > 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); > 157 break; > 158 default: > 159 if (is_dmic_dev) { > 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; > 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; > 162 } > 163 break; > 164 } > 165 } > 166 >
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 5e7f9c1c1b0e..b015e845e5fa 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -54,6 +54,11 @@ /* time in ms for runtime suspend delay */ #define ACP_SUSPEND_DELAY_MS 2000 +#define ACP63_DMIC_ADDR 2 +#define ACP63_PDM_MODE_DEVS 3 +#define ACP63_PDM_DEV_MASK 1 +#define ACP_DMIC_DEV 2 + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, @@ -102,4 +107,6 @@ struct acp63_dev_data { struct resource *res; bool acp63_audio_mode; struct platform_device *pdev[ACP63_DEVS]; + u16 pdev_mask; + u16 pdev_count; }; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 489f01a20699..9066a625e501 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -132,6 +132,38 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) return IRQ_NONE; } +void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) +{ + struct acpi_device *dmic_dev; + const union acpi_object *obj; + bool is_dmic_dev = false; + + dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); + if (dmic_dev) { + if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == ACP_DMIC_DEV) + is_dmic_dev = true; + } + + switch (config) { + case ACP_CONFIG_0: + case ACP_CONFIG_1: + case ACP_CONFIG_2: + case ACP_CONFIG_3: + case ACP_CONFIG_9: + case ACP_CONFIG_15: + dev_dbg(&pci->dev, "Audio Mode %d\n", config); + break; + default: + if (is_dmic_dev) { + acp_data->pdev_mask = ACP63_PDM_DEV_MASK; + acp_data->pdev_count = ACP63_PDM_MODE_DEVS; + } + break; + } +} + static int snd_acp63_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -183,6 +215,7 @@ static int snd_acp63_probe(struct pci_dev *pci, if (ret) goto release_regions; val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); + get_acp63_device_config(val, pci, adata); switch (val) { case ACP_CONFIG_0: case ACP_CONFIG_1: @@ -195,14 +228,14 @@ static int snd_acp63_probe(struct pci_dev *pci, default: /* Checking DMIC hardware*/ - adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0); + adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); if (!adev) break; if (!acpi_dev_get_property(adev, "acp-audio-device-type", ACPI_TYPE_INTEGER, &obj) && - obj->integer.value == 2) { + obj->integer.value == ACP_DMIC_DEV) { adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); if (!adata->res) { ret = -ENOMEM;