From patchwork Tue Jan 31 18:46:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 648930 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 4C3EDC636CC for ; Tue, 31 Jan 2023 18:48:47 +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 3D2EB1F3; Tue, 31 Jan 2023 19:47:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3D2EB1F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675190925; 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=jNGJZrOj8+Bd5kYJdYt/28+LKKZI61yJOmtz3GS35+Yiq9oLE9FiuY8FYazjsevyR Ev3cfjjHtd7gYKBRATctEwYdWDw62Wqo/DB0SJ5vFzZUQOMoW5UxcLa1vIAp7EBg39 5FKr2H13YB443eErqLr8TyAk9RE2esUCBF/07yXE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 27D23F80524; Tue, 31 Jan 2023 19:47:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB70BF80543; Tue, 31 Jan 2023 19:47:28 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8c::61d]) (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 7648EF800A7 for ; Tue, 31 Jan 2023 19:47:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7648EF800A7 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=iNQ2kNqz ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKkmcKW2AQa4JIRSSeS8RFYvaQJltPdP4aY/a0ez1NIlP5Cfv7sD3tDjvG7qm8aCAs/xx7xkaiYzAlJI+QLXY6+RrFpPwdmlxfqYoJkeIr/Vlyock9mvhWQoQiAaNMNTsUS+CLjgurdUfdgMYMrXO2s9ry5GF3O6LZNX26sbQH1AQYRRC4EqLAOS8bPSQMpMvLWR84Ua96ilCOi3Vz8dkgQh8RWcSkneu7JEZLZOLwfAceXt2zoS7x7CTamXT7PrTtAVIizx0h4xi9mECkeiRsiYzEzcJNH00f2hlqKU24rEbRzoxsEXDCx2BcQQ6bGCZS8b+m742pOFAzQT9jhKNw== 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=TkMdGWg0SpRECfgz3I5VDkqK56jjrtLJPIiEGhTK2IY8ZYfRSoqz/No6U3CCT1CqL+ez8pLz4TVQeCKKON8UQ8cO/LfyIvknTfwjCqoKXuzrWdR+II53pjtj73FtsI0GG21l+OOFQG3alEEYsC2co8VMNIB0FKDTa1GJI8vNk0Pr/oFwga8z9psDR3QE133cwOvBqZRmZp429Yda+wxsXYA4MqmDcnx3QImz0bRZFnYDz0HfOcRpy7h73PY6LBDHHPnH1a3dwShnQpoHu6i1Uk8El/Fy4gCa1YAS3XHK7BaTstTUOWC+CPjzt1ShqpkiO75wX0JXxmvufzLSXlx+Ag== 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=iNQ2kNqzbplCLg2Vdy+b2OC3FJB6KTDHenTKKp4zNPRwws3A7Uvpm8wdINKGKGhtBjSvIuLO6LWrgU5XWecCLGGkXRzSC6TRtynqz1jFw2SHQIu90ckVWrOjg8x8Js7TwDkl18UY8XtjMdC1ugWH0mtO6zAsQ3pxXFF1G4k5sQo= Received: from BN9P222CA0019.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::24) by DM4PR12MB5200.namprd12.prod.outlook.com (2603:10b6:5:397::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 18:47:07 +0000 Received: from BL02EPF0000C403.namprd05.prod.outlook.com (2603:10b6:408:10c:cafe::1c) by BN9P222CA0019.outlook.office365.com (2603:10b6:408:10c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Tue, 31 Jan 2023 18:47: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 BL02EPF0000C403.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47: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; Tue, 31 Jan 2023 12:47:06 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 1/6] ASoC: amd: yc: Adjust the gain for PDM DMIC Date: Tue, 31 Jan 2023 12:46:47 -0600 Message-ID: <20230131184653.10216-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C403:EE_|DM4PR12MB5200:EE_ X-MS-Office365-Filtering-Correlation-Id: e3f10f85-6860-46c3-417c-08db03bb8de9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: syT24L7mFKtpSpxssJMomJ5Qc/oD2s1WOLedcb5aifty6pFR7XGea1A2L+NKxKp7HCSd5p+kThifAeaOmJj/CmTRVh6n6lJuQHdLP7YSxim8nw98IQmfBoQmELBNCUIDTuZvDc4OABEzxFGQ59WGzAtvcaOZ0GVbdqex83BmnAmvgFwMU7Ig9pi68Q7aRE+dXpykMgPD4fTrx3nWtaNA6Ck8QawWbqbCc+pI1d5lzjOMwkdQ+SpsFIvLCVi45L9H7zurQ8m+FTYKFulShlOvnzHkn0TCLlwUvQM81kovgSwsatP+C3EEasYWe6W4ZICgbbsk/Am34IWJ9LTvVyZlycFu3kC/cqWnfL99wcyYBCoteK8vZTmyV6Silm20dYNtyUO2lyWoE/ZZNe1UqCoDWIcnGS4GEXeKCsotJ9V8MibINQ/ZVbMHhdaRzXrSiOlHg1eHfnVQAcs8CXdg56ABtR9/UAqQ0FvFr7oAB6Zzu6Zb9hX6K3HLnWI3k/2esRKL/mhqkMMNZN9VzwhDlyCz6vh1dlGpBr+g66kXeh74IGBb43S4WxHHGOS5g2DlKiQ4681/9PxNIYSNdfh3MD1KGUWLU97LnTbBZ1ZbomMRAEmITMmFA6h4zu9lR588056JEURgofQpUT4IadJ2RjkP6PzjQfPGCQ8o0Gb4oQSfS4AS7A/D9D77uN7yIiLU7fYcxezhL5aOe5JMez0UWShHEKfuVMGrGX216Mn9PNnU0es= 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)(346002)(136003)(39860400002)(396003)(451199018)(40470700004)(36840700001)(46966006)(8936002)(16526019)(336012)(2616005)(2906002)(186003)(1076003)(6666004)(26005)(40460700003)(41300700001)(4326008)(36756003)(70206006)(8676002)(5660300002)(4744005)(40480700001)(70586007)(86362001)(82310400005)(316002)(426003)(36860700001)(47076005)(7696005)(54906003)(478600001)(110136005)(44832011)(356005)(81166007)(82740400003)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:07.7230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3f10f85-6860-46c3-417c-08db03bb8de9 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: BL02EPF0000C403.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5200 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 Tue Jan 31 18:46:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 649215 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 941DFC636D7 for ; Tue, 31 Jan 2023 18:49:35 +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 777CC832; Tue, 31 Jan 2023 19:48:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 777CC832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675190973; bh=mA2rCNKwTlgNynfZ4NLkltn3N5TtcZzuVGMHZEFkmAo=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=VtIoK/vKEpkIq7wkbS0hAfBLJPq7pUZlUvUVTJAMMxRDTvv72qhsT7PIzWUkheUfF zor5pY4Vk0wT15M7F5osxjkeylmA2pKJpP4e+T+40TzthGZjqmG3fcVRpfaL97Ev1/ 6KDmvx3lWihCx6kbcWZK+WEFyzHCGRQ3p8RF1fUg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 820A5F8055B; Tue, 31 Jan 2023 19:47:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A657FF80564; Tue, 31 Jan 2023 19:47:36 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) (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 5308BF80245 for ; Tue, 31 Jan 2023 19:47:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5308BF80245 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=EbOWBKLo ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cn6eLJJZK6tg/6QEV4GZZ9xV94UyeHYNbvLQdgafir2xsTCyTtyoaCaV9WHIVocwy6YkA3UVZs+Hzh8KnnQGgiE9NvuZn5olVAL/nirZZpara1VOMGVi9NeaRYUrmmtJRxyP0VeLFZG4IiOhphHpeMGOPCcJAaOX2+T6lRAGN2IRZt6VP8CHATnSsvhjp0d4Fn89kw9r0VikZeA4pT6JsNjBbN7e4CIDcspgiUgUKNmxlzLle5aGgge2iUdD+E0zFpBf82ViTPnkut5Dbb4TOTSRp/z1ViJWA0ic6v4Uz3xjZj3ZOZ4VduvSzomOBJT62cLK3CbaRWaNuhlsmswh8w== 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=rAd1NZLR+FUKZnFAoMjgWppZMiDNdLbEXqRN7gKfx0c=; b=GwOHjGc6Ffi5Pk0j1WGRTOAUlLqiNz361YwzC54T2D0Z1fqK9ObV7nXl+0hvgXDKty8phANTPGz/aNIrsijxliyGWZt+oav7fjT66jvxluJvazscqW2JieeztyM7oThC2+y6CK7m1reuspEV9jD9Ctro9MyshC2jY/H+zApuJ4BhUYBHQTml87UU2px72Mm60GJ6CJlWgY9FaeruBNTrivNuSGV0tP1DHxXxtz7HwxZrmSSvGrYjeUQv27aC4OBLz86IjC8170F2y+OpAK+DJyPnRVNVHvRmqYPAoSI+C997LWSmJo8lY/TFjG1gRSSjcRF3Vkn0XEVXX0bBWJR4GA== 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=rAd1NZLR+FUKZnFAoMjgWppZMiDNdLbEXqRN7gKfx0c=; b=EbOWBKLogCL+C9uVdUHD3NTJ7FRnXgcwq6UEM8bjUffzkuO87/FrhOhsvu1P62sPwcemqQtmVOgyfg8OPu6hhu8rNS1SfZ6cxikbXjBz5w+eor+1oVQFCWm0xj+aTvK9CR3ai8UYQwQSCgrsVjXeKQ4j2EYT3bKu8p+LUcuqCfo= Received: from BL1PR13CA0098.namprd13.prod.outlook.com (2603:10b6:208:2b9::13) by PH7PR12MB8426.namprd12.prod.outlook.com (2603:10b6:510:241::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Tue, 31 Jan 2023 18:47:09 +0000 Received: from BL02EPF0000C407.namprd05.prod.outlook.com (2603:10b6:208:2b9:cafe::2c) by BL1PR13CA0098.outlook.office365.com (2603:10b6:208:2b9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22 via Frontend Transport; Tue, 31 Jan 2023 18:47: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 BL02EPF0000C407.mail.protection.outlook.com (10.167.241.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47:08 +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; Tue, 31 Jan 2023 12:47:07 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 2/6] ASoC: amd: yc: Add a module parameter to influence pdm_gain Date: Tue, 31 Jan 2023 12:46:48 -0600 Message-ID: <20230131184653.10216-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C407:EE_|PH7PR12MB8426:EE_ X-MS-Office365-Filtering-Correlation-Id: ad827265-73d4-46f7-8697-08db03bb8ea9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hzH3CE1wWwrwehoRI0YpSoxsjm6et1uHBTQId6EFvX6MuL10lj2PylRmxHhf9nzPwezIAUAb8KV09ARDku5UQAIVaH69896cW1T8wxrurs6OXBnhJ1xbCzFHyDS7jTCFf+5412+lKdxuAdKa15WFiHenmAAPSKup7GncHumUrhzaaCg2GDpjOzuOLY/niROVqJwy1peVyJxWT7lKA5KfE/DpuIaSPHsXbcJxml+bLcHXF7965CRSEPeaGhuPN5GVHcoxzXotH17VWYg5ddobnmT2e4Z+uBbyokabuIdIAbvG5Gh4IpGh76tVoiYmyADfmD1qgywmf/jqnpEQPWz7C3cm1Pj9hpXYZRXd0pYTgX94oaWSfdS5hOtT3ZLmL1vCJkqeBF5rgsZIO2z+08Yr7R5jp7ShTSiiLNr+DDUUpj30b0604X3Q7F93lTF5UdJYszSLjRpvpelW14h+aJf2vqtCLD34eAqhYfsuA/ftzWxK8mVPBPMhzmcq4XrH4FbfwU/bv14mU8rEPY+DHWeIeiuafjq7dLZykNWLa68lzyTSPnxJvc3qMzv31lShtBSyPTidKPvEvDoFzT/D5zOZCoLRWALcdYroACYfH67prXA6s06DqP1iL8pTLZ7TchzIw33SbtxsBs04jw1ie8yIH673CNR2o8l6bGadrgddNKWjQP93c/rTVTKO2Xk4R6istutti2g6Yj5M3+4B1yYzYKnrhh+zWWW7Il3omluLdxE= 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)(376002)(396003)(451199018)(36840700001)(46966006)(40470700004)(81166007)(86362001)(36756003)(82310400005)(356005)(6666004)(336012)(83380400001)(426003)(1076003)(82740400003)(36860700001)(47076005)(2616005)(26005)(16526019)(186003)(316002)(7696005)(110136005)(8676002)(54906003)(478600001)(40480700001)(2906002)(5660300002)(70586007)(4326008)(70206006)(44832011)(40460700003)(41300700001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:08.9830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad827265-73d4-46f7-8697-08db03bb8ea9 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: BL02EPF0000C407.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8426 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 --- v2->v3: * Use clamp() and clear bits appropriately 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 | 8 +++++++- sound/soc/amd/yc/acp6x.h | 2 +- 2 files changed, 8 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..294dd7fb43c9b 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,8 @@ 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 &= ~ACP_WOV_GAIN_CONTROL; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, clamp(pdm_gain, 0, 3)); 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 Tue Jan 31 18:46: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: 649216 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 BE5C2C636CC for ; Tue, 31 Jan 2023 18:49: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 E83B574C; Tue, 31 Jan 2023 19:48:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E83B574C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675190949; 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=SeSoSvKkZhJuI5kNWlIYwFwJjbEGcBAoxH2z0BLC0uO6i5xwjXFDVUKPe6ZBI2YUU tMuda0iLRq11RoOLji11ZxkkjoRbzIgEju/ozR9qdq3zsKsHu70uJLedmULP53pKdY d5QRScv8rx4yppFQWoS91vwUFJHu+V2HwKcnZKS0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B79C1F80544; Tue, 31 Jan 2023 19:47:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B843F80548; Tue, 31 Jan 2023 19:47:31 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::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 74EA1F804C2 for ; Tue, 31 Jan 2023 19:47:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 74EA1F804C2 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=UUcBpi9y ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nofyHf5USCnkGALJOuSvgFUb5FzaqeDRqW8RCDJKYGRjysXUYxSZNLb809Xt8HJ2+DWNuYuwAMCgLFy3xnd7oq+wQoAqkdxp6N4oL+eF07na+wYi/XqYhChMTyLu1SDyzuJ093ENYN94Xx5jG1D71BLpc+uzGYy1eo0fFHeV313JP9QkpCVOTClrGW9Me43d3s2EbuPIRw/jyCsQap/sNylHGPpCgPTJzmYoOqX7f4t/9y7vPH24nwZ9yzJ/RaNuY1f6HfW6Rd/k8ohGYfH1DPg9/SQBzC1rfpQgolBlZNslMMKhHabMdX0kbPXvYc8jtKIX8hY7eFa85N/vX58miw== 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=KSizRSBe5+c6ucIGMyIgcyUZbM9kGh5QUDRjbwujWfghKjGsLjs6u5C+uHzrBXL6Xm3rU78ZgKwVBeQG0RdNmzc+PfcJLQ/ZXMxW0gY5/2LQNy8rcrLJP5f5C+fYUtNONK2xkpN8XRq1TO0xAw+g5FzJdYYAcuXxOerwUs1Tk/AcARX9j2x1PxQY9a/Lkz1tlwv7tSVUOAa8BeFOCPuwhB1ko1jqfuvHPcJWzY7962OIneKXVNRNxhN0KqxaMVwkE5Q7RoqbgHjR0mbc/MeT/QdMSIJ1aPok2v4hNo8E2fNNsmvQbRP0gg6KPm/kgcE+wy27eW7SO9KRioNLGcMGxw== 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=UUcBpi9yFDF/R8YIgYDR7Rl5Iv+x3XyTJAdZN2F2we4Qs+iqfz9reoGO9eIsVXVsMhuOjV9/fxyVerX1tjf44/tG9Mgr19rjv1SY42oUDDlog4qwHs4LfULcYUEGRDJ4wciQyd4B7vNy9br4kHWvskvCyWTzL4lbKLoMNIN8deM= Received: from BL0PR05CA0011.namprd05.prod.outlook.com (2603:10b6:208:91::21) by MN2PR12MB4126.namprd12.prod.outlook.com (2603:10b6:208:199::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 18:47:10 +0000 Received: from BL02EPF0000C405.namprd05.prod.outlook.com (2603:10b6:208:91:cafe::7d) by BL0PR05CA0011.outlook.office365.com (2603:10b6:208:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.21 via Frontend Transport; Tue, 31 Jan 2023 18:47: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 BL02EPF0000C405.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47: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; Tue, 31 Jan 2023 12:47:08 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 3/6] ASoC: amd: renoir: Adjust the gain for PDM DMIC Date: Tue, 31 Jan 2023 12:46:49 -0600 Message-ID: <20230131184653.10216-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C405:EE_|MN2PR12MB4126:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d9adc26-c6f8-4066-f61d-08db03bb8f48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cYoIZVCYmkcBCE6qpf+E/Jqe8jB8Dvpmo1zxeVlXIwygl/mn9obPLzTEJpfx9G1GocysZI0Y9qf+H9Oo6YSM2rzq8Jairc4ZGflJgGbQl3mksLqFJxvQ+Vk7/Shb6EicupKS9y/uZ92B5bi8oZaSYIWIHno4/kN0nITTAVwnDpURpXQ03TKCUfoRQcgzh3NVTnbfOVqIv5SOgSZ+zd4nLSI10PKbeOJ3H4oMk5ToU0UQlJy2UAmqwqCZqNnhQOiJ9i34aNhvRMsD25CmS+KJScf9yYGPunzgX6n9hFdYFp6fU+EN66686OvqcA4wQXMppJj0rgG4bWHnYlWveeLN/5cIldm9i68GdVn5rruUS9D3MgtID0Ot6aBuofHHInTVPf0zntIcxuK6uE5cIwwncdYInbsEZNusUkDoZXjKzm3cuRf8h/O3PLeYZz7Wh7iLRoQu6kEQdvrjj6ad4VvALeKvDuVC9zkJ9hFbbaH1g6y7vUxKeerDHlHICF1dtKEKmKd08Wd/Y1Fh/hlGcJOZ5BSC/zw5ids87POyGpQqsEdxqImZEujTtxr+WEFebpezKAmXPiUWRtPkXwuBFOuqy7ZjWpnce1jliDx8HWMvTxDuvQSL46RMa97y/gPP3LV3dgAw086/sXA9CWSv3NbtwMZZw3ddxZquHJ4ycu+w1jDj5vnMIRjYm6iYkTA16/wwc80XbhgNV7UTahwm+mkeKtA3I+L/bsCKb71rGsBOw7Y= 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)(396003)(346002)(376002)(136003)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(6666004)(1076003)(186003)(26005)(4326008)(478600001)(16526019)(8676002)(70586007)(70206006)(7696005)(336012)(2616005)(47076005)(41300700001)(426003)(83380400001)(2906002)(40460700003)(82740400003)(8936002)(86362001)(36860700001)(81166007)(82310400005)(36756003)(40480700001)(356005)(4744005)(44832011)(316002)(5660300002)(110136005)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:10.0278 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d9adc26-c6f8-4066-f61d-08db03bb8f48 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: BL02EPF0000C405.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4126 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 Tue Jan 31 18:46: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: 648928 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 2CCDBC38142 for ; Tue, 31 Jan 2023 18:49:52 +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 3477C203; Tue, 31 Jan 2023 19:49:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3477C203 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675190990; bh=b3A6c+YWGJD4zgb4zQ2jEzHSYjNhOFIlFKky766rxnU=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=gwkcckY4kw+Kr3CQjAkiSkKrl4agr6LKEA89zp/HHQLA3rZ3ZdVf24APy7CfGTb1f WqEpDPAT/ssVxKogzFT1MhgEr3NRnOz+WGD1iZDfIfKO4VvQm+YeQf0Tv1g/MsMDen wdbeRzO2rFtnbwqB3en4Pb8asvlW0oZK8vPIvefk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3576AF80567; Tue, 31 Jan 2023 19:47:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 885DDF80563; Tue, 31 Jan 2023 19:47:37 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::624]) (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 87896F804E0 for ; Tue, 31 Jan 2023 19:47:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87896F804E0 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=A23qewsF ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1VRbbOhme9OALuaBXp5oJN+unuA4admPUnB5lEFRwVm19RZQH4jvIEQaPb2uzx/D3XniNRdNOsR0OEUDj0OoD2fPjN5qMlScB1OiHlWuiSoaFB7sVrNPi8A/9oT19/FermzQ8uwqubtYKzMsO4mSfGj4/RnOeonNUtYL3EBkvDPb4hJKdzcS9OBVsMqh4xhhZciXbJHi+zAX6meN609thvckdIVyEQQknrTNa79JhtVZsdaYxksZIRJxNdEttKdERLnDqZO7RwfCO0CmDDbKU0tNUBXrDMLdZN8xNXpa3fjGg0a3PewAfIEfh5fjouYudPqM1mQoNwhVZzAkor26g== 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=cxiMDW/X7/0SvWq9rTK1uXLqBW0d2EkED+WcBSW6i1M=; b=ZW6neh8Fi28GPu8sYgoNqaKL7VmHFqKQApkNyH31l1ZjbEWZ8V7GnP5durH8/C5qQjiJyftgxzP66vDauqKSUW4Ptuk8W3aDQvouoPrqmHHa0cxxfn9ewDoLf81wdM0DjnonySJVzNS2XCoZQpjWUcyFe4Ui7gDhmoy5UlLlo99UEfzk9qQEIxD9nEPFNwBvtKABXxi9H6Nf0fmnU8ztbkFS19sbwZ1/XmmwHVcrSvWro0e2O8LAS8AA2QeCUk0AuADFj8nDYKZ2OM94LF6F+hLIrLoOh+c6QpI6OhMukx8BahWXAXmRmADBZZ/ua4wSDvew/9HQtdiHqlJW6PlUNg== 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=cxiMDW/X7/0SvWq9rTK1uXLqBW0d2EkED+WcBSW6i1M=; b=A23qewsF0Q+ClgVgpxW3OduEPeePRw+GiWc9G/KXHv2tcQVosCH50jMydEJ1DaJEHa0aq9p0C4Es9Fr4dg2EmyzBJA1Nxez8hCcLzy3JkRbrKmcMrp4RdQ3Ehv+6Op/+HxohHPvU3prIdNDMAbfzfWn2so5kVEWyFYkI43psI6E= Received: from BN1PR10CA0017.namprd10.prod.outlook.com (2603:10b6:408:e0::22) by DM4PR12MB7696.namprd12.prod.outlook.com (2603:10b6:8:100::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 18:47:11 +0000 Received: from BL02EPF0000C409.namprd05.prod.outlook.com (2603:10b6:408:e0:cafe::a3) by BN1PR10CA0017.outlook.office365.com (2603:10b6:408:e0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 18:47:11 +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 BL02EPF0000C409.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47:11 +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; Tue, 31 Jan 2023 12:47:10 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 4/6] ASoC: amd: renoir: Add a module parameter to influence pdm_gain Date: Tue, 31 Jan 2023 12:46:50 -0600 Message-ID: <20230131184653.10216-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C409:EE_|DM4PR12MB7696:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e700995-cc26-4eea-6b3c-08db03bb9005 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WmtsjelyhHGP/AMvpxWLnZSykDUM2eG9t+BFfR4cUb/0BGqvPDlC4dJyqp+f5G12UxAqIjsSGBbr7OqLrQuiiAlqHvUp4fNxuSzMEdytp+Of1gueUxq6RcE85qcZl/62qQ5zcBCYFPsIuvmhyyDJ+WKeoiSV39sIYc6liZICUmF+2NCbCXivjvNec5bH408D4Fw0QAKIuvSxbu7v8i0AO9Q317WhoEv1xnhMVRhSm8ppdd7f3KKA1mod2a2bJqs3z7yQ8v+rMaaMTVXJgDjKruM9fNY44xQjwTiEUuTNOtTH0P1P0248zjB4TNsGVERQaRnztHLsDqy6GQZAImJh89ZM5XwQWCbUHnW9mNp3N3+NOTmyF+D1G4CR63Mjiooc85lJ47Xv/jQV7e8WY2yObC/s/lmnyjZtmD8lCOn6MGbk89c+sDjZFW63vx17p/+jGLAFewUUBf4PWDCwyeaaeTzWvd7un30HiOL/+ugvDrri0Ip19ARQMDhS29lVoT/UhFadbt6yt9/jmMhMJvCLc4i4+ggq9lMXLYZMkUCHaWsQM/B5MJ9Ks3R+LewyeeQBl6SsBHwnGrT0qs+aJBvs1H55dpjoJaGwgUlN/PplWFQclDxAry8XJiOiFpyOVXnW7ILmNOVG+hZISbGpmcj3/eXQ6d/ZA5yFe0Tzs6ReQnE9EnxFYAYMsF2fWTeitJzhhce528z0OJOW2Onhp1vjjlzSd90kqtfVit1A99oEFxg= 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)(396003)(346002)(39860400002)(136003)(451199018)(36840700001)(46966006)(40470700004)(316002)(8936002)(82740400003)(6666004)(1076003)(86362001)(7696005)(478600001)(2616005)(336012)(82310400005)(26005)(81166007)(186003)(356005)(16526019)(44832011)(36860700001)(36756003)(40460700003)(426003)(5660300002)(110136005)(2906002)(54906003)(40480700001)(47076005)(4326008)(8676002)(70206006)(70586007)(41300700001)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:11.2630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e700995-cc26-4eea-6b3c-08db03bb9005 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: BL02EPF0000C409.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7696 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 --- v2->v3: * Use clamp() and clear bits appropriately 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 | 8 +++++++- sound/soc/amd/renoir/rn_acp3x.h | 2 +- 2 files changed, 8 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..0d8b693aecc9f 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,8 @@ 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 &= ~ACP_WOV_GAIN_CONTROL; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, clamp(pdm_gain, 0, 3)); 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 Tue Jan 31 18:46: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: 648929 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 D9AE9C636CC for ; Tue, 31 Jan 2023 18:49:19 +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 BBE7882C; Tue, 31 Jan 2023 19:48:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBE7882C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675190957; 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=PFJwz93C+iJ8QsDD3edoBZ5+xVJJY93Q4n2u8+hv0nE/PDCM7whqK+XqqFQVW83WS txObA2LtuQ/0+huATZHTvamBa9VF7hH0eKikIKJ28Zae4+XcQEnfxp3+O+2GT57gDL 4UinC7aVzTxR72EiUwNxjbAaoez+5+qsg3uuR/ZU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F0739F8055A; Tue, 31 Jan 2023 19:47:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 69520F80553; Tue, 31 Jan 2023 19:47:33 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20621.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::621]) (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 58549F804EB for ; Tue, 31 Jan 2023 19:47:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 58549F804EB 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=TZrFdgIi ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=li9DctEoKprLLvdtsOBXTQWIQj9FODte5ohCDtrlbzB1VQrlY1wlp8p+rjpISMeCAR7YOKvCS2T2wrPmEWm1YJ/XuJOdRE8vUwKrau5UfBKO9zRZFa6JzYOss4DT0RooNJ+pAKI6/xl2zn+OzYuNJ76cynnrBHHJrBCQ3WnimJgwWHgXxixfgXGIGF6szWdogmqqYc4q7ebTAU+AfeyjGF/H7rF09rahTsbjmEL5+EifjVspgCblB6OlnhJortJvHU/FeCysSVZN8fKXZkneYIM3sQG4LcuKMh+Ebn7FYgEnizZF4FOV/I/kHLD+4BzLj0Yn/3/gohm0HHypTfdEIQ== 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=IJot68EsR//7Ys4Q2ZebsEIOTeD+NW18mwkh6NYK6zQoOk6CCJjql+A1LXLaTQTEAsRniXTltZP1CxHcUSfeLpSJ8uxCD9/Jp6dqKX2YU96OHTslcySpia0EQ7C7PMfNW7uHVF59YfpzIpOWH9cS1bhdatOc/7gNzUC5lY2FZbjEDeBvorYOiHVGGuMEu/ugheNSUKnxTmiRYqfVFW3RaFCSHrrRPh0/zx/jw9EmDlLT1me0vh6Ny5q/wtQ36v74COHjigChdyfgTl6BVOjv1xViLF6LgfVXdjuNv+U/+YDkzhFNOo5VuxJ7RKJpvDf13QVerExffpXd621szjwDTQ== 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=TZrFdgIiBjcm7Li+wljLFxCBLhfRyPO2rq9eHVmslNXVY7ixLusDaO17EnNSrZT4SXxtUBa+AtcYYGd6DYCGjTCo59rI1e/vctlqiEgyi3uIkh+m+DQJ22yetcmqPcgSfFFnQbnOCPCy6vvy/iGpJwcaUM7FbG9cHWZlquC4caQ= Received: from BN1PR10CA0030.namprd10.prod.outlook.com (2603:10b6:408:e0::35) by DS7PR12MB5767.namprd12.prod.outlook.com (2603:10b6:8:76::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 18:47:12 +0000 Received: from BL02EPF0000C409.namprd05.prod.outlook.com (2603:10b6:408:e0:cafe::e2) by BN1PR10CA0030.outlook.office365.com (2603:10b6:408:e0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 18:47: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 BL02EPF0000C409.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47: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; Tue, 31 Jan 2023 12:47:11 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 5/6] ASoC: amd: ps: Adjust the gain for PDM DMIC Date: Tue, 31 Jan 2023 12:46:51 -0600 Message-ID: <20230131184653.10216-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C409:EE_|DS7PR12MB5767:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b00ed1f-e7e2-4e09-77c9-08db03bb90b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SQDAkiXbjouX4fXFf5aUr/6pcEfJBEn/jgu7MCqXLkdHBCnD+YzcJ+wfqYXFWvdXbl9614joQQIH1RSOVQ08tXQGbSR8mz+ZHOT6lDeVFohLxG6N4Q/QmAvzdaZdsZ/4eee7lLs3jcclZ5OyilO19D9c+xh69t6ToxYcTwjSwjHs5ENP8wEXGasQTdiTRtMxQ/ozxTe7V4vvx6kZuhteXNe/LjqL1muZ9WUapUZDs5tXQvKt99iUXwRuRaVFmCz+8bKR/AYAs/lHlVRBnP/gZEP5VV13Ttz1ATPTSVUG20PcEzhGsFX3ODxYSxXw1e4Gxd3Ln6WYcuNBvjJgfO+aluq6FegL0XsmDIyIuSDLHlrAVENK2HQZIf7KbSMPQ/QFs1zcj+DVbi9tDToYhw83uTEm/OeflaUalfjpt1currVnNAGQ3dTl971nqCZLuauYIMx3noOVCVGqrshwtzzw1M/RfGXt92m4BuGaXCsXMYtHcV5z1TVIyPbbnHepa+KNs2d6FN1Lu8uBdywgLcf6korHIbULg68NWKRlkuvBxfKsV3ZgEfaz6oKis+F32es0i355xd8McAT30feGFBaeAjZ029+CK2Ktv15vrXenTaOHOgC89iWKRFfCICI/QsXDZSgDv0zJewa13XgaHaZNi22g5dUs4Xd8R/RBEOzuHOw2NEPzYqSpxgCjEH9yKBhpV1yktAkjt5/JXAe6H1VeOpT37+DJiYR+Fm/X6LEGfhI= 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)(396003)(346002)(39860400002)(136003)(376002)(451199018)(36840700001)(46966006)(40470700004)(44832011)(83380400001)(82740400003)(47076005)(2616005)(336012)(426003)(356005)(82310400005)(2906002)(7696005)(36756003)(81166007)(36860700001)(40460700003)(1076003)(86362001)(478600001)(186003)(26005)(16526019)(6666004)(40480700001)(8676002)(8936002)(4744005)(70586007)(41300700001)(4326008)(70206006)(110136005)(54906003)(5660300002)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:12.4036 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b00ed1f-e7e2-4e09-77c9-08db03bb90b3 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: BL02EPF0000C409.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5767 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 Tue Jan 31 18:46: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: 649214 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 72CA6C38142 for ; Tue, 31 Jan 2023 18:50: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 9B60682E; Tue, 31 Jan 2023 19:49:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9B60682E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675191009; bh=8Vs4g0Z+x6vRLUMChZD29qhI5YtyQe6FwGx2revHYbA=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Re9gLSeyCcXM+Y4XCm1CbOKE+LmXqS87ZcPFd21ougqjfIbtL6sgAts0zWFF5ykkP Zuu0IWewqtKekYinTTfLhww7ffiT9hQl15ZNVL7qwcJrwvTlphJ+M+P8Dt9XiFHaty SmaFK/juMSTfj2PBHEtkQGmH67s1UVEaNcJ/VFmY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 636C5F8057C; Tue, 31 Jan 2023 19:47:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E114BF80567; Tue, 31 Jan 2023 19:47:38 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e83::62d]) (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 4EAC1F804E2 for ; Tue, 31 Jan 2023 19:47:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4EAC1F804E2 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=dhmRTstU ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0zzAyTCkP/Huu/wYZ1L0gVlm5cbaX4OuqYkODWwhCq82AgaYs+HB4D2uPwds9ZC+2/FO8rbQjlZzVV/VTiYfeGEV0NKD1Odv/dDQdIBMXW/v6+a77frRnQwG0IZyE1nQhwKPlL7Sy222f5Gy5lVLamgob4YWXHi4yqNLipuzIxjyUXSwdSgkN4yXV7omdU/7qADxCHpcjqDjkLumYffvgul+DfYW8doYSgqprOT/JrZ2tl6No5wo9qfmqJfG67n+QGT8qbwn2HV1yDavL/WiVUQwCM93mwGuAmFq4yL740yh+hqh3WtYm20Ygve5W7f1+4dIDNEJiyyUMXAg4RaBA== 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=pMb27UoT51F2jiZ+qfluHAb9UnvJXc5ynlPkyyqTRsw=; b=BsiCCAXRWl+4qPEMgwJUO6njUqJM/eKLcSV5eHFKhhOI4P8IEdUP3BTTXwC0QxAzpte526ntI1g34KeuycAstGI8siYx10ewQ7G5SmCxtI6ZVXb3EvPMGJvkxcxcJ9se7tpFQHdEc0BDWBdCQGjrIwWSK9EHkPyqB9mQ0W3bIk3dGD7kdiGnKHWlZ4tvuxT200XansYNcdfT5tXGvB7kC9GY7ZyFmILji78EqMXBZSBmLIB0UlHxbrcdn9sG5wUo6vZnW/rxmjmaX10mjYEC3t8aP2wwNeaa0AomH0q/6F7YN9oMIyF/N7jRKPXI9gNtBfTt2TA/Lu1nohDgjHASKQ== 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=pMb27UoT51F2jiZ+qfluHAb9UnvJXc5ynlPkyyqTRsw=; b=dhmRTstUI1xmGdyiBNegmT4OoYlvCwmv/p0lsIb/feEvLjJ7s4wyF7tDJJFpWOPJaUJHaeR72Y3MSOGNAThWAEpkO1s5J3GnUU1bVjOd/vu+qrWytFIYhboFTEeN0S4x4vSCky+qmrV8mTvOlRzVUrfi63JFySjC/DJK/st1NZ8= Received: from BL1PR13CA0389.namprd13.prod.outlook.com (2603:10b6:208:2c0::34) by SA1PR12MB8597.namprd12.prod.outlook.com (2603:10b6:806:251::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Tue, 31 Jan 2023 18:47:15 +0000 Received: from BL02EPF0000C404.namprd05.prod.outlook.com (2603:10b6:208:2c0:cafe::50) by BL1PR13CA0389.outlook.office365.com (2603:10b6:208:2c0::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.21 via Frontend Transport; Tue, 31 Jan 2023 18:47: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 BL02EPF0000C404.mail.protection.outlook.com (10.167.241.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Tue, 31 Jan 2023 18:47:13 +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; Tue, 31 Jan 2023 12:47:12 -0600 From: Mario Limonciello To: Jaroslav Kysela , Mukunda Vijendar , Saba Kareem Syed , Subject: [PATCH v3 6/6] ASoC: amd: ps: Add a module parameter to influence pdm_gain Date: Tue, 31 Jan 2023 12:46:52 -0600 Message-ID: <20230131184653.10216-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131184653.10216-1-mario.limonciello@amd.com> References: <20230131184653.10216-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C404:EE_|SA1PR12MB8597:EE_ X-MS-Office365-Filtering-Correlation-Id: 36063a56-cb39-433d-6227-08db03bb9167 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ASHpDunfo4jXRUMO5HB/Nh3AxEod4Ui36qbNYF/jTP/USUm12sxug8/oqwqOXKXXB3xHlCazGPGMJvX17gJJrkYsyGeY1NhphHC4qi/Ih/DDxCIiLfWQFp+3RK72aEpybTsG8A8vvB00CJv2aewRkoGLonDbfhnU3H7wYCJIZs7Ks+E2I+tGZ///scd3x53bAVgLJmUkSd5u9PPDmwj/XasJbXIsfcv2lupO+Vx01+escXWptFRq+JbCAhyxJsKdeLwjQTbFYZlPKSUG8FznJ1uuILnpthiZQaYHXsKx/UjM/VX5H3eyrJdQSe6JsgvzeTVtW3rmt/a7RK0ra7p+zxbnBMqSGXB4eTbzr86T8In0dss89nvkB1MFcsRKWgM0h4a/e8IxplgPXzRU5Qce5Nv9Jy2u/WfOcmKECzx7t2dqgRA2CEY+ezFcpHfg3/jHbf1K+DOaZz8+t9n5hDL5TsYqovYlDSmsaAKqFidqo0oOc78BSBylV7QdlLyurA5XnFOyVjEOtXCpANa1nUDA134KoOVJ6a52SiNsNFPz6mBvyJsssStu7fHFfTbLhR6rVSma60vhDdpZVjz+0LdXv4wt4QnmifbNKF1AUMQZAOYf5BliR4NB8DbwuhHflWe2zh1Yniq2nLUUgkezyD2t1kw1SHEA7o3zlEpOtM34miz9DngoJT5hmbZqVRx2LcVLTuntDEaEiQRqchJgLm3WNdNjXsPA+dJ50BdDRYdRrTE= 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)(376002)(396003)(451199018)(36840700001)(46966006)(40470700004)(81166007)(86362001)(36756003)(82310400005)(356005)(6666004)(336012)(83380400001)(426003)(1076003)(82740400003)(36860700001)(47076005)(2616005)(26005)(16526019)(186003)(316002)(7696005)(110136005)(8676002)(54906003)(478600001)(40480700001)(2906002)(5660300002)(70586007)(4326008)(70206006)(44832011)(40460700003)(41300700001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 18:47:13.5828 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36063a56-cb39-433d-6227-08db03bb9167 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: BL02EPF0000C404.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8597 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 --- v2->v3: * Use clamp() and clear bits appropriately 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 | 8 +++++++- 2 files changed, 8 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..91f1631f42c6b 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,8 @@ 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 &= ~ACP_WOV_GAIN_CONTROL; + pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, clamp(pdm_gain, 0, 3)); acp63_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); }