From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 F18FC392C47 for ; Wed, 22 Apr 2026 17:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776880760; cv=none; b=tR7Y+mOeqzg1dd+ICxPknoI67f49KuWtAFaU8/n4N8OsTGl7yxg8JpgW+aGXQgPq6Tas3SRxg1ZCRTBmpzvstmxyHKkCnbTe6hh0tx1qpCF7p2uUSiHJOV12UIb0LpMgQKBbqnbooa2MkUVbCAcTEDxsfsJIJS6K74O5/sMS7pY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776880760; c=relaxed/simple; bh=oSwSjRcqFgmUDNciLfbR3xEQk2X154orQ4R79xVy2bw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VvVU3PQ+3/P4QocWchNzMcz/vsWfU5S/ZQlaZs0wemKjsJc9c1G3CQBwUfgRO5O2RkbNWX6RiBM6ggTHn0D3xVzkXJlw0UKOUDCwzL2E7nI/jyOTkAV7Kux/vfKV0/zn22R1HyhZdZ4d9riNJSeFY70odWlRqqHq2Jm1AT8tgws= 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=lWo4IRsy; arc=none smtp.client-ip=209.85.215.178 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="lWo4IRsy" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c70fb6aa323so2013932a12.3 for ; Wed, 22 Apr 2026 10:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776880758; x=1777485558; 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=hzVO1meE1c/JGoIEI9CESvSlvQaIMvGuuQhtTpxCv40=; b=lWo4IRsyCJKInuqAxJxGrDUOZ3h9AS6V8NnuG/98YaJ6uSciaDLhkfjINcP/4avGiu 18NX4HY9MDrCoVWz79HpaIV3pWJeOVdB6LRcUNaRBf6f74muZsvNCr70PioXITHA8mzC q2Bjh95BhXSp3UCxQeIqb1W+COoj8OrKUuKCVkqFYpqmepZ/g5CicpY3P9CNZ9naAGn9 QnXGbBqs8vha0RTCMjr9u1HyvXSDTBzamona2U70Lz22Qm691UzA7bSTPBqvGf+nnzCJ gjTlJS973NBiNMaz+3+KTxW1VrHCWAncQeyVGQ9FKji2kSYDSqMXAtSztuzwTuUnCtDv NirQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776880758; x=1777485558; 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=hzVO1meE1c/JGoIEI9CESvSlvQaIMvGuuQhtTpxCv40=; b=gmEpKFKCS5BwiEzrY/oIPS63c2iEXFnpckGmBCi7h5sBOaOcr57W8nfZZ+KxUbhwRn cPDZsqTDxnb8v5Dx0y/1qS5mdhpcrlHv4wjQnsU0u1o4CXKF0UZLayzEnAVr/JdiCsNR SYyaVn5am4TEbqqwSPOrpJ7EnlLQPjJIMNKGYznWFmki5qso4ZrxwVodRQ9s45yB7Fpg AhHGoNRvijIBMWixTjSsW3tIFvfI9LAs4sLxZZqdPF/UeeTXyV1nUlgb+P4KUy9HhQO4 SAJZqm5pgUYxSUHoeFm8UWu2A0myUmnYhYx3562qzbWYtpg8YNO36dhj1bqQt/8zY6M8 3G5Q== X-Forwarded-Encrypted: i=1; AFNElJ8YiBBZJH0LZ8PukmDNkdP9x85e4CkGzRlksdlGfDYJpHMj9D9Phj3Z2MF6p1LFw5PzmWdKIgQ2G6EQI2c=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8GMXx1z1YPv6qgTYmfv6ySJN5lDZAGPMz1y9PX8Xdcp/f+mUN nbCNGYmVzGoNgRYw41xBI350oJNhtPvqpxYu79rFM0sHjZD1TYPraZZM X-Gm-Gg: AeBDies9/OdXWpFHoDjnSQrn/NEk61bzckFti2stdcGjDjtzx840DhFXAof4VZtyKj6 hQuZB7xzUfO3wIrF03/SlRG4xIQ/BsgjUsmKzTYEvrS2NJa3zPuUOVedTgzst7tgZ/8srIULNdP AkHydGAQqPvahkjiNX/gt/D3Ditj8i/MjoQlynjZK2EyObD1MXIOyib4vmqIxM5T0IFB3xyKcVS aJkqw5zH0e7iMWsN/bTzWYTu+y4cJJzk4rHBAslkdsVIFn1LmbaKrW5xph32y0r918QhRxBKZqV G/niZXqYHwxRjanp4BHJtjk//YjWQzsu0fgHh17Yrugl/HjOP1NVV3KNzvvosYqfx0MPuZX5sWL B9NhaXPEQI73eGyAubFhGodPYyzAfSMpmS6X2FlK0AYg+tyobLfZbHgf2otSXJnQDkOQOCNDPvA beii2O/NkehGyvC3CDr/Np2mKsuR8gQjWRB+kFHtVCE+IuhppBqFiGALS+5aBlGmfYUCSkteWBD S9zhsIZi9zd5ym+ebQFV3X9uoWPetVgCc6q+Q4fbplsbLoHY/U= X-Received: by 2002:a05:6a20:7350:b0:3a2:bd1d:d68c with SMTP id adf61e73a8af0-3a2bd1dd849mr15278903637.50.1776880758180; Wed, 22 Apr 2026 10:59:18 -0700 (PDT) Received: from lord-daniel-VivoBook-ASUSLaptop-K3502ZA-S3502ZA.. ([2405:201:31:d01f:48f3:f940:b423:53fc]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976f9cacasm15174361a12.8.2026.04.22.10.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 10:59:17 -0700 (PDT) From: Piyush Patle To: Jonathan Cameron , Andreas Klinger Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] iio: adc: hx711: add HX710B support Date: Wed, 22 Apr 2026 23:29:07 +0530 Message-ID: <20260422175910.1258579-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 HX710B ADC, a variant of the HX711 with the same GPIO interface but a different channel and gain model. The first patch updates the devicetree binding to add the `avia,hx710b` compatible, document the variant-specific behavior, and add chip-specific properties for supplies, the RATE pin, and an allOf constraint for HX710B nodes. The second patch refactors the driver with per-chip configuration and keeps the existing HX711 behavior unchanged. The third patch adds HX710B support using that infrastructure, with pulse counts stored in chan->address, a dedicated fixed_gain flag, and the differential channel descriptor for the HX710B input. Tested on PocketBeagle2 with an HX710B breakout module. The device probed successfully, both 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 - 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 alignment. Changes in v3: - See individual patch changelogs for full details. - dt-bindings: remove vref-supply wording; drop repeated clock-frequency default text; restore example node name; remove the extra HX710B example - driver: split the hx711_chip_info refactor from the HX710B support patch; fix signedness; update channel_set only after successful channel switching; keep HX710B scale based on the documented fixed gain of 128; add direct ARRAY_SIZE/types includes; use pahole to verify and improve hx711_chip_info field ordering - Reworked Kconfig text to use "HX711 and compatible ADCs" and list supported AVIA ADCs one per line. - Restored/updated driver header and module description wording while keeping the bitbanging context. Changes in v2: - See individual patch changelogs for full details. - dt-bindings: add dvdd-supply, vsup-supply, rate-gpios; allOf if/then for HX710B; fix clock-frequency description; remove dead vendor URL; clarify AVDD as voltage reference on both chips - driver: fix pulse count bug ({25,26}->{1,2}); move counts to chan->address; add fixed_gain flag; add .differential/.channel2; remove NULL check; drop reset_channel; pass iio_chan_spec * directly Piyush Patle (3): dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible iio: adc: hx711: refactor to per-chip hx711_chip_info structure iio: adc: hx711: add support for HX710B .../bindings/iio/adc/avia-hx711.yaml | 50 +++- drivers/iio/adc/Kconfig | 8 +- drivers/iio/adc/hx711.c | 216 ++++++++++++++---- 3 files changed, 221 insertions(+), 53 deletions(-) -- 2.43.0