From nobody Sat Jul 25 15:51:13 2026 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 D05A5430315; Thu, 16 Jul 2026 14:27:08 +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=1784212030; cv=fail; b=HPL7pyXMJUBy5kKnoFxjejQo/lxwd2iq1jOdwm0Pp2dl0LzbttCCQeK9vVXAXn0BK+0I3kEsgM0VUpL1EOPXLWEpCsb3ZkXqJj1RSYkgADhn95eRILywBMyK6J9+lPE6oBfR490yPcxgNxA4mej6WXolMj2c758AqIPeWw/veZ0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212030; c=relaxed/simple; bh=Yx+J0yE6XGiLBZ1t7ALJKVC3mza22SQBSC+Cu3Db9u0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uAH+IbkwAfznZI1rHqn+7/mq7Au9VJtUInS+ar7Y/4kI9qJ2XbfoUw5xggIvNlX9ju0MC4zZ9nyIaYXyZcr/ZlXdAzm/l/YHKYIfW6o1VOw1J5ln9PQlVFp2ZXHlmVj8edIEv4IpKjCcrESeoisT2kqJtiUqUCFpWEub7Cu0yN4= 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=WdogF0uE; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=Nm/teU9e; 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="WdogF0uE"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="Nm/teU9e" 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 66G5sV2b242232; Thu, 16 Jul 2026 09:26:54 -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=Gd76c2J+2crz1HJKcPVOI6cQCzodIzDgHN6n+8ajpHM=; b= WdogF0uEXu/vEC4JXNdMKtT36gyC7DszX5D+xtAoTeRHX7498GUbEqU314U2BX0g MM8HKCwUN01nKLO5B6GFe6D/vwCjNjgr1cp586FzqBtOZOfpmk7nLEj2OhSWwgm6 kdvFSuQ6dl/R3OdmAFC5hFuYhotZ5lk+usztgymgF62l/tVjzKUoZsPFA02xBsuB Cns45BPduoZJYuyb7KizFKPBNamczh/PIoCCYkDamoIxwY4GwDidoHrRrTrBex7L xwQGkiEsYYT8atg+Rf26cCG9UbkmvbZ67E95wXzZOccbZIckQcUJCsGeistr/b5L GSAs6PIEp/3+4ldK1TQZJw== Received: from cy3pr05cu001.outbound.protection.outlook.com (mail-westcentralusazon11023134.outbound.protection.outlook.com [40.93.201.134]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 4fbj8fq9s1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 09:26:53 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QcdcEJ5BT3K9ynEa8Fgow7arTlXmzVJ47/i8AdltzbAzGDwO2WlQSPyhwAHf7DEPaZ4dudgU4eusI+K4Tb1dcArpTw6E0PsxgY9yqn3kqxr46E5wSo0IKk9vjMAKKyfXmJ7/kVW6UAtZbVLiXhXuqHu2e+AgTqB6cfACivflkRP/RL/xmkimfXgd4ZvX2sWvVxuygrIvY/95HVDLj6u2yHCuf+ZGkThUMbOGOo4nh7jyVvTZQpr0AG4lRAWblEWzqPBn2XFIg/g2oD0e3MMnFezYky/Nerj1Vo+NLp/fxPtGnv8wr/uSEVX5LpHx9/v+/llBLaPPRNcqpTlVcE2riA== 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=Gd76c2J+2crz1HJKcPVOI6cQCzodIzDgHN6n+8ajpHM=; b=LrpjcM+gvCaadQ82XKXelHOiJYh8PbxaFoZ45KRidCVgcCHNTWrU8H26EtggNF7FgZihuBd4g1GpIEL3NAqYHNJoP3QPVGzJc4oSmheZ5kY/IOwby/7xrdBmnmFR8xrtvED8kPFWJGLFh3VIWRzvHjZbh+8h/oAhD5Rp5FDxufy/Bb2m5SAcqEiWy1V5Kh8sNMkuRcbuDvqTQBia+TUEIJaLNCsDM/M0NeIGWUauy6tYT3wblswHoIFZm/zOVoHkrbwz3OXZHPPGRIM6ycqihfqe9DAH7+l1lLyV5l2SeHwZv5qAgilEb5s5cTvks9aoSyboJbT0xyYuPo0fno2igQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (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=Gd76c2J+2crz1HJKcPVOI6cQCzodIzDgHN6n+8ajpHM=; b=Nm/teU9eXj0J6/L6Q2jBDrfUgjAJeIkww3J+VRxKeruWE8Dt3N043H9HMeBz7PYLubIdInoz6vPGfrCsAI6wJqykaPJykRaOV2CVYFhDJxVbzq8qBywCU+MPKuk3qxdhkkPSvSfokqjmq8yuuR69c0i5iPkmQ6lKRkDH0KUWwm0= Received: from DS1PR06CA0023.namprd06.prod.outlook.com (2603:10b6:8:23e::16) by SJ1PR19MB6283.namprd19.prod.outlook.com (2603:10b6:a03:45a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Thu, 16 Jul 2026 14:26:45 +0000 Received: from DS3PEPF0000C37C.namprd04.prod.outlook.com (2603:10b6:8:23e:cafe::9) by DS1PR06CA0023.outlook.office365.com (2603:10b6:8:23e::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Thu, 16 Jul 2026 14:26:44 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (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: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF0000C37C.mail.protection.outlook.com (10.167.23.6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 14:26: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 06868406542; Thu, 16 Jul 2026 14:26:43 +0000 (UTC) Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.12]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id DD8B782026C; Thu, 16 Jul 2026 14:26:42 +0000 (UTC) From: Charles Keepax To: broonie@kernel.org Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH v3 1/4] ASoC: Add a component fixup_controls callback Date: Thu, 16 Jul 2026 15:26:36 +0100 Message-ID: <20260716142639.2306757-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260716142639.2306757-1-ckeepax@opensource.cirrus.com> References: <20260716142639.2306757-1-ckeepax@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: DS3PEPF0000C37C:EE_|SJ1PR19MB6283:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f20fc7d-ee97-44f7-2e70-08dee3464311 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|82310400026|30052699003|61400799027|36860700016|18002099003|22082099003|16102099003|11063799006|10067099003|56012099006; X-Microsoft-Antispam-Message-Info: 3uqpD+40XSvUjuUQryaT7hGIB/S2LH5JRq0YxTLW5wgm6hsz/DnLoOnMTut/JrYLwXVXn1sO+Tj+BYLuJ58330UORt2j03HEPhI3lTALDulo5PzJP3jZs31zxEZzYu+I3oMyRfM6C7E6a3rdx+lecC/DR270S2ICj8+NmuHt6oVYjRWYFeGSTLmRVn9ssaAOp2Trd2ewjhzAtJI7S0YQO+mGCigBRVlLUJWz3/FKEzXveCY2REynZL5nwQeUAPAjvEIn1VdOtYhDuP39f188sUcGA5b0tDCWw5HYPU8TNqzaP1qzVS7R/wcMgEYCQrYjKkJyTuPwZPJg0GCWOCO9DV3VjStTarxomBnSZLf50gUHLJdBCL8LEdLtZyJ8cSXnYYJfhE2zdJs6vbDEJMlS0XRRc6Y2ioijIZykbyaSJVJaIFiTSpE6Vs/ek0vv5/95eoKmpm1i290TDfPTr8dcQh1L89znkU2S8UAmd19RkfUqTvdrk1PDDOXxAftjnRmBcsiNjCaZvIO2RQ5mzVOKZDadJTfxWnOLhtifkjldLsELXu7+t56qmm10oJClijsN0qzfi158jNsf+CZfYB2Sc0yAmVz9KOs6/3BTgoqZy/IlaRfRfbWaZbppQdJAwShyEmxGXeNzgXWV5P/Wag49oAdhSJlob9rrCl3t7WyYs1pB6LWmtcxY0L9KgHBoMpqNELwZvh9lozGLU1B87GUijA== 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)(23010399003)(82310400026)(30052699003)(61400799027)(36860700016)(18002099003)(22082099003)(16102099003)(11063799006)(10067099003)(56012099006);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DnY73cweiXipMr95RloUoicvqCIsUj3Wj6m4Q6UUAFPht089NsVWxailHk0fHI5bOLW6CYT9uG4t1OzCRiSikhzdo0aLVJrzjdw46hDiqHvyJw+jMnntuWkSETRRs1N87OXrPD+KKq5pj17Oz4vrDwzFtMpSGlXYoJjvGCz+Oed7l21v15R+PZnVg4/klIpAaqCzVwR/j6ku7Yxa+u8+OnDEzCqCT5dBV6yE6KdN07K78SRhdepLjL0jpVj0Oa8KGvENZ5Nv5VuGRDI6yqDhZm0UQa2i4Fg9hAD/j65//EvjeiIVrK9ClOyQuI6ZKGxXeJHzPs/dK3QQRgqczVihmX0yV//+RQnX9ctR/YHxVAOts1CGlb/tJAnIzYr/nvHNVNXVWbSRxx+fpaxMHGipx+gjlSyznUmgLFu4f/iwNFpGpjuEY+uVYX8Dis9LiEl+ X-Exchange-RoutingPolicyChecked: V/J3SNfiWIUzoefLO8he8ygrTJzgOWDDEi7dENpWydTtlgY4evaDD0ZY8mEs6rAMPfNPIWmh8Mp/kc7Mo/mFl0GdQXhibB3ecc6iMW8Fx2uBohMWOTBxjpmvuev/yrKchtm62XpHmdZSiM8MWKUB9fe+iAGbtwaMHUGb6vkdmBsMKbd14ui73l0iSJU0CfB0/a/53L172Frr81BO541TifIJiyK0Kdghihe1O5peAM/EoxwLck2mqV4elmSYh47tZKsILMv1+vBQhBf5HP8EU7iZp3w4al+ujgvAO9aa8gZsVWGUpVwoY86UE/E75GrQskcE3lH/fkmgJ7D+TcQwnw== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 14:26:44.2841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f20fc7d-ee97-44f7-2e70-08dee3464311 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-DS3PEPF0000C37C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR19MB6283 X-Proofpoint-GUID: oww3FdfG0SdnmgTC68Qj-4ozpRxIQwDA X-Proofpoint-ORIG-GUID: oww3FdfG0SdnmgTC68Qj-4ozpRxIQwDA X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfXyLujS2f5QfxU WwFgnidZS1SFzf0qZr3UiftmrZL2W6NXJITzLQrF5e7MBt3fGhUWLuxb9+2jQ0iKEkd/FZbuUNL iNa2BocKdXFvS08Tr5SFBUQF/7azSRU= X-Authority-Analysis: v=2.4 cv=M7597Sws c=1 sm=1 tr=0 ts=6a58ea2d cx=c_pps a=kguG1nR2ma0GTtLk2h9wKQ==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=RAioF0-LDSMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=KfkQE9S9VqCBgivYGm0O:22 a=w1d2syhTAAAA:8 a=z9ncmWt8M9pI67tEN-gA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfX4snBDgb6Ml0k 9SnP+BWj+Wzqe6j004TAI6ju93wgkgu+dL7JrxdChZTonz3o507S4KePIz07XmXGGrGF5nDlgdd iB9zyptBY6TL2ovSfB0JbshxAhTcA4laZYgBqwoQNzGMENChC/EXC+kidTHylDzRcHssBrxmAoh FdGI7Stmi9ZeowiH2VoqGRX35UldBk4GbdakZDbOILn8vq1uAtv9W15XJHbMkV/wcrdZc0tu+tK PakqmkWAJiUZYnMNWWQe7RsNiJTxdLIY9jO10UrotFV/9slry9dxLBl+TCeY7a55kb1s3ZhKo74 ros0cnKW8aHBztfxqw5n3Pz36iRz5cE2Xmxq7EvdZVN1LMWkBsy3oksnVcSfET+TIBPP1X+FEad ebJl1pFLzhiCdNdbYZlb4xFIFpea/JUhSc4PCW8hY5RzfuW+cyJt53a3JZ8T8jlkd8MSr7c7hMw 4yqdwHZ+84/iRfUOYhg== X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" A card level fixup_controls callback was added in: commit df4d27b19b89 ("ASoC: Introduce 'fixup_controls' card method") This allowed the machine driver to take actions after all the card controls have been added. However, there are times when a codec driver would also want to do things like obtain references to controls for later use, which require all the controls to be present. Add a component level fixup_controls callback, echoing the card level option. Signed-off-by: Charles Keepax --- No changes since v2. include/sound/soc-component.h | 2 ++ sound/soc/soc-component.c | 10 ++++++++++ sound/soc/soc-core.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index aa423865dbe7c..4b7d7954953db 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -78,6 +78,7 @@ struct snd_soc_component_driver { unsigned int num_dapm_routes; =20 int (*probe)(struct snd_soc_component *component); + int (*fixup_controls)(struct snd_soc_component *component); void (*remove)(struct snd_soc_component *component); int (*suspend)(struct snd_soc_component *component); int (*resume)(struct snd_soc_component *component); @@ -380,6 +381,7 @@ void snd_soc_component_suspend(struct snd_soc_component= *component); void snd_soc_component_resume(struct snd_soc_component *component); int snd_soc_component_is_suspended(struct snd_soc_component *component); int snd_soc_component_probe(struct snd_soc_component *component); +int snd_soc_component_fixup_controls(struct snd_soc_component *component); void snd_soc_component_remove(struct snd_soc_component *component); int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component, struct device_node *ep); diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 21492d15833f7..2ce24513fac5d 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -310,6 +310,16 @@ int snd_soc_component_probe(struct snd_soc_component *= component) return soc_component_ret(component, ret); } =20 +int snd_soc_component_fixup_controls(struct snd_soc_component *component) +{ + int ret =3D 0; + + if (component->driver->fixup_controls) + ret =3D component->driver->fixup_controls(component); + + return soc_component_ret(component, ret); +} + void snd_soc_component_remove(struct snd_soc_component *component) { if (component->driver->remove) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 7817beea5b3bc..44f9bb4473f55 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2162,6 +2162,11 @@ static int snd_soc_bind_card(struct snd_soc_card *ca= rd) goto probe_end; =20 snd_soc_dapm_new_widgets(card); + for_each_card_components(card, component) { + ret =3D snd_soc_component_fixup_controls(component); + if (ret < 0) + goto probe_end; + } snd_soc_card_fixup_controls(card); =20 ret =3D snd_card_register(card->snd_card); --=20 2.47.3 From nobody Sat Jul 25 15:51:13 2026 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 592584302E1; Thu, 16 Jul 2026 14:27:06 +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=1784212028; cv=fail; b=Z/2Yrg6A1FT4FwLRFgsb7cyltwl+hpsLtnMPxEQ4hl8wrdjRnmW71lcMp3SiB1YXYsgCSrk6mbCjIXNCzoF3aD1bq+nl3+Quh1jwdrqaSuQYFCW2VpEednlevc2tzKceOUqKVGrZ/NcgwOuacETzmW+3PZxmnHxI3rm0bhX7KJM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212028; c=relaxed/simple; bh=zYi41jIcYpo6SoKSQ1uTUyT6ESvzF1dlnl71CaqwuJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eOy0Ky3rj7pPp97rDaaZRqzaXcrXLvYfNm9PrpiZJ4e9W980DUWc4JF+jCkZqXmm3fzvfGwWR+tr7agfhDye5S9jHmhvGosdYBIk8Anm3h6GV/bHxMJmL9tAcwYtg/fCMIbjAWLlF9xECb6svVW01cMVr/Ubuw2YhjY975Ba048= 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=JikKat/n; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=vqno7BYm; 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="JikKat/n"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="vqno7BYm" 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 66G5sV2a242232; Thu, 16 Jul 2026 09:26: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=S0JCv2MdJqsLJbuNWod6Rp9DXkexzLs+Q6eWqqwilwY=; b= JikKat/nSYHl2rKhZwrdMbAl906IiMpy+A/5JAoX8IAgMZ/yBVvD/X6M+1JqocuN lhnaKAz+8Az2QnWf7vITAAR6LANcMpAIzk1lLYeukJ7lbZLIDtLrwXrIuO1F42qv +EC9UW3QdCgQH4e8G2aP/dGLPktnATIOc/6A3N0RiQWoXIxsq0sXfM07RPnXkJeJ S12TYwr+VZbsxpkNFvmS9Jc8iUA4TZKaUdXQTqIPXXkHuFjwtA4psIW5hVaSVTFN m8CZNPvO0oreaSgPXRCLCFkgriqxVjw0sOLY1h+XvqD4QuEkZ2xXQ4ihvZdlWRPa e2cZpDN21sd5rkt7L4JxgQ== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11022110.outbound.protection.outlook.com [52.101.43.110]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 4fbj8fq9rt-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 09:26:49 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hejyG56G1zcA/wmQubKKlBdrTAPdPN+r7ptzENgaOHYmqZ1dWzONXYb4pyMxhEgguz+E3rUPPBnyuyZHs99ZJMdGutgFmgzcaB6x5rBEocqzPxiKTp6IDf4gNOulKA+3XbMtTADYZM/UZZHzQiV7nLsPzoD68JY8QIyhU2+Qia+bw6rZDnmIW+gR5x2h4iOEWcu/JmJftupeEybvtiX7uyrJz2JG5/Xp1J/o04yvx+HsYkqsru1QwPUAwcpkzvK8eLPhf4JPVG+c/DVvrv6ppIlf5ZD62TVYFZH2gBeiNGY8Ea0KKlc1O6utZeHUGpStDz1/oIZfr6Sxrcsr8CpwHA== 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=S0JCv2MdJqsLJbuNWod6Rp9DXkexzLs+Q6eWqqwilwY=; b=FtfLWrFL8v+QY/JqSWtJYUi0eDcb9xOchbJO0HmVekAJ9tY6JFfiRqgxI3d3+uoG+6rV78alhT4Vc5QEzgHq3G6OphJNtyJXYGBn5gL4E7/q82agXzkAKbEqckk7Xe1odbpe3AtkeySVqzeVK7ZAHkUAEalsqGFfgmYdvZ99bbr5wxnxIb89O46wsFbWjwQHXdmGjWaKWP6MVaw7soZvu6+g0LMYLx2/QChGRvSxV6l6djzHHCcBSQP9DNmshiAXG3Gly0v2i74xgL404hLtLx94Dld5vXE0dcbeuAnITkqz8Bizqx1ApTIxvcXVi3FSfA0MdCy2ytCyw7aarcHvjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (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=S0JCv2MdJqsLJbuNWod6Rp9DXkexzLs+Q6eWqqwilwY=; b=vqno7BYmRug2dt5sKgTsCTATa9NNQwNx5iSPnhXnJmf/Mqt158z+xiHmUT2KLx2fbM+QQ6/LKgZk29PJy7gytUqJqJ720ApgO6Jj9fOYUu94OKAw1puSZkHfN6XQE9ZgWwG1q1A2PaeHegTzr1D+1qvulfHryLM4aBxjwe8armk= Received: from DS7PR06CA0007.namprd06.prod.outlook.com (2603:10b6:8:2a::25) by LV0PR19MB9646.namprd19.prod.outlook.com (2603:10b6:408:31f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.10; Thu, 16 Jul 2026 14:26:45 +0000 Received: from DS3PEPF0000C381.namprd04.prod.outlook.com (2603:10b6:8:2a:cafe::8d) by DS7PR06CA0007.outlook.office365.com (2603:10b6:8:2a::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Thu, 16 Jul 2026 14:26:44 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (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: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by DS3PEPF0000C381.mail.protection.outlook.com (10.167.23.11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 14:26: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 06911406543; Thu, 16 Jul 2026 14:26:43 +0000 (UTC) Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.12]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id E02B0822542; Thu, 16 Jul 2026 14:26:42 +0000 (UTC) From: Charles Keepax To: broonie@kernel.org Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH v3 2/4] ASoC: SDCA: Populate IRQ data earlier Date: Thu, 16 Jul 2026 15:26:37 +0100 Message-ID: <20260716142639.2306757-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260716142639.2306757-1-ckeepax@opensource.cirrus.com> References: <20260716142639.2306757-1-ckeepax@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: DS3PEPF0000C381:EE_|LV0PR19MB9646:EE_ X-MS-Office365-Filtering-Correlation-Id: 51f4de72-1e41-412c-ec44-08dee34642fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|61400799027|376014|82310400026|36860700016|10067099003|16102099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: DfC5eZvpQ0NqN7QpGANLmefh+at1Nto7LsBbEkfU4TiqFPF8ZQBVOQaQxlFL44SZJYU2k023+eo5zPi0HlXidtVmD0oV7xugmOYsYLPrVmjqimNMmf6j6DABZDx1kBBwkfpAdCBBOlUxNwPIyWOD8UprOPWU6mnP9SjK+CH7AIgJmZPfXflJt4+I4xYfOfTBnl0NNprmgs0hWq2PO3VqOnfRvFh41Ru44exZ0iI2bgPLKW7YA3Gd5dXjVeXJrRsX5R8c735nYR0vNBc/B7LnBxMX/oqYFN4pkEKOupjem0UG6JBad/t8HksDgXxFbC65yWTdUeF8apwUvkf9Zu03J4r33KOucUFt7v3RWp3gxMtmFDpeyt54xKVbaeMeTCO278C3aL6HZDeNbDcrBUGKM378pZi4I9RDYpdgTG9BgJak8GK0xFAGSLkuQWEIJkv5T654V4zQBlB/psDPTFbc/MYn7NxMEV7IPKxOkBeph5sb+U1dbKnGyJNZ2HptkOqEFVuVBDu+QBSPTxaHRMNSDEvvFBX8Z8h3c1STSzPhtbP9MRtOAadutPFRUN/NJ67WNezK5Xt0ebPXHKFwMp5fj9Ja6ir38dVK80Np3antLXxmDBvDJViE0vjeWT8BZtCUVQ2cNqPFe+/Oi5aGOahJvsrl7by+28FxCrBHTtMdh4d+b0ncjKJWhqnQyksb5GHBy92MKQ3cb7T/SvdzWGiJqA== 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)(23010399003)(61400799027)(376014)(82310400026)(36860700016)(10067099003)(16102099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 227k1rSM6jrWKMYj39sMKISlHjYlH52RS6DjdcT2iOLuE0RpK4NdQXzKGk/RBqK+PKrOu1Oyb+skkKs3eIDSpZYmMIT7huHBFvr4wSKk/EZszc1s8Y3mRAdD7saNX2aBvfDYAFZQ/aH0kl29hqVLNftxKc827qYxCnUpXpb0is3XFP4M8KRGNfMloHp8m46DPaaBzHNGKi6ZvANa8XH7lm3TmD+yNrau9yYFkndFsJCgmr9o7a5PiHYNYhv2ZkYbvFmbfluWd8a0Ly0qX0kfQOegxM7+as96QIuF1O/j7nlAccpFCTKN6CFR2wb13u8BSeNqjLdjDEyIz9ES3mtGKg7tuY3K7n1rD9hAChQUg6CLJwHw2vb+EGWtw0/PVJ4sxvbFhwMEDGJ5Nvs/7KolVv+k7ThovjsPXBGeLtUWHF5DWRiAgOMAgAvZ08K7ar2h X-Exchange-RoutingPolicyChecked: MtlMAJBJJgxKRoraXBeWnqNi/omGFWo7VLuOomu4Qz3uzQXyldji9kb/nHcoSYxNT+siQMH+1j7Hz94a2hKD40gVrmoF7OABzBALVZmpWPgQJBJCsg1PaGU0of7Z5V3j8WixzW22DWSsOHGBZlvotfCbPq7Sx2Q0uTuPlKZLR7sYcZ0GWUD2gJjK8f48diwhJLr/mRRkALek+ZhUgw5Cd/aKQIF+wD7M4W8UKYEA+c9tVtPUlVuCKQSlriU/LEGuqvurLlhC5SK2cHYCZVA0r9unF+3OyvLRRIqH9TlBx+w4ZzvCuguAJLVT4T+wdrTyY+xspRwwp/6o6hfR/DGfDw== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 14:26:44.1385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51f4de72-1e41-412c-ec44-08dee34642fa 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-DS3PEPF0000C381.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV0PR19MB9646 X-Proofpoint-GUID: kXhZlbdQuwHAJJuuKQTuZbT2kDifSyYc X-Proofpoint-ORIG-GUID: kXhZlbdQuwHAJJuuKQTuZbT2kDifSyYc X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfX76uEeBeMtpmx Q3QBjHq/zxUjUXB0saU+azFKAjMtf8bThrqWXc9THEcQX6t9670NodQz9IaJrp0z98hjAXhCnJ4 kR0Tj8OR6l1BWOr2/5yVayygWSU/eeg= X-Authority-Analysis: v=2.4 cv=M7597Sws c=1 sm=1 tr=0 ts=6a58ea29 cx=c_pps a=R5lJJwLUw69E8voCr07FQA==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=RAioF0-LDSMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=KfkQE9S9VqCBgivYGm0O:22 a=w1d2syhTAAAA:8 a=5JuS2gtCSTrAXiciZ00A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfX83F+xD24P3yH Yvnv8OO+pbf1QgVlbVHpUlZagsH27wKfuSq2Ec7WWXciYemufzQY7VKH/FMAS6keO8JMYIeFMpg UUE0x+UV27uqoeWcHKOVcTyM00J3w1WAB7YzB7mHcSeMmDvbCsG0JBO9PWLBiasn+qAxmXzNjCz JTTzgfW8KmCCGa5vsrQaQZg6gC5L8LoNPXlbS6HqXbDIX8dQqTAKFfcSPWVYbt9FMomP0YL/Bk/ JR75xkLLRcpAkYCb+N7yXvGBQETpYS47mzDaP5S/3FoFiiv6cLOpjaWvZE5fncS/d0lKAqwilAO aY6uM8ORpwrPMbkMzL60vJpU6NuZKe2bXHDPbDCVralokx7gmsn6jJnyrd8BG7fCzBYEcXVMDIt o1MCcv5ote1M35/gUlELYum6etTJA8isTmQZ1pOIk10/txbf8Vq+zp9CeUug/Cg4FrQZBUdPYg4 lkrZdcveCuWVDJI//Ng== X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Currently, the IRQ data (attached Entity/Control/etc) is populated as the IRQ is requested. However, this can cause issues as occasionally the setup process wants to access specifics of an IRQ before the IRQ is actually enabled. To facilitate this cache all the IRQ data during sdca_irq_populate_early() and make sdca_irq_populate() simply request the outstanding IRQs. This also has the advantage that sdca_irq_populate() can now just iterate through the IRQ array which is much smaller/faster than going through every Entity in the Function for Controls. Signed-off-by: Charles Keepax --- No changes since v2. include/sound/sdca_interrupts.h | 2 + sound/soc/sdca/sdca_interrupts.c | 98 ++++++++++++-------------------- 2 files changed, 38 insertions(+), 62 deletions(-) diff --git a/include/sound/sdca_interrupts.h b/include/sound/sdca_interrupt= s.h index a515cc3df0971..20ff5eac34eaa 100644 --- a/include/sound/sdca_interrupts.h +++ b/include/sound/sdca_interrupts.h @@ -30,6 +30,7 @@ struct sdca_function_data; * @function: Pointer to the Function that the interrupt is associated wit= h. * @entity: Pointer to the Entity that the interrupt is associated with. * @control: Pointer to the Control that the interrupt is associated with. + * @handler: Handler function to be called for the IRQ. * @priv: Pointer to private data for use by the handler. * @irq: IRQ number allocated to this interrupt, also used internally to t= rack * the IRQ being assigned. @@ -44,6 +45,7 @@ struct sdca_interrupt { struct sdca_function_data *function; struct sdca_entity *entity; struct sdca_control *control; + irq_handler_t handler; =20 void *priv; =20 diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interru= pts.c index 4539a52a8e32b..6bbe65ac3d2f0 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -375,7 +375,7 @@ int sdca_irq_data_populate(struct device *dev, struct r= egmap *regmap, if (!dev) return -ENODEV; =20 - name =3D kasprintf(GFP_KERNEL, "%s %s", entity->label, control->label); + name =3D devm_kasprintf(dev, GFP_KERNEL, "%s %s", entity->label, control-= >label); if (!name) return -ENOMEM; =20 @@ -448,21 +448,34 @@ int sdca_irq_populate_early(struct device *dev, struc= t regmap *regmap, else if (!interrupt) continue; =20 + ret =3D sdca_irq_data_populate(dev, regmap, NULL, function, + entity, control, interrupt); + if (ret) + return ret; + + interrupt->handler =3D base_handler; + switch (SDCA_CTL_TYPE(entity->type, control->sel)) { - case SDCA_CTL_TYPE_S(XU, FDL_CURRENTOWNER): - ret =3D sdca_irq_data_populate(dev, regmap, NULL, - function, entity, - control, interrupt); + case SDCA_CTL_TYPE_S(ENTITY_0, FUNCTION_STATUS): + interrupt->handler =3D function_status_handler; + break; + case SDCA_CTL_TYPE_S(GE, DETECTED_MODE): + ret =3D sdca_jack_alloc_state(interrupt); if (ret) return ret; =20 + interrupt->handler =3D detected_mode_handler; + break; + case SDCA_CTL_TYPE_S(XU, FDL_CURRENTOWNER): ret =3D sdca_fdl_alloc_state(interrupt); if (ret) return ret; =20 + interrupt->handler =3D fdl_owner_handler; + ret =3D sdca_irq_request_locked(dev, info, irq, interrupt->name, - fdl_owner_handler, + interrupt->handler, interrupt); if (ret) { dev_err(dev, "failed to request irq %s: %d\n", @@ -470,6 +483,9 @@ int sdca_irq_populate_early(struct device *dev, struct = regmap *regmap, return ret; } break; + case SDCA_CTL_TYPE_S(HIDE, HIDTX_CURRENTOWNER): + interrupt->handler =3D hid_handler; + break; default: break; } @@ -495,66 +511,26 @@ int sdca_irq_populate(struct sdca_function_data *func= tion, struct sdca_interrupt_info *info) { struct device *dev =3D component->dev; - int i, j; + int i, ret; =20 guard(mutex)(&info->irq_lock); =20 - for (i =3D 0; i < function->num_entities; i++) { - struct sdca_entity *entity =3D &function->entities[i]; - - for (j =3D 0; j < entity->num_controls; j++) { - struct sdca_control *control =3D &entity->controls[j]; - int irq =3D control->interrupt_position; - struct sdca_interrupt *interrupt; - irq_handler_t handler; - int ret; - - interrupt =3D get_interrupt_data(dev, irq, info); - if (IS_ERR(interrupt)) - return PTR_ERR(interrupt); - else if (!interrupt) - continue; - - ret =3D sdca_irq_data_populate(dev, NULL, component, - function, entity, control, - interrupt); - if (ret) - return ret; - - handler =3D base_handler; - - switch (SDCA_CTL_TYPE(entity->type, control->sel)) { - case SDCA_CTL_TYPE_S(ENTITY_0, FUNCTION_STATUS): - handler =3D function_status_handler; - break; - case SDCA_CTL_TYPE_S(GE, DETECTED_MODE): - ret =3D sdca_jack_alloc_state(interrupt); - if (ret) - return ret; + for (i =3D 0; i < SDCA_MAX_INTERRUPTS; i++) { + struct sdca_interrupt *interrupt =3D &info->irqs[i]; + int irq; =20 - handler =3D detected_mode_handler; - break; - case SDCA_CTL_TYPE_S(XU, FDL_CURRENTOWNER): - ret =3D sdca_fdl_alloc_state(interrupt); - if (ret) - return ret; + if (interrupt->function !=3D function || interrupt->irq) + continue; =20 - handler =3D fdl_owner_handler; - break; - case SDCA_CTL_TYPE_S(HIDE, HIDTX_CURRENTOWNER): - handler =3D hid_handler; - break; - default: - break; - } + interrupt->component =3D component; =20 - ret =3D sdca_irq_request_locked(dev, info, irq, interrupt->name, - handler, interrupt); - if (ret) { - dev_err(dev, "failed to request irq %s: %d\n", - interrupt->name, ret); - return ret; - } + irq =3D interrupt->control->interrupt_position; + ret =3D sdca_irq_request_locked(dev, info, irq, interrupt->name, + interrupt->handler, interrupt); + if (ret) { + dev_err(dev, "failed to request irq %s: %d\n", + interrupt->name, ret); + return ret; } } =20 @@ -585,8 +561,6 @@ void sdca_irq_cleanup(struct device *dev, continue; =20 sdca_irq_free_locked(dev, info, i, interrupt->name, interrupt); - - kfree(interrupt->name); } } EXPORT_SYMBOL_NS_GPL(sdca_irq_cleanup, "SND_SOC_SDCA"); --=20 2.47.3 From nobody Sat Jul 25 15:51:13 2026 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 988EA42F700; Thu, 16 Jul 2026 14:27:00 +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=1784212022; cv=fail; b=SLI/b1poyc3U09TesqvMQ66dNmp9Fia8hM5LjuyVSv02P2TCerNknwpRxqUe4vZhuOeGGb4EGB1eBYsDgwGd8FePG+hXILwipeJ5LAIAXqvLEO2QMxypcPtrvvSCNdc3cjTu5QtdzryjrjoTxOP7AHKF92H8WyMw2D7XzVBo7eA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212022; c=relaxed/simple; bh=kZ4UVDgbla7otr9NoCcqQAIQt254X278kmn65dbWvcg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n4IMRKA+1OM1gdaafxAaMjo0QNaQQ8srFbokoONxAJHuGnNMWIXDHl1smMzZZjrCzjAzsFDC2h+/zqfb28Fsp1r/s77d0URYkOpiyAlzbz2E9VmSJl08Csh8rjM68x6EHoxXWtgBKtIUXbYpjV87dg2T6GF+TjzPS0LSSzmiSYY= 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=QQX9h+jc; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=uCYTox+D; 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="QQX9h+jc"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="uCYTox+D" 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 66G5hiPi2757981; Thu, 16 Jul 2026 09:26: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=eS6wLM91HkwakcFXjKkN/1xO/wsjh3RkRV08G4sOLA0=; b= QQX9h+jcRNwdW2SsGJDdC+cHJ0PUi60cKyZY2pcw/dz0nsCIfwhA+CI8mqIh/E4O jJMzOi3IpgEhHoAO3F6ScIEJ111OyHrdt3BWRmhpjwg4AJ+yF/xJwI1NqEuDs4ZW 9e66g5ypxoUa6pnjcLhC/kLe+P+qMtvUN7ZhfptvH7q28NSpsneqeSMVlPnmiHhx fN5za8+00HKPHaaGgfGcjrz9u1YniCjLglvhYYVehz7m+Z2DLxOBpJnGg+F6nRJn DeCCVwbU6jzYsXkVcRTOE6ZTXQA5WKd4JzlSajmpn/ZStYOtS+4hlfcoium/707L P02iAuFEATHXsGz8gHEy/Q== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11022073.outbound.protection.outlook.com [52.101.43.73]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4fbk7vy9r1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 09:26:49 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IVBNUZSOzhibSB9q4ucFMmCzzJVxDFSYUkrkAhTV60gSOcd0dNK0PNlAqCaOmm/EcesxbR+Ki4Dnl/ASLqCKGzTlv3hYdWYMWsKBZJ1dA98n+c38y1chs+B67YE/qygYWOQEELdq6okQoXoUjx0Kjkh9OCXvrX1IDxPl5glv3uA+buTgjtNWFQ0vAjcd1FppBuQoC58GdlDOXH5ydQAFiLlqG6rsK5SnB9YO++VVCFW641F7w2sF9Oy6qtv0p0QjONvIVwlTVMSIh1Hqu2OAAvcmpmurDg1KVLOlQ4rSp/izVmTr6fMHhQibi6ZqMRfvu4l9P7PM4Dj4itJ6mzoB2Q== 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=eS6wLM91HkwakcFXjKkN/1xO/wsjh3RkRV08G4sOLA0=; b=D6xYHORfmGxm5Xv0bSi1U8iT7KimDwPbJaUSejRl+HytKiT6cMOviT+mooo99vjVhiD/XZT8SeY1423JKWOykXYi77OjELCAMas1d48o6B1/lGZ938tqsl0rdQFkUcd0FSPzalitBwj3FEJHL9dC8G3J9GznD/xy4um6GPDmgOSrCJFtv2RfbjgvjhuwP2mldaRYrMdW4IUY+4VQJ7Mp9ziEjfRfI8uFPzmOy3TUsNkDJlemBxTOP185cnlZaV325wsOM3TFyzIKFFFw3cxunG40hA5rfIIZZANPwck7ZM7Z8j4XKVQNOjSdcF9H/ITkxkSR21BU0nvDmzeiGYOYAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (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=eS6wLM91HkwakcFXjKkN/1xO/wsjh3RkRV08G4sOLA0=; b=uCYTox+DmNDMN1/x1P+6Z+dbRzpWkfNcE33/47S7qjcbdtQgPDZToJDdMRT3kNI+tVMP1Mlt33o3mOWirRfE4DjQin9E8AVnTbkEnNDU5LRO98IdK+L6WsgOSkSM3s1kQR0rJBovJ/2k791T5HrWcrugkBKQDpFOb589oPK1H+8= Received: from CH2PR12CA0006.namprd12.prod.outlook.com (2603:10b6:610:57::16) by LV3PR19MB8668.namprd19.prod.outlook.com (2603:10b6:408:274::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Thu, 16 Jul 2026 14:26:45 +0000 Received: from CH1PEPF0000AD79.namprd04.prod.outlook.com (2603:10b6:610:57:cafe::76) by CH2PR12CA0006.outlook.office365.com (2603:10b6:610:57::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Thu, 16 Jul 2026 14:26:44 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (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: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by CH1PEPF0000AD79.mail.protection.outlook.com (10.167.244.57) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 14:26: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 0A32D406547; Thu, 16 Jul 2026 14:26:43 +0000 (UTC) Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.12]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id E312B822544; Thu, 16 Jul 2026 14:26:42 +0000 (UTC) From: Charles Keepax To: broonie@kernel.org Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH v3 3/4] ASoC: SDCA: Add sdca_irq_cleanup_late() Date: Thu, 16 Jul 2026 15:26:38 +0100 Message-ID: <20260716142639.2306757-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260716142639.2306757-1-ckeepax@opensource.cirrus.com> References: <20260716142639.2306757-1-ckeepax@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: CH1PEPF0000AD79:EE_|LV3PR19MB8668:EE_ X-MS-Office365-Filtering-Correlation-Id: f180132f-1f50-4564-99c4-08dee346430d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|61400799027|23010399003|376014|82310400026|6133799003|11063799006|5023799004|56012099006|10067099003|18002099003|22082099003|16102099003; X-Microsoft-Antispam-Message-Info: sDYARbLH3OL7kQXHBQHfF8JvMl8x1YpI/UyBBA1p03fHqZrwPxzDg9G+XUp/IdkCwmwZo1zIWT0ct2T7qUBKMgqwHWRrXXMKZp4v9M93hDQKEkik3yZP32AcVIohHr8viVDprjFsH4gLr3XhzYVUXrV2P7lNJRkm2o/IZlOC0jIFKjTdJ5ZQP+LuOq3a3r0pjqFnYhUuYFqDsr76X09ZW1SqAZPyov+8YR6lxkwY2vAqdHoSpvI0pTdaEQ3F0fdfQHngO5irA6VORpANWw6BHqkd9q/n7hW6EE9VibL1ZdXYs3gTvYwedESZq/3FazkAWwobqfjxuBoxJmE7f3Gw+ed7iXBriXFzZ4gYCCmoiVqisfUmhnOafSr1II/ISlnXS4XQaKCuG98x2zOYw9AEcj3QOJ9uYpoMBs0qxXrXO9de2UApzbWPCYTx0VS7r+cwMmh9agamJXRLWz42M+Lz8nKO6tsLXzOgR8FL2kDGw8BdHyIvsKlPLox/Spl3YUSyAZb8/tw6fhvF1k/BUg9btj14C6tfbcHLdVVqIOvMgAyC9zv+gcWR/YmUgREiWbVxqoCEWBVUDy+4aMyNtOIgmjx/QAmPwwgybqEAVEHyN8CCyPp3zUEnDeeWBWL0DWxdQur/7ygt2hY/HutXDPh+UVVzOPHH+VYO/opv/BH9SSpTm6QJIJ4bb/JDBUCaLjkxTaSFdTu6RCxE2XXwQPhf6A== 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)(36860700016)(61400799027)(23010399003)(376014)(82310400026)(6133799003)(11063799006)(5023799004)(56012099006)(10067099003)(18002099003)(22082099003)(16102099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GXHXGvcmhg/inuazfF1HINcpUxYizpHDrLF32H5yfN9mfxexow3kFAwzEpBx+Daqpn2NpaHjbhqnoREKzOlKoVGbvVUK2V/uNP3RpfD0YflTHi6fXNu04HDPNW55u0hLf/KixVXCsTKxW8wJB6Gumi6zm6RZcDKgnuBneQTdm026jVT9UTTIgLN7e4IbnCn5gZD3Yb+FSoiBu1Z0EerWbivR/LASv/dsrLTDBrpLEhuQKXQ6DwxUKi3DGBWnYx+qe3c8A0fp6rvTC97IkcU2hLw/rkG2Pv7HqW1zyF6+jEQSgrtXhhBilfQIbXWkqan3N9CPZtIWpUtgjDy0+hUEtTlO+4qUO4feqS2HmDwskZbKnofUXkIOxWuc67tCw7zRbv6dtPCTfQhObPwt689WKAcPrLWmsJSOmlb5y5ORG1HQ6zl0jj7a1coJyvd9p4Oj X-Exchange-RoutingPolicyChecked: FkW3lX8m1bK91sdMuFednsHb3eG8RZ2Z9DKbWq8uZtwEFnHUQkAlug42nWywramRKU3KboSP8ZX6DdtTHdtc/JQhHymHcqCq2puTy0SqmbTs45+DdH9LANTkg7YC+zbRx8zzAsVDJl8keO8u8Z6LW+s4uVu9ZNjqIL6CkHWcW5KNnbmEG8JUszl4ISK6XBRfKl3S6DT5BMGB16SOuw52GNBYNsvthBwR5z02vXIUjYXKXwaZWUxIixhowAAwHl8Jx8h7fXXlEXW+ppaRDpH5FjhMk7MFXpZfYezRiWXMO8oh9eT+BqCPTl46flQdiccorTT50NDVgYP2iXl69Qz5qQ== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 14:26:44.3011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f180132f-1f50-4564-99c4-08dee346430d 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-CH1PEPF0000AD79.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR19MB8668 X-Authority-Analysis: v=2.4 cv=V71NF+ni c=1 sm=1 tr=0 ts=6a58ea29 cx=c_pps a=rss2Ezl/rPWt8HBHL2MHqw==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=RAioF0-LDSMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=XKGCx_0LT0-6ilDT8okA:9 X-Proofpoint-ORIG-GUID: r3dUDsmf1-Lh9w4g2yZoURECfNXz5JSE X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfX1ODwcMekD7jz NVaOxZfe9DM/k8UeQoTBoBh9//trx80+DtUbEjV8U1XrYWTew5d8NbvNcC3dg0mNlRNwUomuTHh 5b0K/AkBPmiGOuPfB2S2+ajUrH09oIw= X-Proofpoint-GUID: r3dUDsmf1-Lh9w4g2yZoURECfNXz5JSE X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfXyDl1s4mlLHC6 +RZo+G9eVTUgGLLjNDK6I1WiUzOvJ4COKccw7QaKciYFjjgwEFxtapglhYykbZq3P2h5rkcCc0s MunV1qIljgX7LbGs4c0S0Pv9V+24zp2PJz6UGZLdzPCDBwh2EBl6WtgPiW/E7a1El1mmF8lieSS ZQVwsFmfHWBX8s4cOoE0Y/rgoJA6x637oE/YHNjorSDT0swvyCd98dH26MczByMI4kLDpVcCVFr N9G3rN0IuBoZamFHWlO8OydNWgqwLahZ8OmrUCwnv2AWhDwDQRucpK4A0cHOJX78ygWNm0KJGy6 bKP2u4iEDkNpvQxnF8/PRi5Pe/w+/fmBm8GN+jTlZk33ef0UkhMOOBMB+pX4gZbKW+0bM1d5MVc 5zgp8j6RBcFyJXorfTgADQ6IyNACno07v1+Y+NeOS9hYkFfJJXf1x3bK/gedfTCswoswQT7H6xG ixhpvnoEdpRsfIdexfA== X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" The SDCA IRQs are split into two groups, those registered at bus probe time (basically just FDL) and those registered at component time. The free functions need to also be split, if the FDL IRQ is freed at component time, then nothing would re-register it if the component is probed again. Signed-off-by: Charles Keepax --- New since v2. include/sound/sdca_interrupts.h | 3 ++ sound/soc/sdca/sdca_interrupts.c | 59 ++++++++++++++++++++++++++------ 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/include/sound/sdca_interrupts.h b/include/sound/sdca_interrupt= s.h index 20ff5eac34eaa..6c8a9bbb9a196 100644 --- a/include/sound/sdca_interrupts.h +++ b/include/sound/sdca_interrupts.h @@ -88,6 +88,9 @@ int sdca_irq_populate(struct sdca_function_data *function, void sdca_irq_cleanup(struct device *dev, struct sdca_function_data *function, struct sdca_interrupt_info *info); +void sdca_irq_cleanup_late(struct device *dev, + struct sdca_function_data *function, + struct sdca_interrupt_info *info); struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev, struct regmap *regmap, int irq); =20 diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interru= pts.c index 6bbe65ac3d2f0..75957460fd287 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -538,17 +538,10 @@ int sdca_irq_populate(struct sdca_function_data *func= tion, } EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA"); =20 -/** - * sdca_irq_cleanup - Free all the individual IRQs for an SDCA Function - * @dev: Device pointer against which the sdca_interrupt_info was allocate= d. - * @function: Pointer to the SDCA Function. - * @info: Pointer to the SDCA interrupt info for this device. - * - * Typically this would be called from the driver for a single SDCA Functi= on. - */ -void sdca_irq_cleanup(struct device *dev, - struct sdca_function_data *function, - struct sdca_interrupt_info *info) +static void sdca_irq_cleanup_flags(struct device *dev, + struct sdca_function_data *function, + struct sdca_interrupt_info *info, + bool skip_early) { int i; =20 @@ -556,15 +549,59 @@ void sdca_irq_cleanup(struct device *dev, =20 for (i =3D 0; i < SDCA_MAX_INTERRUPTS; i++) { struct sdca_interrupt *interrupt =3D &info->irqs[i]; + struct sdca_control *control =3D interrupt->control; + struct sdca_entity *entity =3D interrupt->entity; =20 if (interrupt->function !=3D function || !interrupt->irq) continue; =20 + switch (SDCA_CTL_TYPE(entity->type, control->sel)) { + case SDCA_CTL_TYPE_S(XU, FDL_CURRENTOWNER): + if (skip_early) + continue; + break; + default: + break; + } + sdca_irq_free_locked(dev, info, i, interrupt->name, interrupt); } } + +/** + * sdca_irq_cleanup - Free the regular IRQs for an SDCA Function + * @dev: Device pointer against which the sdca_interrupt_info was allocate= d. + * @function: Pointer to the SDCA Function. + * @info: Pointer to the SDCA interrupt info for this device. + * + * Typically this would be called from the driver for a single SDCA Functi= on + * from component remove. + */ +void sdca_irq_cleanup(struct device *dev, + struct sdca_function_data *function, + struct sdca_interrupt_info *info) +{ + sdca_irq_cleanup_flags(dev, function, info, true); +} EXPORT_SYMBOL_NS_GPL(sdca_irq_cleanup, "SND_SOC_SDCA"); =20 +/** + * sdca_irq_cleanup_late - Free the early IRQs for an SDCA Function + * @dev: Device pointer against which the sdca_interrupt_info was allocate= d. + * @function: Pointer to the SDCA Function. + * @info: Pointer to the SDCA interrupt info for this device. + * + * Typically this would be called from the driver for a single SDCA Functi= on + * from bus remove. + */ +void sdca_irq_cleanup_late(struct device *dev, + struct sdca_function_data *function, + struct sdca_interrupt_info *info) +{ + sdca_irq_cleanup_flags(dev, function, info, false); +} +EXPORT_SYMBOL_NS_GPL(sdca_irq_cleanup_late, "SND_SOC_SDCA"); + /** * sdca_irq_allocate - allocate an SDCA interrupt structure for a device * @sdev: Device pointer against which things should be allocated. --=20 2.47.3 From nobody Sat Jul 25 15:51:13 2026 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 512EA4302FB; Thu, 16 Jul 2026 14:27:07 +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=1784212029; cv=fail; b=Z5CJaLeA0HOxUZLYxy7cPGdzS70gP3EBhqsyASsZ5xKTNlEttolQkvoNSYiGsbCk4Sj0wF7DQIIn+Pacv8m4R/RA7zNriDMV5G5KgqIx7Lq62vk7d9MNWnNYxlPoXwv2L/2z0Q5SLjkjaALeQw+a7PyI9k2wyR+sWQL03Ng2jMw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212029; c=relaxed/simple; bh=YdHqavXlDXQf+30jT2MVUSd+UDSlSjZs5xigxNjvfxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EbGDmsFUalb3oANNtRi27Gji6KsT1phX9+7RHzJf1yMf6IYjvx/9wuJ4M8AfyHpju/0FLsV9zh+vWz8a17mJzSJezjKi6cJmWz+7yqJpwtcPwdvqH6ZchZckNm0vTVl4R2qYpg+MBjoPM28YL+Ls7tSd/gQMsrY/X8Hx8vZ3Zec= 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=jKRqs4jy; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b=MZgAGGfr; 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="jKRqs4jy"; dkim=pass (1024-bit key) header.d=cirrus4.onmicrosoft.com header.i=@cirrus4.onmicrosoft.com header.b="MZgAGGfr" 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 66G4iPoj2661140; Thu, 16 Jul 2026 09:26: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=neQrV2iaP2NqKC32lr3hV0WEINT8b70Kd7vQphEqmVs=; b= jKRqs4jyQ7S+rqoGK4RyHRjFQtDqaOkghTpmSlMTHiHrESHRuuXrAQxYVCNHIVjw QWaYg/JGItjFEq8LIRsqvFYEfncIppTDUmi0ncCTHfWwbM39nsSgbGDwW0wKefR8 XgZ0AHSyOSOyAH65ewWgHJ/WEZmSGae3UizlzI/sv2qNDXjHFdhRO1TCriAyPMpP h+UKGju3hEGW6qjS9HQowgaTyzqBKtRaLQVraDc1Lhwo4Mo7ScHsZS/CPpKwy175 iVxEGMaeDqKqFcJ91tGdyeIfN2H+zUcKYN9UizK8O3T6QoFrgWU2EdvoFMYvzzax ftUydKHbLGOuzyft47eo1A== Received: from ch5pr02cu005.outbound.protection.outlook.com (mail-northcentralusazon11022104.outbound.protection.outlook.com [40.107.200.104]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 4fbk7vy9r6-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 09:26:50 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L8+eJBsyIHrNxTC4Fwk/Acuv3cVTUWjHiX9jAyIPUaVrC26+OYvx7opX40//XMm/LzmpuFdNrOtaDWt4ujxiKN0iYwUU+A4Xv2ZkZhHrNQdmaK1yz6TFnkTSvCsODESUNj1kDEmB+68z/8B4BL4PZqD4/juT5cvNemBHXidX+D1sxE95AnMySI9p5dG1b+DrbVel54g0IFf0O//1eP1iWBprNTi/wbuuzpcHcSNnH7CCIvam3uZ7W/U2H2bBJqYN1+KP3IQ8yIHFGqnJuYMez3F91hC2Wx9dQpFw031V/730aoFC91mCPhsOdws5Gb9c33pkZU1bGHfqS5V1GFm8LA== 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=neQrV2iaP2NqKC32lr3hV0WEINT8b70Kd7vQphEqmVs=; b=OW1YsDSIEk3yDVK35mhOl4MFXSDTyEaKKeT+6g3OyKpW/VhN2A09PeB3iLj20v4FPQhAzCYRmm7KrjR4+8KekxY6MsuXKoOjO1tbs74Senptl/cewYWChx4usNLM+a5lcfaphwmddDC0WDK8NDrR/juTZPqU/NrEouXVrYcCq7Itqt2rc2GCX2MHYtto/8WRVL21ije3vaoo3/UWygfYHzSbRyOC/9cp5bWbe47MjXo3aiH+m71q9YS5obsL6qQw8IoUF1WZ3Sr3Y0Ngus9/dlQ3fZS1vq4k6mto4hbSk1+t85gQ7gZifywj8J6cg08VSsTdPCsdzDWteZB+vCBEhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (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=neQrV2iaP2NqKC32lr3hV0WEINT8b70Kd7vQphEqmVs=; b=MZgAGGfr4cQWc8a4TNChXOhgs2fFVZxkPZpCd4TU2rkHS/FV6QhBUdFVYiVWARI2POsGV6bSR2F/ZJhIgGlGd4no2VKlpL0M5KrE0lZ4zmQBh11LbUtC6pAt6yrCMu60dloR6RJnIzBWj56fNuhLMXAIJSfJb455pdkUwqgRQKM= Received: from CH0P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::6) by SAWPR19MB997276.namprd19.prod.outlook.com (2603:10b6:806:4e0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.11; Thu, 16 Jul 2026 14:26:45 +0000 Received: from CH1PEPF0000AD7A.namprd04.prod.outlook.com (2603:10b6:610:11c:cafe::3c) by CH0P221CA0013.outlook.office365.com (2603:10b6:610:11c::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Thu, 16 Jul 2026 14:26:44 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (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: SoftFail (protection.outlook.com: domain of transitioning opensource.cirrus.com discourages use of 84.19.233.75 as permitted sender) Received: from edirelay1.ad.cirrus.com (84.19.233.75) by CH1PEPF0000AD7A.mail.protection.outlook.com (10.167.244.59) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 14:26: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 0A125406545; Thu, 16 Jul 2026 14:26:43 +0000 (UTC) Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.12]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPSA id E5EB1822545; Thu, 16 Jul 2026 14:26:42 +0000 (UTC) From: Charles Keepax To: broonie@kernel.org Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH v3 4/4] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration Date: Thu, 16 Jul 2026 15:26:39 +0100 Message-ID: <20260716142639.2306757-5-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260716142639.2306757-1-ckeepax@opensource.cirrus.com> References: <20260716142639.2306757-1-ckeepax@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: CH1PEPF0000AD7A:EE_|SAWPR19MB997276:EE_ X-MS-Office365-Filtering-Correlation-Id: 9838c2ea-f7c2-4f2e-c064-08dee3464325 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|61400799027|376014|82310400026|36860700016|3023799007|10067099003|16102099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: 08392mib6zry11M4+T/A4wBmgsFl1Xf1mM+e9obc+9A+ugHdXOVoV1k7Xj21gGnKK8rEYpnMStfnA+ra2PeSP+FMsbwxexqlBxzrHO4doNjNaJTLD5/Od4WNl2KI9a17Me8wNXfYA1PgRUd5s7ipnuZHo9vklQox9CMx2+sLrO5MNarnehQhqb4t/A2yB8WlqKVT9guQoTREM9ezdQsXY7MxeY/AQZeQ6rL+6fEVetmziG5Q23K/27cKZ9ZgI7d881xljGnCKgccf8a5ibti3zEdA5ckw40HJjNx/vMeXE8flDG44N9GoRCiHKhBtTY3GUORctqWrG9Kr+1Jgdg6oPky7h+QilwAJy75rjLCu/Y6sbGKCSCmuTeKyOyIRxoJJ0+3Yq9Ecxby6YvWhzweTD012+NUc92Viljfkrb0diamycCjw93oYXcvCWbA8mAMf+J2ECsKgJTBQnHgNCuH3IEwzcMbSLyTCpUp20MvxBOU40VSF6TuBPVQSphNy41q61W8hhnAi4v2I/OPgaHIVBClAPCXzA8zSFtOq4R3G60Gl86mIEC1z/FhwSqwT2l+e59gQLgyGhjjjJwns51D1OyNPLLaRhWPgmzroC8gSYCtmRxc/ZqEej/nXjLMGXU6Ik4JE6wkMKrL8aknfKvdVtwK/OwvuXx1rl7ioUfYlq9JM+dv7ai5iW7bHX2+zGUzvIqsspBuEV/krRFpFzsU5Q== 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)(23010399003)(61400799027)(376014)(82310400026)(36860700016)(3023799007)(10067099003)(16102099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fNRxRzhqjIhQC6kqrpjX6D/RLsvHqToSjEFd1/oyaLixgHSQbC/5KUGPAbZugXfGESO/o8lAuUDTa6TPH4IQAQU6xKc1V1vCzVA9uzk8+wkFd767o9qrOxbd6lfgQ1xqyX2MNJQwy3Hpeoo2YOBqxe7hB2ZnejNiwCF7Hkkt/c3+POOKrBiZKYhoZz+Z/b+ikuhe9j+iVwIYrAlanBqUWrthERHtc1FhPWCTrMwHS1g8K1iCCuc5gKHEyxk2TSmeaahQMSqAYOztkHfzyjzcDADJOkOv3eGHCsRGPq7EUK7L2MYoErj789w1g80hzW3U1N444p5KZPiPplSkdbIjwGXIbnZ6/LEwlio3G/pH0AYGBnhb/X+fQTu/z1pyLprEL9Bff1wlZHcVKl1l5/jYLIo7aa/G+pv0MEL7Tx5B4JnatVEReEj8TYPm9oXRvEiX X-Exchange-RoutingPolicyChecked: sU2xLZmjnK4bvHR/G+zHeKDR628RJ3vYb4z9u3g2OhNKWFBjviO71kO4Hos+gLlkhu8gdTGbAW4Bv2Y1XJcnta9DFFPyDCkkKWrH8FgtjXmXEr3qjRbL7nd52nP7YO1iiyE5fCKVks9uRb8ikGAteWg9mg53MUyD/VT4n0VheIlVCXzMSbYkWmHKOci+cdyVSH7l6mt97Tr/Tm5UltwbA5npNXuXLrKKiW1SD7JqU8bhEQkUAqcHIfzhFNAKJlwhLAmLhNxQMgb49PIEWKGZpFwzoRRx0djU+Oevq01dwpFHOMrIKxpYWwEvdZodi83lncwhpMDPu3tDXehpt+N94A== X-OriginatorOrg: opensource.cirrus.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 14:26:44.4601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9838c2ea-f7c2-4f2e-c064-08dee3464325 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-CH1PEPF0000AD7A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SAWPR19MB997276 X-Authority-Analysis: v=2.4 cv=V71NF+ni c=1 sm=1 tr=0 ts=6a58ea2a cx=c_pps a=Yy30xeOXBChOadhm8XbUsQ==:117 a=h1hSm8JtM9GN1ddwPAif2w==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=RAioF0-LDSMA:10 a=s63m1ICgrNkA:10 a=RWc_ulEos4gA:10 a=VkNPw1HP01LnGYTKEx00:22 a=iX4cTi3TZMoOKdANLEfx:22 a=Dj2-6B8FqX4mGL0U3gbX:22 a=w1d2syhTAAAA:8 a=wSoEbFGUnSHqE_z0LMIA:9 X-Proofpoint-ORIG-GUID: JExYJHoR_ybjXxy12Ej-1GrleV8vf9Fc X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfXySxSgJdbH5Le JZKF5CnfpB15nbMUbnGz16eXrk6tJbl+uZSI78XoR/+i3iKnwrH/G5x6NpN7/kphmlNllDJamWs +YMTK1lq4XeNJHCW3sHL+kQAwZstnMw= X-Proofpoint-GUID: JExYJHoR_ybjXxy12Ej-1GrleV8vf9Fc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDE0OSBTYWx0ZWRfX29h0tqqprTIo 411xyYiv4cQ60S69G6kcqp/WQ+uAR7fn+817kja8lwz7OePt66Mi49BRuEI4K5ifIkXYh5QsJkA +DbYawdt6wPzJR6gKTwipqtrlbVbtsjssUIECgCihGNilmnBjowPfo2oJ/xQ3/jQsLC1ZN/YMqL vTzBeyrziywxAl28CtvV9njOfZcp0q2eRqBG3QmJTPOQpMmaHFE1Xjjn8iQogdOMCY5uEDYS5eP jbQFkYk9ppnKhPOnc7Vt0EfwDP/EHj2UxXp9XFGSbtLDVeR31aAOxXF3+3guQRCZh0UnrhNosAH rwZNApBVw/cL2Cpfm3Y0I/HrBRmJEvsz08tlmgavgk/4f7f+Gmfj1VSh+uYf+OeMj2Y3a1rrPWE M0V2CgopNDtmRl7mNt2z4M6K1MF8E2salXJnXsoihyLocY25qUDfitIHvBU8TXNL4jqcFdfWjIY 3JbjWrpw6Q1vhMZMXLw== X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="utf-8" Currently there are some race conditions around the boot of SDCA jack detection. The core creates DAPM widgets/routes quite a long time before it creates the associated ALSA control, and the jack detection IRQ is currently registered in component probe. At the time of component probe, the DAPM widgets exist, shortly after this the DAPM routes are added. At the time the DAPM routes are added the register value for the control is checked and the appropriate path is connected. The existing handling in the SDCA jack IRQ handles the case the control doesn't exist and updates the registers directly, which works until the DAPM routes are added. After the routes are added the DAPM graph has already set connected on a particular DAPM path, which will not be updated until an IRQ is received when the control is present. Thus those updated are usually not reflected in the resulting DAPM graph which can lead to the audio path being erroneously powered on/off. Switch to the new fixup_controls callback to register the IRQs, this is guaranteed to run after all the controls have been created. Which means we can avoid the aforementioned race condition and as a bonus no longer need to concern ourselves with a case where the IRQ handler runs and the ALSA control is unavailable. Signed-off-by: Charles Keepax --- Changes since v2: - Add back bus remove - Change the call in bus remove to sdca_irq_cleanup_late() sound/soc/sdca/sdca_class_function.c | 6 ++-- sound/soc/sdca/sdca_jack.c | 44 ++++++++++++---------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/sound/soc/sdca/sdca_class_function.c b/sound/soc/sdca/sdca_cla= ss_function.c index 1496a15f7d2ac..2fb2b043c979c 100644 --- a/sound/soc/sdca/sdca_class_function.c +++ b/sound/soc/sdca/sdca_class_function.c @@ -191,7 +191,7 @@ static const struct snd_soc_dai_ops class_function_sdw_= ops =3D { .hw_free =3D class_function_sdw_remove_peripheral, }; =20 -static int class_function_component_probe(struct snd_soc_component *compon= ent) +static int class_function_component_fixup_controls(struct snd_soc_componen= t *component) { struct class_function_drv *drv =3D snd_soc_component_get_drvdata(componen= t); struct sdca_class_drv *core =3D drv->core; @@ -217,7 +217,7 @@ static int class_function_set_jack(struct snd_soc_compo= nent *component, } =20 static const struct snd_soc_component_driver class_function_component_drv = =3D { - .probe =3D class_function_component_probe, + .fixup_controls =3D class_function_component_fixup_controls, .remove =3D class_function_component_remove, .endianness =3D 1, }; @@ -408,7 +408,7 @@ static void class_function_remove(struct auxiliary_devi= ce *auxdev) { struct class_function_drv *drv =3D auxiliary_get_drvdata(auxdev); =20 - sdca_irq_cleanup(drv->dev, drv->function, drv->core->irq_info); + sdca_irq_cleanup_late(drv->dev, drv->function, drv->core->irq_info); } =20 static int class_function_runtime_suspend(struct device *dev) diff --git a/sound/soc/sdca/sdca_jack.c b/sound/soc/sdca/sdca_jack.c index ae9636622a840..2ac74b9826736 100644 --- a/sound/soc/sdca/sdca_jack.c +++ b/sound/soc/sdca/sdca_jack.c @@ -41,6 +41,7 @@ int sdca_jack_process(struct sdca_interrupt *interrupt) struct jack_state *state =3D interrupt->priv; struct snd_kcontrol *kctl =3D state->kctl; struct snd_ctl_elem_value *ucontrol __free(kfree) =3D NULL; + struct soc_enum *soc_enum; unsigned int reg, val; int ret; =20 @@ -55,10 +56,12 @@ int sdca_jack_process(struct sdca_interrupt *interrupt) return -ENOMEM; =20 kctl =3D snd_soc_component_get_kcontrol(component, name); - if (!kctl) - dev_dbg(dev, "control not found: %s\n", name); - else - state->kctl =3D kctl; + if (!kctl) { + dev_err(dev, "control not found: %s\n", name); + return -ENODEV; + } + + state->kctl =3D kctl; } =20 reg =3D SDW_SDCA_CTL(interrupt->function->desc->adr, interrupt->entity->i= d, @@ -96,30 +99,21 @@ int sdca_jack_process(struct sdca_interrupt *interrupt) =20 dev_dbg(dev, "%s: %#x\n", interrupt->name, val); =20 - if (kctl) { - struct soc_enum *soc_enum =3D (struct soc_enum *)kctl->private_value; - - ucontrol =3D kzalloc_obj(*ucontrol); - if (!ucontrol) - return -ENOMEM; - - ucontrol->value.enumerated.item[0] =3D snd_soc_enum_val_to_item(soc_enum= , val); + ucontrol =3D kzalloc_obj(*ucontrol); + if (!ucontrol) + return -ENOMEM; =20 - ret =3D snd_soc_dapm_put_enum_double(kctl, ucontrol); - if (ret < 0) { - dev_err(dev, "failed to update selected mode: %d\n", ret); - return ret; - } + soc_enum =3D (struct soc_enum *)kctl->private_value; + ucontrol->value.enumerated.item[0] =3D snd_soc_enum_val_to_item(soc_enum,= val); =20 - snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); - } else { - ret =3D regmap_write(interrupt->function_regmap, reg, val); - if (ret) { - dev_err(dev, "failed to write selected mode: %d\n", ret); - return ret; - } + ret =3D snd_soc_dapm_put_enum_double(kctl, ucontrol); + if (ret < 0) { + dev_err(dev, "failed to update selected mode: %d\n", ret); + return ret; } =20 + snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); + return sdca_jack_report(interrupt); } EXPORT_SYMBOL_NS_GPL(sdca_jack_process, "SND_SOC_SDCA"); @@ -192,7 +186,7 @@ int sdca_jack_set_jack(struct sdca_interrupt_info *info= , struct snd_soc_jack *ja struct sdca_control_range *range; struct jack_state *jack_state; =20 - if (!interrupt->irq) + if (!interrupt->dev) continue; =20 switch (SDCA_CTL_TYPE(entity->type, control->sel)) { --=20 2.47.3