From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51A5B1DF26E; Mon, 8 Sep 2025 15:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.152.168 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347132; cv=fail; b=GGWpHtivhofszKA0fyrpBw/QHJJfTeAGSrVVmQi0ozmovABUr1zYLgitlsSrhL17l/9RsJDJzB1NLt6p2EdtLBc/52Et/RevRxiRRRYSobb0Rn7WkzmbfnPKbqyoyekuToqjKzDap/jw1FZU7ripa8DKPVyVZ/4VaQRWuwxx/nI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347132; c=relaxed/simple; bh=h4asHsCQOd2ufeDF7SvrnC4iax+TSSl8XbpivmHl4CY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=SdHN4nHVV2AdUkxAMsv0/e5y2p/UcctNw1wW161krHlbjgOV/4aCfYo2uZO17u0KdU/WhSTVRnBjoKyu65Oo2NR7kDvd/VyThmYIgnq1sc1iIO/QEe9R7jU1Vv/zO0sM2sqWIe49FaBsWp0JRGizyKdLrsJ/vbzdeK18xL/v920= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=CTIOEPlt; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=Kmwx2290; arc=fail smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="CTIOEPlt"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="Kmwx2290" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5888UNUu2151861; Mon, 8 Sep 2025 10:58:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=UPXyvMD/Dhb+w7dbOEt9OnP0AsfSESzw2yqkmnbfxyA=; b= CTIOEPltB9eP5zDomijeWodF8Mb2LFFhs6Yz6xtqNk3tp6ch0+ButCQunB+DlMcl rwNzxey3kxN/KLjMSd0r4Z6P5wTWh49DFUpAStZv2+U6tsQNv0HyjnLj2yxuX7WM ncGJRPwPC5AkVDiUD31NlEPygAwIL/MU9qvWs6lHTHBVvEwc7eEskp3VO7vJ4yZs wfsSJqAOHCgj9m1xKdtRL5i0mfBCs4bBhErhGxVcRvRmPWYry5YG5xqcprchg/ID oHT3eB72nXAWFIOb+F7cJPOIGJIRHjjKKtl/ZXB4zrxL1ATm1mbIOT+hkCxTNKUG OFVO0toNrugy1eddUAtBtA== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04on2091.outbound.protection.outlook.com [40.107.101.91]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 491upq8gr7-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:46 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NKTp1ei0ubQOhJZi93S3GlEdKXUMENJMSSAdVCQbkLAqXfq7fv9GAlBeDx6SHlIETcpfYFfpgYd3lvgAk4huiMTY25K6uUKwSBG4ZPyvLlNHErhbXBGmp1rXPZoSwhVOu8fECPGUbl5y/sQvLpQ6dXkSkv9MifYa02lOk8bDDaKGm0k0tKJjyNB9L423Zfl5xMYGIQ1a7IR1V3Mg57HG9adlMmWzE6RhS1rEp3JXuMcg1i9aZoEtUhl+jpAyae24HzGrIO/S1fKs1Kt4wXY1lE08SrLAClkkDTh2TeSWsFjzIgkL1dYRE8QEn76ucugIZYQizF9pMqrN70utyKCrPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UPXyvMD/Dhb+w7dbOEt9OnP0AsfSESzw2yqkmnbfxyA=; b=QBSSjxnijLlgExW07vWJJFC6PS4HRkDR7dYKDvaK46LQL2BSZNr29jiPWZVIJdzIDlb9UsfKUfiO3kwwB2lPNqI79N4rl3TI3uFBK7pE1kVfBSoL4FwCz681bFzuqDOttUGgSsIFMJYd9o0QhUGBij+HMP5hHdzrUJ+CvO4Jmg2K8rx6dFsfisWBNQ8Zoz1LiVCaDyLpew5XgQzlXGEPiTa/QWlqipbs3PGKzuf9s7Ckk7NMOFkWdvWn81i21oyFPoUB+xOjlAF82Sr3khx9/1VFvk4bhZIqLyqRYXUlyK2LqcFA14oYa2SYRA2rwjG5la+Alm7iT0AOTZEQMgUMvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UPXyvMD/Dhb+w7dbOEt9OnP0AsfSESzw2yqkmnbfxyA=; b=Kmwx2290lNhAsMcrdasiRnDFJo2d6eKE822bNbirCQsJv6ve3aUopiKPW7nOJoe63NljLNe9ocH7y53/+zD2N+EacgP3V8CVvS8H8qPaBTDyPjP9vebQdU70IfYwnPFW5OJBWTaNT5Rs8rlcDHVeYKzx+vMqaSd8kHv1vwLh8kQ= Received: from CH0PR03CA0025.namprd03.prod.outlook.com (2603:10b6:610:b0::30) by SJ0PR19MB4591.namprd19.prod.outlook.com (2603:10b6:a03:279::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Mon, 8 Sep 2025 15:58:44 +0000 Received: from DS3PEPF0000C37D.namprd04.prod.outlook.com (2603:10b6:610:b0:cafe::fc) by CH0PR03CA0025.outlook.office365.com (2603:10b6:610:b0::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Mon, 8 Sep 2025 15:58:44 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF0000C37D.mail.protection.outlook.com (10.167.23.7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:43 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 8B842406542; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 775B582025A; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 1/6] ASoC: cs-amp-lib: Rename defines for Cirrus Logic EFI Date: Mon, 8 Sep 2025 16:58:37 +0100 Message-Id: <20250908155842.599459-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37D:EE_|SJ0PR19MB4591:EE_ X-MS-Office365-Filtering-Correlation-Id: ebc04435-afa8-402e-4fca-08ddeef0967d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|61400799027|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CVFL6xyZ1b9kdzoy5A0NdqVev34fcd+qYjFsFlE9gR1s56piRvBYhHZ5F8PY?= =?us-ascii?Q?tN83CiMw2VEnEK1RJ71fWC1Td/6L6ex4y2ZNUm4hbrdirxdGYGudoDtHbzbN?= =?us-ascii?Q?n1dy9wYuhg6+6e8AETOEB+xtAAMkPBZwxP8F5hD+AES+scvOeqzWs+0qRuLc?= =?us-ascii?Q?HSdNYhtseboqbQD6/Rjft6gRhUkPUo5Z5oXpTWZiw43MmoXD6sp1+KG/U+Wy?= =?us-ascii?Q?/kE5CQaND9RTRaVWyRmhgGHR3i4jxl1QJnysSvEbWrI3hs2D90/bkocJ/xlG?= =?us-ascii?Q?YULrdCLMsGqcAhp4+y4eSiVrF+cQYFoemvLFozZU7BkfO1ylbDSGTF6uu5N4?= =?us-ascii?Q?qL7rkY+Yo0CuLUUKkwV/5PIljdcO5Im8G5q1NYOyD1VUhoyhVVIl8ueR8F2d?= =?us-ascii?Q?l6eMzxks+BCSn40SmzIFDU7zI3X5EwzIJ4vA6Cq+8SNrTFNG/AwSaf2pqZRt?= =?us-ascii?Q?DU9Bd2JT8ZWPFzEXhZsN4jDBCNwYib5eOTysCJJzYhVSwe4K5fKYZiRqPaPi?= =?us-ascii?Q?u2E2/W4mHRgsF+MCf1+B893oZjRW7At4ZP102BC5XUtepq7y9JhBNqMdOVFc?= =?us-ascii?Q?1/qC+MpA0ZhU1FwKHU0z24M1LKE1MvyRzSDAt9BMKDQXgeBck9LTnSZ+3Zq/?= =?us-ascii?Q?WdPW6c0K/InI5MxNjrrlSdo1L5ywO7fD2pL0JEi2Jcayj+RTj2VZFhRb6zfz?= =?us-ascii?Q?ojlIUcC+gebeGz2p/9UB6WpYLEd9mUbjeVzjYP0Cl8M3hgONFOp/lwqaWYM1?= =?us-ascii?Q?bNGEUw0ZOR6C6iHw1zY2z0N2tx5eo0VSu9d2rDrcvFdl5tLRAr8t9dg+ldfj?= =?us-ascii?Q?dryegQOFcXeUw9AvsKL5kx683URHpzmxTVRNJIcT4ZZlkQf3xsRdboYwOQVo?= =?us-ascii?Q?hRC/r/HKZoai3flcdADIx8aSb54ueLMA8RGiicc8ikzhOQWY0AaILwWvgvdh?= =?us-ascii?Q?YX8mvEIA0VuX1FXBtoX4Ssl5m9TUU9IJahLNzP4NmeQDaB/gcDZ5auuhEQbZ?= =?us-ascii?Q?NBPTJo69qDnYgPeHRomnGIc7NtJCXmw1vi34X23LcaBq2iA6+T7WIf8H5pLA?= =?us-ascii?Q?1Nyf2BBqMi3nwZcIM2eWdB1tP1FLggi6NsgMwTkmoSePAXuWYlgjSwY/MfsO?= =?us-ascii?Q?f1J512UNG8orkd+vveOF98IqXmxaPscG/tB1mxult1fAamlpH1LMeSYd1Smr?= =?us-ascii?Q?HaS4e1tnX3fskGmoC04LNDXEK8MfcRcFauNv1fqfxn7MH9b3/RWwOAnzRXF2?= =?us-ascii?Q?PWio9ERTi6KBukNepOYjUhlpVE7RPC34U2IGfOayDF+DTATWEL/GoXFCBiSb?= =?us-ascii?Q?sm87VAc4Jdg+7qHdie1Pg9WCy8f+yt89OQVJukmKW6X8q2zpvIG+/TJz0HLy?= =?us-ascii?Q?BFhVuK/8eDnD3xTd+ZwYarTTWfaaHqezDhyyDtguYN7eEebT52FGXIbPz+h8?= =?us-ascii?Q?LlgzshibKNBeUZBbitd7uIesd84ffiUwDt81P5MCvRluiGvWQmlwW6f4UiCS?= =?us-ascii?Q?wvZN6VZpwz5ZfmraJPFJeZNDp7ZbTpF3NbCU?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(61400799027)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:43.7810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebc04435-afa8-402e-4fca-08ddeef0967d X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DS3PEPF0000C37D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR19MB4591 X-Authority-Analysis: v=2.4 cv=DMuP4zNb c=1 sm=1 tr=0 ts=68befd36 cx=c_pps a=/fMEJewfnb57F3xAaXcmQg==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=uB3EzRcOJay2ftjxBbYA:9 X-Proofpoint-GUID: NNMSdh2j-cl3zVkSGEVjb0GCV4P1Cl_w X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfXzGOa+5Ya4r7F N1Q7h11GTm9cviZuImz82drkWIUELg4nSMIuYYxLufeQ1BoO4MXah3HGdY+Mx7GB6EQjPi83KAk YCzTFJqnQNVj6uEPf2LDzy3LPB4oP96danjE2cZMLq+ZP9n4tmajolwqKq8s4XsdFaZv8zmgGqt nLcJ+jZeFwQubpjF9UMXr29w3y6nP3gKYlF77Aoum/eq8mLrraMyArWXd6eSRcVDyLI9mqV9CP6 3wPIdUFnXNuEVWNDWSViJQdEbmw2/ZEED0MlW4WNZOyN3eWRwyz/QUVLB4+P/+5In34w3lB3+QP nMWCQtSFilq86Si2DRvQSzIJq98fBe7Di3mwHsx5aYwRRPgbfqyCN1n3Sjlvpc= X-Proofpoint-ORIG-GUID: NNMSdh2j-cl3zVkSGEVjb0GCV4P1Cl_w X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Rename: CS_AMP_CAL_NAME =3D> CIRRUS_LOGIC_CALIBRATION_EFI_NAME CS_AMP_CAL_GUID =3D> CIRRUS_LOGIC_CALIBRATION_EFI_GUID This is to clarify that these are specific to Cirrus Logic, especially the GUID. As defined by the UEFI specification the GUID is a vendor identifier, not an EFI variable identifier. There has been some misunderstanding of the purpose of these, which has led to the Cirrus Logic GUID value being copied and used for other vendor's EFI variables. It is rather strange to have data from another vendor marked with the vendor GUID for Cirrus Logic. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs-amp-lib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/cs-amp-lib.c b/sound/soc/codecs/cs-amp-lib.c index 808e67c90f7c..b1530e7c75e8 100644 --- a/sound/soc/codecs/cs-amp-lib.c +++ b/sound/soc/codecs/cs-amp-lib.c @@ -16,11 +16,10 @@ #include #include =20 -#define CS_AMP_CAL_GUID \ +#define CIRRUS_LOGIC_CALIBRATION_EFI_NAME L"CirrusSmartAmpCalibrationData" +#define CIRRUS_LOGIC_CALIBRATION_EFI_GUID \ EFI_GUID(0x02f9af02, 0x7734, 0x4233, 0xb4, 0x3d, 0x93, 0xfe, 0x5a, 0xa3, = 0x5d, 0xb3) =20 -#define CS_AMP_CAL_NAME L"CirrusSmartAmpCalibrationData" - static int cs_amp_write_cal_coeff(struct cs_dsp *dsp, const struct cirrus_amp_cal_controls *controls, const char *ctl_name, u32 val) @@ -124,7 +123,9 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_b= uffer(struct device *dev) int ret; =20 /* Get real size of UEFI variable */ - status =3D cs_amp_get_efi_variable(CS_AMP_CAL_NAME, &CS_AMP_CAL_GUID, &da= ta_size, NULL); + status =3D cs_amp_get_efi_variable(CIRRUS_LOGIC_CALIBRATION_EFI_NAME, + &CIRRUS_LOGIC_CALIBRATION_EFI_GUID, + &data_size, NULL); if (status !=3D EFI_BUFFER_TOO_SMALL) return ERR_PTR(-ENOENT); =20 @@ -138,7 +139,9 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_b= uffer(struct device *dev) if (!data) return ERR_PTR(-ENOMEM); =20 - status =3D cs_amp_get_efi_variable(CS_AMP_CAL_NAME, &CS_AMP_CAL_GUID, &da= ta_size, data); + status =3D cs_amp_get_efi_variable(CIRRUS_LOGIC_CALIBRATION_EFI_NAME, + &CIRRUS_LOGIC_CALIBRATION_EFI_GUID, + &data_size, data); if (status !=3D EFI_SUCCESS) { ret =3D -EINVAL; goto err; --=20 2.39.5 From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A12253054ED; Mon, 8 Sep 2025 15:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347133; cv=fail; b=nRGL/wH2QZVHMoXxv11BwoivoPyIIIxtKpNYtxcWDZbUtv16ctzoZz9G7CDftTW4DhGmCS/YmW0rDrhYD7KlxzyqT44rQoETrSU+OQnbky9NUvoBeJ9k2BmySb1H9VeENG+ymNtxA9NyOlb27iDrgz2msAV0Olj42CvxiTLg3TM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347133; c=relaxed/simple; bh=Fk/a1g+io6oCMJJhpgA9T5RQsVgVkoIlfN9T5kxfpP4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=eOgmsMEMmpm1exoHUtwdAz9sTCmwp9qcuo1JgW+nsMuEdQLzzLSxYtcYjITqp6I+KVc14dhYbkcapxTxoMu7Hz4tXXp4u9tg63WXmpL0WBJCyf7491ae5R0sLX6AByZadrxlOtsMBwnDvU6246vv4oJCC8gX5XBFOfVO2Sy1tuI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=FV/g+Oay; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=nXBCrP1T; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="FV/g+Oay"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="nXBCrP1T" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 588FuSli812009; Mon, 8 Sep 2025 10:58:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=APpcDRBfdcj4G2DWvBwtmFIgJYnpYz7AKZvkufUY1mI=; b= FV/g+Oayyxw06iFfZxoMJFCGAFyJwdNhEAzAwzqCsqU1cl8vNiobR0PJqhwZjobM Nqv00wQ4oEm68SsblSAo1Eyez7e3c2Wud6M+CoVlFafgosfkbnC709x+ZBecD+ld yNKsq75o9VVEz+/T69YGgXssXfgYUAlWepwt21VYjjCEYncFx0cV+gJ05n4m3mq0 /g/0mlYJwLmvPw6/XY0G7ZRFdnk0j6+vBD6i/qNnx66m5iARu6LSFfbnW+UkPSHH ivc+Kq/Ud5UM2M8YVrIwMeUhh991Z7YxW4qV6TgfdwMrZnPbldRS0RA8+1aYZ5uv 1e2sFQCyldEaQcbUdMheGw== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10on2123.outbound.protection.outlook.com [40.107.93.123]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 49227r803n-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:48 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aipZPSOVEENmCd4ZipLXYL3uisgVLrSw2tXHQReehrEXSHVoT95L67Y+3IRe3KwuI63JuZ0xG6dYYi+3d4G9McQFK99ZOeUBkwHX9eNHkfQHomREvWJVL+HCeUJ1Xy01CI33tR9FGhlBaI1+3dgc+y/984k3FkqKEO4Ixwu8vtibHG6klU3uEsuLLs0shLfDeXuDJ+5vMkZsKe3vZaz1u8r0woK70lyzAEWTxBF+DQfGIkUcQmyo16GPVyQQMrraSMYtk5n1nOTVUorpXxvTGiZ3K3WKw86cy4OsyzAH2PxcmTX1dIOvFhG7u46MeEsdOQsuLTrVKMjzYda9mb4Djw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=APpcDRBfdcj4G2DWvBwtmFIgJYnpYz7AKZvkufUY1mI=; b=hOU+1iwzQqSvbx8FF+sJSlYfYgoOLjdqJvdYQv5s8iVK08AVriVa6SNSfzSya/s8qo1hn5dvNzVgvMmvvlCHG9QsLWms7L2kwCpg4AUPs7daWkatMVJU2eUeK66dyT4gkbWUgtLff8puZF9cvnq6ealcV2trXW9T9K0kNRZJRsvRNyRNYP9UcZyvaT7JpFsUJoMMl/K6lTsLMIUsYeEJ7wwTiXq3Hk9qvu6rjuoQtQ8eiepUII9w3wwPpa+CRE00MrIlIwlNHZxa5DJQflYLytjmqSUk2mWWX7RFkr11FSgwR7eBRIeW4z9HqKe+egdySDbt7pDC0h2FaE1sIesjLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=APpcDRBfdcj4G2DWvBwtmFIgJYnpYz7AKZvkufUY1mI=; b=nXBCrP1T0ib+lMmNlGf3d9p9dUuef5mp6jheUE6pClvo69ZC2cOUw6Bd1Pswno8W9j7Q6I5pyzns/XXQ/gpMx8CS5616qHc9bQpziiuhfYjlg9Q0LDsc2mPwAoT4vNBeXKrI+mSMW1dR00pOPkn3aVt7tt85Jz3aRDlX15A6XX0= Received: from BY1P220CA0020.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::7) by PH7PR19MB7512.namprd19.prod.outlook.com (2603:10b6:510:26a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Mon, 8 Sep 2025 15:58:45 +0000 Received: from SJ1PEPF00001CE4.namprd03.prod.outlook.com (2603:10b6:a03:5c3:cafe::5) by BY1P220CA0020.outlook.office365.com (2603:10b6:a03:5c3::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Mon, 8 Sep 2025 15:58:54 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by SJ1PEPF00001CE4.mail.protection.outlook.com (10.167.242.20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:44 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 9396C406545; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 842EF820247; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 2/6] ASoC: cs-amp-lib: Add handling for Lenovo and HP UEFI speaker ID Date: Mon, 8 Sep 2025 16:58:38 +0100 Message-Id: <20250908155842.599459-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE4:EE_|PH7PR19MB7512:EE_ X-MS-Office365-Filtering-Correlation-Id: 0770d830-2258-4339-b991-08ddeef096c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|61400799027|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?lf7Y6nztSqw4iXXmbLNA2jpKo/OJstRgaQRtIbNNoxY3hPtqEHZrCvkw8MBH?= =?us-ascii?Q?WVry61YO5FTFG7uX8qxoD16ClVF9lrhHFjXRYXnfp2tQ5RUca0PbI16X7Oi0?= =?us-ascii?Q?UKKz/rXde0zJOZesD7Qa04NQScXaNHzPh6XrSz+i5xqSfRVn82WYCqI1veyx?= =?us-ascii?Q?vna1r9w4ovTdqMkiFLYFE5Cx5jQJNbkgIkbosegw9Y7pyJFwt7sHgG1JMnbW?= =?us-ascii?Q?nCXz29GyZjOA2N8Bx0GisASw4iaCGSKzJ9QksUmD1lfnzCRAmNvPpWJRmfHz?= =?us-ascii?Q?H37Gzdzn+3DBAI/UIJ3vSIDuTmMcllSxGeprOqvUeQ1dzXb1EPu51JA8TjXp?= =?us-ascii?Q?4I+PeuKB2wcXmHIhzRP+Bolqh8tXuQovjiznVTKtXS4JfONi8WQKcGWxkltK?= =?us-ascii?Q?55jjPdhO7dRMkeyGoLg7+LkDCIinOnWIXcGd40N7XwXhXZfCLTg9Ml91Lsoe?= =?us-ascii?Q?H40IgdSf3AlPGWS4myVXkgKaUxfjECmA1B0vSUemkkpeQEhfCGJaaTELOde4?= =?us-ascii?Q?5qtscFYxPGkytHkjsAIJ6fAWOSKYm+e01jZK2f8kpl4SBsT1neov0EUEm5g0?= =?us-ascii?Q?eOrxk7xWQar3EM3ui5ZFp3S+Tt2e38alJsRfOvrLEdY7wwBtpQcwx0pu6tIR?= =?us-ascii?Q?0KSz59o74oS5XKpxJcPV9NXBHm+OCJSTskNeU//t/DLSij2CQGDzHXtYtGsQ?= =?us-ascii?Q?OxKSgAxX6b2Sy9UIg5ByQVMArfkclxskQc8xvpW1OLaVl9hQ/IDmgKJgOs3o?= =?us-ascii?Q?4mqFb24eUDZwaihXbDRZehPJQhz39zg2MwR0QGAh6dKqOp04RnJ4VUcZBMXQ?= =?us-ascii?Q?KSyiqfKvCW9fBJGWdY0BUZdkLn3eODoo15oFj/oHQ44r3i16c2dySdcyQjkL?= =?us-ascii?Q?ULy1DNStOXchp1wLPzPR+M6WVBQneI2wZ0efTBD4HEAAWkke9mGz61lmXC1Y?= =?us-ascii?Q?F1g/lQxaDlGzQUH6/L46rCu4U896g2cxwp6gNEseTq/0GLMPNRK3buqJw/a1?= =?us-ascii?Q?HvBBk7jbJt2xq+HWjGeRZhGxsdih5o/ecjkdyu5ZQEzOvBjnrgqkTag1NHdx?= =?us-ascii?Q?usugfSCW5Oo3CV99lyyRPW2l9dkmrhA1jbB4kmYPyq41blXWi3e2fZG/sLyy?= =?us-ascii?Q?xcQekfoKiNgb0cdNXdomiml+Jz303dVRpkZNffXL2LA46bKbJ+M7Qq4K3nqC?= =?us-ascii?Q?apcV+DBYRxLDh02FnJLA0HRsf2tMJZYfKqFcV5OQeR2iO18nmRix/+MtuHOS?= =?us-ascii?Q?wS26+FcXSdh8JrDTDT9olDjK9B4KwkIlw1gMlb5Z+Sn/DwZDrgh32YSNHvCz?= =?us-ascii?Q?ShvwG2D98BS1RwOv61Fpq/J8vAoW0v3K2Kyxv3wJrG6aPbHopyCrKvkZwKmt?= =?us-ascii?Q?sWaz06edngeGnvaFe1BCRcDMMG+/4GrMwroMZMleH6uoMj2QTOwe4p6gDd0H?= =?us-ascii?Q?myhCRM7p3CTFMM52UXJhClk9iSz5SMcHzVmeyU7XMouhv2L3MeMKzp4x9I1S?= =?us-ascii?Q?gCjb40TV8K6RYuT224aW9jsWnFsOI2AvYXSC?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(61400799027)(82310400026)(376014);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:44.2491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0770d830-2258-4339-b991-08ddeef096c9 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-SJ1PEPF00001CE4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR19MB7512 X-Authority-Analysis: v=2.4 cv=f+FIBPyM c=1 sm=1 tr=0 ts=68befd38 cx=c_pps a=i3ALAGCV60MuQowHJNr0Ow==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=wKYcr39KdBWZLYmsaBcA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfX1vb/21ZISmYs fPnqAL9Yi5O5DsOXqMomXocdvPzgGrH15DPetM4nTcIqz4nSLJwMeQKsW7JDL/fB+sKka1UpiEj wxOmF7Ze5dG+Yu/Ak3X3du0GROv6VW4+CYGJBojspmA0vSaY60qoc2C/5loZRWiIoSTJXX0dbZ8 vVwgqzPaJaCuZbbKgibd2op5ApAjcFinYR960yz87RST/wRo7h8luKNV+40Ug/3+xW+czjyvgtE cDQo74l4kfvawUQTZehyqTqQ3vA/UGgaPQ/yIFaJDHuep4+64VgQLZYQI6ZVH51utGbTO6Dd/qU 8brUpbLtASxNaHren/56r5Lc3j9KYOxATSwxuWH/MmKrZXh5FXaXE+UC4WIRpg= X-Proofpoint-GUID: SoNqzVfbBg_CkhuZygV4sA4_uX9zTTpV X-Proofpoint-ORIG-GUID: SoNqzVfbBg_CkhuZygV4sA4_uX9zTTpV X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Add handling of the Lenovo-specific and HP-specific EFI variables for speaker ID. Future Lenovo and HP models will not give the codec driver access to the speaker detect GPIO. Instead, the BIOS will read the GPIO and create an EFI variable with a value indicating the state of the GPIO. The Lenovo and HP EFI variables are both defined to have only two valid values. But the variable name, GUID and values are different. This adds a new exported function cs_amp_get_vendor_spkid(). Signed-off-by: Richard Fitzgerald --- include/sound/cs-amp-lib.h | 1 + sound/soc/codecs/cs-amp-lib.c | 101 ++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/include/sound/cs-amp-lib.h b/include/sound/cs-amp-lib.h index 5459c221badf..43a87a39110c 100644 --- a/include/sound/cs-amp-lib.h +++ b/include/sound/cs-amp-lib.h @@ -49,6 +49,7 @@ int cs_amp_write_cal_coeffs(struct cs_dsp *dsp, const struct cirrus_amp_cal_data *data); int cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, in= t amp_index, struct cirrus_amp_cal_data *out_data); +int cs_amp_get_vendor_spkid(struct device *dev); =20 struct cs_amp_test_hooks { efi_status_t (*get_efi_variable)(efi_char16_t *name, diff --git a/sound/soc/codecs/cs-amp-lib.c b/sound/soc/codecs/cs-amp-lib.c index b1530e7c75e8..9b51d056d863 100644 --- a/sound/soc/codecs/cs-amp-lib.c +++ b/sound/soc/codecs/cs-amp-lib.c @@ -20,6 +20,14 @@ #define CIRRUS_LOGIC_CALIBRATION_EFI_GUID \ EFI_GUID(0x02f9af02, 0x7734, 0x4233, 0xb4, 0x3d, 0x93, 0xfe, 0x5a, 0xa3, = 0x5d, 0xb3) =20 +#define LENOVO_SPEAKER_ID_EFI_NAME L"SdwSpeaker" +#define LENOVO_SPEAKER_ID_EFI_GUID \ + EFI_GUID(0x48df970e, 0xe27f, 0x460a, 0xb5, 0x86, 0x77, 0x19, 0x80, 0x1d, = 0x92, 0x82) + +#define HP_SPEAKER_ID_EFI_NAME L"HPSpeakerID" +#define HP_SPEAKER_ID_EFI_GUID \ + EFI_GUID(0xc49593a4, 0xd099, 0x419b, 0xa2, 0xc3, 0x67, 0xe9, 0x80, 0xe6, = 0x1d, 0x1e) + static int cs_amp_write_cal_coeff(struct cs_dsp *dsp, const struct cirrus_amp_cal_controls *controls, const char *ctl_name, u32 val) @@ -114,6 +122,24 @@ static efi_status_t cs_amp_get_efi_variable(efi_char16= _t *name, return EFI_NOT_FOUND; } =20 +static int cs_amp_convert_efi_status(efi_status_t status) +{ + switch (status) { + case EFI_SUCCESS: + return 0; + case EFI_NOT_FOUND: + return -ENOENT; + case EFI_BUFFER_TOO_SMALL: + return -EFBIG; + case EFI_UNSUPPORTED: + case EFI_ACCESS_DENIED: + case EFI_SECURITY_VIOLATION: + return -EACCES; + default: + return -EIO; + } +} + static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device= *dev) { struct cirrus_amp_efi_data *efi_data; @@ -276,6 +302,81 @@ int cs_amp_get_efi_calibration_data(struct device *dev= , u64 target_uid, int amp_ } EXPORT_SYMBOL_NS_GPL(cs_amp_get_efi_calibration_data, "SND_SOC_CS_AMP_LIB"= ); =20 +struct cs_amp_spkid_efi { + efi_char16_t *name; + efi_guid_t *guid; + u8 values[2]; +}; + +static int cs_amp_get_efi_byte_spkid(struct device *dev, const struct cs_a= mp_spkid_efi *info) +{ + efi_status_t status; + unsigned long size; + u8 spkid; + int i, ret; + + size =3D sizeof(spkid); + status =3D cs_amp_get_efi_variable(info->name, info->guid, &size, &spkid); + ret =3D cs_amp_convert_efi_status(status); + if (ret < 0) + return ret; + + if (size =3D=3D 0) + return -ENOENT; + + for (i =3D 0; i < ARRAY_SIZE(info->values); i++) { + if (info->values[i] =3D=3D spkid) + return i; + } + + dev_err(dev, "EFI speaker ID bad value %#x\n", spkid); + + return -EINVAL; +} + +static const struct cs_amp_spkid_efi cs_amp_spkid_byte_types[] =3D { + { + .name =3D LENOVO_SPEAKER_ID_EFI_NAME, + .guid =3D &LENOVO_SPEAKER_ID_EFI_GUID, + .values =3D { 0xd0, 0xd1 }, + }, + { + .name =3D HP_SPEAKER_ID_EFI_NAME, + .guid =3D &HP_SPEAKER_ID_EFI_GUID, + .values =3D { 0x30, 0x31 }, + }, +}; + +/** + * cs_amp_get_vendor_spkid - get a speaker ID from vendor-specific storage + * @dev: pointer to struct device + * + * Known vendor-specific methods of speaker ID are checked and if one is + * found its speaker ID value is returned. + * + * Return: >=3D0 is a valid speaker ID. -ENOENT if a vendor-specific method + * was not found. -EACCES if the vendor-specific storage could not + * be read. Other error values indicate that the data from the + * vendor-specific storage was found but could not be understood. + */ +int cs_amp_get_vendor_spkid(struct device *dev) +{ + int i, ret; + + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE) && + !IS_ENABLED(CONFIG_SND_SOC_CS_AMP_LIB_TEST)) + return -ENOENT; + + for (i =3D 0; i < ARRAY_SIZE(cs_amp_spkid_byte_types); i++) { + ret =3D cs_amp_get_efi_byte_spkid(dev, &cs_amp_spkid_byte_types[i]); + if (ret !=3D -ENOENT) + return ret; + } + + return -ENOENT; +} +EXPORT_SYMBOL_NS_GPL(cs_amp_get_vendor_spkid, "SND_SOC_CS_AMP_LIB"); + static const struct cs_amp_test_hooks cs_amp_test_hook_ptrs =3D { .get_efi_variable =3D cs_amp_get_efi_variable, .write_cal_coeff =3D cs_amp_write_cal_coeff, --=20 2.39.5 From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ABD630DEC6; Mon, 8 Sep 2025 15:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.152.168 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347135; cv=fail; b=ams8R1ZpuPhvBSF6ibiYEmmyBU3OaHFEJCWKBdKjB7fL9l46Ri5251FBl4rew7nw2fuUnVVLCITRfkp3lLOTMox28rdHMoGuDeOoFlf4VUU26piUMMBM0zHvb0mhekwMpLc/XjipPqNcOwQ3Kkm2YY9oF7GzkLP3LjlpTMe/eXU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347135; c=relaxed/simple; bh=dgqUvgurBWL6vstHKCZHHz6jiQsOHyYp9ZPneVqWgog=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=RCQsHFbAZ1TOTQDjkZ7Y6EtM1CGEH+jkdAIG6XWbVq/JTnQK29YPLmydxLNnuv/XLqsSherAuaFNho7UIi9fEIFqWoIvIe6+x9F9BpGbGLcAZQOcgEY4T5lQM/RmTLgDHO4xzbGbQaxdrnBZIzn/PBgYH5/nP06f+7ZY4evbawc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=KsvdhuiH; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=M0AHfy1B; arc=fail smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="KsvdhuiH"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="M0AHfy1B" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5888UUxX2151922; Mon, 8 Sep 2025 10:58:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=x9gRks5JjcsSpCMHUpNR/NWaGqDlrevQD7rqImIrMdQ=; b= KsvdhuiHaMWULhFzJ9qTB47pdu6FOe6JXK2xeHbKiwV65n2VtIMnEjHVyyVtCQMu 8DD84Y7twbvAnwGwY/mBy5k0seeNnfbOogDIs5tYjzH9HU1V57PJkbRAnu3JHxko yWzQ84hZR0rTU81dZudbarDWU1NEF8TF3S8rH20YJF1QlVeh6+72iS8AErgRQz4+ n3nYx7JABpFNrhuxSu3JPE2X5M7r896SfnKZmQYZePEv2LntlkBkdZjD3toGxVFm nkQkjg159XXwoRHxzXZw15BNgFLKqSd9x+Om/hzMPaI0cHcjlZFP0mdeqbZvDDzh 8awB2VoL+bKxXlMlECnilg== Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02on2137.outbound.protection.outlook.com [40.107.95.137]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 491upq8grc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:50 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pO/bSAWaXzYz5/3JG78wtYdR38sQXyAWd4sjh/lqbzhNNh01Fxw/nplDBaPoMw0peUTqzq36lcDQ5LI9TSqYFIxdFs7R6DnZJ/j/AJMPAFMmhulh950+Hrc9S7i7gFE9q+xyfklEfVVf/m9Ab3yYJbNaqQ/QwCHqQfsSFOWbJYFpiZUiSEnjJL3FCV4JYrRq8lLn8lE+fpBJqNm2M1XVjppL9+CQlQnKE5W9pc7MGuCsunGcNo7pw+b6ncO1wsSh5kY2T+NdY/uv1w7XPgXopjABjuv2wwJG8A2G5vpDNRZzkCiNZUgSQv8G/4n9s5g+aHStZ2dPeSnVGAH2VuD+nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=x9gRks5JjcsSpCMHUpNR/NWaGqDlrevQD7rqImIrMdQ=; b=Sl5/y0TkDfjKuVPuNXnw4Ek1HUNGBEt6Ql0JtOonQ9c3ndVySwOoIKrRwOcTN3fSxuDvYrLOZhffQFWhjne3L4QMriYJG7iJMONlSyzacjOliRdvBCK5lGUJfjoe/ZGDDeYrw42fnfAo0APMp5YOOdoIhgNYSzmDq1WPDlqyGZ55aD3VyIla4ZN4qB0vlc1f4/MxB+qnW0NKCqEtjqfnAWVlo4qSfhYGhOQc4Xz0wxLps7tJeOwT4oQmoUziPxEoLV23X4amk5U4+ipXAREkBs770kebYpI2kRsRWo2xtUblnAhF9/PRpVMbsi3beERbLvYMjv6KmBGc8DXEG8KRvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x9gRks5JjcsSpCMHUpNR/NWaGqDlrevQD7rqImIrMdQ=; b=M0AHfy1BmnadNpt/1LsOZZ0IP+ED2+qkEw4KXLTVHWoQ7kd3Iqw+cjxZl29cDM23iVkBgXlSEML2IoxYI3nXv02lG80jfkHNS+5dnum5oLGteIa91FjJuVE1WAcT0Vzo2Isyuc1EfTEpY14FVGWQ2gAUy1RaLi7NbJIsLrd/Zns= Received: from DS7PR03CA0013.namprd03.prod.outlook.com (2603:10b6:5:3b8::18) by CH9PR19MB9370.namprd19.prod.outlook.com (2603:10b6:610:2db::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Mon, 8 Sep 2025 15:58:44 +0000 Received: from DS3PEPF0000C37F.namprd04.prod.outlook.com (2603:10b6:5:3b8:cafe::6d) by DS7PR03CA0013.outlook.office365.com (2603:10b6:5:3b8::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Mon, 8 Sep 2025 15:58:44 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF0000C37F.mail.protection.outlook.com (10.167.23.9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:43 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 99C6240654E; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 87DA482026B; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 3/6] ASoC: cs35l56: Check for vendor-specific speaker ID value Date: Mon, 8 Sep 2025 16:58:39 +0100 Message-Id: <20250908155842.599459-4-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37F:EE_|CH9PR19MB9370:EE_ X-MS-Office365-Filtering-Correlation-Id: ca1150c2-ca9d-4f11-1c97-08ddeef09686 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|61400799027; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Wqpoj5j3ULmbvl4mA6OrZ+17UltiPZ3i8Vcd4VjDqTdidz5WN3aEPNvBziE7?= =?us-ascii?Q?JgpVuJtr4lDVU/En9GBgUOKCbBqPyZZynt5etYTtOtCwk8gQQ+d3VBlBDGFr?= =?us-ascii?Q?xId0UQgBgeclE2qW8L5b/dtCGmZSkVkaPKXLRdbxZQfksPSC3qJM93n89hxV?= =?us-ascii?Q?gRerw0Gx4LZ08d9asaOpZYeI7usFk9TIAvaKRGm6KiyQGJUqiDc4s05ZwPOf?= =?us-ascii?Q?tGg8NCBPrhV4bMJHfJBH9RcjseGYJ15tHUEiG3ssnI8p0JB5GFuvm2b03d2i?= =?us-ascii?Q?uM/YKBhQ8yc1bjUAfcQ66wztIibtBws53eemDBnj/t94XnH4VLAVo2Muve44?= =?us-ascii?Q?yELrrXHqzr1GckkkAv/lsP+eAKWgs9+CxDLwhofLsX/TIKFCWv0cPjI+0ROf?= =?us-ascii?Q?VkpOc6a+lz4nGbOldxyQFAdNPZCbwktRG3urCW0OpmRdlUPFPhhZZdQPYFtK?= =?us-ascii?Q?M/42qdXclx1bq5+GKvx0j6+95Hn7L1wZd68LfDD8Iw8/uSL0iIBjFGj624GH?= =?us-ascii?Q?C2oxCv8t/S+EEKaRBhfrVb+T4c5R7BTH6XEWQEUgwCt/jLjCReNnEMRY4+eo?= =?us-ascii?Q?sP2j8Wzasf6QjuzX9Io7iYccAcL524kA34H+BGi3hyabbbdbz8bWhwqvaAYX?= =?us-ascii?Q?4VqHYKW98qZPdOOy+NLSQU+0068983qlBVwU+DpxIw2MWbvH/XiyRIaYjWol?= =?us-ascii?Q?4IkikMFrYOHDGu79gLfzOraTuaoGe/OUm0lxuCGbyoFCTZmrgTKrapbka223?= =?us-ascii?Q?L0vuGqJ3V39aqDSmAcpHJKiR5AlE5LnRktfQdBi/6PGOm8g6hp32366hIlBb?= =?us-ascii?Q?NWNaIcVU3rSRP/unZtvkWBnOaT6QxoHilgUx95F+rz5fIIms+QtnBdpVewBL?= =?us-ascii?Q?3Qlc9itmVDRjpIAy/k2h6kFn1NoU5Z6VMYHVOlOXYWbr0/ITJiYr2S5d7rcO?= =?us-ascii?Q?KRvSrjiNPJhXrVFjtpLIDgQZFdivv7lPbf81xElkUH6jssCc19isLLvDdKZd?= =?us-ascii?Q?dpWl9AQJW1CjQrNuei2z//FHbuSDmuvf9AxAPO98FvQzBpPA/YQ7v9FUg55a?= =?us-ascii?Q?qu0n0URQ3VK5nsxgqGB0FNo7PC9UCLruYW/2WIWO/FXKJztPiM6KKxfjSszU?= =?us-ascii?Q?uKQQ+xC0jy1yURLe5540kKo4Wkrqu5XZEPgcaF/BVjpl0UxCWoykP8+fAxhv?= =?us-ascii?Q?WzPmy2qs047+4ygjkWLSO0bkLjI/yoteXVj+RiBzhvalqmk3YSKNYol+B3E9?= =?us-ascii?Q?K0zRiwDjsWiLrCMt1A1jTZ360HzADN1QSJZ84wHcOIf49UltkQEYrQHX7GM+?= =?us-ascii?Q?eSmj/jqBGlHG91Opk5Ef4xkSEbgA4U0XErXqabrPXUYsXpIThuBBLl6mmuaw?= =?us-ascii?Q?Ocw8+J8F1nOo//sB9OvrdbJgiqo16jZ2i44yb8K5iLVa/OPW84CABhoD9JEm?= =?us-ascii?Q?r3dy6xPw+4H84GE2GGe0FDoNoE+vXEPHze2g5WaKe4g9VvOcrJh++eaEyLbr?= =?us-ascii?Q?E6eAIChyspLaX22w+d2m+eRTNbTWB4vxyqzV?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(61400799027);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:43.8391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca1150c2-ca9d-4f11-1c97-08ddeef09686 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DS3PEPF0000C37F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH9PR19MB9370 X-Authority-Analysis: v=2.4 cv=DMuP4zNb c=1 sm=1 tr=0 ts=68befd3a cx=c_pps a=FUT2VZ02y2sEaM13OGTzjA==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=9YM_IZES8PAWDyRG2q4A:9 X-Proofpoint-GUID: Rem6pXxivpekMeIAbGJGFnfa8N4vB2s6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfX94lStJWI3nKL tB0MOJbUS6Eaeibs1jsJtT+RBWhw8X0rGoik1Dz+w97Pkh0Qxn6qrDVwRNqwQSZTEpXEXmDHY4C Xn988ZsJoeNVxFOY3CsCIXzbUsJ4mHKkM6EkxrpmidmFdb5ALIz4Se1aQ+5rP5ApGfbypYKkkpo dhpWUnsn+5wamKXY0a3dj1J0jgl4zVE55GWVF/3hK5pQ9b/LKJ4OBD6vl2RWRxkzoJE0yGBZSGk PR+5S+F+bnj0xOvtIAvJqfoFMVzVdRp3/TsKBuu3CpuA1ayvZ8uH/Q52Kssw/CMqKihg/LpjkWj xz2NrrvNpA+dY01N0rjE7wiOHeAiN6Qj1aJ4cHJYeoc3ARCfX32Hyq1zRS76BU= X-Proofpoint-ORIG-GUID: Rem6pXxivpekMeIAbGJGFnfa8N4vB2s6 X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Call cs_amp_get_vendor_spkid() to get use a vendor-specific speaker ID value, if one exists. The speaker ID is used to load an appropriate set of firmware files for the speakers, and is usually read from a GPIO. Some manufacturers are instead using a custom UEFI variable for the speaker ID. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs35l56-shared.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-s= hared.c index 850fcf385996..95d018ecb953 100644 --- a/sound/soc/codecs/cs35l56-shared.c +++ b/sound/soc/codecs/cs35l56-shared.c @@ -1054,7 +1054,17 @@ int cs35l56_get_speaker_id(struct cs35l56_base *cs35= l56_base) u32 speaker_id; int i, ret; =20 - /* Attempt to read the speaker type from a device property first */ + /* Check for vendor-specific speaker ID method */ + ret =3D cs_amp_get_vendor_spkid(cs35l56_base->dev); + if (ret >=3D 0) { + dev_dbg(cs35l56_base->dev, "Vendor Speaker ID =3D %d\n", ret); + return ret; + } else if (ret !=3D -ENOENT) { + dev_err(cs35l56_base->dev, "Error getting vendor Speaker ID: %d\n", ret); + return ret; + } + + /* Attempt to read the speaker type from a device property */ ret =3D device_property_read_u32(cs35l56_base->dev, "cirrus,speaker-id", = &speaker_id); if (!ret) { dev_dbg(cs35l56_base->dev, "Speaker ID =3D %d\n", speaker_id); --=20 2.39.5 From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F1B430EF63; Mon, 8 Sep 2025 15:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347137; cv=fail; b=s5zWB/MKDFL55vOE/QUEr3OwvtqmbZ/4e1uAtiwg96LD8il1z1Bky1PneZFE8IBsg4tJ5B/HfSoXjCEe3yuQ5nDNqbwTj5Rkg+xH0KuZ4mAYH382RfaFAsjcbE6cEKVe7oHU0tS5MwuxMII647sjckHbShLet2UOJdQHGe+Qw9U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347137; c=relaxed/simple; bh=1CXFuIug/yMLtcH2kEgCQcxzk39tVwXaIoGV0g95s7Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Ni1QBJZPeZerVJCVR/wVJoNhpsxKd6FfZ12KY1+nyUtDima1VVsbsTwQ/9+e/VhMK4yz0+xp8Fl+wvlo2ctds9wKj81yxmvh/id9jxsTCw0naQqIxL4Zl/95skYghv11qLU5NtVGYMqQWSK2ChFfjWrS1zBesPa2iaNR6OYjkRk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=Uvr1Lftp; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=b1MQZcxP; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="Uvr1Lftp"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="b1MQZcxP" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 588FuZL7812472; Mon, 8 Sep 2025 10:58:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=CPaObkdmYNBB+lBLl2984mLFb2yavzxJczSJv86UtP0=; b= Uvr1LftppQTgjWasmd8+irkqO+iD7f4JOH7Fh+8OjHG29wGViAeaSVF5ifXZf0s6 68zFYw4lFJ/5wQJxHtUpN/CklX0EH4Mvm5/RAInsbimuzxvgVapA2/ssrHuVyX0Z V+pDH1GlmgPe5KZ/eKXNgQSgzehO6hz2K43JnhBYjYQbSriHiFLPiqkSaek6SWqH cmsnSTYVR2LohiW7NGbfer/PXUYQf2XyTl+GjpAik6qsWcoKdVuEyaPVhVzzE2l2 nqOM0VC8BIb9NUOP92Y0CPJm89R88PWgvJOcZ+e1WwhYGqZITo5XFGZ4FsnCGPb3 eSDLV5wgGzI/mgBFJ6USgg== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11on2109.outbound.protection.outlook.com [40.107.223.109]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 49227r803r-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:52 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iafsuiMmS8IgaBk9nms4ojKZenp+skD0WT2OSuouov9vVXiGGJBr04CByLcpXHJrYUhteJUfUvc/5aklJkJ5Tj/A9WH3OvVxxyjChtyce0vePrdwdFvCByVTkMeYZOF1Uu/BHw76bpv7fzJMQsXW5EQ6H3BLoBhj0RCuWatclEwlFSLax/VkRDg7QHFJiFsYXdZ/Qw4PzqdjTRtLVaa7l70X765di9r+FD7Mp85xP82eZbadWbOoMwNu2HLKb/2KHl4mfF6t9iEcO3Yf/Rak7eJnb4NAQFXVQ2Lg1km0duUQ5dB1RmIafgJFNYt3di0j7eLvF3WrnMMHAeZaJ8lLcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CPaObkdmYNBB+lBLl2984mLFb2yavzxJczSJv86UtP0=; b=M85ufXTfr1Syl9XFz8B1KweNgjJgr+erFDxOrdDM0e2ACykFRkfjeClMqBmTj8uHe1kvAzmro52imnIjG/LJqw5S/6D83fb7S4iGX5fZPbZ5szThFE4RC/rXL0K8k8wI0Q2rmqmwly6AtbdHjjtbc0BbmQGLHQMNVwqfpp9wA31Nk5pokX1RhmXYwLdqAxPiqEbVp1BM3pcfCWvLkSe2e42+x7T9efzd5K8ScuZpdPkhM9VMJJGLxOziG3htmglrs3pVOMfPTC8+a2LD0gQYFZ6cnOBJTJcrq2aXXtj4MwjZrjq48phvWvD29NUd+KjKvy7ghSnuCcZW2dKNajflUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CPaObkdmYNBB+lBLl2984mLFb2yavzxJczSJv86UtP0=; b=b1MQZcxPhwR0dBzIciknRmccq4rB6Bl+sNiBDD1WaR/2diCqOnATrZ4Zmxvpq+c5NgMFNZ2dNpPCKegjEeL2gcCm83d3UEmHaYTsFcZVX+O3tFi72o8j44iUEYAnjDyCwOpYnx9sHQcngnxyXFa0J61kYFvvpoIQoYfDtO3gIsE= Received: from DM6PR02CA0056.namprd02.prod.outlook.com (2603:10b6:5:177::33) by SA1PR19MB8847.namprd19.prod.outlook.com (2603:10b6:806:45b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.19; Mon, 8 Sep 2025 15:58:47 +0000 Received: from DS3PEPF000099DB.namprd04.prod.outlook.com (2603:10b6:5:177:cafe::5c) by DM6PR02CA0056.outlook.office365.com (2603:10b6:5:177::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Mon, 8 Sep 2025 15:58:46 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF000099DB.mail.protection.outlook.com (10.167.17.197) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:44 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 9CD7740654F; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 8A2E282026C; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 4/6] ASoC: cs-amp-lib-test: Add tests for cs_amp_get_vendor_spkid() Date: Mon, 8 Sep 2025 16:58:40 +0100 Message-Id: <20250908155842.599459-5-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DB:EE_|SA1PR19MB8847:EE_ X-MS-Office365-Filtering-Correlation-Id: 8991deb9-22ec-4f0e-0933-08ddeef09718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|61400799027; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?v5cbk+n9OgCGqb2X/8sKJMj8F8Biy+hOdiCLbHlUCUIAl60nlyoP+8WCyemS?= =?us-ascii?Q?D6AhXT/It2MmJ2I6PslS2x7xlZkg85c6p7z89Bg6hwsDLOfVSuQzwk6NjUIW?= =?us-ascii?Q?6+0ACmdSZryyL5aZg+ffV98xswPgXPVY2ZiqOFKg29x74HoOja1b2KZ8GFCn?= =?us-ascii?Q?5EO0jxUm/jaaiMwSg0165dUYJtK6sKH9EC9NdGy1LzkWGUi9buYWLfTRIDdg?= =?us-ascii?Q?3BcvAMOb87fpkMMckLZRVtjmJ7jPIHf7SjxC4J077PBT0q7VHVZ9rvZf6wa5?= =?us-ascii?Q?4lyOd1xL8dDrRRzId4H6KxbTegQWT7uQWfjKwqq8eSw6Pv0wNdw4Zh6f2Aff?= =?us-ascii?Q?lcMPlfC23fWm+9gh25in6EGUWWYTYJw15xUhHGf2n8SsDOD3vJkfzkT2PH1S?= =?us-ascii?Q?mKfYnFiXuLlAt1rTxOsXhH8yRdEGkbGnw/ixXus5HAMuCGCaI48VPS/8bdph?= =?us-ascii?Q?s+6QmdCjF4UgJ9rngSdb2xb+JH0enH/Nyl/Af7lCPgNLbtDN1q62riawYdFP?= =?us-ascii?Q?cmmM/IZjxqUI9YZuKFK43+HxjAAZ+6QvC2DsA2jIE9BAl5jmHWiwa9LMsau9?= =?us-ascii?Q?/NddAEbmGGzYnibWZ1CnyISVc1ndhtuAZllKB2j6gTpqAOUOLQtIJIne3bto?= =?us-ascii?Q?pSHRqoIiQr+bjg831LHnyfFzJKX3m6LrdIS0Fy+0VhlaeV9Sx8x7rOl4k8rQ?= =?us-ascii?Q?P8EduECj1SvKu3vFZf4t4iIbHzTqXUrpR6Z2HpC0UtiXzeKusG2XO4Ykwjv9?= =?us-ascii?Q?rPp4MyjT585YuroH8ZjQ8+OHGa5hSvWUhTC2Gq8xCndx8/0Pq66AvKErdarR?= =?us-ascii?Q?6C5EpOIotFEzYd5npMo6kq+96Z2eFQmUhBsFmT6n99KbX61wnWhWPf1+3sZr?= =?us-ascii?Q?Nvj8SO/HmjMltuP8LLoLkNYLOZTkVF4t1GghVF+M6KkDmA1HZFdtS4UJvlrv?= =?us-ascii?Q?QHiY9bSj8AmJMybG3boZFzOubUOtgnEcsgkggpxITEANlHUGEADQS4l6Iz15?= =?us-ascii?Q?+BVtneJ2AV9HhzhsNkSuUaPfa0bAw9FvwUdrslgUOiJtNlr2vBaOYLjdFPEv?= =?us-ascii?Q?o+d/eijin+3sk9A/eOwM6Im3UC5rRgQ1RAvXDa0+SUMpg3Wh9xj4Y/DQ3uIi?= =?us-ascii?Q?wylN/FSkQTnTuf2rd++jS2XyxvH36YDtwQWKln9KPW2lXIIXg1kWkzSZsv+c?= =?us-ascii?Q?Gh4KqX2XyCIqU05iSrwzb6CQ22qB6kTd5TGIhTqUwDklwdKlUR8gldJXh+3x?= =?us-ascii?Q?B/L19Z9CCP7i4Oe6bPwmdS2uyBlE23qVjJ5/NFu21P/YHigvUeRUZCeZ4bGx?= =?us-ascii?Q?j9DzSfW9z9Ac+dkqE+KyR9gEd+JPuOkEMq7rRTF1IwTswdDKI36eaCcdXued?= =?us-ascii?Q?vaP99X5/1534nvNpFyqt0Dz/ZaQBzsrIjGk5syMS/aNARkliZgUVRr+zCbLq?= =?us-ascii?Q?31CbfL4Dx76LXZFFXhnQ/YJOx+OSS1YE0CXmG8AuSHVBGAdDiVBPSR/8Izp3?= =?us-ascii?Q?q/8G1Qc/boy0C5VQvtoPJ8YIP9MYAfbQQh5/?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(61400799027);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:44.8506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8991deb9-22ec-4f0e-0933-08ddeef09718 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DS3PEPF000099DB.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR19MB8847 X-Authority-Analysis: v=2.4 cv=f+FIBPyM c=1 sm=1 tr=0 ts=68befd3c cx=c_pps a=JCInGfjmQJ+O+leRUSAC4A==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=VFd6b9-Wlax7agovK-8A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfX0py/OiBNDEmW XRPgmTOk7njoBwsoyf7usuHalohX6+Ryb8C4OaDXxcVCZu+G+5R0eDc0/VkouLFJqbfGKhpW7uU 6ZfwQ6X5csMhAf4ZcW5gx+2kJmRAKVSRVrZE4hm8NoqvcJw1xjgRtpY9JJYeLFJkAbUPJdJ+zCI ZPG0yfxhdi6mCXNbDxgxUZK8Vv/Lia/xvWA4tGuV14OLHM5Nhvnj+jYkAhsjtT2eR4sdrij8gx9 bfhZs6kRA2Mm+O5hK9VjBsRUB8STLsVnsrB9UjSq09uRS6H+WdK8QCP8yB3lsmznUs/MqTCU1wH ZzU+N2nJ3aPOOzSeI2w5g/94zcsfaacU5Ad+3o8LwTjjP+4Oz21UEyr0AgQUqA= X-Proofpoint-GUID: phxarWg4V1CllDJhmRxz9woLOdxdTwSw X-Proofpoint-ORIG-GUID: phxarWg4V1CllDJhmRxz9woLOdxdTwSw X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Add test cases for cs_amp_get_vendor_spkid() for the Lenovo speaker ID UEFI variable. This is a simple set of cases: - EFI variable is not found - EFI variable size is larger than the expect 1 byte - EFI variable has invalid value 0 - Lenovo UEFI variable valid values are interpreted correctly - HP UEFI variable valid values are interpreted correctly Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs-amp-lib-test.c | 196 +++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/sound/soc/codecs/cs-amp-lib-test.c b/sound/soc/codecs/cs-amp-l= ib-test.c index f53650128fc3..e7492afa041e 100644 --- a/sound/soc/codecs/cs-amp-lib-test.c +++ b/sound/soc/codecs/cs-amp-lib-test.c @@ -19,6 +19,14 @@ #include #include =20 +#define LENOVO_SPEAKER_ID_EFI_NAME L"SdwSpeaker" +#define LENOVO_SPEAKER_ID_EFI_GUID \ + EFI_GUID(0x48df970e, 0xe27f, 0x460a, 0xb5, 0x86, 0x77, 0x19, 0x80, 0x1d, = 0x92, 0x82) + +#define HP_SPEAKER_ID_EFI_NAME L"HPSpeakerID" +#define HP_SPEAKER_ID_EFI_GUID \ + EFI_GUID(0xc49593a4, 0xd099, 0x419b, 0xa2, 0xc3, 0x67, 0xe9, 0x80, 0xe6, = 0x1d, 0x1e) + KUNIT_DEFINE_ACTION_WRAPPER(faux_device_destroy_wrapper, faux_device_destr= oy, struct faux_device *) =20 @@ -642,6 +650,185 @@ static void cs_amp_lib_test_write_cal_data_test(struc= t kunit *test) KUNIT_EXPECT_EQ(test, entry->value, data.calStatus); } =20 +static void cs_amp_lib_test_spkid_lenovo_not_present(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_none); + + KUNIT_EXPECT_EQ(test, -ENOENT, cs_amp_get_vendor_spkid(dev)); +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d0(efi_char16_= t *name, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + struct kunit *test =3D kunit_get_current_test(); + + if (efi_guidcmp(*guid, LENOVO_SPEAKER_ID_EFI_GUID) || + memcmp(name, LENOVO_SPEAKER_ID_EFI_NAME, sizeof(LENOVO_SPEAKER_ID_EFI= _NAME))) + return EFI_NOT_FOUND; + + KUNIT_ASSERT_EQ(test, *size, 1); + *size =3D 1; + *(u8 *)buf =3D 0xd0; + + return EFI_SUCCESS; +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d1(efi_char16_= t *name, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + struct kunit *test =3D kunit_get_current_test(); + + if (efi_guidcmp(*guid, LENOVO_SPEAKER_ID_EFI_GUID) || + memcmp(name, LENOVO_SPEAKER_ID_EFI_NAME, sizeof(LENOVO_SPEAKER_ID_EFI= _NAME))) + return EFI_NOT_FOUND; + + KUNIT_ASSERT_EQ(test, *size, 1); + *size =3D 1; + *(u8 *)buf =3D 0xd1; + + return EFI_SUCCESS; +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_00(efi_char16_= t *name, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + struct kunit *test =3D kunit_get_current_test(); + + KUNIT_ASSERT_EQ(test, 0, efi_guidcmp(*guid, LENOVO_SPEAKER_ID_EFI_GUID)); + KUNIT_ASSERT_EQ(test, *size, 1); + *size =3D 1; + *(u8 *)buf =3D 0; + + return EFI_SUCCESS; +} + +static void cs_amp_lib_test_spkid_lenovo_d0(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_lenovo_d0); + + KUNIT_EXPECT_EQ(test, 0, cs_amp_get_vendor_spkid(dev)); +} + +static void cs_amp_lib_test_spkid_lenovo_d1(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_lenovo_d1); + + KUNIT_EXPECT_EQ(test, 1, cs_amp_get_vendor_spkid(dev)); +} + +static void cs_amp_lib_test_spkid_lenovo_illegal(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_lenovo_00); + + KUNIT_EXPECT_LT(test, cs_amp_get_vendor_spkid(dev), 0); +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_buf_too_small(efi_cha= r16_t *name, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + return EFI_BUFFER_TOO_SMALL; +} + +static void cs_amp_lib_test_spkid_lenovo_oversize(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_buf_too_small); + + KUNIT_EXPECT_LT(test, cs_amp_get_vendor_spkid(dev), 0); +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_hp_30(efi_char16_t *n= ame, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + struct kunit *test =3D kunit_get_current_test(); + + if (efi_guidcmp(*guid, HP_SPEAKER_ID_EFI_GUID) || + memcmp(name, HP_SPEAKER_ID_EFI_NAME, sizeof(HP_SPEAKER_ID_EFI_NAME))) + return EFI_NOT_FOUND; + + KUNIT_ASSERT_EQ(test, *size, 1); + *size =3D 1; + *(u8 *)buf =3D 0x30; + + return EFI_SUCCESS; +} + +static efi_status_t cs_amp_lib_test_get_efi_variable_hp_31(efi_char16_t *n= ame, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + struct kunit *test =3D kunit_get_current_test(); + + if (efi_guidcmp(*guid, HP_SPEAKER_ID_EFI_GUID) || + memcmp(name, HP_SPEAKER_ID_EFI_NAME, sizeof(HP_SPEAKER_ID_EFI_NAME))) + return EFI_NOT_FOUND; + + KUNIT_ASSERT_EQ(test, *size, 1); + *size =3D 1; + *(u8 *)buf =3D 0x31; + + return EFI_SUCCESS; +} + +static void cs_amp_lib_test_spkid_hp_30(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_hp_30); + + KUNIT_EXPECT_EQ(test, 0, cs_amp_get_vendor_spkid(dev)); +} + +static void cs_amp_lib_test_spkid_hp_31(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct device *dev =3D &priv->amp_dev->dev; + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_efi_variable_hp_31); + + KUNIT_EXPECT_EQ(test, 1, cs_amp_get_vendor_spkid(dev)); +} + static int cs_amp_lib_test_case_init(struct kunit *test) { struct cs_amp_lib_test_priv *priv; @@ -737,6 +924,15 @@ static struct kunit_case cs_amp_lib_test_cases[] =3D { /* Tests for writing calibration data */ KUNIT_CASE(cs_amp_lib_test_write_cal_data_test), =20 + /* Test cases for speaker ID */ + KUNIT_CASE(cs_amp_lib_test_spkid_lenovo_not_present), + KUNIT_CASE(cs_amp_lib_test_spkid_lenovo_d0), + KUNIT_CASE(cs_amp_lib_test_spkid_lenovo_d1), + KUNIT_CASE(cs_amp_lib_test_spkid_lenovo_illegal), + KUNIT_CASE(cs_amp_lib_test_spkid_lenovo_oversize), + KUNIT_CASE(cs_amp_lib_test_spkid_hp_30), + KUNIT_CASE(cs_amp_lib_test_spkid_hp_31), + { } /* terminator */ }; =20 --=20 2.39.5 From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8163A30F950; Mon, 8 Sep 2025 15:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.152.168 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347140; cv=fail; b=n+zkTJqTQiT3sfVYt9r9CGvx1++BTiFf+CzlYPe9ibUEeTMtnaa2I36CtNR7Nl4emUEQ/wTXLu0cxnQbtCqa3G3llaxzz2Kqf54y0X08AwFdUAOiwa5587okabtfkL0RyvZyycQk1CIFh1t5rKs2NyXnjqjlfPGNdfO6eC0Iroc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347140; c=relaxed/simple; bh=wJhnQMsUsI9rAjc0BNjA1XOBKL7QbUrGwXxQp9Iz5Lc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oULb4vgm6qDVQxuYfTZ4MVF+YtXzp90K2Urt+P9qFkL8N8pUGY7W+PYVCk25wz3vbm3HbF0PcWoOI8VPc/htvPBT55lHWYQ89H62BmuPx2f6lpu27Q77KI95TbvWXg9Y1Y4Y0zkPpWwlrTt6nugBUZindzikNwycYA61Os14NOc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=GLtaLn+a; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=jAVrqaH1; arc=fail smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="GLtaLn+a"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="jAVrqaH1" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5888Uljj2152512; Mon, 8 Sep 2025 10:58:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=h4Dfr0hD8yE9FJXgyaN7BRfYnhLiGIoENqRcYFsQiR4=; b= GLtaLn+aNvZBMuZzI3adria7MIVu1tNvr7bgdAxj+NRdo6GSxxub02anl44O5wf0 44bLHbPc09s9aZNU6Wb9eg4Opixcv5weg7iHRyPwbN8BjOYMPio7e1c5ewKG5TxY MVtZ1VvL+kfWRHVEYAfQggtATtFsKdYd76VluPU8hQ2AGa5l6MBNDmEvySu/MpfC 6JFXjnhrmQnTj40egqZFsaVtGooAsraKtJGPGXk6VtDWLlLlxqp1RhWrc9aOfWdL czgKB3YiWsOGOsN010gyZolb7FVRFyLNkvr+tKOF70wVJ/SnbsEhl7vZJp/wKfBs C+0zJrfA0oFczJZoojMaFA== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11on2117.outbound.protection.outlook.com [40.107.220.117]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 491upq8grh-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:55 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GdCxPAJ1hrjxkJPr2QOww9fKWns5VYVvL0XoxwlMsWInlPqo9NzeKyFCe/WcUTBwbjuiqwe1BZj9QsNLAGMpVX73pEYt8lH+pjp5786wIdbQ3QL76s1Ve+t7UXiPrWjEwGu+K3zR8I5gDbH8OO0wZtFygCFrb9sgMCYTGtR5CxwdiQ7rX1hiy70ngnPy2kTCRRop2Cg5tnu7Eq3opCmcHb8JJkfsZIYIyr1MewTyInpNAUrHmYgdi+8177UKZp+jmSGGhaH7TTkUIDtmw6HGB2NRxWT71p7ZjafCZJSQv2qsxc6cm3972t0dVWNkefr21sBx46JSe5rS9hx+dIw3mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=h4Dfr0hD8yE9FJXgyaN7BRfYnhLiGIoENqRcYFsQiR4=; b=CZ68G7K26IN/Tlb61tHfiL6Wb6Wax7ezC5YnldhvvFBgyPzYa2Y0eDT5OIUZ48XzIf/oHZ+6LyOlcGZW3jqAFZwSGHDZMqab+nINH/K/sZgNSdVEFCjEZrth3uRMdkcQxhUeYdUfkBkHpYPyUJOTRKR/UF3HMXGPuqW6dT17dNqunO2CMu1Eb9Ebn1WGCr92jfAf411R5N1QLrr7imesutf4VyTWa3QkLRHym8PLDIF9LokjSZCfRaE1aI5dyXahKwu2t6sZGSmig/YA06LWEgGbgqOrjutBOnrkOgUajUdgem3isTtUnMPGogDaTsl0Ry/yr7vzKxTgrc87ixdHCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h4Dfr0hD8yE9FJXgyaN7BRfYnhLiGIoENqRcYFsQiR4=; b=jAVrqaH1SZgAT2LSVOiUt1HQmLQck8ah/nGhFVzWmsvAqbcjZyvX0zcCHP4bNaORfPhU/KFywacKay1reu8XD76YSmzHQBjC30FlTbvNyOEArmTSV2qNpkxnLbaHbEhbtmmQnlXxlpTN/fR86kXRCTh6AkKbl16xHR2bkxiXsFY= Received: from BY3PR05CA0023.namprd05.prod.outlook.com (2603:10b6:a03:254::28) by DS0PR19MB7926.namprd19.prod.outlook.com (2603:10b6:8:161::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Mon, 8 Sep 2025 15:58:45 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:254:cafe::91) by BY3PR05CA0023.outlook.office365.com (2603:10b6:a03:254::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.14 via Frontend Transport; Mon, 8 Sep 2025 15:58:45 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:45 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id 9FB25406558; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 9775E820247; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 5/6] ASoC: cs-amp-lib: Add HP-specific EFI variable for calibration data Date: Mon, 8 Sep 2025 16:58:41 +0100 Message-Id: <20250908155842.599459-6-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|DS0PR19MB7926:EE_ X-MS-Office365-Filtering-Correlation-Id: 968659f0-5855-4ea6-887b-08ddeef09765 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|61400799027; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?S/b2WsPjqBggLWVRcVLAYTKRlj9QSW6oHxUpUyrcJ/Qaa6pUVHrXMuDHZw2K?= =?us-ascii?Q?qZxN+FMDl64ElsXBpHw16hyx5IU4TbtGlMbibkcJoj+ntwONnJj49RHV+ZOK?= =?us-ascii?Q?C2SQYslfyuH75sjN6dh2IBggqV+fRI6c4is5t8c0ldX3jPKljrLgxr2PmC2p?= =?us-ascii?Q?IzYVYpr9qURXeNmEW14I1VWH4Mr+VgMzJJA7OTDh8qb7kd/h41h1vVBkoSrT?= =?us-ascii?Q?VBPsaslmhR6V+QrQP/XBlq3lqMxbbe/BXZjkgigv+winRN3Wolj3mXGvysfu?= =?us-ascii?Q?OUPcNP3LExOh8Gh70jsgMbgiUb6aCVjjOJEcrH/YZp3HO9pz1QINm/b4DGOx?= =?us-ascii?Q?ugPw5l6puPmmtCBxY3nw9aqqwqyMi9tZpeOGAkbMdFyYBlfqGGsK0IqfqKjH?= =?us-ascii?Q?CBYQt61X/OJtLjuZyo348CnCaKfXHoHgO27iwT9iuVkUZlDgWIiN4ci/k8Rp?= =?us-ascii?Q?fx9Kht6OCbxB3M1Tbf+gp5KK0TPO4bsChXDMwjw5N7vxnGdRvdhqfVNxXqbq?= =?us-ascii?Q?6JSMDE0j4/4nRydQ9Q56/E9NVk/qhY9SvA57qCcn+NoeM6uDlU7+nzr8oWCz?= =?us-ascii?Q?HURAXb6w72B8nFb0vqQuMvUanj/fla0qotbRTnA2dOzqqFmEDrb20V3FWdX1?= =?us-ascii?Q?/1jgoKnHnqDguwwfCbXjRJIjB4MNdrbjI0ob6ERLsEMhZt0wPV1GwZ7bOSu7?= =?us-ascii?Q?eAtSQXXTWHMoWqq9XrwYUhRXMXOgAPEYZYfKKkvF4aoLSyA41nYD/C1wPC4+?= =?us-ascii?Q?yuljneiORgFZldv/wJrzo+eYH5hNLKzQZjzgJfHXIzkJd9lLMBsHVxTrk0vZ?= =?us-ascii?Q?i0AJzdJ6Fo1PiQH1A1dusH3/JYNqOLej7bPa8E6VFjMgtbsU3tWCJ8lBZs9d?= =?us-ascii?Q?WlyL5wE5wm5JFwDhVcN2sGUH/6XbGvvNtRNlpZlfONy9c/P7j72Fr8tAEYLa?= =?us-ascii?Q?bhPK3ND0FiRt6hk87ezPCoWDnmul0JAsMDdXU+LqFujMfmEf288KgjmgHZCs?= =?us-ascii?Q?bjosEA+JCdmVu14WSqdCUiF7Wi1kX3L1Vzk9y5ixhfWTXoFGeILFoJCl69V9?= =?us-ascii?Q?F/9bgV++tKa5m5RXt8Jaon8CoGaCDlmDY9y0yDbQdZGzqVM3zdTDIEtVkUe4?= =?us-ascii?Q?oevd53avlgklaBRGXbKkiEbWFJFqKbyitI6Rlki0QHYWObGGviFBBM8yTV4M?= =?us-ascii?Q?zwXjOnqXRe8o92YhFGKcx6j6VJb01hWIRUkAVGT2yMFpC9f0NmIXZzxWI66O?= =?us-ascii?Q?dVKmfU7XQcAt1AZ1gn7gkYVf/YDFPNsQFEMRE2v3jW3wH52TWRByryZAiLVP?= =?us-ascii?Q?yxcliy/+35zl5W1dovgwmNae9GB2GblsoIZDbtKoVNF1xHxHnF7SJKcUnYaR?= =?us-ascii?Q?yrfDGfxYNtwN8xiRMJ2RNXvdlVhYfKcj1z8DexUqocJ5mxwc7Ut/elsfajgG?= =?us-ascii?Q?1MuKRLCmyL/N1k+LCmJXgP3cBkQHzdRiq1XYrzdG3DBGwdVEjVIkBEJlUsOV?= =?us-ascii?Q?bhDjB7sIdJjH7fWzQnhq14LEprH0Iu5xa149?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(61400799027);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:45.2658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 968659f0-5855-4ea6-887b-08ddeef09765 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR19MB7926 X-Authority-Analysis: v=2.4 cv=DMuP4zNb c=1 sm=1 tr=0 ts=68befd3f cx=c_pps a=Gqw+4yJV85EtGHpvYtJK2w==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=gujROYcaeV9tRZqipvkA:9 X-Proofpoint-GUID: PRTS8-qawMoFFkQx3jxbJLQENeHB5R8W X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfX+mREDBk0bKqh Vu8TvKjvG0dCdRgGkKu4TyzN9BxpAb2R27Y5R1HKKdW1XpugAb1kJ1RjD7Xe+LKUOxkyVLGCxEI tHIocnRHu1fCQp2qX7m6QeO2wxQRgE3Nh9usrldIbpbOBWyOKi9nzXJDoD4v5ACY/HfYq5sudQK 0Dz4Sys1NVeTFrLQlY+G/tkz/HpxICk8Aj6/DfVtzPQYtFb8CdaLRYHKsESOCRzy4HzGGFc/sFZ sVSlOa5+Y5JBC7ZFSgI/PZv9C5LQDBhYjiFbySzCkx+0CrX+v2XyMk69wXD23hVwbABNJ15kTL+ jjUkpdsjfSjVD+9X9ST1DPafOKPuP8UAikbKuFpIcRCTc6gGP7VG2v963xtbH4= X-Proofpoint-ORIG-GUID: PRTS8-qawMoFFkQx3jxbJLQENeHB5R8W X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Search for an HP-specific EFI variable for calibration before falling back to the normal Cirrus Logic EFI variable. Future HP models will use an HP-defined EFI variable for storage of amp calibration data. The content is the same as the normal Cirrus Logic EFI variable. The first step in cs_amp_get_cal_efi_buffer() is to get the size of the EFI variable, so this has been made a loop that walks through an array of possible variables. A small change is needed to the KUnit test, which is included in this patch. Originally the cs_amp_lib_test_get_efi_variable() hook function asserted that the passed name and GUID matched the Cirrus Logic EFI variable. Obviously this will fail because the code now tries the HP definition first. The function has been changed to return EFI_NOT_FOUND instead, which emulates the normal behaviour of trying to get the HP variable on a system that has the Cirrus variable. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs-amp-lib-test.c | 5 ++-- sound/soc/codecs/cs-amp-lib.c | 37 ++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/cs-amp-lib-test.c b/sound/soc/codecs/cs-amp-l= ib-test.c index e7492afa041e..c090498cbf78 100644 --- a/sound/soc/codecs/cs-amp-lib-test.c +++ b/sound/soc/codecs/cs-amp-lib-test.c @@ -204,8 +204,9 @@ static efi_status_t cs_amp_lib_test_get_efi_variable(ef= i_char16_t *name, KUNIT_EXPECT_NOT_ERR_OR_NULL(test, guid); KUNIT_EXPECT_NOT_ERR_OR_NULL(test, size); =20 - KUNIT_EXPECT_MEMEQ(test, name, expected_name, sizeof(expected_name)); - KUNIT_EXPECT_MEMEQ(test, guid, &expected_guid, sizeof(expected_guid)); + if (memcmp(name, expected_name, sizeof(expected_name)) || + efi_guidcmp(*guid, expected_guid)) + return -EFI_NOT_FOUND; =20 if (!buf) { *size =3D priv->cal_blob->size; diff --git a/sound/soc/codecs/cs-amp-lib.c b/sound/soc/codecs/cs-amp-lib.c index 9b51d056d863..8434d5196107 100644 --- a/sound/soc/codecs/cs-amp-lib.c +++ b/sound/soc/codecs/cs-amp-lib.c @@ -28,6 +28,24 @@ #define HP_SPEAKER_ID_EFI_GUID \ EFI_GUID(0xc49593a4, 0xd099, 0x419b, 0xa2, 0xc3, 0x67, 0xe9, 0x80, 0xe6, = 0x1d, 0x1e) =20 +#define HP_CALIBRATION_EFI_NAME L"SmartAmpCalibrationData" +#define HP_CALIBRATION_EFI_GUID \ + EFI_GUID(0x53559579, 0x8753, 0x4f5c, 0x91, 0x30, 0xe8, 0x2a, 0xcf, 0xb8, = 0xd8, 0x93) + +static const struct cs_amp_lib_cal_efivar { + efi_char16_t *name; + efi_guid_t *guid; +} cs_amp_lib_cal_efivars[] =3D { + { + .name =3D HP_CALIBRATION_EFI_NAME, + .guid =3D &HP_CALIBRATION_EFI_GUID, + }, + { + .name =3D CIRRUS_LOGIC_CALIBRATION_EFI_NAME, + .guid =3D &CIRRUS_LOGIC_CALIBRATION_EFI_GUID, + }, +}; + static int cs_amp_write_cal_coeff(struct cs_dsp *dsp, const struct cirrus_amp_cal_controls *controls, const char *ctl_name, u32 val) @@ -146,12 +164,17 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi= _buffer(struct device *dev) unsigned long data_size =3D 0; u8 *data; efi_status_t status; - int ret; + int i, ret; + + /* Find EFI variable and get size */ + for (i =3D 0; i < ARRAY_SIZE(cs_amp_lib_cal_efivars); i++) { + status =3D cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name, + cs_amp_lib_cal_efivars[i].guid, + &data_size, NULL); + if (status =3D=3D EFI_BUFFER_TOO_SMALL) + break; + } =20 - /* Get real size of UEFI variable */ - status =3D cs_amp_get_efi_variable(CIRRUS_LOGIC_CALIBRATION_EFI_NAME, - &CIRRUS_LOGIC_CALIBRATION_EFI_GUID, - &data_size, NULL); if (status !=3D EFI_BUFFER_TOO_SMALL) return ERR_PTR(-ENOENT); =20 @@ -165,8 +188,8 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_b= uffer(struct device *dev) if (!data) return ERR_PTR(-ENOMEM); =20 - status =3D cs_amp_get_efi_variable(CIRRUS_LOGIC_CALIBRATION_EFI_NAME, - &CIRRUS_LOGIC_CALIBRATION_EFI_GUID, + status =3D cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name, + cs_amp_lib_cal_efivars[i].guid, &data_size, data); if (status !=3D EFI_SUCCESS) { ret =3D -EINVAL; --=20 2.39.5 From nobody Wed Sep 10 01:57:59 2025 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AD3F30DD18; Mon, 8 Sep 2025 15:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.231.149.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347135; cv=fail; b=a0npPzKmCucnIbNIh3Vu3o4eSmciGRd/xyct3Ma860wKBiB7x2wjxu1UNCtmhD9A5ocmFLgxk74F9uN3Nxz+RexnCGNHip86HzA7vLv8h3Pm6tfAPj2eJ1UcOJsSPM4xQo6qh8lNZJwfIXovo+7luj6EsC1LMmLB4jxBPyAvz6M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757347135; c=relaxed/simple; bh=An8C+eWTpaJ/ogMYU8+WICytSYEVaLcQ/MNZhlsorAQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oQKHIlVSedBr6NL0KlBQvzrymp9NFkWBhR+hKbeymzg8dZA0lqco0qTfA/Z0jXt1d/F73oiZlGHiX2WnNqZ+DToN6KLIH5w6Te8g9CkRppdTFliG+bCRusF0RjWgs3kMc4TE3TWd+qA+SSx9ACmxVIatk85e4ub5SfxVCzbSVjQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=Fey6fkA8; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=eg5pVMlf; arc=fail smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="Fey6fkA8"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="eg5pVMlf" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 588FuabP812520; Mon, 8 Sep 2025 10:58:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= PODMain02222019; bh=1OOg6dO91+A3Knc4yiSKiJxKV3O0GVI5it7rrZy/lwc=; b= Fey6fkA8Rpiwdz9UfSZyctj5OxOjwOS7r6unEJJFJHAmzwm3FZy61NwlR85/+JDp nI8M3ui4TYWs5lI/AKvvcGxV9k868vhmoTcVQpS4BrXB6HaI3HpPderOYEmsmmZV MP5tXjh2vr2lOoeZs28fGeck/+a/YNLDs4RxinmuMJ7ugKSDbEe3VCnbmDKJ5dtZ XuLSSsSfW3i8rSoqKQk01amY61UwldHKdCoXtxtyNbRMNJ88LeK1O7mndExx7dYC EriEJUcJTjHvUBsrp4GfgTnhn75Mw4yurbYJkD+T5a3xwPpa7BD7G+jrzFn5B3v7 gZqjyIF/NoAPVuoGBzjb1Q== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12on2096.outbound.protection.outlook.com [40.107.237.96]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 49227r803q-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 08 Sep 2025 10:58:50 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z+FmXvfOzMrRC/I+sRdvacky1py6tupqGhmJ4mtkscfTAY5PJsRGQy+1IBdPItuqo7cz+K83q0F/mwy/a6lN27c0c+5hrYIGr1iPtZH7oUp5fds12WdiJUPbe9HEsz7Js2ev0bLW61asC9baoT9DKXt8i+0Widl//F4zDWKx/n44O4HHF/zjJDxD+HFzIeLjcR4TwxYwJlMxJ5ndm9mAauIAymMFBndePlcqrG7qAc2PZcHXtJjhc+9MH+gmTuaqceofJyt1OQnMT9leCj4IGbqdPaokjHY2seOKuEVoa07tP3AfJxY9qD2OfO2FKKingphQd6j8WGKL92aHsnesew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1OOg6dO91+A3Knc4yiSKiJxKV3O0GVI5it7rrZy/lwc=; b=GGp5AdmjjOozWaRQT6K4rqq1+tCiy0T2h4ZTBgRqE2/ZFL72qr0Yu4Jw1XsgXDsKB23zYmh+D5qA4uM2QCDK93RXmUbhQd6KzIvf3J752bH6ryNzHmoJRpswEgCApaWq9arQqeUKY9iydFFAbVszHFMiGmJPnoaC0/jbkjsb7s8/9VS/VbPRj8e7oBWScrAeHjt7l94ZVCgaysVLskaUHG+X+oseehaweHXxXCGHdysKVvaFlZYHEaGNiuNtuKP2q7oyd9HCuXv35WpDxGm+8L6n/SXQznHV/XJYgP7TngK9GshBLNws+8eEeF3Md/HcPVABitaK+S4lRxA3ixGqTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 84.19.233.75) smtp.rcpttodomain=cirrus.com smtp.mailfrom=opensource.cirrus.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=opensource.cirrus.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus4.onmicrosoft.com; s=selector2-cirrus4-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1OOg6dO91+A3Knc4yiSKiJxKV3O0GVI5it7rrZy/lwc=; b=eg5pVMlfXhB7RbAGkwP1oBLS1Qcz01mWDq0h2mnAL4Xgs0elT/825Q2zZ21GaqU15FVHuUCmPWGnt3W3LFjZt3JQhAltCWtt7g19P890kCKWBjP0p6J6O0zei48cZDh8msPtF0HWXDdrTedAwCksFqbk4jnMk8MIQE8Fmb/sxLU= Received: from CH0PR03CA0020.namprd03.prod.outlook.com (2603:10b6:610:b0::25) by CH9PR19MB9347.namprd19.prod.outlook.com (2603:10b6:610:2e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Mon, 8 Sep 2025 15:58:47 +0000 Received: from DS3PEPF0000C37D.namprd04.prod.outlook.com (2603:10b6:610:b0:cafe::5b) by CH0PR03CA0020.outlook.office365.com (2603:10b6:610:b0::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Mon, 8 Sep 2025 15:58:46 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 84.19.233.75) smtp.mailfrom=opensource.cirrus.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=opensource.cirrus.com; Received-SPF: Fail (protection.outlook.com: domain of opensource.cirrus.com does not designate 84.19.233.75 as permitted sender) receiver=protection.outlook.com; client-ip=84.19.233.75; helo=edirelay1.ad.cirrus.com; Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF0000C37D.mail.protection.outlook.com (10.167.23.7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Mon, 8 Sep 2025 15:58:46 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by edirelay1.ad.cirrus.com (Postfix) with ESMTPS id A943340655A; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) Received: from ediswws06.ad.cirrus.com (ediswws06.ad.cirrus.com [198.90.208.24]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id 99F7982025A; Mon, 8 Sep 2025 15:58:42 +0000 (UTC) From: Richard Fitzgerald To: broonie@kernel.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 6/6] ASoC: cs-amp-lib-test: Add test for getting cal data from HP EFI Date: Mon, 8 Sep 2025 16:58:42 +0100 Message-Id: <20250908155842.599459-7-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250908155842.599459-1-rf@opensource.cirrus.com> References: <20250908155842.599459-1-rf@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37D:EE_|CH9PR19MB9347:EE_ X-MS-Office365-Filtering-Correlation-Id: f17a18a9-92f5-4685-df7d-08ddeef09812 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|61400799027|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?C1aby6KFUVTyCvXcMlr7AaV+PNXzvBUIvP4rovktDoQkdVZ28S62w8V/poOe?= =?us-ascii?Q?YFLyDTH/irjiwh3woguj+KIKAaRRHnNKm4h7H9JyD5peSWwka/xdWs15DLrc?= =?us-ascii?Q?pOwM58kzd0zSnQDmFrCs2ip0iJfgkMQGXAIxYqrHYgLllj/9kaSCx6vlEi/u?= =?us-ascii?Q?8mxSTa1OtVL9i4rmznp6vIoUU5x6xWNr5YvdeL3aL6Hbh84vrGKhkALxK0K/?= =?us-ascii?Q?lO1/3ozvI2q0jMNsA+ZYnny3831Y5LrsrDlw9kBI7rCpCrVgi2rUftAf+b69?= =?us-ascii?Q?66p8gw8/nEmKal4zcx0VUNFwIkXlhfBermBnxC0zWYy1LMF0yRnkd4pwDGtT?= =?us-ascii?Q?yJIuH8XCrrsJLQKQZhuf6lD66oktk4AZpx8WLxP1dysF3YWaaWLE6KLZPB/J?= =?us-ascii?Q?WFo3OdqjiV5jmXD95XmqeoNUpbtbozUVlmfHcuP6UwsKjHrFSHtVIuVWZpn3?= =?us-ascii?Q?iKx5IJr31+VSTyuGKItAFMqsRtGFvpr2qYppU1C5EPx2czMgHj2RIXZYOZ2g?= =?us-ascii?Q?g/0MRUp1fnUkJX+YZmDQ9mYsdEw4T4/ssIij+uWmkGX757+1N1w00Z1g8wEt?= =?us-ascii?Q?rqvS9k9zefGcAbZBWAKABMWjvMRTIs2hu8fPYotdKkb4vJS3wQOVQ5TpuKcJ?= =?us-ascii?Q?ASe1G0mbj/s0spuJ8Zo3uV8BmYAMkgHn31pPi11kRPTzfZsH7mVC36IJ3kN5?= =?us-ascii?Q?tYgiz720SaSlRrdQ9H7VVhy4QQdR0MU+gqDFu5ZH6Dg8gi7zUp/NOVXtBZCF?= =?us-ascii?Q?SpECdM6GJMQ+IVwpdeYXL9dMaxDPV9SK9VCBJUDEJ6+h27eSnta1nlWL2/fM?= =?us-ascii?Q?+V9Vl5X81OD0utuSXl0Llk50J2nDVdB1ZEAbq/heoBvLmbz4OGZBYtnHcgsK?= =?us-ascii?Q?2l8ib59Zq1vzgMbh+Q63RIORDlXSmGmBDq2Cb2/C5UtXZVACXaJfNdPzk8HS?= =?us-ascii?Q?rUsCI8R7xLY4Z1UGkGM/qMCBohKyLEuTMejry0eeMU5swp5s0W7eTjltCqAy?= =?us-ascii?Q?QiI88UV6Pn9LjgsWfCggSbR3/Hf93CCQoDIL/dm+YNZJOj2g+ZGC9myE9+t4?= =?us-ascii?Q?U2qKQsp3qDaT+yfgeeFaujeemkttOBIEwoTJfsabqDBeN0jD22AZEvcg54xL?= =?us-ascii?Q?iU7X2/ut8jwk0Lc+W4ak4OSWPndZYh8ufpd/f5Fc5esUImmXTqI7iySdERcp?= =?us-ascii?Q?g6ncMwed3JZQL3WkQrcEg7QH4Wqj2+mBHFlYT61llMOHxi67RXxbQJEEUdEK?= =?us-ascii?Q?pWfe8J4mZ+nLQJmHrmaefzm7nPEpOSZPrv6gAAwdCv4eJBigabwy+rLxDEZC?= =?us-ascii?Q?vi7tyCMRxODJ4miipIIBBTuR11c1anavZXf/aSN9ltEmv89UP4PtjN2eZEjS?= =?us-ascii?Q?Et06a/QxDyBO+rgIOnlPjoYJ5TURm0PRdaaP1quif6BXG+/N9KCgus9cjac4?= =?us-ascii?Q?/cZgI7Cd2BZzqPaMpAUR0WlnRho48ToaQOt0D27ujDr7u4licatbA8FD+QaZ?= =?us-ascii?Q?ooyuUWzJh5K5QsbWlXpg2IwMzDev8SPIAQge?= X-Forefront-Antispam-Report: CIP:84.19.233.75;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:edirelay1.ad.cirrus.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(61400799027)(376014)(36860700013);DIR:OUT;SFP:1102; X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2025 15:58:46.4371 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f17a18a9-92f5-4685-df7d-08ddeef09812 X-MS-Exchange-CrossTenant-Id: bec09025-e5bc-40d1-a355-8e955c307de8 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bec09025-e5bc-40d1-a355-8e955c307de8;Ip=[84.19.233.75];Helo=[edirelay1.ad.cirrus.com] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DS3PEPF0000C37D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH9PR19MB9347 X-Authority-Analysis: v=2.4 cv=f+FIBPyM c=1 sm=1 tr=0 ts=68befd3a cx=c_pps a=XYC6++eb3LU7Tn/YozfASw==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=w1d2syhTAAAA:8 a=erahUydJdZyVaCJA8SoA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA4MDE1NyBTYWx0ZWRfX2/OGR+71K6hv +/G8idgck07BDIBZcw5JP7EAnjwNid/Ss/BlD9Ue/xjDPg0F3PDC3YSaB9ksiYT47UG4/bQDMcw MsR47ZJqWwSy6Xqd1goxGYoNq3zZvk0xS0vJ7JwRj4aX9Cy03vUNmBA4N64S5i+7dARxCyG0yWe 5NUcGuUAKFzDeewpBimmFmrUIc4xDGaWaPAb5kQQGnkHdR/yjJapR9xVHEKa9MnjqqpJ32a/HvF xHaM0F3+IGJdI1B4fyLeWy9rLGTx7e7fA0GMNLCVY9ST6SHkDXa/w+7oHIFreDITsHvjmRJzhXn ZzR7dzoA//1g/Zyzc6Ot55boTR0kF+Fvql4xj2C0t8du7gXB+iyM1zbJ84mHfw= X-Proofpoint-GUID: YBAObZCsIwCGeP4AjX_6DrNwW3HdWbhg X-Proofpoint-ORIG-GUID: YBAObZCsIwCGeP4AjX_6DrNwW3HdWbhg X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Add a test case that cs_amp_get_efi_calibration_data() returns data when it is in the HP-specific EFI variable. This uses redirected implementation of cs_amp_get_efi_variable() that only returns data if the passes name and GUID match the HP EFI variable. A simple test case installs this function hook and then checks that calibration data is returned. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs-amp-lib-test.c | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/sound/soc/codecs/cs-amp-lib-test.c b/sound/soc/codecs/cs-amp-l= ib-test.c index c090498cbf78..02fb28edd985 100644 --- a/sound/soc/codecs/cs-amp-lib-test.c +++ b/sound/soc/codecs/cs-amp-lib-test.c @@ -220,6 +220,58 @@ static efi_status_t cs_amp_lib_test_get_efi_variable(e= fi_char16_t *name, return EFI_SUCCESS; } =20 +static efi_status_t cs_amp_lib_test_get_hp_cal_efi_variable(efi_char16_t *= name, + efi_guid_t *guid, + unsigned long *size, + void *buf) +{ + static const efi_char16_t expected_name[] =3D L"SmartAmpCalibrationData"; + static const efi_guid_t expected_guid =3D + EFI_GUID(0x53559579, 0x8753, 0x4f5c, 0x91, 0x30, 0xe8, 0x2a, 0xcf, 0xb8,= 0xd8, 0x93); + struct kunit *test =3D kunit_get_current_test(); + struct cs_amp_lib_test_priv *priv =3D test->priv; + + KUNIT_EXPECT_NOT_ERR_OR_NULL(test, name); + KUNIT_EXPECT_NOT_ERR_OR_NULL(test, guid); + KUNIT_EXPECT_NOT_ERR_OR_NULL(test, size); + + if (memcmp(name, expected_name, sizeof(expected_name)) || + efi_guidcmp(*guid, expected_guid)) + return -EFI_NOT_FOUND; + + if (!buf) { + *size =3D priv->cal_blob->size; + return EFI_BUFFER_TOO_SMALL; + } + + KUNIT_ASSERT_GE_MSG(test, ksize(buf), priv->cal_blob->size, "Buffer to sm= all"); + + memcpy(buf, priv->cal_blob, priv->cal_blob->size); + + return EFI_SUCCESS; +} + +/* Get cal data block from HP variable. */ +static void cs_amp_lib_test_get_hp_efi_cal(struct kunit *test) +{ + struct cs_amp_lib_test_priv *priv =3D test->priv; + struct cirrus_amp_cal_data result_data; + u64 target_uid; + int ret; + + cs_amp_lib_test_init_dummy_cal_blob(test, 2); + + kunit_activate_static_stub(test, + cs_amp_test_hooks->get_efi_variable, + cs_amp_lib_test_get_hp_cal_efi_variable); + + target_uid =3D cs_amp_lib_test_get_target_uid(test); + ret =3D cs_amp_get_efi_calibration_data(&priv->amp_dev->dev, 0, 0, &resul= t_data); + KUNIT_EXPECT_EQ(test, ret, 0); + + KUNIT_EXPECT_MEMEQ(test, &result_data, &priv->cal_blob->data[0], sizeof(r= esult_data)); +} + /* Get cal data block for a given amp, matched by target UID. */ static void cs_amp_lib_test_get_efi_cal_by_uid_test(struct kunit *test) { @@ -910,6 +962,7 @@ static struct kunit_case cs_amp_lib_test_cases[] =3D { KUNIT_CASE(cs_amp_lib_test_get_efi_cal_no_uid_index_not_found_test), KUNIT_CASE(cs_amp_lib_test_get_efi_cal_no_uid_no_index_test), KUNIT_CASE(cs_amp_lib_test_get_efi_cal_zero_not_matched_test), + KUNIT_CASE(cs_amp_lib_test_get_hp_efi_cal), KUNIT_CASE_PARAM(cs_amp_lib_test_get_efi_cal_by_uid_test, cs_amp_lib_test_get_cal_gen_params), KUNIT_CASE_PARAM(cs_amp_lib_test_get_efi_cal_by_index_unchecked_test, --=20 2.39.5