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 2/3] iio: adc: hx711: refactor to per-chip hx711_chip_info structure
Date: Wed, 22 Apr 2026 23:16:47 +0300 [thread overview]
Message-ID: <aeksrz1Q0n5NMFUu@ashevche-desk.local> (raw)
In-Reply-To: <20260422175910.1258579-3-piyushpatle228@gmail.com>
On Wed, Apr 22, 2026 at 11:29:09PM +0530, Piyush Patle wrote:
...
> config HX711
> - tristate "AVIA HX711 ADC for weight cells"
> + tristate "AVIA HX711 and compatible ADCs"
> depends on GPIOLIB
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
> help
> - If you say yes here you get support for AVIA HX711 ADC which is used
> - for weigh cells
> + If you say Y here you get support for the following AVIA ADCs:
> + - HX711
> + which are used for bridge sensors such as weigh cells.
>
> This driver uses two GPIOs, one acts as the clock and controls the
> channel selection and gain, the other one is used for the measurement
This along with top comment and other text doesn't belong to the change, please
split into separate patch.
> +/**
> + * 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
> + */
> +struct hx711_chip_info {
> + const char *name;
> + const struct iio_chan_spec *channels;
> + unsigned int num_channels;
> + const struct iio_info *iio_info;
> +};
...
> /*
> - * delay after a rising edge on SCK until the data is ready DOUT
> - * this is dependent on the hx711 where the datasheet tells a
> - * maximum value of 100 ns
> - * but also on potential parasitic capacities on the wiring
> + * Delay after SCK rising edge before sampling DOUT.
> */
Doesn't seem like a part of this change.
...
> - for (i = 0; i < 24; i++) {
> + for (int i = 0; i < 24; i++) {
Be consistent. Why here is 'i' signed?
In any case doesn't belong to this change.
...
> - ret = hx711_read(hx711_data);
> + ret = hx711_read(hx711_data,
> + hx711_get_gain_to_pulse(hx711_data->gain_set));
This sounds like a separate change to me.
...
> -MODULE_DESCRIPTION("HX711 bitbanging driver - ADC for weight cells");
> +MODULE_DESCRIPTION("HX711 and compatible bitbanging ADC driver");
Doesn't belong to this change.
...
This needs to be split to 3 or even more patches!
- text in the MODULE_*(), top comments, and Kconfig
- chip_info initial change
- modifying the existing code to prepare for new HW support
(the above ^^^ might be done in a couple of patches)
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-22 20:16 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 [this message]
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
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=aeksrz1Q0n5NMFUu@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