The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support
  2026-08-17 21:11 [PATCH v4 0/6] iio: dac: ad5504: bindings, cleanups, locking, and scale fixes Taha Ed-Dafili
@ 2026-08-17 21:11 ` Taha Ed-Dafili
  2026-08-18  4:45   ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Taha Ed-Dafili @ 2026-08-17 21:11 UTC (permalink / raw)
  To: jic23, lars
  Cc: Michael.Hennerich, robh, krzk+dt, conor+dt, dlechner, nuno.sa,
	andy, skhan, linux, linux-iio, devicetree, linux-kernel,
	Taha Ed-Dafili

The AD5504 driver contains fallback logic to use legacy pdata for
configuration. Since modern systems configure hardware exclusively
using device tree or ACPI, and there are no in tree users for it.
It can be safely removed.

Drop the ad5504_platform_data structure, remove the fallback logic
from the probe function, and delete the dedicated
include/linux/iio/dac/ad5504.h header file.

Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
---
 drivers/iio/dac/ad5504.c       | 14 +++-----------
 include/linux/iio/dac/ad5504.h | 15 ---------------
 2 files changed, 3 insertions(+), 26 deletions(-)
 delete mode 100644 include/linux/iio/dac/ad5504.h

diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
index 689147cdaa14..55ce7e49e0e0 100644
--- a/drivers/iio/dac/ad5504.c
+++ b/drivers/iio/dac/ad5504.c
@@ -18,7 +18,6 @@
 #include <linux/sysfs.h>
 #include <linux/types.h>
 
-#include <linux/iio/dac/ad5504.h>
 #include <linux/iio/events.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -275,7 +274,6 @@ static const struct iio_chan_spec ad5504_channels[] = {
 static int ad5504_probe(struct spi_device *spi)
 {
 	struct device *dev = &spi->dev;
-	const struct ad5504_platform_data *pdata = dev_get_platdata(dev);
 	struct iio_dev *indio_dev;
 	struct ad5504_state *st;
 	int ret;
@@ -287,16 +285,10 @@ static int ad5504_probe(struct spi_device *spi)
 	st = iio_priv(indio_dev);
 
 	ret = devm_regulator_get_enable_read_voltage(dev, "vcc");
-	if (ret < 0 && ret != -ENODEV)
+	if (ret < 0)
 		return ret;
-	if (ret == -ENODEV) {
-		if (pdata->vref_mv)
-			st->vref_mv = pdata->vref_mv;
-		else
-			dev_warn(dev, "reference voltage unspecified\n");
-	} else {
-		st->vref_mv = ret / 1000;
-	}
+
+	st->vref_mv = ret / 1000;
 
 	st->spi = spi;
 	indio_dev->name = spi_get_device_id(st->spi)->name;
diff --git a/include/linux/iio/dac/ad5504.h b/include/linux/iio/dac/ad5504.h
deleted file mode 100644
index 9f23c90486ee..000000000000
--- a/include/linux/iio/dac/ad5504.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * AD5504 SPI DAC driver
- *
- * Copyright 2011 Analog Devices Inc.
- */
-
-#ifndef SPI_AD5504_H_
-#define SPI_AD5504_H_
-
-struct ad5504_platform_data {
-	u16				vref_mv;
-};
-
-#endif /* SPI_AD5504_H_ */
-- 
2.55.0


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

* Re: [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support
  2026-08-17 21:11 ` [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support Taha Ed-Dafili
@ 2026-08-18  4:45   ` Andy Shevchenko
  2026-08-19  8:22     ` Taha Ed-Dafili
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2026-08-18  4:45 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: jic23, lars, Michael.Hennerich, robh, krzk+dt, conor+dt, dlechner,
	nuno.sa, andy, skhan, linux, linux-iio, devicetree, linux-kernel

On Mon, Aug 17, 2026 at 05:11:12PM -0400, Taha Ed-Dafili wrote:
> The AD5504 driver contains fallback logic to use legacy pdata for
> configuration. Since modern systems configure hardware exclusively
> using device tree or ACPI, and there are no in tree users for it.
> It can be safely removed.
> 
> Drop the ad5504_platform_data structure, remove the fallback logic
> from the probe function, and delete the dedicated
> include/linux/iio/dac/ad5504.h header file.

This breaks the case with dummy regulators as far as I can see.
Has this been discussed in the previous rounds?

...

> -	if (ret == -ENODEV) {

> -		else
> -			dev_warn(dev, "reference voltage unspecified\n");


This one.

...

In general it's a good change.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support
  2026-08-18  4:45   ` Andy Shevchenko
@ 2026-08-19  8:22     ` Taha Ed-Dafili
  2026-08-19 13:21       ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Taha Ed-Dafili @ 2026-08-19  8:22 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: 0rayn.dev, Michael.Hennerich, andy, conor+dt, devicetree,
	dlechner, jic23, krzk+dt, lars, linux-iio, linux-kernel, linux,
	nuno.sa, robh, skhan

> This breaks the case with dummy regulators as far as I can see.
> Has this been discussed in the previous rounds?

Yes, David Lechner suggested in v3 to follow the pattern in
adc/ti-ads7950.c. Patch 3 is an intermediate state. Patch 5 replaces
this block with ACPI_COMPANION() fork.

Best Regards,
Taha Ed-dafili

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

* Re: [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support
  2026-08-19  8:22     ` Taha Ed-Dafili
@ 2026-08-19 13:21       ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-08-19 13:21 UTC (permalink / raw)
  To: Taha Ed-Dafili
  Cc: Michael.Hennerich, andy, conor+dt, devicetree, dlechner, jic23,
	krzk+dt, lars, linux-iio, linux-kernel, linux, nuno.sa, robh,
	skhan

On Wed, Aug 19, 2026 at 04:22:21AM -0400, Taha Ed-Dafili wrote:
> > This breaks the case with dummy regulators as far as I can see.
> > Has this been discussed in the previous rounds?
> 
> Yes, David Lechner suggested in v3 to follow the pattern in
> adc/ti-ads7950.c. Patch 3 is an intermediate state. Patch 5 replaces
> this block with ACPI_COMPANION() fork.

But this is still a runtime bisectability issue.
Not critical most likely, but still...

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support
       [not found] <aoWt52LMj5nviqAVe3O@ashevche-desk.local>
@ 2026-08-19 20:13 ` Taha Ed-Dafili
  0 siblings, 0 replies; 5+ messages in thread
From: Taha Ed-Dafili @ 2026-08-19 20:13 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: 0rayn.dev, Michael.Hennerich, andy, conor+dt, devicetree,
	dlechner, jic23, krzk+dt, lars, linux-iio, linux-kernel, linux,
	nuno.sa, robh, skhan

> But this is still a runtime bisectability issue.
> Not critical most likely, but still...

I see your point. My plan for v5 is to reorder: introduce the ACPI/DT
fork first, then remove pdata on top of it. That way the -ENODEV case
is already handled by the ACPI fork when pdata is removed. What do you
think of this approach?

Best Regards,
Taha Ed-dafili

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

end of thread, other threads:[~2026-08-19 20:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <aoWt52LMj5nviqAVe3O@ashevche-desk.local>
2026-08-19 20:13 ` [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support Taha Ed-Dafili
2026-08-17 21:11 [PATCH v4 0/6] iio: dac: ad5504: bindings, cleanups, locking, and scale fixes Taha Ed-Dafili
2026-08-17 21:11 ` [PATCH v4 3/6] iio: dac: ad5504: remove legacy platform data support Taha Ed-Dafili
2026-08-18  4:45   ` Andy Shevchenko
2026-08-19  8:22     ` Taha Ed-Dafili
2026-08-19 13:21       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox