From nobody Tue Jun 23 07:07:28 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C28CEC433F5 for ; Wed, 9 Mar 2022 10:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbiCIKma (ORCPT ); Wed, 9 Mar 2022 05:42:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbiCIKm3 (ORCPT ); Wed, 9 Mar 2022 05:42:29 -0500 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA6B4F45A for ; Wed, 9 Mar 2022 02:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=z4mmaxHNrXBGVaJHxv43kF3l/Y+f4qiTwxrkpu78Hyo=; b=BN Gp83IgqHQfM8bfylB5NIE2XSsbWdoAc2n18JGuvGO6ihMcyoLssgBoHx/cpHPocq8NgpNGkOQm9hZ 7ZpJtcRAzNewRg5d8fLVFtp8o81hkdrnXc4CDui0dBeO7S7hufgkSCDYkryRCM3rSDom/IsjLwRBY cyhRL/B8Xbkrv6h6e1HjQcZ3C6fgN+NpC0lrpvfJLhQ+X/CVo5FSZM+H8tQq6Re87GPZmkqcZPKBI 8yP7GnFqOmK2PvdfWQsVt1gVIWBIDyA3f9OhcHx6/l4ASgHEJe3ZjPKD3UmEtXkOjoXcUyOxJwqBx lsTqxIzh5l7d6n/rHZiceo2a+vf4mRFw==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nRtkj-0008Ez-Sx; Wed, 09 Mar 2022 10:41:09 +0000 From: John Keeping To: alsa-devel@alsa-project.org Cc: John Keeping , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Daniel Beer , linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: tas5805m: fix pdn polarity Date: Wed, 9 Mar 2022 10:41:04 +0000 Message-Id: <20220309104104.3605112-1-john@metanate.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated: YES Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The binding defines the GPIO as "pdn-gpios" so when the GPIO is active the expectation is that the power down signal is asserted, but the driver swaps this to represent the inverted logic of the electrical signal. The GPIO_ACTIVE_HIGH/LOW flags should be used to identify the inverted logic here with the driver treating power down as active when the mapped GPIO value is 1. Fixes: ec45268467f4 ("ASoC: add support for TAS5805M digital amplifier") Signed-off-by: John Keeping --- sound/soc/codecs/tas5805m.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/tas5805m.c b/sound/soc/codecs/tas5805m.c index fa0e81ec875a..12146a860ef8 100644 --- a/sound/soc/codecs/tas5805m.c +++ b/sound/soc/codecs/tas5805m.c @@ -155,7 +155,7 @@ static const uint32_t tas5805m_volume[] =3D { =20 struct tas5805m_priv { struct regulator *pvdd; - struct gpio_desc *gpio_pdn_n; + struct gpio_desc *gpio_pdn; =20 uint8_t *dsp_cfg_data; int dsp_cfg_len; @@ -444,11 +444,11 @@ static int tas5805m_i2c_probe(struct i2c_client *i2c) =20 dev_set_drvdata(dev, tas5805m); tas5805m->regmap =3D regmap; - tas5805m->gpio_pdn_n =3D devm_gpiod_get(dev, "pdn", GPIOD_OUT_LOW); - if (IS_ERR(tas5805m->gpio_pdn_n)) { + tas5805m->gpio_pdn =3D devm_gpiod_get(dev, "pdn", GPIOD_OUT_HIGH); + if (IS_ERR(tas5805m->gpio_pdn)) { dev_err(dev, "error requesting PDN gpio: %ld\n", - PTR_ERR(tas5805m->gpio_pdn_n)); - return PTR_ERR(tas5805m->gpio_pdn_n); + PTR_ERR(tas5805m->gpio_pdn)); + return PTR_ERR(tas5805m->gpio_pdn); } =20 /* This configuration must be generated by PPC3. The file loaded @@ -505,7 +505,7 @@ static int tas5805m_i2c_probe(struct i2c_client *i2c) } =20 usleep_range(100000, 150000); - gpiod_set_value(tas5805m->gpio_pdn_n, 1); + gpiod_set_value(tas5805m->gpio_pdn, 0); usleep_range(10000, 15000); =20 /* Don't register through devm. We need to be able to unregister @@ -515,7 +515,7 @@ static int tas5805m_i2c_probe(struct i2c_client *i2c) &tas5805m_dai, 1); if (ret < 0) { dev_err(dev, "unable to register codec: %d\n", ret); - gpiod_set_value(tas5805m->gpio_pdn_n, 0); + gpiod_set_value(tas5805m->gpio_pdn, 1); regulator_disable(tas5805m->pvdd); return ret; } @@ -529,7 +529,7 @@ static int tas5805m_i2c_remove(struct i2c_client *i2c) struct tas5805m_priv *tas5805m =3D dev_get_drvdata(dev); =20 snd_soc_unregister_component(dev); - gpiod_set_value(tas5805m->gpio_pdn_n, 0); + gpiod_set_value(tas5805m->gpio_pdn, 1); usleep_range(10000, 15000); regulator_disable(tas5805m->pvdd); return 0; --=20 2.35.1