From patchwork Mon Jan 30 22:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121958 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 77EB5C54EAA for ; Mon, 30 Jan 2023 22:09:13 +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 7501A829; Mon, 30 Jan 2023 23:08:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7501A829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116550; bh=DloRz2y0bMEvM06on3C1wHyCZSZhB9corbwgfoBAQFw=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=G1PqSzxtEy5MDM96r85je+9yoPGU9GvsezVOZDcdrxBFuxYDSxupPJbvb/Ai2Q5To 57nWdTqZDKNVYiGg8ggHjM/fyOvfJIYz9EYinMnSsil2/Zq0qxCfR2KHzwghWLn5fn HENlc0pvqVuiWFnWHpIbDidM0wxsadQQgZ82eLAk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 07E1EF80496; Mon, 30 Jan 2023 23:08:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE66BF8047D; Mon, 30 Jan 2023 23:08:18 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.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 502A2F800A7 for ; Mon, 30 Jan 2023 23:08:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 502A2F800A7 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=hyyUCFCl ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FwIqQ/7J/TlEuluJL4GVWJO4jTZrP0z7QsJCb1ypyUwos5O/dLQ+ZRgYJKpkJgprWPsS7jRrACAOVSaMw988SHzMxV6I9ZRgmOfx2/YCYNjZfJBHzGLO68EnGBlXphmKEEDZghLllzNOFXBnk1kpcxNENvFylhAA24yOCzLJM1Qqsf+1jzvrPFTQFhrcFCxqEX5CPYLDikSn46BAf4f4FCTOgUN0w6v4y/mdmyWJ7n5iEcVcqmo8TwmHjeMSqumSIoaMpeepNtulOyqa0x+2tbdK9rkp9wNQdR7I5PipAeHNsy9A4cIbrZHJaye0+yn0BlSzWVqydmh1taF1jQWJ5Q== 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=5aKmvnOZr7+ZbKfC741aJVN4sW9FPDgnJEvlymWjFz8=; b=D3fgKrv7aBecg75BEnDwl19UZwIoIEnoTMbu01nbrzBIW6Y/kGJX6MzmpxOx+xFuHnavt8/zHPvCO4K73Pc2o11VCt9tG5KGbu5vzLX2S/OUIKJA9iXuPF5bhlbCboZbMCyZxcH7l5OooepuoUfYlS+9hqRZMp7ONOBy+Y90PU0F1eo/OfZxlwWjWKOSiglfDQ5F9eK/fmLIT84MDylkiWzOO8ufHMViE3/CRMLlHn9sbPYli39Os9ZgJxKwB8MZfj3zvybJ0YqTp+fUzyvEbcxmuj2JQ1+POAr8fX1zqC8p+qRBGLczwUBIau4LGdhZUxr2qzcqgylnh50Tt4NmKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=5aKmvnOZr7+ZbKfC741aJVN4sW9FPDgnJEvlymWjFz8=; b=hyyUCFClvEV8t8s/O4+mUkMt/CB93Aj0ms7dGmRBbYnhgKz60d38tWG9TBusCxfvQ0qM9blkhym+9rUlrIOGQ+wW5bcbC0GSpNHYYWocLglz55mchvET46aMWMEVyLRIxJlDSkNyFSsNTtHNga2ikUdxb5hwhdeKPwqfwqcmHLY= Received: from DM6PR06CA0096.namprd06.prod.outlook.com (2603:10b6:5:336::29) by DM4PR12MB7599.namprd12.prod.outlook.com (2603:10b6:8:109::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.33; Mon, 30 Jan 2023 22:08:08 +0000 Received: from DM6NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::35) by DM6PR06CA0096.outlook.office365.com (2603:10b6:5:336::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:07 +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 DM6NAM11FT068.mail.protection.outlook.com (10.13.173.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 22:08:07 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:06 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 1/6] ASoC: amd: yc: Adjust the gain for PDM DMIC Date: Mon, 30 Jan 2023 16:07:49 -0600 Message-ID: <20230130220754.8379-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT068:EE_|DM4PR12MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 95617e9a-3206-4a55-178d-08db030e77d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tpKOmrSsdyLwGrw6Wv+QTIbz6N9QXDTdbuRSybMJ8JQfSY+s+FGXQQlMRRF6L8ONYWPzyocdzvhVFt6vgzU7GGuOL3lhpz6bz6FlfuVrgz0PxhmPLXf169Ni4JMNLAuqbafcwQnHhqtZ4n0CPztFyuTTMylPdoG9rhgMxq/tyAnTXRr+VHTjmYtzYUHC2U6MVqbYs5o39tnrODVGhE5JVQntzkv9QYTGSwAmgE/Gd/Ic7FcH07tTj5hi0wYuI0JtxiyVlKUBKk/ADMlg8gAWZdslPTQZU/kXc5o2avXQQxy5eJZi+jPUDnfdehV0ClVN1xEsnyeUCglxPk3R+RI/tDXW9KnLfZcfJumM6nSWU+NFElGrsmbHNFF3pQTagZl4kQsm0GnVFKsZ1WzHrZQOj13fQxJ0uZ6MkT29Y+dwN+p37UALvljwj/NLqVgRtxAkU4lzFpFnCBW1wchqAxCwmBiIdh3oREjb2WSnJrSRqLbFBn7FSIpYtgiu/g8NWCc+u5J+nExAS+Mr306F1hYQEI6HAyPrNiCrd1pEHuS0Q4OeXIEWGzy8TZ/z0KQBPmjE1Lh9iCHn5nU8jg+E1l6ZOWpe3DghCgANdgR2vRmrF7EZH29OrCMmwcgRPhltftFQQV5XDpSwcPHqoN5fqGBSN7seveSdxCosncBnw04U0guiv2Uom7OrmHa+PKqGx+CXMCDUtB0CpasmpshlsKADQKnDCSyGb5yr6Gsr79u3RI8= 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:(13230025)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199018)(40470700004)(36840700001)(46966006)(2906002)(36756003)(86362001)(82310400005)(16526019)(2616005)(26005)(186003)(70206006)(336012)(4326008)(70586007)(47076005)(8676002)(426003)(7696005)(110136005)(1076003)(40460700003)(6666004)(478600001)(316002)(54906003)(81166007)(82740400003)(4744005)(44832011)(5660300002)(356005)(40480700001)(41300700001)(36860700001)(83380400001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:07.7155 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95617e9a-3206-4a55-178d-08db030e77d5 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: DM6NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7599 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" A number of users for Lenovo Rembrandt based laptops are reporting that the microphone is too quiet relative to Windows with a dual boot. Increase the PDM gain to overcome this problem. Signed-off-by: Mario Limonciello --- sound/soc/amd/yc/acp6x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 74b596e6807ad..846ca10e24d3f 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -31,7 +31,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 2 #define ACP_PDM_CLK_FREQ_MASK 7 -#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_WOV_MISC_CTRL_MASK 0x18 #define ACP_PDM_ENABLE 1 #define ACP_PDM_DISABLE 0 #define ACP_PDM_DMA_EN_STATUS 2 From patchwork Mon Jan 30 22:07:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121962 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 C077FC636CD for ; Mon, 30 Jan 2023 22:10:29 +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 6A736846; Mon, 30 Jan 2023 23:09:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6A736846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116627; bh=aImkc++qNiCq1Xg4UEls08uOApVJ0OfKRixH4ccXLME=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Az8v6nGoxs7n9ZzCSm2TeTM0+x9DElKW8eW6f5Ng3FGJKkOuEOkCdwriGmdNz2Pvt os+ODcMWRHliwkBkzl0iS8iEIh6gE4uC2PoLE7RqOcsl927ATFGOXTwm8Cd+I1dpIj MjOZ4wSE+j9SCvp8cYehS5xD3EsWOrnvPgTZJME8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A8003F8055C; Mon, 30 Jan 2023 23:08:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 402EEF8055C; Mon, 30 Jan 2023 23:08:26 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) (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 0A15EF80236 for ; Mon, 30 Jan 2023 23:08:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0A15EF80236 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=o2n8V+96 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZHGb5MmU+SO2GjFbMc57AAjQzlffjGPdtgOWyRWBqM+d0y19YspyN29q5ZzzBtxRcR/nbxbtlb1kJHlGfgcA3A1VU/MBDQNIEcZLgmYBFxfRLOjL0YiPOKelB+A0PTLf2IBVnYCGAooSweBOXNNfhR8MtrCBNTNu+CRF1Cap0cJI5/BuKVvMyElPltb6NUtrg8HMJnCo1MLLozH44qCqpmHgTvKkWpiiF6lsFqV746IK5Xu52E0c38Oi18Mk8XWD15jMpmUg7CI8FHMaxOqB9yOUM0Lr+PZh5xmzUNEJnZPzSHmpvoh+auhjvm0IjibXaRV0JyudqfvqhJxX4GNqw== 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=40Z2QG+kXxpSw+po0RsvIEJYYU/V1nwfSsaV7p53keA=; b=jTZKzu21EpCjElaK5H/25m4VjHnT6jz0ToVypzbIRI9GXySx/j4BaEPz2wpI2HuxigkHGLXQt43UW8VuE4sSkBefVSfYGlDqNpmRH9ZGVk4JnNA4ajz6rDRBpehiZhTI/ORLpBq27WefF1jdHe8uTGJ9h8yeRorq/6erHYZa5htGDkDUwU3vIyAa4npBsvCAH7IRhgWJY3Lxx9gxeyA1U7okrFG0cGVXrY75v/fKlGz8wDXQ6Lxy7pgK1/khh1dHD/bD/+7GRA/CLcoGOT5WfM/s4lLVvoeP52wCqxwNtIR7PoET7UJYEcPorReIZOMaaI67B8Mth5Q9jmzeOKS8dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=40Z2QG+kXxpSw+po0RsvIEJYYU/V1nwfSsaV7p53keA=; b=o2n8V+96lcZu4V0YvIwiDTrvmjQk8qTH7i7p/+Jj30d+Lvoto6khxEsXBsaTeBqNVWJgzo7cBvO1Wmq9xCHRrr2HaTnLKk+ONqu3MrMWd8DyZ3YcLEygSsRhAmfEq65UvamY5w/C1NcwzQ8IG8eiVn0FyvySZG7IdYuFsetc0F8= Received: from DM6PR11CA0007.namprd11.prod.outlook.com (2603:10b6:5:190::20) by DM4PR12MB5232.namprd12.prod.outlook.com (2603:10b6:5:39c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 22:08:09 +0000 Received: from DM6NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::3) by DM6PR11CA0007.outlook.office365.com (2603:10b6:5:190::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:09 +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 DM6NAM11FT017.mail.protection.outlook.com (10.13.172.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 22:08:09 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:07 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 2/6] ASoC: amd: yc: Add a module parameter to influence pdm_gain Date: Mon, 30 Jan 2023 16:07:50 -0600 Message-ID: <20230130220754.8379-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT017:EE_|DM4PR12MB5232:EE_ X-MS-Office365-Filtering-Correlation-Id: 13d68a55-8682-4c02-96af-08db030e78b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hks8ocH/ejoXCQnAeGsBid+/+0rK5Oiaye6pmU9vqBF5jJPBw/YFd9Bd0Y/q0qxl6hSwPGvkTj6We2EagNsVuPYezQer9oTfwrZluA5YvSTeOf8fuUb3enetfH5mtuTMcyRbPCoQqwlBeqNKXOZdFtnLjGILO4RRjDt/GMA2TrdWsXtsVW5c2QI60ZRil1hlgqDbLQGnRAukNxY+DyuoiQkeAiC9Hf7Twsa99I4N1K+MgQvttnP9Dk/pGYzUTt1kszB0VLdqN1p2Q6YLcog2BcYRW2B/yj/v93sVf9BZQmuymVZAKgV4vIiv86FzKjyRvM8xvLjw5xeaLEtPiseldAaN/Q3zKTcASSbD5vlnun69dKQItK75+18Wa9NFHXfLcplKT4g3QTNS1JoSSe8GdrX1VObYBpTILJNuvXDDvRg28fsGcni+G4i/X/yKJ8MdGNo1EIU2fy9r06PCtQ4aEYvRvqO0+5eh56/+VQ/GRzj17TKYelp3sp4Zq76o1jaJq64dpvClrNUeXKW8YIjM0wtGV2QzFU+cXXIlNiPNTSbO+C9QUaaTA77pYDXQDhUJErkbUSndp7akLEsWWxuB7bmMxAmOHX1mvX4z5LgU07iNJdsNQBkO64Tfv24hmIgpk3kZTG1X8cmZ7RPzV8cLJOtWERlUBkDw3G/rV+sU1FL2gfXwK1tgdk7r3ZS1dReDWbC3+7drQ9IExIcIOGNa9E+xmTNr9aWiubbU5hv3FfA= 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:(13230025)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199018)(46966006)(40470700004)(36840700001)(356005)(81166007)(86362001)(36860700001)(82740400003)(110136005)(54906003)(36756003)(82310400005)(8936002)(41300700001)(5660300002)(316002)(70586007)(8676002)(4326008)(70206006)(2906002)(47076005)(40460700003)(40480700001)(44832011)(336012)(426003)(83380400001)(2616005)(478600001)(7696005)(26005)(16526019)(186003)(6666004)(1076003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:09.1605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13d68a55-8682-4c02-96af-08db030e78b1 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: DM6NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5232 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello --- v1->v2: * Add a guard for values > 3 to overflow the FIELD_PREP * Clear ACP_WOV_GAIN_CONTROL before setting it --- sound/soc/amd/yc/acp6x-pdm-dma.c | 10 +++++++++- sound/soc/amd/yc/acp6x.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index acecd6a4ec4b1..2bb3ea14bae9c 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,10 @@ #define DRV_NAME "acp_yc_pdm_dma" +static int pdm_gain = 3; +module_param(pdm_gain, int, 0644); +MODULE_PARM_DESC(pdm_gain, "Gain control (0-3)"); + static const struct snd_pcm_hardware acp6x_pdm_hardware_capture = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -55,7 +60,10 @@ static void acp6x_enable_pdm_clock(void __iomem *acp_base) acp6x_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); pdm_ctrl = acp6x_readl(acp_base + ACP_WOV_MISC_CTRL); - pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + pdm_ctrl &= FIELD_PREP(ACP_WOV_GAIN_CONTROL, 0); + if (pdm_gain > 3) + pdm_gain = 3; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, pdm_gain); acp6x_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); } diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 846ca10e24d3f..036207568c048 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -31,7 +31,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 2 #define ACP_PDM_CLK_FREQ_MASK 7 -#define ACP_WOV_MISC_CTRL_MASK 0x18 +#define ACP_WOV_GAIN_CONTROL GENMASK(4, 3) #define ACP_PDM_ENABLE 1 #define ACP_PDM_DISABLE 0 #define ACP_PDM_DMA_EN_STATUS 2 From patchwork Mon Jan 30 22:07:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121960 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 4C6C7C636CD for ; Mon, 30 Jan 2023 22:10:10 +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 7E5CD857; Mon, 30 Jan 2023 23:09:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E5CD857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116607; bh=XTU7PWPdZemAoAS2RVaHCh1sbBfbaKW90TZSL+67l6k=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=vqzS7LVuJ3Dx85S4cEdy1hkR02A8ule1ktmYWy02/zZdUwckQTzfGPj1x2MxVSS9p rndT2XgChlA5wBzuhpWTbMXgOCkNpqGY39Xbeoaf+3IRZtoZt03DS1qce46fCizg8Q CEHwI+n73gG0W8ssT7bXsuX2LMc2Dr+swjztGfl8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2343DF8055A; Mon, 30 Jan 2023 23:08:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C361CF80544; Mon, 30 Jan 2023 23:08:24 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20620.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::620]) (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 08693F8032B for ; Mon, 30 Jan 2023 23:08:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 08693F8032B 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=K3TkAfPh ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RtOQp8jouvrrPcErNM2Rt1dJ3yuEeWrZEzNn4rHMgKzIUmWJHe6iBxribnrVnMgg9p3C/IAuOVqiQ1ygd4l7wl0iDPvRRoNJmSbe3xDT8f2DDhNXsSskVsCqI9LDXsBU/Vb3/dACqH9mNX+G4+eqDcCqujhhqUw+6w2JgNlA8Udikeh4+FUtwI6BPLNVW0WqXJv0kkf1Y2LkApvlmxv6+Yr5LiYBEfeoii+3l06N1O5PA4ab0ozOfL+4AdspqOm6UAB7+o5gILTcKFw9kjjis4QRIxI0IL3ArVXYyjSiqtYCK7P4YwowzN1inKVsQrpmPTj7DmBwLUZwly92iWFENA== 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=jtTA9PwUwiy3U/Dloa2J49BaxS2dkptgUr+JvrRziMg=; b=aE4yMrfoQlX7d+CwZQYDgX3ba1wDsaCzx9aKRDzfXNMu9upA3w8pSZ3SMVodYWMVGsQpQmMil5v3iZN8yMHv0ldRkRGBMkc5Wn6ZmMcVKoGB05RIMO9nT5JC2D7J4QJzXRpY7ba3Om29OrS3fWQ1rc/wq/oUJPkLSq41iNZDlCh5CIlvu3371MuYVfKV2b43/BsdDxN/T19rutcXTOWfX3k4lMJBGiUz+TpfCl9zlTndNk5GqmE9Dnolfqv/lLEv21vMaffjIJf8uAsts1CWzQHqIELC1//K7ugTUaGMDpp4/JA4tIvSk21/Ui79vLY0jvJQH1nlcmMohDQy8KYj1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=jtTA9PwUwiy3U/Dloa2J49BaxS2dkptgUr+JvrRziMg=; b=K3TkAfPh0rctCleBRSgiJCqyWFTaBFeT2LouDHKX1iM4DI/zAZBCr1FCiCsencqaW6V94FhTuR97nFzSuPsdI01jQkFJUJOSwcJ2p7P2vGuwyLgkFyvj3ysMCjYvXIO5AU1hFVa7mxIAnS3LDF0YzZX3kMEYBdoHRVDJKRHthog= Received: from DS7PR05CA0014.namprd05.prod.outlook.com (2603:10b6:5:3b9::19) by CH2PR12MB4216.namprd12.prod.outlook.com (2603:10b6:610:a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 22:08:10 +0000 Received: from DM6NAM11FT086.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::7f) by DS7PR05CA0014.outlook.office365.com (2603:10b6:5:3b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.19 via Frontend Transport; Mon, 30 Jan 2023 22:08:10 +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 DM6NAM11FT086.mail.protection.outlook.com (10.13.173.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 22:08:10 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:09 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 3/6] ASoC: amd: renoir: Adjust the gain for PDM DMIC Date: Mon, 30 Jan 2023 16:07:51 -0600 Message-ID: <20230130220754.8379-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT086:EE_|CH2PR12MB4216:EE_ X-MS-Office365-Filtering-Correlation-Id: 58cbfa7e-4181-47df-e55e-08db030e7961 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0LiYR4PX+DloZQF6r1hDkYXQGFIbdZU6nA6ldSYmDcGbUr0TXvM1uFxbXxaaF+IWLELBzZ1YdsOaX64vUZkS9gPltaHAq5dfh27Xuo9z85i0VCvuGsC+0rskgEZ9mnyGAH4anFrgefr184QS0uqK8ASLdYYDyL6bJ4KSP8Q9m6H1ORrOTyi50rtKpkq4lKqD2YtAVR2n/zr5AmhLMv2FFShbk2d9Sg467noTnMtj9YBhgTRbUam3kzWAdwct3jv9q8Z2BhzBtLDK0OjP9YZZlycGvM4u58HKO23RkKJzg3bhtBj8rfwy8KuKKydf70SnU0Y88OkXkDnWGMyglwFbNi4DGRi7BzJz20lfMORicEHPBM+7pLC9aQErv4pq6Cbr1JNXg/k92Cvjz5XwrmvEBjNudZt8UNTOw+SBjG6+oGDIgtDR5Z+DyZrdIFUFuSEP3fSwkAuAg9eRVTDmL3tEWKrpVZyA+1cX0gb4Cz7EYS5y5jxKlWjA4dewubw6zqraDasYljC908EUCIlTJSw2wa+Esoc5cIVVKK9sgqYZdl4gFZ+z6GGYINmwCW5OKfMgpEaI8baOBFlzA0lBB68K4+Fpy8NLGdUGP/8Ia4UoXUOEZciokCibK+G+H7GDdzxqy7SXvT8qLLKERK5mFllb03pS9TvmpknsTtCO45gzSp4vzUxdLuTFEdmybldYWrrEofqSwWAM084S2JB2qrTwgd2NB5685DOAjKAK24FwtSY= 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:(13230025)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199018)(36840700001)(40470700004)(46966006)(47076005)(7696005)(70206006)(8676002)(4326008)(36860700001)(41300700001)(8936002)(70586007)(336012)(426003)(83380400001)(478600001)(86362001)(2906002)(316002)(6666004)(40480700001)(82740400003)(82310400005)(1076003)(81166007)(5660300002)(16526019)(44832011)(186003)(4744005)(356005)(26005)(36756003)(110136005)(2616005)(54906003)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:10.3160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58cbfa7e-4181-47df-e55e-08db030e7961 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: DM6NAM11FT086.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4216 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" A similar issue that was reported on Rembrandt based laptops with low DMIC volume is also being reported for Barcelo based laptops that use renoir acp3x. Increase the PDM gain to overcome this problem. Signed-off-by: Mario Limonciello --- sound/soc/amd/renoir/rn_acp3x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index ca586603d7203..c174f84650d24 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -34,7 +34,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 0x2 #define ACP_PDM_CLK_FREQ_MASK 0x07 -#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_WOV_MISC_CTRL_MASK 0x18 #define ACP_PDM_ENABLE 0x01 #define ACP_PDM_DISABLE 0x00 #define ACP_PDM_DMA_EN_STATUS 0x02 From patchwork Mon Jan 30 22:07:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121963 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 464BEC54EAA for ; Mon, 30 Jan 2023 22:10:40 +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 71E7084D; Mon, 30 Jan 2023 23:09:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 71E7084D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116638; bh=AqlnzWPRF+uEjVv/UozyuoSzWlkU2O5O2wEg5CwY4xs=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=LRSr6tOkTjsusTOF/LXXIu8BM9SoGKJRbnvs7tTZwROUPWq6ifwe7hBuDerxyQve/ czU51FzV8ADJiqM9nSs8Hv77eXYMfOEriqOpLW3QLC9L91wcHgNGRCMpY65jcb2FAv 76YwRlxQaULFwnpZEK2w1hb4M13uk0Q7Nu7wMEvA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4BC1EF80568; Mon, 30 Jan 2023 23:08:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DF668F80563; Mon, 30 Jan 2023 23:08:28 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::60e]) (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 17912F80423 for ; Mon, 30 Jan 2023 23:08:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 17912F80423 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=WIDvcg3/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=erMNaNB8BnFQxTJLc/svYfQ+F01L7owz+ll6vaA2kjxrFFiIq/JwgXiqNDCgkrH+ZWp2L1h3ye/0Y8DsXmkralt/oN+J7EShy9rzsVhOM6VTwYAq+lIsnYizz0h90nUOg7qGjeQZXyJraIThg/sfsROQwO72wNrGZfaopIXqYgEVGLWEWlMzDjbXmG6bJYrkrkJavotVvM567yQNHU4wYSsk2BOhkjw8SDtcak33khGCpcj1VWEN7yL+tvPxKsiEwDhq6RTdehWjsAbsz+o04+LirkO9cI9lfHI+W1caNNfRGvTqP4T5O46b7mdEQbt8CwttbgGErjUQ0DjUfcPo2w== 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=F/8511HDqNx9BFiFOeiqBy0XH6KI5pNo1EYEK/Be4Fo=; b=D+BfSltUediaHcWZM8p+jl2Vq/UjrgqcpIWLxmIpHhVIQhcedk4Fkr2SWMqeiQHc1GBTPv9WtndexAhbesTGVfb6m6gvYt+yw4Iz7bSkvU3Xn03EqG+3q2v3+iLzkJX9odLryo/TCG2TPW2Vv9XUL1hMh41GfrBN8o9NPrbaVRQcjavA6BWTnT8CAPMIKfuSbP7pZIhgqjXRJrEDqOgxAGTtHJ29g4+z7Z1ttfPwhQVxMp8uulAqZ5JayOSlANcfasyQefMWMY/JT2GbqgvZbC3dCtYLRA1/CP0ZKBby3of+igf85W4fzqqj87QTD2/JWPl6rTu+HF5fntAWEEX5aQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=F/8511HDqNx9BFiFOeiqBy0XH6KI5pNo1EYEK/Be4Fo=; b=WIDvcg3/AoYMNnNJxbvQUqsz6TSvL+Bty0e104Z32f0ILK1op3okJUmu6xBltHo5JUNby6XObk22aAUrklqgXOhmN3SusJp5LdfEMf+t2jtNodL3RWhAO84YjxitSt7FyT9+XAEVYWscHCBkyHI0/OBSYVvvSn0Je7fFoFVAhxk= Received: from DM6PR17CA0001.namprd17.prod.outlook.com (2603:10b6:5:1b3::14) by MN2PR12MB4552.namprd12.prod.outlook.com (2603:10b6:208:24f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 22:08:12 +0000 Received: from DM6NAM11FT102.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::5) by DM6PR17CA0001.outlook.office365.com (2603:10b6:5:1b3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:12 +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 DM6NAM11FT102.mail.protection.outlook.com (10.13.173.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:12 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:10 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 4/6] ASoC: amd: renoir: Add a module parameter to influence pdm_gain Date: Mon, 30 Jan 2023 16:07:52 -0600 Message-ID: <20230130220754.8379-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT102:EE_|MN2PR12MB4552:EE_ X-MS-Office365-Filtering-Correlation-Id: 51ccd41d-1839-4af0-202e-08db030e7a73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SlP+CFJog3VmnKxTgtaNr76pppN+B3ySbPM4Z4duNBZ2pscOC1XA3xb/LaXHlttXPXaxbYovqqzHidjqhHvR7Ynh0lp9M6VUBcNC1UJVwM0hlA7v3vtLdRshDIMsIEhzzSTR5MRNve5vKQi9lN0J10phP50MUaMy76jfTQ70PU8AdOJAlEI05TbQTdeOJsfIiJZIDwTPThjPbFCWcx4nMGqCZ1MlJOjUSy/Zic9p934l/dLBdvu9oUUyWJRgZ2wXgDjUEmro08JpqGZljQ5/9nxnVBCodRfoBiemswa5/QT03O6n0brxwUT6KUUudFzUMt1pGBD4VlQELNh0c2tDiXnXu/nCG/M/dKElFQBAaUwyNTDFOFOZ2zvQALM1DS9BEIFy5mdrzPF85Cij83jEkZivRIceNxPPvU1T8GYFhzWGyN73qDFE8xkaT6oE3Rngmm8Cvj6S++YQH3ldmW362FOORX6ZCcIp2nXjdL0Ai9ZG6IXBpIiQ/hF8nlnsKwYKNojlXHcuLIQW+K/cxCeA0i1PV/Wyzlfv79kkoI7xjbCnJOVBuiv1Oww9/7cORpzg0zyZLECjV5PLaabTTj2rz0CcvCqvHSZbssinrBGphXT3pEeH2ANFYAxeJUWxPZ/djOPzJ2Qa8oC4+gejoFBNpftl8Lzw8qhcICYc0wjheh30meRZdfP5v/kcvW07d2BcG/BcB7FTgZAO4OHzbcV9seonFcVAIAAvIzjeFJehHHA= 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:(13230025)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199018)(40470700004)(36840700001)(46966006)(2906002)(316002)(186003)(5660300002)(356005)(44832011)(1076003)(16526019)(36756003)(110136005)(54906003)(2616005)(40460700003)(26005)(81166007)(6666004)(82310400005)(40480700001)(86362001)(47076005)(7696005)(426003)(336012)(83380400001)(82740400003)(478600001)(4326008)(70206006)(8676002)(70586007)(8936002)(36860700001)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:12.1066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51ccd41d-1839-4af0-202e-08db030e7a73 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: DM6NAM11FT102.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4552 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello --- v1->v2: * Add a guard for values > 3 to overflow the FIELD_PREP * Clear ACP_WOV_GAIN_CONTROL before setting it --- sound/soc/amd/renoir/acp3x-pdm-dma.c | 10 +++++++++- sound/soc/amd/renoir/rn_acp3x.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index 7203c6488df0e..4582d4b8cdf73 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -17,6 +18,10 @@ #define DRV_NAME "acp_rn_pdm_dma" +static int pdm_gain = 3; +module_param(pdm_gain, int, 0644); +MODULE_PARM_DESC(pdm_gain, "Gain control (0-3)"); + static const struct snd_pcm_hardware acp_pdm_hardware_capture = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -80,7 +85,10 @@ static void enable_pdm_clock(void __iomem *acp_base) rn_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); pdm_ctrl = rn_readl(acp_base + ACP_WOV_MISC_CTRL); - pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + pdm_ctrl &= FIELD_PREP(ACP_WOV_GAIN_CONTROL, 0); + if (pdm_gain > 3) + pdm_gain = 3; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, pdm_gain); rn_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); } diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index c174f84650d24..7d0f4e6a2834d 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -34,7 +34,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 0x2 #define ACP_PDM_CLK_FREQ_MASK 0x07 -#define ACP_WOV_MISC_CTRL_MASK 0x18 +#define ACP_WOV_GAIN_CONTROL GENMASK(4, 3) #define ACP_PDM_ENABLE 0x01 #define ACP_PDM_DISABLE 0x00 #define ACP_PDM_DMA_EN_STATUS 0x02 From patchwork Mon Jan 30 22:07:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121961 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 B6150C54EAA for ; Mon, 30 Jan 2023 22:10:11 +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 C49C8E71; Mon, 30 Jan 2023 23:09:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C49C8E71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116602; bh=gneaJEkqB4aHYWjxuQig8OCrMZyrRQNKP51dZ/hhJaE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=BNdfMgDTK7HhOhgo01gZwXnvfqjL2uxH4LTPeF0pXVdmxc9bzEreMkGviVKJc3zov lobV4kbV263lrOpRt+lQ+40dtxvEFyp7KIP7NiTcKSTy2vG7VvUPnKHlVfwsMJaKoB ExxbTNgj6MkcG/smNQHcG5cHeki/6CsUiWgYHuFo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 60DC3F80552; Mon, 30 Jan 2023 23:08:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A71AF80544; Mon, 30 Jan 2023 23:08:23 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20603.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::603]) (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 C3E5EF800A7 for ; Mon, 30 Jan 2023 23:08:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C3E5EF800A7 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=mlGV5BZJ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ji+rGmFhK6N+cvVBRGJtmMX84dds583YdSi3YLPoYJRsv5Ip8tLtmluBmhGE1Gr12uD8n51ZrA1NssaoUYjGOwvpfYjrWfduy1qRpun4wz5BiGXS8wE1l1y/GlKKuwTKm79d+AeaATGeaharqnkqO4yBn6OksYhY6NMm4HAUE6hHdFRTwhrcnxdNFnL32ZGQvcumlnmSLcLOAg11ViqCHBNWPL9ZyPuQJUZE+6eNLhXeIW3zJ2BE6VdshR0Sctu62GZXzTVN9k+sx1MIUogt6JqBS6PbZGn9AhZNRB7tozN+BPy3XJT5JMPvKhfnFfUYaFK0sFw4fx77I0+x81NvTw== 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=7myppTcR7oW5npvdU5XwvzSX65cR7yfxVbtsMstF1lM=; b=PZv6iW1084G/iqMJHozQ83t5yRjyVwa+GMOX2R4ebRJpdUnrOoQSp+coTRj7i7Ze6ScLghS4lfCKUzJ1BidqT5ldxY0LV631+gJA/cp1zGESEW9rcO0MhAVseHU0bfb5nY8QYQ6nCTgx5MbKxVK8AwII74clTChu6Z9ZZBvaLHA7NPKVOB73WOtJb+qc5G1LqrWBL/eB8wtfvFJHpr2ATrRwcCSen/GjeVYyqqG0vA7VvKrnbdRfi/JgTpehb+on7f+NaKaH2uiATFUSpZk91ewCfL3DBNRG7iJoOknepW314kcToxCPpWjqKVEB4GhJwMS90RaKQFEDMQsFqMAMiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=7myppTcR7oW5npvdU5XwvzSX65cR7yfxVbtsMstF1lM=; b=mlGV5BZJJT84p/jw9nWwRO9jQKWBtgmPmNrELgSetAl3y6XqNKmy5IUZj0j7Y5Xd4eUuyYFN2auXtaZjkBc3K1b9bl3dHM28psQZGH29kgzZ5qaMY6mvdZKJQ5CKxV+nCWSKsvG197d/T9QoHh1m2BoACOF8NmNrDqVtLMtCRjw= Received: from DM6PR17CA0026.namprd17.prod.outlook.com (2603:10b6:5:1b3::39) by DM4PR12MB6133.namprd12.prod.outlook.com (2603:10b6:8:ae::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 22:08:12 +0000 Received: from DM6NAM11FT102.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::9e) by DM6PR17CA0026.outlook.office365.com (2603:10b6:5:1b3::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:12 +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 DM6NAM11FT102.mail.protection.outlook.com (10.13.173.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 22:08:12 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:11 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 5/6] ASoC: amd: ps: Adjust the gain for PDM DMIC Date: Mon, 30 Jan 2023 16:07:53 -0600 Message-ID: <20230130220754.8379-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT102:EE_|DM4PR12MB6133:EE_ X-MS-Office365-Filtering-Correlation-Id: 406f0b7f-c0d1-41dc-7c5e-08db030e7ad2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hLDCKK0AaeHaf6Q7hAKw4pENjvqbJ6zSMwrYCETAcyJpbs1fxU7/oQcvVsD5iSAMJJXROmuvYmu9Wa8g6+Bs7dKcjTX5nf7JdngYcnO+0DdeZCfbc8F0DaB4vuyG9sl6vo2PAtoZeMSeJuqWDZbhucqi99WNinpGfV5Bv/VIIvIjrmISHg9TNuHTrhYerkHrKtyJN4IDmGNK594iJntZ9jbWZ8CGSthyhrq8+VqDa+5k5Pnj0ZsobTGcakMnJquQWdYTL70BDIjMTUQtunyLodirfKtMitQkUBxlPTloKcWgTUu6EKgRfb3NXikKTWhzW6p7/K6cFvfOJeESlJ0pE4TkncxbvxyvMGJASaZ8MdXzEh/3r7WTIytfwjDTfkM13NJaFurS7I2aE5eaycczbY5JYsUBoiFJ8pRrvCeqJ/Y9kdOOKPppaRPotDjlq0JSDnZYTtHXxC0EQvHa993a4lGfuW27mteOcaPYVNLtjlXFcZxGJXNDMHnB/d486G6OE041IWidRgNnImueTgAIAcyQp6zRSdKqWfOcX2XEKkaJAGmLgN35veBfwtg0eqg6TKWHGugg0t3UtHx1/51+WhDsvDW+koiZECqGrqZhjG81BdTtX5g5TW/hfnlLfUiHjz9SHuMPgCCWwLVIZnfdfGYcVvn2zJfBjWKAMJycmo+6W99F7BurL3fnOXVy6VfUfMoCo/1pt9gP3ue23V9+UegDn60795YqzFWIwy+riDw= 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:(13230025)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199018)(36840700001)(40470700004)(46966006)(82310400005)(2906002)(5660300002)(86362001)(44832011)(4744005)(47076005)(336012)(426003)(83380400001)(81166007)(8936002)(40460700003)(41300700001)(356005)(36756003)(478600001)(26005)(1076003)(7696005)(6666004)(186003)(82740400003)(2616005)(36860700001)(110136005)(54906003)(4326008)(70206006)(8676002)(40480700001)(70586007)(316002)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:12.7316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 406f0b7f-c0d1-41dc-7c5e-08db030e7ad2 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: DM6NAM11FT102.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6133 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" No issues have been reported yet for DMIC audio level on ps platforms, but as problems were found both on YC (Rembrandt) and Renoir based designs it's very likely they happen on ps too. Increase the PDM gain to solve this problem. Signed-off-by: Mario Limonciello --- sound/soc/amd/ps/acp63.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 5e7f9c1c1b0e8..bae8288d8231c 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -30,7 +30,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 2 #define ACP_PDM_CLK_FREQ_MASK 7 -#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_WOV_MISC_CTRL_MASK 0x18 #define ACP_PDM_ENABLE 1 #define ACP_PDM_DISABLE 0 #define ACP_PDM_DMA_EN_STATUS 2 From patchwork Mon Jan 30 22:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13121964 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 B854FC636CD for ; Mon, 30 Jan 2023 22:11:03 +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 6CAAAE99; Mon, 30 Jan 2023 23:10:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6CAAAE99 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675116661; bh=z9j9g7oW4oINzhxB1BWH+dA+LCPApOUhmfrdJFbEY1c=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fmlX4qW5tKnKPNdJLTUMQFAsZD64jyH+zh9tluRWHXsEUnLxrojK+S+XD0YSdfQ2q nACst6W/6LEnJgQ1CINK60aAp3gK4QGouIbcLUT3s3G2gW5420vffD9tMI82ZBnmzq K6wenVl0jgs9T/NUtYc82RVZo6OomOljizLpcsMk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 855E6F8057C; Mon, 30 Jan 2023 23:08:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 66E1DF8057D; Mon, 30 Jan 2023 23:08:31 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2069.outbound.protection.outlook.com [40.107.96.69]) (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 8B598F8047D for ; Mon, 30 Jan 2023 23:08:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B598F8047D 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=PUYtMWQI ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ab9Qtc0l3Hwx/Cc63OQr7KOPQGKogu4bldGwCssb2WgxGKIb7JhGjyuacUhIMdTbulAy67o4scTkhu/Mhx97KdVfbAWM2izu8KZ/i5A5+c5gdW+Uac4XuB0fYwRjZ/KY96h8XCAaOwFOkF+yV3BLAThNGcBYjhPScIpJm7WP8faXd3UHt2iuZ0Gqx6nwXmsbZpeEF4aFA1eNoa0ytCaN8i83xahULmyx+dp40P17rViCW7xu7pJEi7GBOdeJiNq6O8KfkH3fS4tK3icNTh9wUu46BIF1lFBFkyc0Qi3Y58cpBHABk7qVHHa0unyb8JD+dDWu+Ak+uClMQQXzAQRbZQ== 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=EgM1juvU/GVR4OO6ohMnSYuaIZ1Y7TOmayaeQ6fpr/c=; b=VPQQo2rsv88NxdLuAO+2vhM6kPhOjOqnEfoNd/qkHuQxCm4ZSBTGFUeHOHWkfc7nn7FV7fK/x+Gp48Uu58HJWKacYEgaQ0MM0eZ0bAe/wAKXLhmEJv2LBJA9ggztbjgLdA1WH1zgwWmQVAbkFPtB43hd5zf0LxVvKbnEtYliCOA4yHkGbKeHETPLKt6bbk3YgCtcEa4JcpM69JtLhCiVQW9r0aL7th/AQC9b57rlQr0VYBR5/0Wp5nxn9vvZgdrLqWPuaX4kO5wLLeKjfVsWoWx+l0bRQyNmT4lc9doQgfKoRgf2tDJjz6dUzenP8K7Po36VACVu6eTDufPbtLYdvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com 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=EgM1juvU/GVR4OO6ohMnSYuaIZ1Y7TOmayaeQ6fpr/c=; b=PUYtMWQIQuhYQCeX5X6cCpaBYhoODmY1kOFDW9FXqIfWd/gBPvwehtw3eEAzA5nGqn+lEMSTr+BiaWFpVd7REGrINWuHa9O+ekUWS314RNfeMJCfAu52jF3OFx9WmEe9LNTJMnveTaz2ln75JFVeWlHV1xJx5z5eYEYkgRKhOII= Received: from DS7PR05CA0072.namprd05.prod.outlook.com (2603:10b6:8:57::7) by SA1PR12MB7248.namprd12.prod.outlook.com (2603:10b6:806:2be::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 22:08:14 +0000 Received: from DM6NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::10) by DS7PR05CA0072.outlook.office365.com (2603:10b6:8:57::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.20 via Frontend Transport; Mon, 30 Jan 2023 22:08:14 +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 DM6NAM11FT115.mail.protection.outlook.com (10.13.173.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.25 via Frontend Transport; Mon, 30 Jan 2023 22:08:14 +0000 Received: from AUS-LX-MLIMONCI.amd.com (10.180.168.240) 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; Mon, 30 Jan 2023 16:08:12 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v2 6/6] ASoC: amd: ps: Add a module parameter to influence pdm_gain Date: Mon, 30 Jan 2023 16:07:54 -0600 Message-ID: <20230130220754.8379-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130220754.8379-1-mario.limonciello@amd.com> References: <20230130220754.8379-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT115:EE_|SA1PR12MB7248:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c480c5a-d22e-4f52-543f-08db030e7bc6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LHxDDJW/z+dkMFzWx2KWIPGszYg7Gq+aOzctlYOgzpcLlXEdCp25SAoFEQhX2XXi15Cu8thjThorcNeG21LUF1IHV56sNZsjQ80Jj2B3cl+kyVuIo+Jbrpes8gjBImq1trqWYWI0wbxlRgnlOFQ0bnkWmzFuCNv3CauqnTNqllXSEo9Az6ww0viSdao36TpgY4lfFHo3tpxJ9rkWdSFlzDtP/RxB/5cag7AuUh80/S3BCIdo5a79sPft/UEHv+CQ+bparSlzBwTTb0M4fnWK+N2sshlSNy9xVsfYRZP5mfviawcsXZ5kVD4nu2abNcY9r2eYdi6TmHygdPuUR79UEcslqSaSBJXMGKBjW0FgGbfbstq5H5iBrqVE6BFZz6hNeWw8Z5MVL5PFAcAGVvAuinfE/llotREo013M8wbIukQLo8+og7aYpPF3inJKTi9/YzOwQdKD4ok8RPNBp8KfH0xzbMXMhMkO2m78sogyBWmnmNBhqwxmoxr3ohw83i53RlaAewbRb8ITJhFvCg9Y5oNq1UH97k2NRIa3G/VNvWkio8q4uS8JcTdo1oSn1PVJqt0wnoZFXYW7YAbtA+ryz/CyGxYUyTyM0NO7gv8zIN9uCHnBgvcOEa390ol/1RFUrQehTxdkI1x+3DaQ1TctdMrL7f6YLLws0Twh0dEgmjIY+5fpAdP9X3xS9t/6/yFUi7kKixd7b2r0WXElEyYzGuH2prn2ZMov3q2rJS/VAPU= 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:(13230025)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199018)(36840700001)(40470700004)(46966006)(36756003)(110136005)(54906003)(8676002)(4326008)(70586007)(8936002)(316002)(5660300002)(36860700001)(70206006)(81166007)(86362001)(356005)(82740400003)(16526019)(26005)(1076003)(6666004)(186003)(336012)(44832011)(82310400005)(2906002)(40460700003)(40480700001)(7696005)(478600001)(426003)(47076005)(41300700001)(83380400001)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 22:08:14.3296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c480c5a-d22e-4f52-543f-08db030e7bc6 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: DM6NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7248 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Pananchikkal Renjith , Takashi Iwai , Liam Girdwood , Mark Brown , Mario Limonciello , Mark Pearson Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello --- v1->v2: * Add a guard for values > 3 to overflow the FIELD_PREP * Clear ACP_WOV_GAIN_CONTROL before setting it --- sound/soc/amd/ps/acp63.h | 2 +- sound/soc/amd/ps/ps-pdm-dma.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index bae8288d8231c..bed4d51e226a5 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -30,7 +30,7 @@ #define ACP_ERROR_STAT 29 #define PDM_DECIMATION_FACTOR 2 #define ACP_PDM_CLK_FREQ_MASK 7 -#define ACP_WOV_MISC_CTRL_MASK 0x18 +#define ACP_WOV_GAIN_CONTROL GENMASK(4, 3) #define ACP_PDM_ENABLE 1 #define ACP_PDM_DISABLE 0 #define ACP_PDM_DMA_EN_STATUS 2 diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index eea71a9d2ef1a..c85cd471e739e 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,10 @@ #define DRV_NAME "acp_ps_pdm_dma" +static int pdm_gain = 3; +module_param(pdm_gain, int, 0644); +MODULE_PARM_DESC(pdm_gain, "Gain control (0-3)"); + static const struct snd_pcm_hardware acp63_pdm_hardware_capture = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -55,7 +60,10 @@ static void acp63_enable_pdm_clock(void __iomem *acp_base) acp63_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); pdm_ctrl = acp63_readl(acp_base + ACP_WOV_MISC_CTRL); - pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + pdm_ctrl &= FIELD_PREP(ACP_WOV_GAIN_CONTROL, 0); + if (pdm_gain > 3) + pdm_gain = 3; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, pdm_gain); acp63_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); }