From patchwork Wed Nov 1 02:25:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Rau X-Patchwork-Id: 13442471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 194E2C4332F for ; Wed, 1 Nov 2023 02:35:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7A9676C1; Wed, 1 Nov 2023 03:34:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7A9676C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1698806125; bh=cLnRV4y4EnP/D1i3B4yVTIkurlo2P6ImtLrndHqgkxU=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=aOYrbfDhAX2QWIE8nlngqxMiITcKVAsPudx0il/MNv/r6iURRwETnD/ckMR83SnfJ l8qgq9W01lMc1lahAwaqK+nuyPmbjETDi0gr5rpa9fbiWJNsW5hKNEa6KShc/dYwxo zB3rYBm5GJWBDqtBTeP0piR2PjySALY6mVh6dMzM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5F38F80166; Wed, 1 Nov 2023 03:34:34 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EBA93F8020D; Wed, 1 Nov 2023 03:34:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 168BEF8016D; Wed, 1 Nov 2023 03:28:06 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6F643F80152 for ; Wed, 1 Nov 2023 03:25:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6F643F80152 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=dm.renesas.com header.i=@dm.renesas.com header.a=rsa-sha256 header.s=selector1 header.b=U3NKxgcd ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ehr2fbPtwqiYIOZ0MA7Gnc4lVPxjGbYHoALvfbVxuP4W+1yskLXnzX2x7l3obRzz6rgSLAG1zcupmM/+v5rDzRRm/6l0M4WuulqQ2KWjqEoX7sUTYKoEXfksd/oH24ssV+kEYIh9TcuB4jcRbYGuSC5zLT3BMSyk4Iv6QjlCQ+KGks99vw9DUu7sRPOOYQUS4U5pXNkKWNztzWNov7Gzn4dyQVHJFe8kUOG0HQpvM0cPV04nqM+RhFzURh3i4OBaWOhZp74xV+/VVJ999dcJXDcqm5jpDCW7zFRlTGXMViO7caQd8k7f7QpieM+gsPY9oW25FcVooa/lblc+H3iZdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uzazwkcs/XZboL2eH0QdXRwHkUV04C+9y689HakhubI=; b=b4PfOah9MyETvMz8sQROImWT2mfPv95Q5d2PJMe3SGRrDfajvxM7ZElawOJVC6D+3ljIF0FnztX5s9oX2thGCDiSTRFh/rJxE2cIWgLiiORxOwGCwcrauWsDB0leCjmBcqlAQ9sJhguofKZUJ+YZYEOguE5erscqftCSCr+fkS14g78mcVTXv86UR4c9Yf3pBH42FHhzOIG95amsl47iGY5+RPFA3yoETcrofL2RQl6BOg20th/OArTE3evl2mQ3BV/SGcxam9NCYaGf0rYDC4EvvNwUttJDudH7m/jvK+nKmJAuhtbNvQ/j4chlFYYpsrzqw69W7Bpdxoxb3ta/WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dm.renesas.com; dmarc=pass action=none header.from=dm.renesas.com; dkim=pass header.d=dm.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dm.renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uzazwkcs/XZboL2eH0QdXRwHkUV04C+9y689HakhubI=; b=U3NKxgcdR+TTFtLdS/w8OeTzv/RaaSyxWPnhaLIIwChHdikiwbI06iJca137X7F9KoOQCnQbZ1jRQNXf9qiksFdEv+7WwL2ldyZ4JnPK/G0x830EFgN5xZ1uNPn6DvFtmWrQYVPuxGQkpzyM5DkgUV2O4c0J1bQcRuqZaBTOgts= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=dm.renesas.com; Received: from OS3PR01MB6641.jpnprd01.prod.outlook.com (2603:1096:604:10b::11) by TYAPR01MB6105.jpnprd01.prod.outlook.com (2603:1096:402:37::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.23; Wed, 1 Nov 2023 02:25:15 +0000 Received: from OS3PR01MB6641.jpnprd01.prod.outlook.com ([fe80::9d30:9f0:11e7:48f7]) by OS3PR01MB6641.jpnprd01.prod.outlook.com ([fe80::9d30:9f0:11e7:48f7%4]) with mapi id 15.20.6954.019; Wed, 1 Nov 2023 02:25:15 +0000 From: David Rau To: broonie@kernel.org Cc: support.opensource@diasemi.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, dmaluka@google.com, David Rau Subject: [PATCH] ASoC: da7219: Improve system suspend and resume handling Date: Wed, 1 Nov 2023 10:25:07 +0800 Message-Id: <20231101022507.6226-1-David.Rau.opensource@dm.renesas.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: TY2PR06CA0032.apcprd06.prod.outlook.com (2603:1096:404:2e::20) To OS3PR01MB6641.jpnprd01.prod.outlook.com (2603:1096:604:10b::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB6641:EE_|TYAPR01MB6105:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ec749ba-2464-41f4-a72a-08dbda81c87f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sha1N3y0v3kSNzhj9VnWRt9zR2bYnnEjOBkCQCHFD90PU0VANXqwXAxT880YstPUDZpHmLxlwqM9qebtP+D3oK3HXOVpLnVqNzNBoEFkemZ4+Mq3Otu77Tg08cL6UTTgkN3QWdBjnveSgJEO8z36XhzvBoR4TNZN8PFvVPV5f7o45EWpUwm22Ki7tCpbvUoCjxI8cVvTvt+EWiNNkSSF6jGzzOhE5sp6iFNQ8XlcQ/VXG5ox4EGOUZCweGwNz+2jba5ukic4iqkROAl5F3/tf+MY5/Mfphr98eNwlaSTDQjmOb7B9opwJ4frYjMSUfpIKyiw+6dq9LWs1Sb8F8izXTXK0/v86OpIa7XnpQ/mzbFrtTaLolH4jsOrjCKXgxqyH7SLVCuo+ucX7l0pyPSwAG1of8uo3z8Qxu2XXL1laUY55KcT4Ydp3jsmN+ETPfU7IrlM+WrNtCx8uQW2uR3FAxe67rWdmOVwXpQfgNl/kxlJb/c3zarTio8CRebEuqXUpIaakkh1fqvgP1OnmH/iCmwVsLKGAMnwjgTdJnx4znOE7Ax1K7A9/ZWfdG+KFQ3OdS1BIWFgvuO6ERl+XC7RjTaJFKjjh8r4jG8AWc0UCuGIe2lIKs7d9fuoMcpA8a6Q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB6641.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(366004)(396003)(346002)(136003)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(103116003)(86362001)(41300700001)(8676002)(5660300002)(2906002)(15650500001)(8936002)(4326008)(83380400001)(107886003)(2616005)(6512007)(6486002)(1076003)(6506007)(6666004)(52116002)(66556008)(478600001)(26005)(38350700005)(38100700002)(66476007)(66946007)(316002)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wE5DveJ8XyAHzh2ni5Ge7q11n45I9LcA1167ACxHdIOSyFKI8nMgaMgcJJMJ3yMrQQp022t1PJO4DneuZOrqD8q7pqNBZALAgfsnzCSzuqEC/gYxD9ID7u2JWn8pwFmWk8qYztGIeiFRNue+17DEmzSSoc2SuhV8LXy5r8Vi/cqGM+FogNorIfsls87bEo5UXeU1oP78ClJRFbuVThH1/p49YjM6W0Qdd9ho1YpRPqpMHGKMZl32e+GGyC+QxoWanNFj9IymigvGu5n1uQUPuP4Nn+ULCJ408ZhiHCQwBab2Qfixu1besnVX8Y66ui+AQbKRtuylkJ2HxVyBKvt3SeziZ3DG2L0NayB2olClzOO5dqbozZgL4Eg6j4LTzslJXzxWVxwpUsgJl89Ig/rJRLutmyDcQdM7AJq580eAJ0ZCHax5VC+FnzAhxMN5sGNNtVP9GrQqf1qyWmvedjmiME6LYM0RZQCBDlXiqM9hpl1KJXJpG8VU20l/zX7lz0iIILg0XZx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8JHnb7TpT+KyQJq+Q== X-OriginatorOrg: dm.renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec749ba-2464-41f4-a72a-08dbda81c87f X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB6641.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 02:25:15.4960 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DJgLjXtvnQHOdUEuWj0OsKg93PlYDdqLcZYty+ezMN4Zy6YmARaoTcEwGL+nymOAr3Qr0no8KmsWbL1Ck+Yh/bqFv9AjUERx72h4HMhcsXs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB6105 Message-ID-Hash: DK74ZHB4JOXSPFPPST4SGMHCHPTUEEYM X-Message-ID-Hash: DK74ZHB4JOXSPFPPST4SGMHCHPTUEEYM X-MailFrom: David.Rau.opensource@dm.renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When DA7219 is suspended, prevent the AAD IRQ handler is unexpectedly executed and cause the I2C driver "Transfer while suspended" failure. Signed-off-by: David Rau --- sound/soc/codecs/da7219-aad.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c index 3bbe85091649..4c4405942779 100644 --- a/sound/soc/codecs/da7219-aad.c +++ b/sound/soc/codecs/da7219-aad.c @@ -927,10 +927,15 @@ void da7219_aad_suspend(struct snd_soc_component *component) struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); u8 micbias_ctrl; + disable_irq(da7219_aad->irq); + if (da7219_aad->jack) { /* Disable jack detection during suspend */ snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1, DA7219_ACCDET_EN_MASK, 0); + cancel_delayed_work_sync(&da7219_aad->jack_det_work); + /* Disable ground switch */ + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); /* * If we have a 4-pole jack inserted, then micbias will be @@ -947,8 +952,6 @@ void da7219_aad_suspend(struct snd_soc_component *component) } } } - - synchronize_irq(da7219_aad->irq); } void da7219_aad_resume(struct snd_soc_component *component) @@ -971,6 +974,8 @@ void da7219_aad_resume(struct snd_soc_component *component) DA7219_ACCDET_EN_MASK, DA7219_ACCDET_EN_MASK); } + + enable_irq(da7219_aad->irq); }