From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED0DD2E9730 for ; Tue, 10 Mar 2026 17:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164927; cv=none; b=HrHmype+eoh3f5TPZ4kVL3j6gNh6G13MbdHD4DQN8uLEkkx+ObF+StgSGI7LT8kZZ3DPNjm2sOmVCaUX+wu0PNocpXBi+W8mHL2WiPA8wBmktVM2AKBHnIVqmQ08Bo/xZzD08kabY8PlDKXbUYjWUexnt64TVwFp/wfMdAa09co= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773164927; c=relaxed/simple; bh=CAt5rbLDMhxVLmOqiqlVM1mP0fA6B6zhT5OMjhjh6p4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rLaL8TsYIhjr0XUIbPXpeeNF09gi3ERI6YjpT2ozWWJwAjHxodRasIGqeiKY3znyBORe9UPJYE/9BLvTO0dKpH2X8k/1CVklkgNr5isB0rJE69SffoxTb9ByiGTphAeWCPVWLqWjCC6qu8s/449PWOfHkyZSEFoC6x5EGXlOLfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eQ88UCSW; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eQ88UCSW" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48539cbb7b1so18169515e9.3 for ; Tue, 10 Mar 2026 10:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773164923; x=1773769723; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2dldqyonvLVTQ/Lexaotmy5KRFPJ0gpKjoNB+Wq1yLo=; b=eQ88UCSW5DYGD7Ov835QPzK1xYqpr8tVgdb5t3TiSL3lJ1W1HjNPFWHNqVgEXbZdnx IIG/MMZkalA3fAfMURSphGYxS9bJWt4WSO5DKWEVYikHb2DhZtpYQRm3RJCa/3Xnc0xd 5bmSWHLNPsoeiYA/3nlzXhR/TDqY5kpmz5CeWkG0RZzilsKL8dNOCxKfxfcPh/7rhXMU G4q+JsIWD8tZCrrfRkaX+91A4y0BirPAbLurkZpMEB+hVQgHOupar+Q6s57Bzbki2s5J hQwnAL7SCiuegeioHEWpi7hD3QDPZ67hpatdjsoaB0u8Sz2AuDKvmcNk9ZRMFrAk+8ct LPRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773164923; x=1773769723; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2dldqyonvLVTQ/Lexaotmy5KRFPJ0gpKjoNB+Wq1yLo=; b=c4sMnUyBgqWWLBZLVWxTubdjdFsKh8f/Bwa9m7Z+qCKqx7lAcPDbsdXmo+dyJTVusO OkkQBNTF9sIHS/OCEsjNJGOFy1Cz4Kj6vXUnZMKqiEoHUegK7BqPKn06icbPgeyH/2j2 ZoRNIZ9Rvj7kgvaO10VnvPhE68U9EP2FVgLIBfQIN5VD0XLiDgWS+Vk5c4gJ2vHiZD19 9ZZK5sl4YGOvjwC3FIT35FVfLjH7wjppP4XV0IkvOkz3HmH6bmeb7CLBD06fonmQ7aYo kL0MjgUXksle+88cQL2BoHlqXhxhUjsQalC9d3uEM2089oxHeevEdbOpxyXRpnKBaRGV O5Ng== X-Forwarded-Encrypted: i=1; AJvYcCWyIfD8tqNV5o2bqoutEkILfdYYOCjmAjKqQ+y7IhSP8bVe7Uv2dmhLNLT+5A3sKj+Qg8+jcC8QS09NRuo=@vger.kernel.org X-Gm-Message-State: AOJu0Ywvz8xkIkgZo64KwkF+QtGEF89whtovoKche6fzcFfHs2TC7j5z VXb+FCgb69cdW0zo2oAiVpk7/Nr+3gAlizAgb5Hl45Zq2ZtizaebeXUN X-Gm-Gg: ATEYQzxqO6XuaSEyMOjV7ZMmUnN/MnSj7C66U+I1fC11L7Rt5hZnkxbL5X5PsQ+YrOJ Q/jBZW4Hh7Mknfaqmxue24KYf59p8nryLXdX3XUTvbtpSWkczSGgpNcO1ZzyZ9F9N/xlgSZAfGc WMiJlz1VtyYz3c1s95ZsKrfh36/13RwxjRgTcjANqyKvxnAH1DJb3hnPQ3wIx79zc4Kxr+84ogv qdqRKF3/TayRbPStaRtno2YVITqBjzcFGg4AHrHTERLi6brEEOwYx6tHeCDErp/h0MYUKeMxY06 ptpAyfNPcas/AZGCS2CufrPkcxUntyXIYbJYMaQaWoTakPQ9kgNUlXLAb0HWzaJ1T87JVQOJvtr gwOKztMEcfjT13/JtQxgju0fE53Ngt8z4LufzWFunG7o5GdzgAqTZ9E3M54EqIeP/fQlRVV1lmz Ht4oAjfSSJXyHnFqFGOadX70UwuurlnvSFVXbsJpXSmANQr4SiEJ3J5s+z1eJjzu6u0yHp X-Received: by 2002:a05:600c:35d2:b0:485:3ca4:4eee with SMTP id 5b1f17b1804b1-4853ca45255mr123439525e9.34.1773164923066; Tue, 10 Mar 2026 10:48:43 -0700 (PDT) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dae45786sm42986166f8f.32.2026.03.10.10.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 10:48:42 -0700 (PDT) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, skhan@linuxfoundation.org, me@brighamcampbell.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v2 0/5] iio: dac: ad5504: fix voltage scaling and add missing bindings Date: Tue, 10 Mar 2026 17:48:30 +0000 Message-ID: <20260310174835.24209-1-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes the voltage scale calculation for the AD5504 DAC and updates the devicetree bindings to support the necessary hardware configuration. Previously, the driver calculated the scale based on the VCC supply voltage. However, the AD5504 has an integrated precision reference, and the output range is determined strictly by the state of the R_SEL pin (0-30V or 0-60V). This series updates the bindings to use standard IIO DAC properties, aligns the driver headers with the IWYU principle, and fixes the core scaling bug while adding support for the hardware's optional GPIOs. Changes in v2: - Replaced vendor-specific adi,output-range-volts with the standard output-range-microvolt property array (Krzysztof). - Replaced adi,output-range-gpios with standard range-sel-gpios (Krzysztof). - Refactored allOf block in bindings to use not/required logic (Krzysztof). - Split header updates into two patches: alphabetical sorting and IWYU compliance (Andy). - Used MILLI and MICRO macros to replace hardcoded values (Andy). - Used a local dev pointer to respect the 80-character limit and realigned function arguments accordingly (Andy). - Added driver implementation for the optional CLR and LDAC GPIOs (new in v2) Thank you to Jonathan Cameron, Krzysztof Kozlowski, Andy Shevchenko, and David Lechner for the reviews, schema guidance, and C optimizations on v1. Note: I do not have access to the physical AD5504 hardware, so this series has been strictly compile-tested and validated against dt_binding_check based on the datasheet specifications. Taha Ed-Dafili (5): dt-bindings: iio: dac: ad5504: add output-range and missing gpios iio: dac: ad5504: sort headers alphabetically iio: dac: ad5504: Align headers with IWYU principle iio: dac: ad5504: fix scale via output-range-microvolt iio: dac: ad5504: add optional GPIO control for CLR and LDAC .../bindings/iio/dac/adi,ad5504.yaml | 40 ++++++++++- drivers/iio/dac/ad5504.c | 70 ++++++++++++------- 2 files changed, 84 insertions(+), 26 deletions(-) -- 2.47.3