Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2205555pxb; Fri, 5 Mar 2021 09:36:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY1pfK+UjSDOf+HiHvxjUqgu2GMb1iZwSPM4RA7GjijOcwqona/mEeXAH7Gco3STEjeayp X-Received: by 2002:a05:6402:9:: with SMTP id d9mr10010874edu.67.1614965794528; Fri, 05 Mar 2021 09:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614965794; cv=none; d=google.com; s=arc-20160816; b=BQ7jbM8kC4kzRHhEBjASC8P6yWdoGPMU+ey5j8ue0h6k1zP47AEInSMwZve8Y1qj+n aUmMGTLxhgkTd4xAkHTIHSNOoM642PyjJhSXX6qCK9lQnuGqGV8zwNuTRpOzrpDJDNUz IrpuGnZ1jEg7Pwi+VmrzLhjBbqu74kuwj1YTIaABgrr/jh76A0275whLgilqLYPdgmAU 0ICvtE5DCL3dyO6jqEeJRZvuD05ZLbbWQic6z6G+G9569zcEjM1c6qGFYhSGz9nCrNAn OJfGn8KiBEXiHs58Z5LA9tCE8MB2SUQNmT0X98ROlLA1yf2HntJf+fHmxGAH3aVvptmo ZxYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=11rGUtyJmP7HKLy3D23ZZDv+qF7JzV2QzjUhD9/jmAM=; b=ZrlSkweayntS05aeYJmCR37xJtRyg9kWh4XiPjhB4/oF8IWGoeUkXtUoEibudJRD/X 9BlDtYqbTcG1ZALGsCc2V9/j6zimMQOFmirZeS1cly87skryXDU7NpxKqmY6z3mlZBn/ qXWye4YlUJ5HV3xJsKB+hdJQJW9vdee34b+9BGFSce7SfUnxxGFLLUHXMkKgVYSSyC9p DTJG9N31LTNp7qdwR0pFE3PPFavUgMdchYqqfrvOz4VCj9hoDEAfU9hxO1mEVOYkK4FT 2b47GaAp7X1YfT/OdIejhUxpemu+GbWsRrXJwev0wLT9Y2fC8+rMqYFvMXnbtqtkXVbl 3TuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lXCUJmoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si1067452edn.523.2021.03.05.09.36.10; Fri, 05 Mar 2021 09:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lXCUJmoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbhCERfR (ORCPT + 99 others); Fri, 5 Mar 2021 12:35:17 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:31392 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbhCERfF (ORCPT ); Fri, 5 Mar 2021 12:35:05 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 125HUg0j001824; Fri, 5 Mar 2021 11:34:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=11rGUtyJmP7HKLy3D23ZZDv+qF7JzV2QzjUhD9/jmAM=; b=lXCUJmoBcjWM0s+Q8Zc9QPXRs8K35BAoqPefGpHbuu5vNgALFRZlD8/4YjRMX1gOUHcT Ew0Urp/R7riigbQ4NsDcwyFayg6MGVzpvDFp6JVZQ3xtVuDilsze81GzdQ9fgA4dV/BK YJTncXxMHogVGtaKZ0z9THrLgR08omyn10OyT5xfkXo+VAipJ0LItQ3hXWz+YbVSrBL6 kYsU4HvkluEeeVsklFSTies7WjwMYhfRbGYePpa1HsPoEbpBol2v2VuKzn6cURXlwDqx O5FVm3uL1NASG4KafPsWnnCsZh+soCxKy5vVtgB3X01cQbeQKBUkK2DIv0pyXk3l38s9 yQ== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 36ykctraxk-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 05 Mar 2021 11:34:48 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 5 Mar 2021 17:34:47 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 5 Mar 2021 17:34:47 +0000 Received: from mail1.cirrus.com (unknown [198.61.64.35]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id CB87011D7; Fri, 5 Mar 2021 17:34:46 +0000 (UTC) From: Lucas Tanure To: James Schulman , David Rhodes , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: Richard Fitzgerald , , , , Lucas Tanure Subject: [PATCH v2 06/15] ASoC: cs42l42: Remove power if the driver is being removed Date: Fri, 5 Mar 2021 17:34:33 +0000 Message-ID: <20210305173442.195740-7-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305173442.195740-1-tanureal@opensource.cirrus.com> References: <20210305173442.195740-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 impostorscore=0 mlxlogscore=842 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103050090 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ensure the power supplies are turned off when removing the driver Signed-off-by: Lucas Tanure --- Changes in v2: - Use PM functions to shutdown the codec - Disable IRQ before pm_suspend sound/soc/codecs/cs42l42.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 811b7b1c9732e..78274537a22af 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1840,10 +1841,9 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client, static int cs42l42_i2c_remove(struct i2c_client *i2c_client) { - struct cs42l42_private *cs42l42 = i2c_get_clientdata(i2c_client); - - /* Hold down reset */ - gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); + disable_irq(i2c_client->irq); + pm_runtime_suspend(&i2c_client->dev); + pm_runtime_disable(&i2c_client->dev); return 0; } -- 2.30.1