public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Piyush Patle <piyushpatle228@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Andreas Klinger" <ak@it-klinger.de>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] iio: adc: hx711: add support for HX710B
Date: Wed, 22 Apr 2026 23:20:51 +0300	[thread overview]
Message-ID: <aekto_uV5JXkOibo@ashevche-desk.local> (raw)
In-Reply-To: <20260422175910.1258579-4-piyushpatle228@gmail.com>

On Wed, Apr 22, 2026 at 11:29:10PM +0530, Piyush Patle wrote:
> Add support for the AVIA HX710B ADC, which shares the HX711 GPIO
> interface but has a fixed gain of 128 and uses trailing PD_SCK pulses
> to select between the differential input and the DVDD-AVDD supply
> monitor.
> 
> Model the HX710B with its own channel specification and iio_info.
> Store the HX710B trailing pulse counts in chan->address and add
> fixed-gain handling so the HX711 selectable-gain path remains
> separate from the HX710B fixed-gain path.
> 
> The HX710B datasheet documents a single fixed PGA gain of 128 and
> does not provide configurable gain selection like the HX711.
> 
> Order hx711_chip_info as pointers first, then unsigned int fields, then
> bool. pahole then reports no internal holes in the structure; the
> remaining padding is tail padding from 8-byte alignment.
> 
> Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
> ---
> Changes in v3:
> - Add HX710B support on top of the separate hx711_chip_info refactor.
> - Update channel_set only after hx711_read() and hx711_wait_for_ready()
>   both succeed.
> - Keep a single HX710B fixed-gain scale based on the datasheet's fixed
>   PGA gain of 128; do not apply the HX711 channel-B gain of 32 to the
>   HX710B supply monitor path.
> - Use unsigned int for channel state and fixed-gain scale storage.
> - Keep HX710B trailing pulse counts in chan->address.
> - Describe HX710B channel 0 as a differential IIO channel.
> - Reorder hx711_chip_info fields based on pahole output so the
>   structure has no internal holes.
> 
> Changes in v2:
> - Fix pulse count bug: HX710B values were {25, 26} total SCK cycles;
>   corrected to {1, 2} trailing pulses because hx711_read() already
>   clocks the 24 data bits.
> - Add .differential = 1 and .channel2 = 1 to HX710B channel 0.
> - Move trailing pulse counts from a separate array to chan->address.
> - Replace chan_pulse_count tests with a dedicated fixed_gain flag.
> - Add fixed_gain_val to hx711_chip_info.
> - Add the iio_info pointer to hx711_chip_info and assign
>   indio_dev->info from chip_info.
> - Remove the NULL check after device_get_match_data().
> - Remove reset_channel from hx711_chip_info.
> - Change hx711_reset_read() and hx710b_set_channel() to take
>   const struct iio_chan_spec *.
> - Revert unrelated hx711_data struct member alignment noise.
> - Sort of_device_id entries alphabetically.
> - Expand the commit message to explain HX711 versus HX710B trailing
>   pulse behaviour.
> - Restore the file header to mention weight sensor modules.

...

>   * struct hx711_chip_info - per-variant static configuration
>   * @name: IIO device name
>   * @channels: channel specification
> - * @num_channels: number of channels
>   * @iio_info: IIO info ops for this variant
> + * @num_channels: number of channels

>  struct hx711_chip_info {

> -	unsigned int			num_channels;
>  	const struct iio_info		*iio_info;
> +	unsigned int			num_channels;

>  };

No ping-pong patches, please. If you know the result, place the field in the
structure and kernel-doc in the place where it will stay during the entire
chain of changes in the same series. I.o.w. ideally you must have no '-' lines
_at all_ in this patch.

...

Also, split to a couple more preparatory patches. Altogether I expect this
series to be ~7 patches or more.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-22 20:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 17:59 [PATCH v3 0/3] iio: adc: hx711: add HX710B support Piyush Patle
2026-04-22 17:59 ` [PATCH v3 1/3] dt-bindings: iio: adc: avia-hx711: add avia,hx710b compatible Piyush Patle
2026-04-23  8:05   ` Krzysztof Kozlowski
2026-04-24 12:00   ` Jonathan Cameron
2026-04-26 16:28   ` David Lechner
2026-04-26 16:43     ` Piyush Patle
2026-04-22 17:59 ` [PATCH v3 2/3] iio: adc: hx711: refactor to per-chip hx711_chip_info structure Piyush Patle
2026-04-22 20:16   ` Andy Shevchenko
2026-04-24 11:53   ` Jonathan Cameron
2026-04-24 12:14   ` Jonathan Cameron
2026-04-22 17:59 ` [PATCH v3 3/3] iio: adc: hx711: add support for HX710B Piyush Patle
2026-04-22 20:20   ` Andy Shevchenko [this message]
2026-04-24 12:19   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aekto_uV5JXkOibo@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=ak@it-klinger.de \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=piyushpatle228@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox