From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 AEE473AD50B for ; Sun, 3 May 2026 12:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777810204; cv=none; b=NmTWKGvYxykGXM1FjhBZ+oFUHBlXqF5NtV2ueqxOTW9LOxQaUHBASr9dwh5DBV4NPKMLmDBYOm4DwZfXHYAiNZq3oUyeMQk9/47rFig5SJhGrCoycZP21kdtJlxTbMwUywn3IEYdnYmpXsuNSz4HqqvL8kNQzz4/RThXs97r+LY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777810204; c=relaxed/simple; bh=SV3B/g37WUP64p+W/862f7gX61rxiGRnF3JOrS/DGIE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c9JD4Sy8a0D9F5ly/Dqq+CQygcObBF+c1FjFo1+9p48nP25wO9YBrTvV63X2N+IYlhTsENjHaaFqM58FO7c5AC+J1QRQViVESJ7lQl2QYOxVLDnQRWlkn62MhrEZkS4eDYEsjAOcc0lnmPH+IGMtQXHvq+w5Q8XyLZCtIn2WZCM= 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=fEC457Xa; arc=none smtp.client-ip=209.85.215.172 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="fEC457Xa" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c8025f1c227so302203a12.2 for ; Sun, 03 May 2026 05:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777810202; x=1778415002; 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=4mATdg5TAnsv6yqujjYHQNli4F9uj6Nj2HPuDvR1YhI=; b=fEC457XaFCM1Xba3ntKWUYC9AqVpG4z+VStiZzWAAzDDILlCI1XhUC2qiPqy3mvb10 bIgkeCohVZAqdwejeqn6ueVbXqqpTD9IQ7yPXASdm8EVfmqJG1Qix1q+ehVsVZotKRh0 q6s+pmc4bUldg+ZUVpwgdy4I7mndjroRuZ/6ZwZXwQk8Cq88B6l+efugkNVERctFVM6s LgN339V5P14QnErw/3CSCVJOsn3y/PXzO2f3r2XOVEOIix+MpQfwhLZ370lVhFm8HbZu Ousqm3DOFA1UnVCv8OMcdib38RGA4RGSP0Tf5XwB9tL0W2bLelv4O4760x3xDuXdkV8p Hikw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777810202; x=1778415002; 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=4mATdg5TAnsv6yqujjYHQNli4F9uj6Nj2HPuDvR1YhI=; b=tEopIgOdPrqrsYN9RB2s/+RUOPymnZou3C5YeSm23e70iyllI43wvcLxSaLXzJShbE g+vBSKsBxBKScT+jw99AujwjhAan2yXTLX6fB+2EQYWTXceI46urplbqltbf31/Hh3Uh nCc6I1jDchx+iVkLQt+nQouNUH65uLPnuYQhzJftUsgaFk689/0lBLK+8cya/JjCh8iT 1vvvM70e4v9EDBfXPLhtiLOEXNOAFu6y6RLsMTAnAnsJH510rvaTMmkzAv4A320RGVZ2 1M4pPFCLmJaUHSaUBjPyRWJBVTRRX65viXQ23x84Y+2pOnQY7K2AKGEo5Wgcl+OEFcrR VHVQ== X-Forwarded-Encrypted: i=1; AFNElJ/WhB2i+NMF6zSAWSzu5Wa1pAWRN7HDz3anavl1Hangg6ZqesZduYBdkdd/3AsCZkxDIAyDSpz5+0ITrq0=@vger.kernel.org X-Gm-Message-State: AOJu0Yzw9a+evMevSC+J35z1GRSnjWeM5IAWDC7k+b5rIpJVhlJJkOqp g8IB0mKlSgywoWoCxGP3gBIF9HuYIfrQylBNLmcaCLUkXu5MEXfJnn1v X-Gm-Gg: AeBDievOgICP3DROTtGO0iAldDNjcfljQYitTVvZBrDPiHgFgeQHF67WM0XNyrnGyQK cqzvP+Fo2g54lHZiz7XW+jzqFE8Nv5KMic1QqmLZGt0SnpEGTGs8zpzajyEzWNIqdGc/5YGEXp3 u3x+Vq6qdQ3Y5LMqQUAmGf4Kjv9Kj4p06KsPZBu0Tzwcd1huZnb0tB5BuMAQNV3xIznkepkDw07 /Cg4zRuRM0eM6ClJEtBnOjSwoMF0vgNhijJM4S8f/plKS1izoNoByYYmIhD/Zu2OCUCz/O8Ajf3 GxuVBmzxp7zM9BbWfOef2kWNyAK+1oWYoHYKmj43uXAZK9doknh7pkpfbuGegBIr3fKUYp33aR+ IkmeTIevMrVsnDXqyBlHBDBnEDdtYjaBje/Vo/8cnEuGvausC4dRj4aILYipwx2hUFpZhGUnYmc ThzOOhDbSQc3WrVFaIGtiDCFs7JVSmwDNyhZXHnvWkm3Oq2No+oCwTUg+rYXfyn7hvRcgtIr3pg j5uhnY3xSCvTTuBensJLYpwxo5yTebnthxs3JqDrPRerWAknwMtqgDZ34aFIRby/AwaHC0= X-Received: by 2002:a05:6a00:bc8f:b0:82c:9e00:f958 with SMTP id d2e1a72fcca58-8352ce6e3cfmr5583554b3a.0.1777810201788; Sun, 03 May 2026 05:10:01 -0700 (PDT) Received: from lord-daniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.www.tendawifi.com ([14.139.108.62]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8357c4f4530sm1474364b3a.9.2026.05.03.05.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2026 05:10:00 -0700 (PDT) From: Piyush Patle To: Andreas Klinger , Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 00/11] iio: adc: hx711: add HX710B support Date: Sun, 3 May 2026 17:39:29 +0530 Message-ID: <20260503120949.80292-1-piyushpatle228@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add support for the AVIA HX710B ADC, a HX711-compatible converter with the same GPIO interface but a different channel-selection model and a fixed gain of 128. Compared to v5, this series is unchanged functionally and only folds in the remaining review nits: - keep the per-variant probe local declarations in reversed xmas tree order - add a preparatory split-assignment patch before the loop-iterator cleanup, then keep the loop indices signed to match trailing_pulses - replace the 24-bit read loop bound with a named constant while touching the same code - keep the driver wording aligned on "weigh sensor modules" - rename fixed_gain to has_fixed_gain and drop the channel_set cast The DT binding split from v5 is kept as-is: - cleanup of the existing HX711 binding text - HX711-only VSUP documentation - HX711-only RATE GPIO documentation - HX710B binding addition Tested on PocketBeagle2 with an HX710B breakout module. The device probed successfully, all three channels returned stable raw readings, and alternating reads confirmed channel switching between the differential input and the DVDD-AVDD supply monitor path. Build-tested with: - make -s W=1 drivers/iio/adc/hx711.o - make -s dt_binding_check \ DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/adc/avia-hx711.yaml - pahole -C hx711_chip_info drivers/iio/adc/hx711.o pahole reports hx711_chip_info as 40 bytes with no internal holes. The remaining 7 bytes are tail padding from 8-byte pointer alignment. Changes in v6: - Fold the remaining review nits into the original 11-patch series rather than adding follow-up fixes. - Keep hx711_probe() local declarations in reversed xmas tree order in the hx711_chip_info patch. - Add a preparatory split-assignment patch before the loop-iterator cleanup and keep the iterator types signed to match trailing_pulses. - Replace the 24-bit hx711_read() loop bound with HX711_DATA_BITS in the loop-iterator patch. - Keep the driver header wording as "weigh sensor modules". - Rename fixed_gain to has_fixed_gain and make channel_set signed so the HX710B channel comparison no longer needs a cast. Piyush Patle (11): dt-bindings: iio: adc: hx711: clean up existing binding text dt-bindings: iio: adc: hx711: add VSUP supply property dt-bindings: iio: adc: hx711: add RATE GPIO property dt-bindings: iio: adc: hx711: add HX710B support iio: adc: hx711: move scale computation to per-device storage iio: adc: hx711: introduce hx711_chip_info structure iio: adc: hx711: pass trailing pulse count into hx711_read iio: adc: hx711: split variable assignments in hx711_read and hx711_reset iio: adc: hx711: localize loop iterators in hx711_read iio: adc: hx711: pass iio_chan_spec to hx711_reset_read iio: adc: hx711: add support for HX710B .../bindings/iio/adc/avia-hx711.yaml | 77 ++++- drivers/iio/adc/Kconfig | 8 +- drivers/iio/adc/hx711.c | 299 ++++++++++++++---- 3 files changed, 308 insertions(+), 76 deletions(-) -- 2.43.0