From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93A1C3D3CE3; Tue, 23 Jun 2026 10:56:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782212160; cv=none; b=dpUl22ch7SjOMJEeYiIEQaVOOGYh8lp8wkbDbpNkU3EvCyht6JNBCrRXaQXLOzx8jc/ZJKhBxgZDcAxORHkFMWfstURfFvJEutaPyN59niXI0dZ2OAOkGuOK63ADl6RIYTAPB6FOgSwc+7C0cF8vZd4+WcKoLz+lwrIofI8ixZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782212160; c=relaxed/simple; bh=a5ii237YAQbZhAWbgzsaBxeKq5PZFGzly8bdIQIY/9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kUtnf8DDHwk4wP80R8jvWL2+TiVXIXgZUCUEpNdCcTeQB2ziIwxxeOS8Of+9qygc0ss+c74K9t6tUVQq040iFUz1RwOweK2jH0RQgPs4iYWosUcO8R2Yf8XwXaSFnYw76wABSu7Xaa2QZT6oHJsIq/PSqyF/wmFaJIh1POiWsAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T4norrIR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T4norrIR" Received: by smtp.kernel.org (Postfix) with ESMTPS id 03BE2C2BD01; Tue, 23 Jun 2026 10:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1782212160; bh=a5ii237YAQbZhAWbgzsaBxeKq5PZFGzly8bdIQIY/9k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=T4norrIRv0FDhsDghvEytrBY9dmw+cVGs1jIxSULRR8OawKQsAEI2gfy6njc9qX7u XolNqlQyRx/+oVygSIGnEc+0TkuEh8hMF/b+445WzKy/FbkGsX8Dp48j8bbK7JnhM2 rML16qrG6BtjPMlI9/eyCX3azCe6638oBwOJQa7GwnNrvGwjX17GnDdjBXd33Zrd14 0LakEkyfok1fWYWZNTlow1nrVjJGAbbYfIROwA60wme7LVihk35tLzT4S4hy4JG2cQ KjTcRD7h2ly1e0/X4p3hIzLKTTooTU3XT+tzPue97CdKX898tVqouYwomDaYidK95e glxdQuzDCVf5A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE9BCCDB47F; Tue, 23 Jun 2026 10:55:59 +0000 (UTC) From: Rodrigo Alencar via B4 Relay Date: Tue, 23 Jun 2026 11:55:47 +0100 Subject: [PATCH v4 07/12] iio: dac: ad5686: add ldac gpio Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260623-ad5686-new-features-v4-7-28962a57db0f@analog.com> References: <20260623-ad5686-new-features-v4-0-28962a57db0f@analog.com> In-Reply-To: <20260623-ad5686-new-features-v4-0-28962a57db0f@analog.com> To: Michael Auchter , linux@analog.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Cc: Michael Hennerich , Jonathan Cameron , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Kees Cook , "Gustavo A. R. Silva" , Rodrigo Alencar X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782212158; l=2164; i=rodrigo.alencar@analog.com; s=default; h=from:subject:message-id; bh=qIXIbMOm8r3LJQkfBJp1eZbsYSUAGUStilUJvzLUnp0=; b=whCIm+R7Ww3LF+rxDWOC4SeqbumoYAH3pEyYEVz4CldQOsdOP0R1owY250wmwkx+ZuiwuPK/A X/EXB6P9CJsAXrsCZQofGM9A7DjcNLLUqbGH4luam8CGtmrwB84baYB X-Developer-Key: i=rodrigo.alencar@analog.com; a=ed25519; pk=ULeHbgU/OYh/PG/4anHDfLgldFItQHAhOktYRVLMFRo= X-Endpoint-Received: by B4 Relay for rodrigo.alencar@analog.com/default with auth_id=561 X-Original-From: Rodrigo Alencar Reply-To: rodrigo.alencar@analog.com From: Rodrigo Alencar If wired LDAC, should be asserted when unused (pin is active-low), which allows for synchronous DAC updates. This will be used to update all the channels at the same time when adding buffer support. Signed-off-by: Rodrigo Alencar --- drivers/iio/dac/ad5686.c | 6 ++++++ drivers/iio/dac/ad5686.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index 8ad8931a3d7f..713fe71ad1e7 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -521,6 +522,11 @@ int ad5686_probe(struct device *dev, fsleep(1); reset_control_deassert(rstc); + st->ldac_gpio = devm_gpiod_get_optional(dev, "ldac", GPIOD_OUT_HIGH); + if (IS_ERR(st->ldac_gpio)) + return dev_err_probe(dev, PTR_ERR(st->ldac_gpio), + "Failed to get LDAC GPIO\n"); + /* Initialize masks to all ones */ st->pwr_down_mask = ~0; st->pwr_down_mode = ~0; diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index a06fe7d89305..c424720f8f72 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -60,6 +60,8 @@ enum ad5686_regmap_type { AD5686_REGMAP, }; +struct gpio_desc; + struct ad5686_state; /** @@ -119,6 +121,7 @@ extern const struct ad5686_chip_info ad5679r_chip_info; * @dev: device instance * @chip_info: chip model specific constants, available modes etc * @ops: bus specific operations + * @ldac_gpio: LDAC pin GPIO descriptor * @vref_mv: actual reference voltage used * @pwr_down_mask: power down mask * @pwr_down_mode: current power down mode @@ -131,6 +134,7 @@ struct ad5686_state { struct device *dev; const struct ad5686_chip_info *chip_info; const struct ad5686_bus_ops *ops; + struct gpio_desc *ldac_gpio; unsigned short vref_mv; unsigned int pwr_down_mask; unsigned int pwr_down_mode; -- 2.43.0