Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3505590pxb; Wed, 14 Apr 2021 07:04:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYmNkMRVEgoDv/wf6UHOwT7fjDQoDUGs9ylydHQ6B5e/xB0tHAASF2WG6j4u4gqt2Y4Loa X-Received: by 2002:aa7:c2cc:: with SMTP id m12mr27079534edp.259.1618409092656; Wed, 14 Apr 2021 07:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618409092; cv=none; d=google.com; s=arc-20160816; b=xOE1+ZU7gV7NTzyuJ4g7HKmWCGV4/6k1fHC2ngj3NhikQHGe2TFns9Oc9vHyql/q71 jLvujYbDoVgeDdB62TJLkrYi9aGJlqX7HDQW/apGkmgvht3EgzB4Iz7/3OYTHGmdaq5Y 18rOt5sR0LjV+kWYPCUbBAN4XYxhZE3pSFYX5RX5pgJi0HbE/F6Da+RM+QjMonGkwGQm LdD2WTp+KFufLXgXviu6ouaqOU4WEzKmHlCmfYivKAl9pnRpdCPuYbXVCBe+vavzRgdO Q0Sk/7AkPn/8y3Qjkfr/5H0K0W8PgPhHGTUtbsV/w6L4pEyYNbO0kIKZXEmfZa37oDY4 C8wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=Clt3Cuc6nn4UYTPo+rSr9Yy0HVe7JR7O11A0+IdGUhM=; b=eDHMQTzoxq1wx1TibjS32d7CzEmlyWwLJ37kDeDQLZCcpZmwDhF738bX88W3pxPhxJ kaeLGP+5RAVDWWj7h3xw6861hyEIuQ2GryIbWi2INWuaYimSt40t+pvuAuN/68k6gHQm J2m0MHh2Fs7/pIcMRhWzAgxGUoS3gPPPKlmVn+drv78lQfr75SowIYMsjR8L5AxPM8I0 FD+bVyYUqT6kKK+CX/J+OXKcw5z5DazpMmXLXIafSTSR0hCU8GYo/Ln+qiu8iqUrqzvi lXbwFEHChax/w+6lRQUefTNApEbaTiJmaipQtceapq4idMuHDhBBXbAPZlYcZOfO7fvM jEcw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si14003710ede.162.2021.04.14.07.04.29; Wed, 14 Apr 2021 07:04:52 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349338AbhDNGtM (ORCPT + 99 others); Wed, 14 Apr 2021 02:49:12 -0400 Received: from inva021.nxp.com ([92.121.34.21]:33508 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349356AbhDNGtC (ORCPT ); Wed, 14 Apr 2021 02:49:02 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0E9FB2028ED; Wed, 14 Apr 2021 08:48:40 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5751E2028EF; Wed, 14 Apr 2021 08:48:37 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AE7D5402F0; Wed, 14 Apr 2021 08:48:33 +0200 (CEST) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 -next 2/2] ASoC: ak5558: change function name to ak5558_reset Date: Wed, 14 Apr 2021 14:33:44 +0800 Message-Id: <1618382024-31725-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618382024-31725-1-git-send-email-shengjiu.wang@nxp.com> References: <1618382024-31725-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change function name to ak5558_reset to match devicetree property "reset-gpios". Signed-off-by: Shengjiu Wang --- changes in v2: - split patches to two patches sound/soc/codecs/ak5558.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c index f24d91b728dd..34aed80db0eb 100644 --- a/sound/soc/codecs/ak5558.c +++ b/sound/soc/codecs/ak5558.c @@ -318,21 +318,12 @@ static struct snd_soc_dai_driver ak5552_dai = { .ops = &ak5558_dai_ops, }; -static void ak5558_power_off(struct ak5558_priv *ak5558) +static void ak5558_reset(struct ak5558_priv *ak5558, bool active) { if (!ak5558->reset_gpiod) return; - gpiod_set_value_cansleep(ak5558->reset_gpiod, 1); - usleep_range(1000, 2000); -} - -static void ak5558_power_on(struct ak5558_priv *ak5558) -{ - if (!ak5558->reset_gpiod) - return; - - gpiod_set_value_cansleep(ak5558->reset_gpiod, 0); + gpiod_set_value_cansleep(ak5558->reset_gpiod, active); usleep_range(1000, 2000); } @@ -340,7 +331,7 @@ static int ak5558_probe(struct snd_soc_component *component) { struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); - ak5558_power_on(ak5558); + ak5558_reset(ak5558, false); return ak5558_set_mcki(component); } @@ -348,7 +339,7 @@ static void ak5558_remove(struct snd_soc_component *component) { struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); - ak5558_power_off(ak5558); + ak5558_reset(ak5558, true); } static int __maybe_unused ak5558_runtime_suspend(struct device *dev) @@ -356,7 +347,7 @@ static int __maybe_unused ak5558_runtime_suspend(struct device *dev) struct ak5558_priv *ak5558 = dev_get_drvdata(dev); regcache_cache_only(ak5558->regmap, true); - ak5558_power_off(ak5558); + ak5558_reset(ak5558, true); regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies); @@ -375,8 +366,8 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev) return ret; } - ak5558_power_off(ak5558); - ak5558_power_on(ak5558); + ak5558_reset(ak5558, true); + ak5558_reset(ak5558, false); regcache_cache_only(ak5558->regmap, false); regcache_mark_dirty(ak5558->regmap); -- 2.27.0