lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250703075037.2558549-2-catalin.popescu@leica-geosystems.com>
Date: Thu,  3 Jul 2025 09:50:36 +0200
From: Catalin Popescu <catalin.popescu@...ca-geosystems.com>
To: lgirdwood@...il.com,
	broonie@...nel.org,
	robh@...nel.org,
	krzk+dt@...nel.org,
	conor+dt@...nel.org,
	shenghao-ding@...com,
	kevin-lu@...com,
	baojun.xu@...com,
	perex@...ex.cz,
	tiwai@...e.com,
	matthias.bgg@...il.com,
	angelogioacchino.delregno@...labora.com
Cc: linux-sound@...r.kernel.org,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org,
	m.felsch@...gutronix.de,
	bsp-development.geo@...ca-geosystems.com,
	Catalin Popescu <catalin.popescu@...ca-geosystems.com>
Subject: [PATCH next 2/3] ASoC: tas2781: fix reset-gpio polarity

Both TAS2563 & TAS2781 have an active low reset, yet the driver assumes
an active high reset. Hence, in order to get the chip out of reset we
need to lie to the devicetree about the reset polarity. The patch fixes
the driver so it could work no matter the polarity and leaves it to the
devicetree to define the correct polarity.

Signed-off-by: Catalin Popescu <catalin.popescu@...ca-geosystems.com>
---
 sound/soc/codecs/tas2781-comlib-i2c.c | 4 ++--
 sound/soc/codecs/tas2781-i2c.c        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/tas2781-comlib-i2c.c b/sound/soc/codecs/tas2781-comlib-i2c.c
index c078bb0a8437..2553af086637 100644
--- a/sound/soc/codecs/tas2781-comlib-i2c.c
+++ b/sound/soc/codecs/tas2781-comlib-i2c.c
@@ -313,9 +313,9 @@ void tasdevice_reset(struct tasdevice_priv *tas_dev)
 	int ret, i;
 
 	if (tas_dev->reset) {
-		gpiod_set_value_cansleep(tas_dev->reset, 0);
-		usleep_range(500, 1000);
 		gpiod_set_value_cansleep(tas_dev->reset, 1);
+		usleep_range(500, 1000);
+		gpiod_set_value_cansleep(tas_dev->reset, 0);
 	} else {
 		for (i = 0; i < tas_dev->ndev; i++) {
 			ret = tasdevice_dev_write(tas_dev, i,
diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c
index 9f4d965a1335..b7202b000247 100644
--- a/sound/soc/codecs/tas2781-i2c.c
+++ b/sound/soc/codecs/tas2781-i2c.c
@@ -1895,7 +1895,7 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
 		tas_priv->tasdevice[i].dev_addr = dev_addrs[i];
 
 	tas_priv->reset = devm_gpiod_get_optional(&client->dev,
-			"reset", GPIOD_OUT_HIGH);
+			"reset", GPIOD_OUT_LOW);
 	if (IS_ERR(tas_priv->reset))
 		dev_err(tas_priv->dev, "%s Can't get reset GPIO\n",
 			__func__);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ