devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211
@ 2025-12-08 12:30 Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 1/3] dt-bindings: " Tomas Melin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 12:30 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Michael Hennerich, linux-iio, devicetree, linux-kernel,
	Tomas Melin, Krzysztof Kozlowski, Andy Shevchenko

This series adds support for the ad9211, a variant of the already
supported devices.

Example usage:

$ cat name 
ad9211
$ cat in_voltage_scale_available 
0.957031 0.976562 0.996093 1.015625 1.035156 1.054687 1.074218
1.093750 1.113281 1.132812 1.152343 1.162109 1.171875 1.181640
1.191406 1.201171 1.220703 1.240234 1.259765 1.279296 1.298828
1.318359 1.337890 1.357421 1.376953 1.396484 1.416015 1.425781
1.435546 1.445312 1.455078 1.464843

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
Changes in v3:
- Add Cleanup kernel.h in favor of array_size.h patch
- Drop redundant empty line
- Amend commit messages
- Link to v2: https://lore.kernel.org/r/20251204-add-ad9211-v2-0-a1561f977ee5@vaisala.com

Changes in v2:
- Use HZ_PER_MHZ
- Update commit message texts.
- Link to v1: https://lore.kernel.org/r/20251203-add-ad9211-v1-0-170e97e6df11@vaisala.com

---
Tomas Melin (3):
      dt-bindings: adc: ad9467: add support for ad9211
      iio: adc: ad9467: add support for ad9211
      iio: adc: ad9467: drop kernel.h in favor of array_size.h

 .../devicetree/bindings/iio/adc/adi,ad9467.yaml    |  2 +
 drivers/iio/adc/ad9467.c                           | 46 +++++++++++++++++++++-
 2 files changed, 46 insertions(+), 2 deletions(-)
---
base-commit: ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d
change-id: 20251203-add-ad9211-897dc9354185

Best regards,
-- 
Tomas Melin <tomas.melin@vaisala.com>


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

* [PATCH v3 1/3] dt-bindings: adc: ad9467: add support for ad9211
  2025-12-08 12:30 [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211 Tomas Melin
@ 2025-12-08 12:30 ` Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 2/3] iio: " Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h Tomas Melin
  2 siblings, 0 replies; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 12:30 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Michael Hennerich, linux-iio, devicetree, linux-kernel,
	Tomas Melin, Krzysztof Kozlowski

This device has e.g. different scaling values than currently
listed devices.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
 Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml
index 2606c0c5dfc61fd65cd0fb2015b3f659c2fc9e07..5acfb0eef4d5cf487adaa93ce5bda759bb4853c9 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml
@@ -18,6 +18,7 @@ description: |
   All the parts support the register map described by Application Note AN-877
    https://www.analog.com/media/en/technical-documentation/application-notes/AN-877.pdf
 
+  https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf
   https://www.analog.com/media/en/technical-documentation/data-sheets/AD9265.pdf
   https://www.analog.com/media/en/technical-documentation/data-sheets/AD9434.pdf
   https://www.analog.com/media/en/technical-documentation/data-sheets/AD9467.pdf
@@ -25,6 +26,7 @@ description: |
 properties:
   compatible:
     enum:
+      - adi,ad9211
       - adi,ad9265
       - adi,ad9434
       - adi,ad9467

-- 
2.47.3


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

* [PATCH v3 2/3] iio: adc: ad9467: add support for ad9211
  2025-12-08 12:30 [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211 Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 1/3] dt-bindings: " Tomas Melin
@ 2025-12-08 12:30 ` Tomas Melin
  2025-12-08 13:27   ` Andy Shevchenko
  2025-12-08 12:30 ` [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h Tomas Melin
  2 siblings, 1 reply; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 12:30 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Michael Hennerich, linux-iio, devicetree, linux-kernel,
	Tomas Melin, Andy Shevchenko

The AD9211 is a 10-bit monolithic sampling analog-to-digital converter
optimized for high performance, low power, and ease of use. The product
operates at up to a 300 MSPS conversion rate and is optimized for
outstanding dynamic performance in wideband carrier and broadband systems.

The scale table implemented here is not an exact match with the
datasheet as the table presented there is missing some information.
The reference presents these values as being linear,
but that does not add up. There is information missing in the table.
Implemented scale table matches values at the middle and at the ends,
smoothing the curve towards middle and end.
Impact on end result from deviation in scale factor affects only software
using it for scaling. All the possible hw-settings are also available with
this implementation.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
 drivers/iio/adc/ad9467.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index f7a9f46ea0dc405e25f312197df4b2131871b4bc..5840bef795daae88518b23ca0dec4da0c5fef07f 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -20,7 +20,7 @@
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/of.h>
-
+#include <linux/units.h>
 
 #include <linux/iio/backend.h>
 #include <linux/iio/iio.h>
@@ -81,6 +81,14 @@
 /* AN877_ADC_REG_OUTPUT_DELAY */
 #define AN877_ADC_DCO_DELAY_ENABLE		0x80
 
+/*
+ * Analog Devices AD9211 10-Bit, 200/250/300 MSPS ADC
+ */
+
+#define CHIPID_AD9211			0x06
+#define AD9211_DEF_OUTPUT_MODE		0x00
+#define AD9211_REG_VREF_MASK		GENMASK(4, 0)
+
 /*
  * Analog Devices AD9265 16-Bit, 125/105/80 MSPS ADC
  */
@@ -234,6 +242,17 @@ static int ad9467_reg_access(struct iio_dev *indio_dev, unsigned int reg,
 	return 0;
 }
 
+static const unsigned int ad9211_scale_table[][2] = {
+	{980, 0x10}, {1000, 0x11}, {1020, 0x12}, {1040, 0x13},
+	{1060, 0x14}, {1080, 0x15}, {1100, 0x16}, {1120, 0x17},
+	{1140, 0x18}, {1160, 0x19}, {1180, 0x1A}, {1190, 0x1B},
+	{1200, 0x1C}, {1210, 0x1D}, {1220, 0x1E}, {1230, 0x1F},
+	{1250, 0x0}, {1270, 0x1}, {1290, 0x2}, {1310, 0x3},
+	{1330, 0x4}, {1350, 0x5}, {1370, 0x6}, {1390, 0x7},
+	{1410, 0x8}, {1430, 0x9}, {1450, 0xA}, {1460, 0xB},
+	{1470, 0xC}, {1480, 0xD}, {1490, 0xE}, {1500, 0xF},
+};
+
 static const unsigned int ad9265_scale_table[][2] = {
 	{1250, 0x00}, {1500, 0x40}, {1750, 0x80}, {2000, 0xC0},
 };
@@ -297,6 +316,10 @@ static void __ad9467_get_scale(struct ad9467_state *st, int index,
 	},								\
 }
 
+static const struct iio_chan_spec ad9211_channels[] = {
+	AD9467_CHAN(0, BIT(IIO_CHAN_INFO_SCALE), 0, 10, 's'),
+};
+
 static const struct iio_chan_spec ad9434_channels[] = {
 	AD9467_CHAN(0, BIT(IIO_CHAN_INFO_SCALE), 0, 12, 's'),
 };
@@ -369,6 +392,23 @@ static const struct ad9467_chip_info ad9434_chip_tbl = {
 	.num_lanes = 6,
 };
 
+static const struct ad9467_chip_info ad9211_chip_tbl = {
+	.name = "ad9211",
+	.id = CHIPID_AD9211,
+	.max_rate = 300 * HZ_PER_MHZ,
+	.scale_table = ad9211_scale_table,
+	.num_scales = ARRAY_SIZE(ad9211_scale_table),
+	.channels = ad9211_channels,
+	.num_channels = ARRAY_SIZE(ad9211_channels),
+	.test_points = AD9647_MAX_TEST_POINTS,
+	.test_mask = GENMASK(AN877_ADC_TESTMODE_ONE_ZERO_TOGGLE,
+			     AN877_ADC_TESTMODE_OFF),
+	.test_mask_len = AN877_ADC_TESTMODE_ONE_ZERO_TOGGLE + 1,
+	.default_output_mode = AD9211_DEF_OUTPUT_MODE,
+	.vref_mask = AD9211_REG_VREF_MASK,
+	.has_dco = true,
+};
+
 static const struct ad9467_chip_info ad9265_chip_tbl = {
 	.name = "ad9265",
 	.id = CHIPID_AD9265,
@@ -1264,6 +1304,7 @@ static int ad9467_probe(struct spi_device *spi)
 }
 
 static const struct of_device_id ad9467_of_match[] = {
+	{ .compatible = "adi,ad9211", .data = &ad9211_chip_tbl, },
 	{ .compatible = "adi,ad9265", .data = &ad9265_chip_tbl, },
 	{ .compatible = "adi,ad9434", .data = &ad9434_chip_tbl, },
 	{ .compatible = "adi,ad9467", .data = &ad9467_chip_tbl, },
@@ -1275,6 +1316,7 @@ static const struct of_device_id ad9467_of_match[] = {
 MODULE_DEVICE_TABLE(of, ad9467_of_match);
 
 static const struct spi_device_id ad9467_ids[] = {
+	{ "ad9211", (kernel_ulong_t)&ad9211_chip_tbl },
 	{ "ad9265", (kernel_ulong_t)&ad9265_chip_tbl },
 	{ "ad9434", (kernel_ulong_t)&ad9434_chip_tbl },
 	{ "ad9467", (kernel_ulong_t)&ad9467_chip_tbl },

-- 
2.47.3


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

* [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 12:30 [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211 Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 1/3] dt-bindings: " Tomas Melin
  2025-12-08 12:30 ` [PATCH v3 2/3] iio: " Tomas Melin
@ 2025-12-08 12:30 ` Tomas Melin
  2025-12-08 13:20   ` Andy Shevchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 12:30 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Michael Hennerich, linux-iio, devicetree, linux-kernel,
	Tomas Melin

No need to include the entire kernel.h when the only thing needed
is the ARRAY_SIZE macro.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
 drivers/iio/adc/ad9467.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 5840bef795daae88518b23ca0dec4da0c5fef07f..e1a89806713835ba73acaa5029de9df481399e5c 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -12,7 +12,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
+#include <linux/array_size.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
 #include <linux/seq_file.h>

-- 
2.47.3


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

* Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 12:30 ` [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h Tomas Melin
@ 2025-12-08 13:20   ` Andy Shevchenko
  2025-12-08 15:41     ` Tomas Melin
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-12-08 13:20 UTC (permalink / raw)
  To: Tomas Melin
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
> No need to include the entire kernel.h when the only thing needed
> is the ARRAY_SIZE macro.

ARRAY_SIZE().

...


> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -12,7 +12,7 @@
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/device.h>
> -#include <linux/kernel.h>
> +#include <linux/array_size.h>
>  #include <linux/slab.h>
>  #include <linux/spi/spi.h>
>  #include <linux/seq_file.h>

Please, keep them sorted.

...

While this change is almost (*) okay per se, I think we can address more
while at it.
- Make the header inclusions ordered (also fix the location of clk.h)
- drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
- add missing ones (dev_printk.h, device/devres.h, ...)

(*) no, kernel.h provides more for this driver, for example, your patch
misses types.h.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v3 2/3] iio: adc: ad9467: add support for ad9211
  2025-12-08 12:30 ` [PATCH v3 2/3] iio: " Tomas Melin
@ 2025-12-08 13:27   ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2025-12-08 13:27 UTC (permalink / raw)
  To: Tomas Melin
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

On Mon, Dec 08, 2025 at 12:30:58PM +0000, Tomas Melin wrote:
> The AD9211 is a 10-bit monolithic sampling analog-to-digital converter
> optimized for high performance, low power, and ease of use. The product
> operates at up to a 300 MSPS conversion rate and is optimized for
> outstanding dynamic performance in wideband carrier and broadband systems.
> 
> The scale table implemented here is not an exact match with the
> datasheet as the table presented there is missing some information.
> The reference presents these values as being linear,
> but that does not add up. There is information missing in the table.
> Implemented scale table matches values at the middle and at the ends,
> smoothing the curve towards middle and end.
> Impact on end result from deviation in scale factor affects only software
> using it for scaling. All the possible hw-settings are also available with
> this implementation.

...

> +	.max_rate = 300 * HZ_PER_MHZ,

With this change applied, you may consider adding a new patch to convert other
initialisers to use the same approach for the sake of consistency and making it
less error prone (easier to count up to 3 digits than zillions of zeroes).

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 13:20   ` Andy Shevchenko
@ 2025-12-08 15:41     ` Tomas Melin
  2025-12-08 15:58       ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 15:41 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

Hi,

On 08/12/2025 15:20, Andy Shevchenko wrote:
> On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
>> No need to include the entire kernel.h when the only thing needed
>> is the ARRAY_SIZE macro.
> 
> ARRAY_SIZE().
> 
> ...
> 
> 
>> --- a/drivers/iio/adc/ad9467.c
>> +++ b/drivers/iio/adc/ad9467.c
>> @@ -12,7 +12,7 @@
>>  #include <linux/module.h>
>>  #include <linux/mutex.h>
>>  #include <linux/device.h>
>> -#include <linux/kernel.h>
>> +#include <linux/array_size.h>
>>  #include <linux/slab.h>
>>  #include <linux/spi/spi.h>
>>  #include <linux/seq_file.h>
> 
> Please, keep them sorted.
These were unfortunately not sorted to start with.

> 
> ...
> 
> While this change is almost (*) okay per se, I think we can address more
> while at it.
> - Make the header inclusions ordered (also fix the location of clk.h)
> - drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
> - add missing ones (dev_printk.h, device/devres.h, ...)

As this change (kernel.h) does not seem at all as straightforward as I
envisoned based on your initial request, I will likely change this patch
to instead just sort the headers. Reworking the includes is separate
topic from the intent of this patch series.

Thanks,
Tomas




> 
> (*) no, kernel.h provides more for this driver, for example, your patch
> misses types.h.
> 


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

* Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 15:41     ` Tomas Melin
@ 2025-12-08 15:58       ` Andy Shevchenko
  2025-12-08 16:21         ` Tomas Melin
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-12-08 15:58 UTC (permalink / raw)
  To: Tomas Melin
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

On Mon, Dec 08, 2025 at 05:41:20PM +0200, Tomas Melin wrote:
> On 08/12/2025 15:20, Andy Shevchenko wrote:
> > On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
> >> No need to include the entire kernel.h when the only thing needed
> >> is the ARRAY_SIZE macro.
> > 
> > ARRAY_SIZE().

Please, remove context you are agree with.

...

> >>  #include <linux/module.h>
> >>  #include <linux/mutex.h>
> >>  #include <linux/device.h>
> >> -#include <linux/kernel.h>
> >> +#include <linux/array_size.h>
> >>  #include <linux/slab.h>
> >>  #include <linux/spi/spi.h>
> >>  #include <linux/seq_file.h>
> > 
> > Please, keep them sorted.
> These were unfortunately not sorted to start with.

But your patch makes situation even worse. That's what I meant by the comment.
Since there is no a* header, it may be put to the proper location from day 1.

...

> > While this change is almost (*) okay per se, I think we can address more
> > while at it.
> > - Make the header inclusions ordered (also fix the location of clk.h)
> > - drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
> > - add missing ones (dev_printk.h, device/devres.h, ...)
> 
> As this change (kernel.h) does not seem at all as straightforward as I
> envisoned based on your initial request, I will likely change this patch
> to instead just sort the headers. Reworking the includes is separate
> topic from the intent of this patch series.

If you don't feel going that deep, than it's a (small) problem.

As the author of a driver feature one should understand slightly more about
this (yeah, currently mess) header stuff. So, your first patch should add
missed headers, if any, that's required to your changes, this one can be
omitted after all.

But on some day you will still need to understand a bit more about headers...

TL;DR: make sure you have all needed headers for your changes in the previous
patch and drop this one.

> > (*) no, kernel.h provides more for this driver, for example, your patch
> > misses types.h.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 15:58       ` Andy Shevchenko
@ 2025-12-08 16:21         ` Tomas Melin
  2025-12-08 16:23           ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Tomas Melin @ 2025-12-08 16:21 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

Hi,

On 08/12/2025 17:58, Andy Shevchenko wrote:
> On Mon, Dec 08, 2025 at 05:41:20PM +0200, Tomas Melin wrote:
>> On 08/12/2025 15:20, Andy Shevchenko wrote:
>>> On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
>>>> No need to include the entire kernel.h when the only thing needed
>>>> is the ARRAY_SIZE macro.

>>> While this change is almost (*) okay per se, I think we can address more
>>> while at it.
>>> - Make the header inclusions ordered (also fix the location of clk.h)
>>> - drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
>>> - add missing ones (dev_printk.h, device/devres.h, ...)
>>
>> As this change (kernel.h) does not seem at all as straightforward as I
>> envisoned based on your initial request, I will likely change this patch
>> to instead just sort the headers. Reworking the includes is separate
>> topic from the intent of this patch series.
> 
> If you don't feel going that deep, than it's a (small) problem.
> 
> As the author of a driver feature one should understand slightly more about
> this (yeah, currently mess) header stuff. So, your first patch should add
> missed headers, if any, that's required to your changes, this one can be
> omitted after all.
Well, I think reworking the headers is a sane idea, but it is not the
topic of this series.

> 
> But on some day you will still need to understand a bit more about headers...
> 
> TL;DR: make sure you have all needed headers for your changes in the previous
> patch and drop this one.

Hope we mean the same thing, I was thinking more like
   1. sort current headers
   2. add feature which adds the new header in correct location


Thanks,
Tomas


> 
>>> (*) no, kernel.h provides more for this driver, for example, your patch
>>> misses types.h.
> 


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

* Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
  2025-12-08 16:21         ` Tomas Melin
@ 2025-12-08 16:23           ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2025-12-08 16:23 UTC (permalink / raw)
  To: Tomas Melin
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sa, Jonathan Cameron,
	David Lechner, Andy Shevchenko, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-iio, devicetree, linux-kernel

On Mon, Dec 08, 2025 at 06:21:25PM +0200, Tomas Melin wrote:
> On 08/12/2025 17:58, Andy Shevchenko wrote:
> > On Mon, Dec 08, 2025 at 05:41:20PM +0200, Tomas Melin wrote:
> >> On 08/12/2025 15:20, Andy Shevchenko wrote:
> >>> On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:

...

> > If you don't feel going that deep, than it's a (small) problem.
> > 
> > As the author of a driver feature one should understand slightly more about
> > this (yeah, currently mess) header stuff. So, your first patch should add
> > missed headers, if any, that's required to your changes, this one can be
> > omitted after all.
> Well, I think reworking the headers is a sane idea, but it is not the
> topic of this series.
> 
> > But on some day you will still need to understand a bit more about headers...
> > 
> > TL;DR: make sure you have all needed headers for your changes in the previous
> > patch and drop this one.
> 
> Hope we mean the same thing, I was thinking more like
>    1. sort current headers
>    2. add feature which adds the new header in correct location

Sure, it's even better!

-- 
With Best Regards,
Andy Shevchenko



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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 12:30 [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211 Tomas Melin
2025-12-08 12:30 ` [PATCH v3 1/3] dt-bindings: " Tomas Melin
2025-12-08 12:30 ` [PATCH v3 2/3] iio: " Tomas Melin
2025-12-08 13:27   ` Andy Shevchenko
2025-12-08 12:30 ` [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h Tomas Melin
2025-12-08 13:20   ` Andy Shevchenko
2025-12-08 15:41     ` Tomas Melin
2025-12-08 15:58       ` Andy Shevchenko
2025-12-08 16:21         ` Tomas Melin
2025-12-08 16:23           ` Andy Shevchenko

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).