linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] iio: adc: ad7124: proper clock support
@ 2025-08-25 22:54 David Lechner
  2025-08-25 22:55 ` [PATCH v2 1/4] dt-bindings: iio: adc: adi,ad7124: fix clocks properties David Lechner
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: David Lechner @ 2025-08-25 22:54 UTC (permalink / raw)
  To: Michael Hennerich, Jonathan Cameron, Nuno Sá,
	Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-iio, devicetree, linux-kernel, David Lechner

I started looking at adding some new features to the AD7124 driver and
noticed that the clock support was not quite right. The devicetree
bindings had a required "mclk" clock. MCLK is actually the name of an
internal counter in the ADC and also the name of the external clock
connection on the evaluation boards, so I guess it came from one or the
other of those. However, what the hardware actually has is a CLK pin
that can be wired up in one of three ways: not connected, input or
output. So the existing bindings making the clock required don't make
sense.

Furthermore, when looking at how this clock was being used in the
driver, I found that essentially this was being used as a way to
select the power mode of the ADC which is not at all how devicetree
bindings are supposed to work. The clock rate is fixed and the power
mode can change no matter what type of clock is being used. Again,
this just doesn't make sense.

So here is a series to fix the devicetree bindings and actually
implement proper clock support in the driver.

---
Changes in v2:
- Picked up review tag.
- Wrap some long lines and tweaked some other odd line wrapping.
- Dropped mention of "hack" from comments.
- Use __free() instead of devm_ to free temporary name variable earlier.
- Link to v1: https://lore.kernel.org/r/20250724-iio-adc-ad7124-proper-clock-support-v1-0-88f35db2fcaf@baylibre.com

---
David Lechner (4):
      dt-bindings: iio: adc: adi,ad7124: fix clocks properties
      iio: adc: ad7124: do not require mclk
      iio: adc: ad7124: add external clock support
      iio: adc: ad7124: add clock output support

 .../devicetree/bindings/iio/adc/adi,ad7124.yaml    |  21 +++-
 drivers/iio/adc/ad7124.c                           | 139 +++++++++++++++++----
 2 files changed, 134 insertions(+), 26 deletions(-)
---
base-commit: 91812d3843409c235f336f32f1c37ddc790f1e03
change-id: 20250723-iio-adc-ad7124-proper-clock-support-7249022a7349

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-08-26 16:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 22:54 [PATCH v2 0/4] iio: adc: ad7124: proper clock support David Lechner
2025-08-25 22:55 ` [PATCH v2 1/4] dt-bindings: iio: adc: adi,ad7124: fix clocks properties David Lechner
2025-08-25 22:55 ` [PATCH v2 2/4] iio: adc: ad7124: do not require mclk David Lechner
2025-08-25 22:55 ` [PATCH v2 3/4] iio: adc: ad7124: add external clock support David Lechner
2025-08-26  8:10   ` Andy Shevchenko
2025-08-26 15:17     ` David Lechner
2025-08-25 22:55 ` [PATCH v2 4/4] iio: adc: ad7124: add clock output support David Lechner
2025-08-26  8:13   ` Andy Shevchenko
2025-08-26 15:11     ` David Lechner
2025-08-26 15:32       ` Andy Shevchenko
2025-08-26  9:21   ` kernel test robot
2025-08-26 16:02   ` David Lechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).