Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2274687pxb; Thu, 11 Feb 2021 08:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzFR65kdsdeoPD+GR8bXykugT3gQUdgH0NqAq0Ihe6aUJQSKtI0p2zAxvFcRHisxGByuOz X-Received: by 2002:a05:6402:4d3:: with SMTP id n19mr9027817edw.2.1613060762322; Thu, 11 Feb 2021 08:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613060762; cv=none; d=google.com; s=arc-20160816; b=Pw8L86BH5VIucUbbVtPKygnUK+DFRO1HLa8AdXHLeyl/1W+TJATjU4MLKPEGi0crWP szt05on06nMEnqTiULtyQvTX8ta2L31ilg6G9M2KTBLECjvwrEmkEi0j1JwNkQjEPBPd vHs1TqSY0d/jE1DtmSiuJVohzUacpwYuk67I5TZWSXkob9qAOH+W3ljCfzYYtArgIJ8z fvlvHkIlVWzRVQBQSqhSV4984c4J83Iro1f6TPXcHpsKox/Ndo7qgke2iqaI7eFM+xxP KnsGqgLZHld+5+aO+M0KOzC6DA183pqENkxiAIkJme8w8el3TsxjWtd5z2qqKehbiwrS CnNQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WTCzk0oTxkSYuJ6WJ/TGygymgpDoKMRTGhMRwbspKPA=; b=dfZXV/pxnk75nYeLi9Pp2afMQ45+BrZryv/L1EUVXkXpKTQHjMgrVDoP5WH14mVHyz BWLm3b9nWDzcc34rObKgaDPViRgnRtczsIwzWGFw+hjn6SFYLDwopm6+VyNxbLr4kK4S /ou6Ce/PldNd/V+3iF2KLr7bMJhy9xFA0UYe5hmTHaPoYCnyz6bdhjSP6VCREkIb31oG bOMYy6Eo/JwAQrx/AKhTC+Hk4VCaLXYvlcLHtaFHdYTeGbFU/WZmeS8GuSLo2lxNAECH ErRlvOpy4CxjzCi50NXFhgbiMMIA4WYo669+KYT5vTiFgZZvxmPhJQrfDKSYS1KgykMI sRVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WCNFijr8; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si5201060edc.257.2021.02.11.08.25.38; Thu, 11 Feb 2021 08:26:02 -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=@linuxfoundation.org header.s=korg header.b=WCNFijr8; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230330AbhBKQXs (ORCPT + 99 others); Thu, 11 Feb 2021 11:23:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:53540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbhBKPYz (ORCPT ); Thu, 11 Feb 2021 10:24:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2977364ED4; Thu, 11 Feb 2021 15:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055845; bh=4rHAjgicSdqJvjkGL60JOYFUrF5kKSJH2RpwL7k69yA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCNFijr80K9H+q+RuQmJA0O9Y9UnCPJxGKDuO+c2vBtAM6kzE4nrj1kSK5TmeiCau sSlUAfy3DOby1gDPefSsSe0LxrubqeqK/xGlN9pCyqR4lhBQy3Y9belEpG98nLn2Hx Ww4yV2h6+zD9xauB6Dw7+m9e5zpNcMFIQ5r+vQPs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eliot Blennerhassett , Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH 5.10 29/54] ASoC: ak4458: correct reset polarity Date: Thu, 11 Feb 2021 16:02:13 +0100 Message-Id: <20210211150154.158758877@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eliot Blennerhassett [ Upstream commit e953daeb68b1abd8a7d44902786349fdeef5c297 ] Reset (aka power off) happens when the reset gpio is made active. Change function name to ak4458_reset to match devicetree property "reset-gpios" Signed-off-by: Eliot Blennerhassett Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/ce650f47-4ff6-e486-7846-cc3d033f3601@blennerhassett.gen.nz Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/ak4458.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c index 1010c9ee2e836..472caad17012e 100644 --- a/sound/soc/codecs/ak4458.c +++ b/sound/soc/codecs/ak4458.c @@ -595,18 +595,10 @@ static struct snd_soc_dai_driver ak4497_dai = { .ops = &ak4458_dai_ops, }; -static void ak4458_power_off(struct ak4458_priv *ak4458) +static void ak4458_reset(struct ak4458_priv *ak4458, bool active) { if (ak4458->reset_gpiod) { - gpiod_set_value_cansleep(ak4458->reset_gpiod, 0); - usleep_range(1000, 2000); - } -} - -static void ak4458_power_on(struct ak4458_priv *ak4458) -{ - if (ak4458->reset_gpiod) { - gpiod_set_value_cansleep(ak4458->reset_gpiod, 1); + gpiod_set_value_cansleep(ak4458->reset_gpiod, active); usleep_range(1000, 2000); } } @@ -620,7 +612,7 @@ static int ak4458_init(struct snd_soc_component *component) if (ak4458->mute_gpiod) gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); - ak4458_power_on(ak4458); + ak4458_reset(ak4458, false); ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1, 0x80, 0x80); /* ACKS bit = 1; 10000000 */ @@ -650,7 +642,7 @@ static void ak4458_remove(struct snd_soc_component *component) { struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); - ak4458_power_off(ak4458); + ak4458_reset(ak4458, true); } #ifdef CONFIG_PM @@ -660,7 +652,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev) regcache_cache_only(ak4458->regmap, true); - ak4458_power_off(ak4458); + ak4458_reset(ak4458, true); if (ak4458->mute_gpiod) gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); @@ -685,8 +677,8 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev) if (ak4458->mute_gpiod) gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); - ak4458_power_off(ak4458); - ak4458_power_on(ak4458); + ak4458_reset(ak4458, true); + ak4458_reset(ak4458, false); regcache_cache_only(ak4458->regmap, false); regcache_mark_dirty(ak4458->regmap); -- 2.27.0