All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] IIO: More of to generic fw conversions.
@ 2021-12-04 17:12 Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
                   ` (12 more replies)
  0 siblings, 13 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

v2: Drop platform data from ad5755 as suggested by Lars.
    Collect tags.

Nothing particularly special about this series, just a few
more drifvers converted and related header and Kconfig
dependency cleanups.

For now I'm focussing mostly on standalone parts rather than
those integrated in SoCs.

Any feedback welcome.

Thanks,

Jonathan

Jonathan Cameron (12):
  iio:dac:ad5755: Switch to generic firmware properties and drop pdata
  iio:dac:ad5758: Drop unused of specific headers.
  iio:dac:dpot-dac: Swap of.h for mod_devicetable.h
  iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h
  iio:pot:mcp41010: Switch to generic firmware properties.
  iio:light:cm3605: Switch to generic firmware properties.
  iio:adc:max9611: Switch to generic firmware properties.
  iio:adc:mcp3911: Switch to generic firmware properties.
  iio:adc:ti-adc12138: Switch to generic firmware properties.
  iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h
  iio:adc:ti-ads124s08: Drop dependency on OF.
  iio:adc/dac:Kconfig: Update to drop OF dependencies.

 drivers/iio/adc/Kconfig              |   6 +-
 drivers/iio/adc/envelope-detector.c  |   3 +-
 drivers/iio/adc/max9611.c            |  20 ++--
 drivers/iio/adc/mcp3911.c            |   8 +-
 drivers/iio/adc/ti-adc12138.c        |   9 +-
 drivers/iio/adc/ti-ads124s08.c       |   3 +-
 drivers/iio/dac/Kconfig              |   1 -
 drivers/iio/dac/ad5755.c             | 150 ++++++++++++++++++++-------
 drivers/iio/dac/ad5758.c             |   3 +-
 drivers/iio/dac/dpot-dac.c           |   2 +-
 drivers/iio/dac/lpc18xx_dac.c        |   3 +-
 drivers/iio/light/cm3605.c           |   6 +-
 drivers/iio/potentiometer/mcp41010.c |   6 +-
 include/linux/platform_data/ad5755.h | 102 ------------------
 14 files changed, 145 insertions(+), 177 deletions(-)
 delete mode 100644 include/linux/platform_data/ad5755.h

-- 
2.34.1


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

* [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-05 15:02   ` Andy Shevchenko
  2021-12-04 17:12 ` [PATCH v2 02/12] iio:dac:ad5758: Drop unused of specific headers Jonathan Cameron
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Lars pointed out that platform data can also be supported via the
generic properties interface, so there is no point in continuing to
support it separately.  Hence squish the linux/platform_data/ad5755.h
header into the c file and drop accessing the platform data directly.

Done by inspection only.  Mostly completely mechanical with the
exception of a few places where default value handling is
cleaner done by first setting the value, then calling the
firmware reading function but and not checking the return value,
as opposed to reading firmware then setting the default if an error
occurs.

Part of general attempt to move all of IIO over to generic
device properties, both to enable other firmware types and
to remove drivers that can be the source of of_ specific
behaviour in new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---

v2: Drop directly allowing platform data in favour of relying on the
    generic firmware properties route if anyone does want to use this
    from a board file or similar.
    Note that we could refactor the driver more significantly but it
    doesn't seem worth the effort at this stage adn would make this
    patch a lot less clear to read.
    
 drivers/iio/dac/ad5755.c             | 150 ++++++++++++++++++++-------
 include/linux/platform_data/ad5755.h | 102 ------------------
 2 files changed, 114 insertions(+), 138 deletions(-)

diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index cabc38d54085..01ae9ca6f3e5 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -13,10 +13,9 @@
 #include <linux/slab.h>
 #include <linux/sysfs.h>
 #include <linux/delay.h>
-#include <linux/of.h>
+#include <linux/property.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-#include <linux/platform_data/ad5755.h>
 
 #define AD5755_NUM_CHANNELS 4
 
@@ -63,6 +62,101 @@
 #define AD5755_SLEW_RATE_SHIFT			3
 #define AD5755_SLEW_ENABLE			BIT(12)
 
+enum ad5755_mode {
+	AD5755_MODE_VOLTAGE_0V_5V		= 0,
+	AD5755_MODE_VOLTAGE_0V_10V		= 1,
+	AD5755_MODE_VOLTAGE_PLUSMINUS_5V	= 2,
+	AD5755_MODE_VOLTAGE_PLUSMINUS_10V	= 3,
+	AD5755_MODE_CURRENT_4mA_20mA		= 4,
+	AD5755_MODE_CURRENT_0mA_20mA		= 5,
+	AD5755_MODE_CURRENT_0mA_24mA		= 6,
+};
+
+enum ad5755_dc_dc_phase {
+	AD5755_DC_DC_PHASE_ALL_SAME_EDGE		= 0,
+	AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE	= 1,
+	AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE	= 2,
+	AD5755_DC_DC_PHASE_90_DEGREE			= 3,
+};
+
+enum ad5755_dc_dc_freq {
+	AD5755_DC_DC_FREQ_250kHZ = 0,
+	AD5755_DC_DC_FREQ_410kHZ = 1,
+	AD5755_DC_DC_FREQ_650kHZ = 2,
+};
+
+enum ad5755_dc_dc_maxv {
+	AD5755_DC_DC_MAXV_23V	= 0,
+	AD5755_DC_DC_MAXV_24V5	= 1,
+	AD5755_DC_DC_MAXV_27V	= 2,
+	AD5755_DC_DC_MAXV_29V5	= 3,
+};
+
+enum ad5755_slew_rate {
+	AD5755_SLEW_RATE_64k	= 0,
+	AD5755_SLEW_RATE_32k	= 1,
+	AD5755_SLEW_RATE_16k	= 2,
+	AD5755_SLEW_RATE_8k	= 3,
+	AD5755_SLEW_RATE_4k	= 4,
+	AD5755_SLEW_RATE_2k	= 5,
+	AD5755_SLEW_RATE_1k	= 6,
+	AD5755_SLEW_RATE_500	= 7,
+	AD5755_SLEW_RATE_250	= 8,
+	AD5755_SLEW_RATE_125	= 9,
+	AD5755_SLEW_RATE_64	= 10,
+	AD5755_SLEW_RATE_32	= 11,
+	AD5755_SLEW_RATE_16	= 12,
+	AD5755_SLEW_RATE_8	= 13,
+	AD5755_SLEW_RATE_4	= 14,
+	AD5755_SLEW_RATE_0_5	= 15,
+};
+
+enum ad5755_slew_step_size {
+	AD5755_SLEW_STEP_SIZE_1 = 0,
+	AD5755_SLEW_STEP_SIZE_2 = 1,
+	AD5755_SLEW_STEP_SIZE_4 = 2,
+	AD5755_SLEW_STEP_SIZE_8 = 3,
+	AD5755_SLEW_STEP_SIZE_16 = 4,
+	AD5755_SLEW_STEP_SIZE_32 = 5,
+	AD5755_SLEW_STEP_SIZE_64 = 6,
+	AD5755_SLEW_STEP_SIZE_128 = 7,
+	AD5755_SLEW_STEP_SIZE_256 = 8,
+};
+
+/**
+ * struct ad5755_platform_data - AD5755 DAC driver platform data
+ * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter
+ * compensation register is used.
+ * @dc_dc_phase: DC-DC converter phase.
+ * @dc_dc_freq: DC-DC converter frequency.
+ * @dc_dc_maxv: DC-DC maximum allowed boost voltage.
+ * @dac: Per DAC instance parameters.
+ * @dac.mode: The mode to be used for the DAC output.
+ * @dac.ext_current_sense_resistor: Whether an external current sense resistor
+ * is used.
+ * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange.
+ * @dac.slew.enable: Whether to enable digital slew.
+ * @dac.slew.rate: Slew rate of the digital slew.
+ * @dac.slew.step_size: Slew step size of the digital slew.
+ **/
+struct ad5755_platform_data {
+	bool ext_dc_dc_compenstation_resistor;
+	enum ad5755_dc_dc_phase dc_dc_phase;
+	enum ad5755_dc_dc_freq dc_dc_freq;
+	enum ad5755_dc_dc_maxv dc_dc_maxv;
+
+	struct {
+		enum ad5755_mode mode;
+		bool ext_current_sense_resistor;
+		bool enable_voltage_overrange;
+		struct {
+			bool enable;
+			enum ad5755_slew_rate rate;
+			enum ad5755_slew_step_size step_size;
+		} slew;
+	} dac[4];
+};
+
 /**
  * struct ad5755_chip_info - chip specific information
  * @channel_template:	channel specification
@@ -111,7 +205,6 @@ enum ad5755_type {
 	ID_AD5737,
 };
 
-#ifdef CONFIG_OF
 static const int ad5755_dcdc_freq_table[][2] = {
 	{ 250000, AD5755_DC_DC_FREQ_250kHZ },
 	{ 410000, AD5755_DC_DC_FREQ_410kHZ },
@@ -154,7 +247,6 @@ static const int ad5755_slew_step_table[][2] = {
 	{ 2, AD5755_SLEW_STEP_SIZE_2 },
 	{ 1, AD5755_SLEW_STEP_SIZE_1 },
 };
-#endif
 
 static int ad5755_write_unlocked(struct iio_dev *indio_dev,
 	unsigned int reg, unsigned int val)
@@ -604,11 +696,9 @@ static const struct ad5755_platform_data ad5755_default_pdata = {
 	},
 };
 
-#ifdef CONFIG_OF
-static struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
+static struct ad5755_platform_data *ad5755_parse_fw(struct device *dev)
 {
-	struct device_node *np = dev->of_node;
-	struct device_node *pp;
+	struct fwnode_handle *pp;
 	struct ad5755_platform_data *pdata;
 	unsigned int tmp;
 	unsigned int tmparray[3];
@@ -619,15 +709,13 @@ static struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
 		return NULL;
 
 	pdata->ext_dc_dc_compenstation_resistor =
-	    of_property_read_bool(np, "adi,ext-dc-dc-compenstation-resistor");
+	    device_property_read_bool(dev, "adi,ext-dc-dc-compenstation-resistor");
 
-	if (!of_property_read_u32(np, "adi,dc-dc-phase", &tmp))
-		pdata->dc_dc_phase = tmp;
-	else
-		pdata->dc_dc_phase = AD5755_DC_DC_PHASE_ALL_SAME_EDGE;
+	pdata->dc_dc_phase = AD5755_DC_DC_PHASE_ALL_SAME_EDGE;
+	device_property_read_u32(dev, "adi,dc-dc-phase", &pdata->dc_dc_phase);
 
 	pdata->dc_dc_freq = AD5755_DC_DC_FREQ_410kHZ;
-	if (!of_property_read_u32(np, "adi,dc-dc-freq-hz", &tmp)) {
+	if (!device_property_read_u32(dev, "adi,dc-dc-freq-hz", &tmp)) {
 		for (i = 0; i < ARRAY_SIZE(ad5755_dcdc_freq_table); i++) {
 			if (tmp == ad5755_dcdc_freq_table[i][0]) {
 				pdata->dc_dc_freq = ad5755_dcdc_freq_table[i][1];
@@ -641,7 +729,7 @@ static struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
 	}
 
 	pdata->dc_dc_maxv = AD5755_DC_DC_MAXV_23V;
-	if (!of_property_read_u32(np, "adi,dc-dc-max-microvolt", &tmp)) {
+	if (!device_property_read_u32(dev, "adi,dc-dc-max-microvolt", &tmp)) {
 		for (i = 0; i < ARRAY_SIZE(ad5755_dcdc_maxv_table); i++) {
 			if (tmp == ad5755_dcdc_maxv_table[i][0]) {
 				pdata->dc_dc_maxv = ad5755_dcdc_maxv_table[i][1];
@@ -654,25 +742,23 @@ static struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
 	}
 
 	devnr = 0;
-	for_each_child_of_node(np, pp) {
+	device_for_each_child_node(dev, pp) {
 		if (devnr >= AD5755_NUM_CHANNELS) {
 			dev_err(dev,
 				"There are too many channels defined in DT\n");
 			goto error_out;
 		}
 
-		if (!of_property_read_u32(pp, "adi,mode", &tmp))
-			pdata->dac[devnr].mode = tmp;
-		else
-			pdata->dac[devnr].mode = AD5755_MODE_CURRENT_4mA_20mA;
+		pdata->dac[devnr].mode = AD5755_MODE_CURRENT_4mA_20mA;
+		fwnode_property_read_u32(pp, "adi,mode", &pdata->dac[devnr].mode);
 
 		pdata->dac[devnr].ext_current_sense_resistor =
-		    of_property_read_bool(pp, "adi,ext-current-sense-resistor");
+		    fwnode_property_read_bool(pp, "adi,ext-current-sense-resistor");
 
 		pdata->dac[devnr].enable_voltage_overrange =
-		    of_property_read_bool(pp, "adi,enable-voltage-overrange");
+		    fwnode_property_read_bool(pp, "adi,enable-voltage-overrange");
 
-		if (!of_property_read_u32_array(pp, "adi,slew", tmparray, 3)) {
+		if (!fwnode_property_read_u32_array(pp, "adi,slew", tmparray, 3)) {
 			pdata->dac[devnr].slew.enable = tmparray[0];
 
 			pdata->dac[devnr].slew.rate = AD5755_SLEW_RATE_64k;
@@ -715,18 +801,11 @@ static struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
 	devm_kfree(dev, pdata);
 	return NULL;
 }
-#else
-static
-struct ad5755_platform_data *ad5755_parse_dt(struct device *dev)
-{
-	return NULL;
-}
-#endif
 
 static int ad5755_probe(struct spi_device *spi)
 {
 	enum ad5755_type type = spi_get_device_id(spi)->driver_data;
-	const struct ad5755_platform_data *pdata = dev_get_platdata(&spi->dev);
+	const struct ad5755_platform_data *pdata = NULL;
 	struct iio_dev *indio_dev;
 	struct ad5755_state *st;
 	int ret;
@@ -751,13 +830,12 @@ static int ad5755_probe(struct spi_device *spi)
 
 	mutex_init(&st->lock);
 
-	if (spi->dev.of_node)
-		pdata = ad5755_parse_dt(&spi->dev);
-	else
-		pdata = spi->dev.platform_data;
+	if (dev_fwnode(&spi->dev))
+		pdata = ad5755_parse_fw(&spi->dev);
 
 	if (!pdata) {
-		dev_warn(&spi->dev, "no platform data? using default\n");
+		dev_warn(&spi->dev,
+			 "no firmware provided parameters? using default\n");
 		pdata = &ad5755_default_pdata;
 	}
 
diff --git a/include/linux/platform_data/ad5755.h b/include/linux/platform_data/ad5755.h
deleted file mode 100644
index e371e08f04bc..000000000000
--- a/include/linux/platform_data/ad5755.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright 2012 Analog Devices Inc.
- */
-#ifndef __LINUX_PLATFORM_DATA_AD5755_H__
-#define __LINUX_PLATFORM_DATA_AD5755_H__
-
-enum ad5755_mode {
-	AD5755_MODE_VOLTAGE_0V_5V		= 0,
-	AD5755_MODE_VOLTAGE_0V_10V		= 1,
-	AD5755_MODE_VOLTAGE_PLUSMINUS_5V	= 2,
-	AD5755_MODE_VOLTAGE_PLUSMINUS_10V	= 3,
-	AD5755_MODE_CURRENT_4mA_20mA		= 4,
-	AD5755_MODE_CURRENT_0mA_20mA		= 5,
-	AD5755_MODE_CURRENT_0mA_24mA		= 6,
-};
-
-enum ad5755_dc_dc_phase {
-	AD5755_DC_DC_PHASE_ALL_SAME_EDGE		= 0,
-	AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE	= 1,
-	AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE	= 2,
-	AD5755_DC_DC_PHASE_90_DEGREE			= 3,
-};
-
-enum ad5755_dc_dc_freq {
-	AD5755_DC_DC_FREQ_250kHZ = 0,
-	AD5755_DC_DC_FREQ_410kHZ = 1,
-	AD5755_DC_DC_FREQ_650kHZ = 2,
-};
-
-enum ad5755_dc_dc_maxv {
-	AD5755_DC_DC_MAXV_23V	= 0,
-	AD5755_DC_DC_MAXV_24V5	= 1,
-	AD5755_DC_DC_MAXV_27V	= 2,
-	AD5755_DC_DC_MAXV_29V5	= 3,
-};
-
-enum ad5755_slew_rate {
-	AD5755_SLEW_RATE_64k	= 0,
-	AD5755_SLEW_RATE_32k	= 1,
-	AD5755_SLEW_RATE_16k	= 2,
-	AD5755_SLEW_RATE_8k	= 3,
-	AD5755_SLEW_RATE_4k	= 4,
-	AD5755_SLEW_RATE_2k	= 5,
-	AD5755_SLEW_RATE_1k	= 6,
-	AD5755_SLEW_RATE_500	= 7,
-	AD5755_SLEW_RATE_250	= 8,
-	AD5755_SLEW_RATE_125	= 9,
-	AD5755_SLEW_RATE_64	= 10,
-	AD5755_SLEW_RATE_32	= 11,
-	AD5755_SLEW_RATE_16	= 12,
-	AD5755_SLEW_RATE_8	= 13,
-	AD5755_SLEW_RATE_4	= 14,
-	AD5755_SLEW_RATE_0_5	= 15,
-};
-
-enum ad5755_slew_step_size {
-	AD5755_SLEW_STEP_SIZE_1 = 0,
-	AD5755_SLEW_STEP_SIZE_2 = 1,
-	AD5755_SLEW_STEP_SIZE_4 = 2,
-	AD5755_SLEW_STEP_SIZE_8 = 3,
-	AD5755_SLEW_STEP_SIZE_16 = 4,
-	AD5755_SLEW_STEP_SIZE_32 = 5,
-	AD5755_SLEW_STEP_SIZE_64 = 6,
-	AD5755_SLEW_STEP_SIZE_128 = 7,
-	AD5755_SLEW_STEP_SIZE_256 = 8,
-};
-
-/**
- * struct ad5755_platform_data - AD5755 DAC driver platform data
- * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter
- * compensation register is used.
- * @dc_dc_phase: DC-DC converter phase.
- * @dc_dc_freq: DC-DC converter frequency.
- * @dc_dc_maxv: DC-DC maximum allowed boost voltage.
- * @dac.mode: The mode to be used for the DAC output.
- * @dac.ext_current_sense_resistor: Whether an external current sense resistor
- * is used.
- * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange.
- * @dac.slew.enable: Whether to enable digital slew.
- * @dac.slew.rate: Slew rate of the digital slew.
- * @dac.slew.step_size: Slew step size of the digital slew.
- **/
-struct ad5755_platform_data {
-	bool ext_dc_dc_compenstation_resistor;
-	enum ad5755_dc_dc_phase dc_dc_phase;
-	enum ad5755_dc_dc_freq dc_dc_freq;
-	enum ad5755_dc_dc_maxv dc_dc_maxv;
-
-	struct {
-		enum ad5755_mode mode;
-		bool ext_current_sense_resistor;
-		bool enable_voltage_overrange;
-		struct {
-			bool enable;
-			enum ad5755_slew_rate rate;
-			enum ad5755_slew_step_size step_size;
-		} slew;
-	} dac[4];
-};
-
-#endif
-- 
2.34.1


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

* [PATCH v2 02/12] iio:dac:ad5758: Drop unused of specific headers.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h Jonathan Cameron
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Daniel Gomez

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These have never been used in this driver.  What is used is in
mod_devicetable.h so add that include (struct of_device_id)

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Daniel Gomez <dagmcr@gmail.com>
---
 drivers/iio/dac/ad5758.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 0572ef518101..98771e37a7b5 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -10,9 +10,8 @@
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/property.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/spi/spi.h>
 #include <linux/gpio/consumer.h>
 
-- 
2.34.1


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

* [PATCH v2 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 02/12] iio:dac:ad5758: Drop unused of specific headers Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h Jonathan Cameron
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Peter Rosin

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This driver never used anything in the of specific header.
It just wants the struct of_device_id from mod_devicetable.h.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Peter Rosin <peda@axentia.se>
---
 drivers/iio/dac/dpot-dac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/dpot-dac.c b/drivers/iio/dac/dpot-dac.c
index 5d1819448102..83ce9489259c 100644
--- a/drivers/iio/dac/dpot-dac.c
+++ b/drivers/iio/dac/dpot-dac.c
@@ -30,7 +30,7 @@
 #include <linux/iio/consumer.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 
-- 
2.34.1


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

* [PATCH v2 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (2 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 05/12] iio:pot:mcp41010: Switch to generic firmware properties Jonathan Cameron
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This driver never used anything from the of specific headers.
mod_devicetable.h provides the struct of_device_id definition.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/dac/lpc18xx_dac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/dac/lpc18xx_dac.c b/drivers/iio/dac/lpc18xx_dac.c
index 5502e4f62f0d..60467c6f2c6e 100644
--- a/drivers/iio/dac/lpc18xx_dac.c
+++ b/drivers/iio/dac/lpc18xx_dac.c
@@ -16,9 +16,8 @@
 #include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 
-- 
2.34.1


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

* [PATCH v2 05/12] iio:pot:mcp41010: Switch to generic firmware properties.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (3 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 06/12] iio:light:cm3605: " Jonathan Cameron
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Chris Coffey

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

In this case it was only of_device_get_match_data() + header update.
This enables use of other firmware types with no other changes, such
as ACPI via the PRP0001 route.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Chris Coffey <cmc@babblebit.net>
---
 drivers/iio/potentiometer/mcp41010.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/potentiometer/mcp41010.c b/drivers/iio/potentiometer/mcp41010.c
index 79ccac6d4be0..30a4594d4e11 100644
--- a/drivers/iio/potentiometer/mcp41010.c
+++ b/drivers/iio/potentiometer/mcp41010.c
@@ -21,9 +21,9 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/types.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 
 #define MCP41010_MAX_WIPERS	2
@@ -146,7 +146,7 @@ static int mcp41010_probe(struct spi_device *spi)
 	data = iio_priv(indio_dev);
 	spi_set_drvdata(spi, indio_dev);
 	data->spi = spi;
-	data->cfg = of_device_get_match_data(&spi->dev);
+	data->cfg = device_get_match_data(&spi->dev);
 	if (!data->cfg)
 		data->cfg = &mcp41010_cfg[spi_get_device_id(spi)->driver_data];
 
-- 
2.34.1


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

* [PATCH v2 06/12] iio:light:cm3605: Switch to generic firmware properties.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (4 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 05/12] iio:pot:mcp41010: Switch to generic firmware properties Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 07/12] iio:adc:max9611: " Jonathan Cameron
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Linus Walleij

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This enables use of other firmware types with minimal driver changes.
Part of an ongoing effort to move all IIO drivers over to generic
accessors in order to reduce the chance of of_* versions being
copied into new drivers.  Also updated the headers to reflect this change
including using mod_devicetable.h for struct of_device_id definition
rather than going via of.h

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/iio/light/cm3605.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
index 3e7fb16ab1f6..50d34a98839c 100644
--- a/drivers/iio/light/cm3605.c
+++ b/drivers/iio/light/cm3605.c
@@ -10,6 +10,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
@@ -18,7 +19,7 @@
 #include <linux/init.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
-#include <linux/of.h>
+#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
@@ -156,7 +157,6 @@ static int cm3605_probe(struct platform_device *pdev)
 	struct cm3605 *cm3605;
 	struct iio_dev *indio_dev;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
 	enum iio_chan_type ch_type;
 	u32 rset;
 	int irq;
@@ -171,7 +171,7 @@ static int cm3605_probe(struct platform_device *pdev)
 	cm3605->dev = dev;
 	cm3605->dir = IIO_EV_DIR_FALLING;
 
-	ret = of_property_read_u32(np, "capella,aset-resistance-ohms", &rset);
+	ret = device_property_read_u32(dev, "capella,aset-resistance-ohms", &rset);
 	if (ret) {
 		dev_info(dev, "no RSET specified, assuming 100K\n");
 		rset = 100000;
-- 
2.34.1


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

* [PATCH v2 07/12] iio:adc:max9611: Switch to generic firmware properties.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (5 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 06/12] iio:light:cm3605: " Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 08/12] iio:adc:mcp3911: " Jonathan Cameron
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Note the handling of the device tree node in this driver was somewhat
unusual.  I have cleaned that up whilst also moving over to generic
properties.

Part of a general attempt to move all IIO drivers over to generic
firmware properties both as a general improvement and to avoid sources
of cut and paste into future drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/max9611.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
index 052ab23f10b2..01a4275e9c46 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -22,7 +22,8 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #define DRIVER_NAME			"max9611"
 
@@ -513,11 +514,9 @@ static int max9611_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
 	const char * const shunt_res_prop = "shunt-resistor-micro-ohms";
-	const struct device_node *of_node = client->dev.of_node;
-	const struct of_device_id *of_id =
-		of_match_device(max9611_of_table, &client->dev);
 	struct max9611_dev *max9611;
 	struct iio_dev *indio_dev;
+	struct device *dev = &client->dev;
 	unsigned int of_shunt;
 	int ret;
 
@@ -528,15 +527,14 @@ static int max9611_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, indio_dev);
 
 	max9611			= iio_priv(indio_dev);
-	max9611->dev		= &client->dev;
+	max9611->dev		= dev;
 	max9611->i2c_client	= client;
 	mutex_init(&max9611->lock);
 
-	ret = of_property_read_u32(of_node, shunt_res_prop, &of_shunt);
+	ret = device_property_read_u32(dev, shunt_res_prop, &of_shunt);
 	if (ret) {
-		dev_err(&client->dev,
-			"Missing %s property for %pOF node\n",
-			shunt_res_prop, of_node);
+		dev_err(dev, "Missing %s property for %pfw node\n",
+			shunt_res_prop, dev_fwnode(dev));
 		return ret;
 	}
 	max9611->shunt_resistor_uohm = of_shunt;
@@ -545,13 +543,13 @@ static int max9611_probe(struct i2c_client *client,
 	if (ret)
 		return ret;
 
-	indio_dev->name		= of_id->data;
+	indio_dev->name		= device_get_match_data(dev);
 	indio_dev->modes	= INDIO_DIRECT_MODE;
 	indio_dev->info		= &indio_info;
 	indio_dev->channels	= max9611_channels;
 	indio_dev->num_channels	= ARRAY_SIZE(max9611_channels);
 
-	return devm_iio_device_register(&client->dev, indio_dev);
+	return devm_iio_device_register(dev, indio_dev);
 }
 
 static struct i2c_driver max9611_driver = {
-- 
2.34.1


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

* [PATCH v2 08/12] iio:adc:mcp3911: Switch to generic firmware properties.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (6 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 07/12] iio:adc:max9611: " Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-05 15:07   ` Andy Shevchenko
  2021-12-04 17:12 ` [PATCH v2 09/12] iio:adc:ti-adc12138: " Jonathan Cameron
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Kent Gustavsson, Marcus Folkesson

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This allows use of the driver with other types of firmware such as ACPI
PRP0001 based probing.

Also part of a general attempt to remove direct use of of_ specific
accessors from IIO.

Added an include for mod_devicetable.h whilst here to cover the
struct of_device_id definition.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Kent Gustavsson <kent@minoris.se>
Cc: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/iio/adc/mcp3911.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index e573da5397bb..f6895acb8838 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -10,6 +10,8 @@
 #include <linux/err.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
@@ -200,12 +202,12 @@ static const struct iio_info mcp3911_info = {
 	.write_raw = mcp3911_write_raw,
 };
 
-static int mcp3911_config(struct mcp3911 *adc, struct device_node *of_node)
+static int mcp3911_config(struct mcp3911 *adc, struct device *dev)
 {
 	u32 configreg;
 	int ret;
 
-	of_property_read_u32(of_node, "device-addr", &adc->dev_addr);
+	device_property_read_u32(dev, "device-addr", &adc->dev_addr);
 	if (adc->dev_addr > 3) {
 		dev_err(&adc->spi->dev,
 			"invalid device address (%i). Must be in range 0-3.\n",
@@ -289,7 +291,7 @@ static int mcp3911_probe(struct spi_device *spi)
 		}
 	}
 
-	ret = mcp3911_config(adc, spi->dev.of_node);
+	ret = mcp3911_config(adc, &spi->dev);
 	if (ret)
 		goto clk_disable;
 
-- 
2.34.1


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

* [PATCH v2 09/12] iio:adc:ti-adc12138: Switch to generic firmware properties.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (7 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 08/12] iio:adc:mcp3911: " Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-05 15:12   ` Andy Shevchenko
  2021-12-04 17:12 ` [PATCH v2 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h Jonathan Cameron
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This enables using the driver with other firmware types such
as ACPI via PRP0001.

Also part of a general attempt to move IIO drivers over to generic
properties to avoid opportunities for cut and paste.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/ti-adc12138.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/ti-adc12138.c b/drivers/iio/adc/ti-adc12138.c
index 5b5d45210539..99fe53089c72 100644
--- a/drivers/iio/adc/ti-adc12138.c
+++ b/drivers/iio/adc/ti-adc12138.c
@@ -11,6 +11,7 @@
 #include <linux/interrupt.h>
 #include <linux/completion.h>
 #include <linux/clk.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
@@ -430,8 +431,8 @@ static int adc12138_probe(struct spi_device *spi)
 		return -EINVAL;
 	}
 
-	ret = of_property_read_u32(spi->dev.of_node, "ti,acquisition-time",
-				   &adc->acquisition_time);
+	ret = device_property_read_u32(&spi->dev, "ti,acquisition-time",
+				       &adc->acquisition_time);
 	if (ret)
 		adc->acquisition_time = 10;
 
@@ -517,8 +518,6 @@ static int adc12138_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_OF
-
 static const struct of_device_id adc12138_dt_ids[] = {
 	{ .compatible = "ti,adc12130", },
 	{ .compatible = "ti,adc12132", },
@@ -527,8 +526,6 @@ static const struct of_device_id adc12138_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, adc12138_dt_ids);
 
-#endif
-
 static const struct spi_device_id adc12138_id[] = {
 	{ "adc12130", adc12130 },
 	{ "adc12132", adc12132 },
-- 
2.34.1


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

* [PATCH v2 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (8 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 09/12] iio:adc:ti-adc12138: " Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 11/12] iio:adc:ti-ads124s08: Drop dependency on OF Jonathan Cameron
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Peter Rosin

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

There is nothing directly using of specific interfaces in this driver,
so lets not include the headers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Peter Rosin <peda@axentia.se>
---
 drivers/iio/adc/envelope-detector.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/adc/envelope-detector.c b/drivers/iio/adc/envelope-detector.c
index d73eac36153f..e911c25d106d 100644
--- a/drivers/iio/adc/envelope-detector.c
+++ b/drivers/iio/adc/envelope-detector.c
@@ -31,14 +31,13 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/iio/consumer.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
-- 
2.34.1


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

* [PATCH v2 11/12] iio:adc:ti-ads124s08: Drop dependency on OF.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (9 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-04 17:12 ` [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
  2021-12-05 15:16 ` [PATCH v2 00/12] IIO: More of to generic fw conversions Andy Shevchenko
  12 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Nothing in this driver depends on OF firmware so drop the dependency
and update the headers to remove the false impression such a dependency
exists.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/Kconfig        | 2 +-
 drivers/iio/adc/ti-ads124s08.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 8bf5b62a73f4..9b0b99bc826c 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -1166,7 +1166,7 @@ config TI_ADS8688
 
 config TI_ADS124S08
 	tristate "Texas Instruments ADS124S08"
-	depends on SPI && OF
+	depends on SPI
 	help
 	  If you say yes here you get support for Texas Instruments ADS124S08
 	  and ADS124S06 ADC chips
diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
index 17d0da5877a9..767b3b634809 100644
--- a/drivers/iio/adc/ti-ads124s08.c
+++ b/drivers/iio/adc/ti-ads124s08.c
@@ -8,8 +8,7 @@
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_gpio.h>
+#include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/sysfs.h>
 
-- 
2.34.1


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

* [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (10 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 11/12] iio:adc:ti-ads124s08: Drop dependency on OF Jonathan Cameron
@ 2021-12-04 17:12 ` Jonathan Cameron
  2021-12-05 15:15   ` Andy Shevchenko
  2021-12-05 15:16 ` [PATCH v2 00/12] IIO: More of to generic fw conversions Andy Shevchenko
  12 siblings, 1 reply; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-04 17:12 UTC (permalink / raw)
  To: Lars-Peter Clausen, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

We could probably drop a lot more of these, but for now this removes
unnecessary restrictions on stand alone ADC devices.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/Kconfig | 4 ++--
 drivers/iio/dac/Kconfig | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 9b0b99bc826c..c7de4632f24a 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -1146,7 +1146,7 @@ config TI_ADS7950
 
 config TI_ADS8344
 	tristate "Texas Instruments ADS8344"
-	depends on SPI && OF
+	depends on SPI
 	help
 	  If you say yes here you get support for Texas Instruments ADS8344
 	  ADC chips
@@ -1156,7 +1156,7 @@ config TI_ADS8344
 
 config TI_ADS8688
 	tristate "Texas Instruments ADS8688"
-	depends on SPI && OF
+	depends on SPI
 	help
 	  If you say yes here you get support for Texas Instruments ADS8684 and
 	  and ADS8688 ADC chips
diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
index 75e1f2b48638..ba6649a2d040 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -329,7 +329,6 @@ config MAX517
 config MAX5821
 	tristate "Maxim MAX5821 DAC driver"
 	depends on I2C
-	depends on OF
 	help
 	  Say yes here to build support for Maxim MAX5821
 	  10 bits DAC.
-- 
2.34.1


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

* Re: [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata
  2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
@ 2021-12-05 15:02   ` Andy Shevchenko
  2021-12-05 15:36     ` Andy Shevchenko
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:02 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Lars pointed out that platform data can also be supported via the
> generic properties interface, so there is no point in continuing to
> support it separately.  Hence squish the linux/platform_data/ad5755.h
> header into the c file and drop accessing the platform data directly.
>
> Done by inspection only.  Mostly completely mechanical with the
> exception of a few places where default value handling is
> cleaner done by first setting the value, then calling the
> firmware reading function but and not checking the return value,
> as opposed to reading firmware then setting the default if an error
> occurs.
>
> Part of general attempt to move all of IIO over to generic
> device properties, both to enable other firmware types and
> to remove drivers that can be the source of of_ specific
> behaviour in new drivers.

...

>  #include <linux/slab.h>
>  #include <linux/sysfs.h>
>  #include <linux/delay.h>
> -#include <linux/of.h>
> +#include <linux/property.h>

I would also add a blank line here.

>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> -#include <linux/platform_data/ad5755.h>

...


> +       const struct ad5755_platform_data *pdata = NULL;
>         struct iio_dev *indio_dev;
>         struct ad5755_state *st;
>         int ret;


> -       if (spi->dev.of_node)
> -               pdata = ad5755_parse_dt(&spi->dev);
> -       else
> -               pdata = spi->dev.platform_data;
> +       if (dev_fwnode(&spi->dev))
> +               pdata = ad5755_parse_fw(&spi->dev);
>
>         if (!pdata) {
> -               dev_warn(&spi->dev, "no platform data? using default\n");
> +               dev_warn(&spi->dev,
> +                        "no firmware provided parameters? using default\n");

It's fine to have it on one line (and not related to the 80 vs 100
case, it's about string literal as the last argument).

>                 pdata = &ad5755_default_pdata;
>         }


Perhaps

    const struct ad5755_platform_data *pdata;
    ...
    if (dev_fwnode(...))
      pdata = ...
    else
      pdata = &_default;
    if (pdata == &_default)
      dev_warn(...);

?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 08/12] iio:adc:mcp3911: Switch to generic firmware properties.
  2021-12-04 17:12 ` [PATCH v2 08/12] iio:adc:mcp3911: " Jonathan Cameron
@ 2021-12-05 15:07   ` Andy Shevchenko
  2021-12-05 16:19     ` Jonathan Cameron
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:07 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron, Kent Gustavsson,
	Marcus Folkesson

On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This allows use of the driver with other types of firmware such as ACPI
> PRP0001 based probing.
>
> Also part of a general attempt to remove direct use of of_ specific
> accessors from IIO.
>
> Added an include for mod_devicetable.h whilst here to cover the
> struct of_device_id definition.

...

> -static int mcp3911_config(struct mcp3911 *adc, struct device_node *of_node)
> +static int mcp3911_config(struct mcp3911 *adc, struct device *dev)

I am wondering if the device pointer is already embedded in the mpc3911.
It might require assignment reordering in the ->probe(). though
(haven't checked).

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 09/12] iio:adc:ti-adc12138: Switch to generic firmware properties.
  2021-12-04 17:12 ` [PATCH v2 09/12] iio:adc:ti-adc12138: " Jonathan Cameron
@ 2021-12-05 15:12   ` Andy Shevchenko
  2021-12-05 15:13     ` Andy Shevchenko
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:12 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This enables using the driver with other firmware types such
> as ACPI via PRP0001.
>
> Also part of a general attempt to move IIO drivers over to generic
> properties to avoid opportunities for cut and paste.

...

> -#ifdef CONFIG_OF
> -

It's a sign that somewhere should be of_match_ptr().
Please, double check that you remove that as well in all conversion patches.

>  static const struct of_device_id adc12138_dt_ids[] = {
>         { .compatible = "ti,adc12130", },
>         { .compatible = "ti,adc12132", },

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 09/12] iio:adc:ti-adc12138: Switch to generic firmware properties.
  2021-12-05 15:12   ` Andy Shevchenko
@ 2021-12-05 15:13     ` Andy Shevchenko
  2021-12-05 16:38       ` Jonathan Cameron
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:13 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, Dec 5, 2021 at 5:12 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:

...

> > -#ifdef CONFIG_OF
> > -
>
> It's a sign that somewhere should be of_match_ptr().
> Please, double check that you remove that as well in all conversion patches.

Also, check that you drop OF dependencies (where it's the case) from a
certain Kconfig.

> >  static const struct of_device_id adc12138_dt_ids[] = {
> >         { .compatible = "ti,adc12130", },
> >         { .compatible = "ti,adc12132", },

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies.
  2021-12-04 17:12 ` [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
@ 2021-12-05 15:15   ` Andy Shevchenko
  2021-12-05 16:48     ` Jonathan Cameron
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:15 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sat, Dec 4, 2021 at 7:08 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> We could probably drop a lot more of these, but for now this removes
> unnecessary restrictions on stand alone ADC devices.

Ah, I was expecting to see this on per driver conversion change.
Is this simply dependencies which are not covered anyhow by the
previous 11 patches in the series?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 00/12] IIO: More of to generic fw conversions.
  2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
                   ` (11 preceding siblings ...)
  2021-12-04 17:12 ` [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
@ 2021-12-05 15:16 ` Andy Shevchenko
  2021-12-05 15:17   ` Andy Shevchenko
  12 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:16 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> v2: Drop platform data from ad5755 as suggested by Lars.
>     Collect tags.
>
> Nothing particularly special about this series, just a few
> more drifvers converted and related header and Kconfig
> dependency cleanups.
>
> For now I'm focussing mostly on standalone parts rather than
> those integrated in SoCs.
>
> Any feedback welcome.

I like the series!
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmial.com>
But see some (important in patch 9 and 12) comments to address.

> Thanks,
>
> Jonathan
>
> Jonathan Cameron (12):
>   iio:dac:ad5755: Switch to generic firmware properties and drop pdata
>   iio:dac:ad5758: Drop unused of specific headers.
>   iio:dac:dpot-dac: Swap of.h for mod_devicetable.h
>   iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h
>   iio:pot:mcp41010: Switch to generic firmware properties.
>   iio:light:cm3605: Switch to generic firmware properties.
>   iio:adc:max9611: Switch to generic firmware properties.
>   iio:adc:mcp3911: Switch to generic firmware properties.
>   iio:adc:ti-adc12138: Switch to generic firmware properties.
>   iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h
>   iio:adc:ti-ads124s08: Drop dependency on OF.
>   iio:adc/dac:Kconfig: Update to drop OF dependencies.
>
>  drivers/iio/adc/Kconfig              |   6 +-
>  drivers/iio/adc/envelope-detector.c  |   3 +-
>  drivers/iio/adc/max9611.c            |  20 ++--
>  drivers/iio/adc/mcp3911.c            |   8 +-
>  drivers/iio/adc/ti-adc12138.c        |   9 +-
>  drivers/iio/adc/ti-ads124s08.c       |   3 +-
>  drivers/iio/dac/Kconfig              |   1 -
>  drivers/iio/dac/ad5755.c             | 150 ++++++++++++++++++++-------
>  drivers/iio/dac/ad5758.c             |   3 +-
>  drivers/iio/dac/dpot-dac.c           |   2 +-
>  drivers/iio/dac/lpc18xx_dac.c        |   3 +-
>  drivers/iio/light/cm3605.c           |   6 +-
>  drivers/iio/potentiometer/mcp41010.c |   6 +-
>  include/linux/platform_data/ad5755.h | 102 ------------------
>  14 files changed, 145 insertions(+), 177 deletions(-)
>  delete mode 100644 include/linux/platform_data/ad5755.h
>
> --
> 2.34.1
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 00/12] IIO: More of to generic fw conversions.
  2021-12-05 15:16 ` [PATCH v2 00/12] IIO: More of to generic fw conversions Andy Shevchenko
@ 2021-12-05 15:17   ` Andy Shevchenko
  0 siblings, 0 replies; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:17 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, Dec 5, 2021 at 5:16 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:

...

> > Any feedback welcome.
>
> I like the series!
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmial.com>

corrected email
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> But see some (important in patch 9 and 12) comments to address.



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata
  2021-12-05 15:02   ` Andy Shevchenko
@ 2021-12-05 15:36     ` Andy Shevchenko
  2021-12-05 16:26       ` Jonathan Cameron
  0 siblings, 1 reply; 25+ messages in thread
From: Andy Shevchenko @ 2021-12-05 15:36 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, Dec 5, 2021 at 5:02 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:

...

> > +       const struct ad5755_platform_data *pdata = NULL;
> >         struct iio_dev *indio_dev;
> >         struct ad5755_state *st;
> >         int ret;
>
> > -       if (spi->dev.of_node)
> > -               pdata = ad5755_parse_dt(&spi->dev);
> > -       else
> > -               pdata = spi->dev.platform_data;
> > +       if (dev_fwnode(&spi->dev))
> > +               pdata = ad5755_parse_fw(&spi->dev);
> >
> >         if (!pdata) {
> > -               dev_warn(&spi->dev, "no platform data? using default\n");
> > +               dev_warn(&spi->dev,
> > +                        "no firmware provided parameters? using default\n");
>
> It's fine to have it on one line (and not related to the 80 vs 100
> case, it's about string literal as the last argument).
>
> >                 pdata = &ad5755_default_pdata;
> >         }
>
>
> Perhaps
>
>     const struct ad5755_platform_data *pdata;
>     ...
>     if (dev_fwnode(...))
>       pdata = ...
>     else
>       pdata = &_default;
>     if (pdata == &_default)
>       dev_warn(...);
>
> ?

After reading it again, I realized that pdata may be NULL in fwnode
case. So, original code is fine, but I would rather move NULL
assignment closer to the conditional (up to you, I'm fine with either,
i.o.w. you may ignore this comment).

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 08/12] iio:adc:mcp3911: Switch to generic firmware properties.
  2021-12-05 15:07   ` Andy Shevchenko
@ 2021-12-05 16:19     ` Jonathan Cameron
  0 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-05 16:19 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron, Kent Gustavsson,
	Marcus Folkesson

On Sun, 5 Dec 2021 17:07:37 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This allows use of the driver with other types of firmware such as ACPI
> > PRP0001 based probing.
> >
> > Also part of a general attempt to remove direct use of of_ specific
> > accessors from IIO.
> >
> > Added an include for mod_devicetable.h whilst here to cover the
> > struct of_device_id definition.  
> 
> ...
> 
> > -static int mcp3911_config(struct mcp3911 *adc, struct device_node *of_node)
> > +static int mcp3911_config(struct mcp3911 *adc, struct device *dev)  
> 
> I am wondering if the device pointer is already embedded in the mpc3911.
> It might require assignment reordering in the ->probe(). though
> (haven't checked).
> 
Good point. adc->spi->dev is available and is the same pointer so might as well use
that to keep things a little more tidy.

Thanks,

Jonathan



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

* Re: [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata
  2021-12-05 15:36     ` Andy Shevchenko
@ 2021-12-05 16:26       ` Jonathan Cameron
  0 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-05 16:26 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, 5 Dec 2021 17:36:03 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sun, Dec 5, 2021 at 5:02 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:  
> 
> ...
> 
> > > +       const struct ad5755_platform_data *pdata = NULL;
> > >         struct iio_dev *indio_dev;
> > >         struct ad5755_state *st;
> > >         int ret;  
> >  
> > > -       if (spi->dev.of_node)
> > > -               pdata = ad5755_parse_dt(&spi->dev);
> > > -       else
> > > -               pdata = spi->dev.platform_data;
> > > +       if (dev_fwnode(&spi->dev))
> > > +               pdata = ad5755_parse_fw(&spi->dev);
> > >
> > >         if (!pdata) {
> > > -               dev_warn(&spi->dev, "no platform data? using default\n");
> > > +               dev_warn(&spi->dev,
> > > +                        "no firmware provided parameters? using default\n");  
> >
> > It's fine to have it on one line (and not related to the 80 vs 100
> > case, it's about string literal as the last argument).
> >  
> > >                 pdata = &ad5755_default_pdata;
> > >         }  
> >
> >
> > Perhaps
> >
> >     const struct ad5755_platform_data *pdata;
> >     ...
> >     if (dev_fwnode(...))
> >       pdata = ...
> >     else
> >       pdata = &_default;
> >     if (pdata == &_default)
> >       dev_warn(...);
> >
> > ?  
> 
> After reading it again, I realized that pdata may be NULL in fwnode
> case. So, original code is fine, but I would rather move NULL
> assignment closer to the conditional (up to you, I'm fine with either,
> i.o.w. you may ignore this comment).
> 
I think a nicer way to tidy this up given I agree it's no immediately obvious
what is going on is to push

if (!dev_fwnode())
	return NULL;

into ad5755_parse_fw() then the flow here will be more obvious as just

	pdata = ad5755_parse_fw();
	if (!pdata) {
		dev_warn();
		pdata = &_default;
	}


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

* Re: [PATCH v2 09/12] iio:adc:ti-adc12138: Switch to generic firmware properties.
  2021-12-05 15:13     ` Andy Shevchenko
@ 2021-12-05 16:38       ` Jonathan Cameron
  0 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-05 16:38 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, 5 Dec 2021 17:13:42 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sun, Dec 5, 2021 at 5:12 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Sat, Dec 4, 2021 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote:  
> 
> ...
> 
> > > -#ifdef CONFIG_OF
> > > -  
> >
> > It's a sign that somewhere should be of_match_ptr().
> > Please, double check that you remove that as well in all conversion patches.  
Indeed - missed this one.  I'll fix up for v3.  I just checked and no others
in this set.

> 
> Also, check that you drop OF dependencies (where it's the case) from a
> certain Kconfig.

There were very few with an OF dependency in this set (just the ads124s08 in
patch 11).

Jonathan

> 
> > >  static const struct of_device_id adc12138_dt_ids[] = {
> > >         { .compatible = "ti,adc12130", },
> > >         { .compatible = "ti,adc12132", },  
> 


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

* Re: [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies.
  2021-12-05 15:15   ` Andy Shevchenko
@ 2021-12-05 16:48     ` Jonathan Cameron
  0 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2021-12-05 16:48 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Lars-Peter Clausen, linux-iio, Jonathan Cameron

On Sun, 5 Dec 2021 17:15:41 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sat, Dec 4, 2021 at 7:08 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > We could probably drop a lot more of these, but for now this removes
> > unnecessary restrictions on stand alone ADC devices.  
> 
> Ah, I was expecting to see this on per driver conversion change.
> Is this simply dependencies which are not covered anyhow by the
> previous 11 patches in the series?
> 
Yup.  None of these dependencies should have been there even without
this series.

The ads8344 and ads8688 go all the way back to initial driver patches
and I can't see why they were ever needed. 

max5821 looks similar.

I've added a note to the patch description to make it clearer
what is going on in this patch.

Jonathan

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

end of thread, other threads:[~2021-12-05 16:43 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
2021-12-05 15:02   ` Andy Shevchenko
2021-12-05 15:36     ` Andy Shevchenko
2021-12-05 16:26       ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 02/12] iio:dac:ad5758: Drop unused of specific headers Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 05/12] iio:pot:mcp41010: Switch to generic firmware properties Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 06/12] iio:light:cm3605: " Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 07/12] iio:adc:max9611: " Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 08/12] iio:adc:mcp3911: " Jonathan Cameron
2021-12-05 15:07   ` Andy Shevchenko
2021-12-05 16:19     ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 09/12] iio:adc:ti-adc12138: " Jonathan Cameron
2021-12-05 15:12   ` Andy Shevchenko
2021-12-05 15:13     ` Andy Shevchenko
2021-12-05 16:38       ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 11/12] iio:adc:ti-ads124s08: Drop dependency on OF Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
2021-12-05 15:15   ` Andy Shevchenko
2021-12-05 16:48     ` Jonathan Cameron
2021-12-05 15:16 ` [PATCH v2 00/12] IIO: More of to generic fw conversions Andy Shevchenko
2021-12-05 15:17   ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.