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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260119182424.1660601-9-o.rempel@pengutronix.de>
Date: Mon, 19 Jan 2026 19:24:24 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Jonathan Cameron <jic23@...nel.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
	kernel@...gutronix.de,
	linux-kernel@...r.kernel.org,
	linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org,
	Andy Shevchenko <andy@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	David Jander <david@...tonic.nl>
Subject: [PATCH v1 8/8] iio: dac: ds4424: document output sign and probe verification

Document that a zero output value is encoded with a don't-care sign bit
and that the driver verifies device presence via a readable register
since the hardware provides no device ID.

Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
 drivers/iio/dac/ds4424.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c
index 13acb427d43b..2ccac674878e 100644
--- a/drivers/iio/dac/ds4424.c
+++ b/drivers/iio/dac/ds4424.c
@@ -194,6 +194,7 @@ static int ds4424_write_raw(struct iio_dev *indio_dev,
 		if (val < -max_val || val > max_val)
 			return -EINVAL;
 
+		/* Canonicalize 0 to sink; datasheet treats sign as don't-care. */
 		if (val > 0) {
 			raw.source_bit = DS4424_SOURCE_I;
 			raw.dx = val;
@@ -213,6 +214,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev)
 {
 	int ret, val;
 
+	/* No device ID; verify presence by a readable register. */
 	ret = ds4424_get_value(indio_dev, &val, 0);
 	if (ret < 0)
 		dev_err(&indio_dev->dev,
-- 
2.47.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ