Skip to contentSkip to conversation

dt-bindings: iio: adc: ti-ads1298: Add bindings

PATCH Superseded Mike Looijmans 5 participants 16 messages Feb 6, 2024 – Feb 14, 2024 1 message not in the archive

Subsystems (2)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.ad72f8ca-a017-42d2-9c07-f17f282264d0@emailsignatures365.codetwo.com

#1 lore raw

PATCH v3 1/2 dt-bindings: iio: adc: ti-ads1298: Add bindings

Bindings for the TI ADS1298 medical ADC. This device is typically used for ECG and similar measurements. Supports data acquisition at configurable scale and sampling frequency.

The device has so many options for connecting stuff, at this point the bindings aren't nearly complete but partial bindings are better than no bindings at all.

---

(no changes since v2)

Changes in v2:
Remove "clk" name
Add datasheet and "incomplete" note

 .../bindings/iio/adc/ti,ads1298.yaml          | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads1298.yaml
Documentation/devicetree/bindings/iio/adc/ti,ads1298.yaml new file +80 -0
new file mode 100644
index 000000000000..bf5a43a81d59
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,ads1298.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments' ads1298 medical ADC chips
+
+description: |
+  Datasheet at: https://www.ti.com/product/ADS1298
+  Bindings for this chip aren't complete.
+
+maintainers:
+  - Mike Looijmans <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - ti,ads1298
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+
+  reset-gpios:
+    maxItems: 1
+
+  avdd-supply:
+    description:
+      Analog power supply, voltage between AVDD and AVSS. When providing a
+      symmetric +/- 2.5V, the regulator should report 5V.
+
+  vref-supply:
+    description:
+      Optional reference voltage. If omitted, internal reference is used,
+      which is 2.4V when analog supply is below 4.4V, 4V otherwise.
+
+  clocks:
+    description: Optional 2.048 MHz external source clock on CLK pin
+    maxItems: 1
+
+  interrupts:
+    description: Interrupt on DRDY pin, triggers on falling edge
+    maxItems: 1
+
+  label: true
+
+required:
+  - compatible
+  - reg
+  - avdd-supply
+  - interrupts
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@1 {
+          reg = <1>;
+          compatible = "ti,ads1298";
+          label = "ads1298-1-ecg";
+          avdd-supply = <&reg_iso_5v_a>;
+          clocks = <&clk_ads1298>;
+          interrupt-parent = <&gpio0>;
+          interrupts = <78 IRQ_TYPE_EDGE_FALLING>;
+          spi-max-frequency = <20000000>;
+          spi-cpha;
+        };
+    };
+...
Signature · 18 lines
2.34.1


Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl

Please consider the environment before printing this e-mail
#2 lore raw

PATCH v3 2/2 iio: adc: ti-ads1298: Add driver

Skeleton driver for the TI ADS1298 medical ADC. This device is typically used for ECG and similar measurements. Supports data acquisition at configurable scale and sampling frequency.

---

Changes in v3:
Indentation fixups
Remove unused headers
Remove #define leftovers
Use devm_get_clk_optional_enabled
Use ilog2 instead of fls()-1
Magic "23" replaced
Explain the extra "0" in read/write register
use guard() from cleanup.h
use REGCACHE_MAPLE

Changes in v2:
Remove accidental "default y" in Kconfig
Indentation and similar cosmetic fixes
Magic numbers into constants
Short return paths in read_raw and write_raw
DMA buffer alignment
Bounce buffer is u32 instead of u8
Avoid races using claim_direct_mode
Check errors on all register accesses
Immediate SPI restart to reduce underruns
"name" is chip name, not unique

 drivers/iio/adc/Kconfig      |  11 +
 drivers/iio/adc/Makefile     |   1 +
 drivers/iio/adc/ti-ads1298.c | 752 +++++++++++++++++++++++++++++++++++
 3 files changed, 764 insertions(+)
 create mode 100644 drivers/iio/adc/ti-ads1298.c
drivers/iio/adc/Kconfig +11 -0
index 35f9867da12c..1d2d2eff15da 100644
@@ -1318,6 +1318,17 @@ config TI_ADS8688
 	  This driver can also be built as a module. If so, the module will be
 	  called ti-ads8688.
 
+config TI_ADS1298
+	tristate "Texas Instruments ADS1298"
+	depends on SPI
+	select IIO_BUFFER
+	help
+	  If you say yes here you get support for Texas Instruments ADS1298
+	  medical ADC chips
+
+	  This driver can also be built as a module. If so, the module will be
+	  called ti-ads1298.
+
 config TI_ADS124S08
 	tristate "Texas Instruments ADS124S08"
 	depends on SPI
drivers/iio/adc/Makefile +1 -0
index bee11d442af4..ff0e3633eded 100644
@@ -117,6 +117,7 @@ obj-$(CONFIG_TI_ADS7924) += ti-ads7924.o
 obj-$(CONFIG_TI_ADS7950) += ti-ads7950.o
 obj-$(CONFIG_TI_ADS8344) += ti-ads8344.o
 obj-$(CONFIG_TI_ADS8688) += ti-ads8688.o
+obj-$(CONFIG_TI_ADS1298) += ti-ads1298.o
 obj-$(CONFIG_TI_ADS124S08) += ti-ads124s08.o
 obj-$(CONFIG_TI_ADS131E08) += ti-ads131e08.o
 obj-$(CONFIG_TI_AM335X_ADC) += ti_am335x_adc.o
drivers/iio/adc/ti-ads1298.c new file +752 -0

752 lines not on this page · raw message

Signature · 18 lines
2.34.1


Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl

Please consider the environment before printing this e-mail
Reviewed-by on v3 2/2
#3 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 3 lines · Mike Looijmans

Skeleton driver for the TI ADS1298 medical ADC. This device is typically used for ECG and similar measurements. Supports data acquisition at configurable scale and sampling frequency.

Thanks for an update, I have only a few style comments and a single one about comparison (see below). If you are going to address them as suggested, feel free to add

to the next version.

...

drivers/iio/adc/ti-ads1298.c line 45

Quoted 6 lines
drivers/iio/adc/ti-ads1298.c new file +6 -0
+/* Registers */
+#define ADS1298_REG_ID		0x00
+#define ADS1298_MASK_ID_FAMILY			GENMASK(7, 3)
+#define ADS1298_MASK_ID_CHANNELS		GENMASK(2, 0)
+#define ADS1298_ID_FAMILY_ADS129X		0x90
+#define ADS1298_ID_FAMILY_ADS129XR		0xd0

+ Blank line? (And so on for all registers that have bitfields defined)

Quoted 6 lines
drivers/iio/adc/ti-ads1298.c new file +6 -0
+#define ADS1298_REG_CONFIG1	0x01
+#define ADS1298_MASK_CONFIG1_HR			BIT(7)
+#define ADS1298_MASK_CONFIG1_DR			GENMASK(2, 0)
+#define ADS1298_SHIFT_DR_HR			6
+#define ADS1298_SHIFT_DR_LP			7
+#define ADS1298_LOWEST_DR			0x06

...

drivers/iio/adc/ti-ads1298.c line 248

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	factor = (rate >> ADS1298_SHIFT_DR_HR) / val;
+	if (factor >= 128)

I just realized that this comparison is probably better in a form

	if (factor >= ADS1298_MASK_CONFIG1_HR)

as it points out why this is a special case in comparison to 'if (factor)' below. What do you think?

Quoted 5 lines
drivers/iio/adc/ti-ads1298.c new file +5 -0
+		cfg = ADS1298_LOWEST_DR;
+	else if (factor)
+		cfg = ADS1298_MASK_CONFIG1_HR | ilog2(factor); /* Use HR mode */
+	else
+		cfg = ADS1298_MASK_CONFIG1_HR; /* Fastest possible */

...

drivers/iio/adc/ti-ads1298.c line 328

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+		*val = (16 << (*val & ADS1298_MASK_CONFIG1_DR));

Outer parentheses are redundant.

...

drivers/iio/adc/ti-ads1298.c line 452

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

drivers/iio/adc/ti-ads1298.c line 453

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	if (wasbusy) {

To me more robust code would look like

	if (wasbusy < 1)
		return;
	...
	if (wasbusy > 1)
		...
Quoted 14 lines
drivers/iio/adc/ti-ads1298.c new file +14 -0
+		/*
+		 * DRDY interrupt occurred before SPI completion. Start a new
+		 * SPI transaction now to retrieve the data that wasn't latched
+		 * into the ADS1298 chip's transfer buffer yet.
+		 */
+		spi_async(priv->spi, &priv->rdata_msg);
+		/*
+		 * If more than one DRDY took place, there was an overrun. Since
+		 * the sample is already lost, reset the counter to 1 so that
+		 * we will wait for a DRDY interrupt after this SPI transaction.
+		 */
+		if (wasbusy > 1)
+			priv->rdata_xfer_busy = 1;
+	}

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+		/*
+		 * for a single transfer mode we're kept in direct_mode until

For

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+		 * completion, avoiding a race with buffered IO.
+		 */

...

drivers/iio/adc/ti-ads1298.c line 512

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = priv->rdata_xfer_busy++;

So, it starts from negative?

drivers/iio/adc/ti-ads1298.c line 514

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	/* When no SPI transfer in transit, start one now */
+	if (!wasbusy)

To be compatible with above perhaps

if (wasbusy < 1)

also makes it more robust (all negative numbers will be considered the same.

Quoted 1 line
(quoted diff) +1 -0
+		spi_async(priv->spi, &priv->rdata_msg);

...

drivers/iio/adc/ti-ads1298.c line 586

Quoted 3 lines
drivers/iio/adc/ti-ads1298.c new file +3 -0
+	struct device *dev = &priv->spi->dev;
+	int ret;
+	unsigned int val;

Better ordering is so called reversed xmas tree (longest lines first):

	struct device *dev = &priv->spi->dev;
	unsigned int val;
	int ret;

...

drivers/iio/adc/ti-ads1298.c line 588

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	/* Device initializes into RDATAC mode, which we don't want. */

No period at the end of one-line comments (be consistent in the style over comments of the same class).

...

drivers/iio/adc/ti-ads1298.c line 598

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	dev_dbg(dev, "Found %s, %u channels\n", ads1298_family_name(val),
+		(unsigned int)(4 + 2 * (val & ADS1298_MASK_ID_CHANNELS)));

Castings in printf() is a big red flag usually (it's rarely we need them). Why is it here?

...

drivers/iio/adc/ti-ads1298.c line 638

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	/* VREF can be supplied externally. Otherwise use internal reference */

Better to use comma as it's one-line comment. Or make it multi-line with respective periods.

...

drivers/iio/adc/ti-ads1298.c line 652

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+		ret = devm_add_action_or_reset(dev, ads1298_reg_disable,
+					       priv->reg_vref);

Can be one line.

Quoted 2 lines
(quoted diff) +2 -0
+		if (ret)
+			return ret;

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret = devm_add_action_or_reset(dev, ads1298_reg_disable,
+				       priv->reg_avdd);

One line.

Quoted 2 lines
(quoted diff) +2 -0
+	if (ret)
+		return ret;

...

drivers/iio/adc/ti-ads1298.c line 702

Quoted 4 lines
drivers/iio/adc/ti-ads1298.c new file +4 -0
+	if (reset_gpio) {
+		/* Minimum reset pulsewidth is 2 clock cycles */
+		udelay(ADS1298_CLOCKS_TO_USECS(2));
+		gpiod_set_value(reset_gpio, 0);

I would rewrite it as

		/* Minimum reset pulsewidth is 2 clock cycles */
		gpiod_set_value(reset_gpio, 1);
		udelay(ADS1298_CLOCKS_TO_USECS(2));
		gpiod_set_value(reset_gpio, 0);

to be sure we have a reset done correctly, and the comment will make more sense.

Quoted 7 lines
drivers/iio/adc/ti-ads1298.c new file +7 -0
+	} else {
+		ret = ads1298_write_cmd(priv, ADS1298_CMD_RESET);
+		if (ret)
+			return dev_err_probe(dev, ret, "RESET failed\n");
+	}
+	/* Wait 18 clock cycles for reset command to complete */
+	udelay(ADS1298_CLOCKS_TO_USECS(18));
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 8 lines · Andy Shevchenko
Quoted 3 lines · Mike Looijmans

Skeleton driver for the TI ADS1298 medical ADC. This device is typically used for ECG and similar measurements. Supports data acquisition at configurable scale and sampling frequency.

Thanks for an update, I have only a few style comments and a single one about comparison (see below). If you are going to address them as suggested, feel free to add

Quoted 5 lines

to the next version.

...

Thanks for reviewing...

Quoted 7 lines

drivers/iio/adc/ti-ads1298.c line 45

Quoted 6 lines
drivers/iio/adc/ti-ads1298.c new file +6 -0
+/* Registers */
+#define ADS1298_REG_ID		0x00
+#define ADS1298_MASK_ID_FAMILY			GENMASK(7, 3)
+#define ADS1298_MASK_ID_CHANNELS		GENMASK(2, 0)
+#define ADS1298_ID_FAMILY_ADS129X		0x90
+#define ADS1298_ID_FAMILY_ADS129XR		0xd0

+ Blank line? (And so on for all registers that have bitfields defined)

Makes sense... Looks too cluttered as it is now.

Quoted 9 lines
Quoted 7 lines
drivers/iio/adc/ti-ads1298.c new file +6 -0
+#define ADS1298_REG_CONFIG1	0x01
+#define ADS1298_MASK_CONFIG1_HR			BIT(7)
+#define ADS1298_MASK_CONFIG1_DR			GENMASK(2, 0)
+#define ADS1298_SHIFT_DR_HR			6
+#define ADS1298_SHIFT_DR_LP			7
+#define ADS1298_LOWEST_DR			0x06

...

Quoted 8 lines

drivers/iio/adc/ti-ads1298.c line 248

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	factor = (rate >> ADS1298_SHIFT_DR_HR) / val;
+	if (factor >= 128)

I just realized that this comparison is probably better in a form

	if (factor >= ADS1298_MASK_CONFIG1_HR)

as it points out why this is a special case in comparison to 'if (factor)' below. What do you think?

The "HR" bit sets the device to high-res mode (which apparently doubles the internal sample rate).

But "128" could be written as "1 << ADS1298_SHIFT_DR_LP" which is the max oversampling factor.

Quoted 4 lines

...

drivers/iio/adc/ti-ads1298.c line 452

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Maybe better write this as:

--priv->rdata_xfer_busy;

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Quoted 8 lines

drivers/iio/adc/ti-ads1298.c line 453

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	if (wasbusy) {

To me more robust code would look like

	if (wasbusy < 1)
		return;
	...
	if (wasbusy > 1)
		...

wasbusy could have been unsigned.

This code will only ever execute with rdata_xfer_busy > 0 (or the SPI driver called our completion callback without us calling spi_async first)

Quoted 32 lines
Quoted 15 lines
drivers/iio/adc/ti-ads1298.c new file +14 -0
+		/*
+		 * DRDY interrupt occurred before SPI completion. Start a new
+		 * SPI transaction now to retrieve the data that wasn't latched
+		 * into the ADS1298 chip's transfer buffer yet.
+		 */
+		spi_async(priv->spi, &priv->rdata_msg);
+		/*
+		 * If more than one DRDY took place, there was an overrun. Since
+		 * the sample is already lost, reset the counter to 1 so that
+		 * we will wait for a DRDY interrupt after this SPI transaction.
+		 */
+		if (wasbusy > 1)
+			priv->rdata_xfer_busy = 1;
+	}

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+		/*
+		 * for a single transfer mode we're kept in direct_mode until

For

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+		 * completion, avoiding a race with buffered IO.
+		 */

...

drivers/iio/adc/ti-ads1298.c line 512

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = priv->rdata_xfer_busy++;

So, it starts from negative?

drivers/iio/adc/ti-ads1298.c line 514

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	/* When no SPI transfer in transit, start one now */
+	if (!wasbusy)

To be compatible with above perhaps

Quoted 5 lines

if (wasbusy < 1)

also makes it more robust (all negative numbers will be considered the same.

Review

Quoted 1 line
(quoted diff) +1 -0
+		spi_async(priv->spi, &priv->rdata_msg);

The "rdata_xfer_busy" starts at 0.

Increments when a DRDY occurs.

Decrements when SPI completion is reported.

So the meaning of "rdata_xfer_busy" is:

0 = Waiting for DRDY interrupt

1 = SPI transfer in progress

2 = DRDY occured during SPI transfer, should start another on completion

Quoted 10 lines

2 = Multiple DRDY during SPI transfer, overflow, we lost rdata_xfer_busy - 2 samples

...

drivers/iio/adc/ti-ads1298.c line 598

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	dev_dbg(dev, "Found %s, %u channels\n", ads1298_family_name(val),
+		(unsigned int)(4 + 2 * (val & ADS1298_MASK_ID_CHANNELS)));

Castings in printf() is a big red flag usually (it's rarely we need them). Why is it here?

Compiler complains that the expression is "unsigned long". Probably because of ADS1298_MASK_ID_CHANNELS being so.

Quoted 8 lines

...

drivers/iio/adc/ti-ads1298.c line 702

Quoted 4 lines
drivers/iio/adc/ti-ads1298.c new file +4 -0
+	if (reset_gpio) {
+		/* Minimum reset pulsewidth is 2 clock cycles */
+		udelay(ADS1298_CLOCKS_TO_USECS(2));
+		gpiod_set_value(reset_gpio, 0);

I would rewrite it as

Quoted 7 lines
		/* Minimum reset pulsewidth is 2 clock cycles */
		gpiod_set_value(reset_gpio, 1);
		udelay(ADS1298_CLOCKS_TO_USECS(2));
		gpiod_set_value(reset_gpio, 0);

to be sure we have a reset done correctly, and the comment will make more sense.

If used, the reset must be asserted *before* the voltages and clocks are activated. This would obfuscate that, and add a redundant call to set_value.

I did forget to use "cansleep" here, will add that.

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
#5 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 6 lines
Quoted 6 lines

drivers/iio/adc/ti-ads1298.c line 248

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	factor = (rate >> ADS1298_SHIFT_DR_HR) / val;
+	if (factor >= 128)

I just realized that this comparison is probably better in a form

	if (factor >= ADS1298_MASK_CONFIG1_HR)
Quoted 8 lines
Quoted 2 lines

as it points out why this is a special case in comparison to 'if (factor)' below. What do you think?

The "HR" bit sets the device to high-res mode (which apparently doubles the internal sample rate).

But "128" could be written as "1 << ADS1298_SHIFT_DR_LP" which is the max oversampling factor.

Use BIT(..._DR_LP) and we are done here.

...

Quoted 10 lines
Quoted 2 lines

drivers/iio/adc/ti-ads1298.c line 452

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Maybe better write this as:

--priv->rdata_xfer_busy;

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Yes, looks more obvious.

Quoted 9 lines
Quoted 8 lines

drivers/iio/adc/ti-ads1298.c line 453

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	if (wasbusy) {

To me more robust code would look like

	if (wasbusy < 1)
		return;
	...
	if (wasbusy > 1)
		...
Quoted 4 lines

wasbusy could have been unsigned.

This code will only ever execute with rdata_xfer_busy > 0 (or the SPI driver called our completion callback without us calling spi_async first)

You never know what may go wrong in the future :-) That said, I prefer robust code against non-robust.

...

Quoted 21 lines
Quoted 7 lines

drivers/iio/adc/ti-ads1298.c line 512

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = priv->rdata_xfer_busy++;

So, it starts from negative?

drivers/iio/adc/ti-ads1298.c line 514

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	/* When no SPI transfer in transit, start one now */
+	if (!wasbusy)

To be compatible with above perhaps

Quoted 5 lines

if (wasbusy < 1)

also makes it more robust (all negative numbers will be considered the same.

Review

Quoted 1 line
(quoted diff) +1 -0
+		spi_async(priv->spi, &priv->rdata_msg);

The "rdata_xfer_busy" starts at 0.

Increments when a DRDY occurs.

Decrements when SPI completion is reported.

So the meaning of "rdata_xfer_busy" is:

Quoted 8 lines

0 = Waiting for DRDY interrupt

1 = SPI transfer in progress

2 = DRDY occured during SPI transfer, should start another on completion

Quoted 1 line

2 = Multiple DRDY during SPI transfer, overflow, we lost rdata_xfer_busy -

2 samples

Maybe another good comment is needed here as well?

...

Quoted 7 lines
Quoted 4 lines

drivers/iio/adc/ti-ads1298.c line 598

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	dev_dbg(dev, "Found %s, %u channels\n", ads1298_family_name(val),
+		(unsigned int)(4 + 2 * (val & ADS1298_MASK_ID_CHANNELS)));

Castings in printf() is a big red flag usually (it's rarely we need them). Why is it here?

Compiler complains that the expression is "unsigned long". Probably because
of ADS1298_MASK_ID_CHANNELS being so.

So, use the unsigned long specifier and drop casting.

...

Quoted 11 lines
Quoted 11 lines

drivers/iio/adc/ti-ads1298.c line 702

Quoted 4 lines
drivers/iio/adc/ti-ads1298.c new file +4 -0
+	if (reset_gpio) {
+		/* Minimum reset pulsewidth is 2 clock cycles */
+		udelay(ADS1298_CLOCKS_TO_USECS(2));
+		gpiod_set_value(reset_gpio, 0);

I would rewrite it as

		/* Minimum reset pulsewidth is 2 clock cycles */
		gpiod_set_value(reset_gpio, 1);
		udelay(ADS1298_CLOCKS_TO_USECS(2));
		gpiod_set_value(reset_gpio, 0);
Quoted 5 lines
Quoted 2 lines

to be sure we have a reset done correctly, and the comment will make more sense.

If used, the reset must be asserted *before* the voltages and clocks are activated. This would obfuscate that, and add a redundant call to set_value.

Then perhaps you want reset framework to be used instead?

Dunno, but this comment seems confusing in a way that you somewhere asserted it and it's not obvious where and here is the delay out of a blue. Perhaps you may extend the comment?

Quoted 1 line

I did forget to use "cansleep" here, will add that.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 11 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 6 lines
Quoted 6 lines

drivers/iio/adc/ti-ads1298.c line 248

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	factor = (rate >> ADS1298_SHIFT_DR_HR) / val;
+	if (factor >= 128)

I just realized that this comparison is probably better in a form

	if (factor >= ADS1298_MASK_CONFIG1_HR)
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

as it points out why this is a special case in comparison to 'if (factor)' below. What do you think?

The "HR" bit sets the device to high-res mode (which apparently doubles the internal sample rate).

But "128" could be written as "1 << ADS1298_SHIFT_DR_LP" which is the max oversampling factor.

Use BIT(..._DR_LP) and we are done here.

Ok.

Quoted 4 lines

...

Quoted 2 lines
Quoted 2 lines

drivers/iio/adc/ti-ads1298.c line 452

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Quoted 8 lines
Quoted 7 lines

Maybe better write this as:

--priv->rdata_xfer_busy;

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Yes, looks more obvious.

Having done that, and looking at it again, it's better to just eliminate the local "wasbusy" altogether. More concise.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

drivers/iio/adc/ti-ads1298.c line 453

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	if (wasbusy) {

To me more robust code would look like

	if (wasbusy < 1)
		return;
	...
	if (wasbusy > 1)
		...
Quoted 6 lines
Quoted 4 lines

wasbusy could have been unsigned.

This code will only ever execute with rdata_xfer_busy > 0 (or the SPI driver called our completion callback without us calling spi_async first)

You never know what may go wrong in the future :-) That said, I prefer robust code against non-robust.

Maybe: BUG_ON(!priv->rdata_xfer_busy)

Adds more code, dunno what weighs heavier... Haven't seen other drivers do this though.

I made rdata_xfer_busy unsigned as it should have been.

Quoted 24 lines

...

Quoted 22 lines
Quoted 7 lines

drivers/iio/adc/ti-ads1298.c line 512

Quoted 1 line
drivers/iio/adc/ti-ads1298.c new file +1 -0
+	wasbusy = priv->rdata_xfer_busy++;

So, it starts from negative?

drivers/iio/adc/ti-ads1298.c line 514

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	/* When no SPI transfer in transit, start one now */
+	if (!wasbusy)

To be compatible with above perhaps

Quoted 5 lines

if (wasbusy < 1)

also makes it more robust (all negative numbers will be considered the same.

Review

Quoted 1 line
(quoted diff) +1 -0
+		spi_async(priv->spi, &priv->rdata_msg);

The "rdata_xfer_busy" starts at 0.

Increments when a DRDY occurs.

Decrements when SPI completion is reported.

So the meaning of "rdata_xfer_busy" is:

0 = Waiting for DRDY interrupt

Quoted 8 lines
Quoted 6 lines

1 = SPI transfer in progress

2 = DRDY occured during SPI transfer, should start another on completion

Quoted 1 line

2 = Multiple DRDY during SPI transfer, overflow, we lost rdata_xfer_busy -

2 samples

Maybe another good comment is needed here as well?

I thought I had it covered with the comments... I'll add more.

Quoted 26 lines

...

Quoted 6 lines
Quoted 4 lines

drivers/iio/adc/ti-ads1298.c line 598

Quoted 2 lines
drivers/iio/adc/ti-ads1298.c new file +2 -0
+	dev_dbg(dev, "Found %s, %u channels\n", ads1298_family_name(val),
+		(unsigned int)(4 + 2 * (val & ADS1298_MASK_ID_CHANNELS)));

Castings in printf() is a big red flag usually (it's rarely we need them). Why is it here?

Compiler complains that the expression is "unsigned long". Probably because
of ADS1298_MASK_ID_CHANNELS being so.

So, use the unsigned long specifier and drop casting.

...

Quoted 13 lines
Quoted 13 lines

drivers/iio/adc/ti-ads1298.c line 702

Quoted 4 lines
drivers/iio/adc/ti-ads1298.c new file +4 -0
+	if (reset_gpio) {
+		/* Minimum reset pulsewidth is 2 clock cycles */
+		udelay(ADS1298_CLOCKS_TO_USECS(2));
+		gpiod_set_value(reset_gpio, 0);

I would rewrite it as

		/* Minimum reset pulsewidth is 2 clock cycles */
		gpiod_set_value(reset_gpio, 1);
		udelay(ADS1298_CLOCKS_TO_USECS(2));
		gpiod_set_value(reset_gpio, 0);

to be sure we have a reset done correctly, and the comment will make more sense.

Quoted 7 lines
Quoted 2 lines

If used, the reset must be asserted *before* the voltages and clocks are activated. This would obfuscate that, and add a redundant call to set_value.

Then perhaps you want reset framework to be used instead?

Dunno, but this comment seems confusing in a way that you somewhere asserted it and it's not obvious where and here is the delay out of a blue. Perhaps you may extend the comment?

Could use devm_reset_control_get_optional_shared() I guess, but that would change devicetree bindings as well...

And it wouldn't change the order, as it'd still be asserted at the start of probe()

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
#7 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 11 lines · Mike Looijmans
Quoted 10 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 2 lines
Quoted 1 line

+    wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Maybe better write this as:

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

--priv->rdata_xfer_busy;

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Yes, looks more obvious.

Having done that, and looking at it again, it's better to just eliminate the local "wasbusy" altogether. More concise.

This removes the decrement operator, so the method now looks like this:

static void ads1298_rdata_release_busy_or_restart(struct ads1298_private *priv) {
    guard(spinlock_irqsave)(&priv->irq_busy_lock);

    if (priv->rdata_xfer_busy > 1) {
        /*
         * DRDY interrupt occurred before SPI completion. Start a new
         * SPI transaction now to retrieve the data that wasn't latched
         * into the ADS1298 chip's transfer buffer yet.
         */
        spi_async(priv->spi, &priv->rdata_msg);
        /*
         * If more than one DRDY took place, there was an overrun. Since
         * the sample is already lost, reset the counter to 1 so that
         * we will wait for a DRDY interrupt after this SPI transaction. */
        priv->rdata_xfer_busy = 1;
    } else {
        /* No pending data, wait for DRDY */ priv->rdata_xfer_busy = 0;
    }
}

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
#8 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 5 lines · Mike Looijmans
Quoted 4 lines · Mike Looijmans
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 33 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

+    wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Maybe better write this as:

--priv->rdata_xfer_busy;

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Yes, looks more obvious.

Having done that, and looking at it again, it's better to just eliminate the local "wasbusy" altogether. More concise.

This removes the decrement operator, so the method now looks like this:

static void ads1298_rdata_release_busy_or_restart(struct ads1298_private *priv)
{
    guard(spinlock_irqsave)(&priv->irq_busy_lock);

    if (priv->rdata_xfer_busy > 1) {
        /*
         * DRDY interrupt occurred before SPI completion. Start a new
         * SPI transaction now to retrieve the data that wasn't latched
         * into the ADS1298 chip's transfer buffer yet.
         */
        spi_async(priv->spi, &priv->rdata_msg);
        /*
         * If more than one DRDY took place, there was an overrun. Since
         * the sample is already lost, reset the counter to 1 so that

Quoted 8 lines

         * we will wait for a DRDY interrupt after this SPI transaction. */
        priv->rdata_xfer_busy = 1;
    } else {
        /* No pending data, wait for DRDY */ priv->rdata_xfer_busy = 0;
    }
}

Yep and it looks like you reinvented atomics :-)

	atomic_t rdata_xfer_busy;
	...

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#9 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 47 lines · Andy Shevchenko
Quoted 5 lines · Mike Looijmans
Quoted 4 lines · Mike Looijmans
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 31 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

+    wasbusy = --priv->rdata_xfer_busy;

Why preincrement? How would it be different from postincrement?

Maybe better write this as:

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

--priv->rdata_xfer_busy;

wasbusy = priv->rdata_xfer_busy;

I want the value after decrementing it.

Yes, looks more obvious.

Having done that, and looking at it again, it's better to just eliminate the local "wasbusy" altogether. More concise.

This removes the decrement operator, so the method now looks like this:

static void ads1298_rdata_release_busy_or_restart(struct ads1298_private *priv)
{
    guard(spinlock_irqsave)(&priv->irq_busy_lock);

    if (priv->rdata_xfer_busy > 1) {
        /*
         * DRDY interrupt occurred before SPI completion. Start a new
         * SPI transaction now to retrieve the data that wasn't latched
         * into the ADS1298 chip's transfer buffer yet.
         */
        spi_async(priv->spi, &priv->rdata_msg);
        /*
         * If more than one DRDY took place, there was an overrun. Since
         * the sample is already lost, reset the counter to 1 so that

Quoted 8 lines

         * we will wait for a DRDY interrupt after this SPI transaction. */
        priv->rdata_xfer_busy = 1;
    } else {
        /* No pending data, wait for DRDY */ priv->rdata_xfer_busy = 0;
    }
}

Quoted 8 lines

Yep and it looks like you reinvented atomics :-)

	atomic_t rdata_xfer_busy;
	...

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

The spinlock also protects the call to spi_async().

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
#10 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 3 lines

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

The spinlock also protects the call to spi_async().

I don't get this. Locks usually protect the data and not the code. Can you elaborate?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#11 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 12 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 3 lines

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

The spinlock also protects the call to spi_async().

I don't get this. Locks usually protect the data and not the code. Can you elaborate?

Either the DRDY or SPI completion handler will call spi_async(), the lock assures that it's only called by one.

Usually the DRDY handler will call spi_async(). If the next DRDY arrives before the spi_async transfer finishes, the SPI completion handler must call spi_async() a.s.a.p. to also read the newly arrived sample. There's no way to ask the chip whether there's data to read, so all the driver can do is use the ISR to remember that DRDY did trigger.

The lock protects that the "busy" counter matches the actual pending calls to spi_async, and also protects that only one handler will call spi_async (and update the counter).

Maybe this picture helps:

DRDY ---+-----+-----+-----+-

SPI ------+------------+-+--

busy 00001100011111112211101

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
maintainer
#12 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 9 lines · On Tue, 6 Feb 2024 18:38:29 +0100 Mike Looijmans <[email protected]>…
Quoted 8 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:

...

Quoted 3 lines
Quoted 3 lines

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

The spinlock also protects the call to spi_async().

I don't get this. Locks usually protect the data and not the code. Can you elaborate?

Either the DRDY or SPI completion handler will call spi_async(), the lock assures that it's only called by one.

Arguably it's protecting the destination buffer of the spi_async() call. We don't really care if we issue two reads (it's a waste of time and we would store two sets of readings but meh), but we do care about being sure that don't issue a second read into a buffer that we are potentially simultaneously getting data back from.

There are comments where the release is to describe when it can be safely unlocked.

I'm not super keen on this whole structure but I don't really have a better idea. Who builds a device where you have no latched way of seeing if there is new data? (some) Hardware folk love to assume they have a RTOS only talking to their device and that no pulse signals will ever be missed.

We get to educate them when ever the opportunity arises :)

Jonathan

Quoted 20 lines

Usually the DRDY handler will call spi_async(). If the next DRDY arrives before the spi_async transfer finishes, the SPI completion handler must call spi_async() a.s.a.p. to also read the newly arrived sample. There's no way to ask the chip whether there's data to read, so all the driver can do is use the ISR to remember that DRDY did trigger.

The lock protects that the "busy" counter matches the actual pending calls to spi_async, and also protects that only one handler will call spi_async (and update the counter).

Maybe this picture helps:

DRDY ---+-----+-----+-----+-

SPI ------+------------+-+--

busy 00001100011111112211101

#13 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 16 lines · Jonathan Cameron
Quoted 13 lines · On Tue, 6 Feb 2024 18:38:29 +0100 Mike Looijmans <[email protected]>…
Quoted 12 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 3 lines

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

The spinlock also protects the call to spi_async().

I don't get this. Locks usually protect the data and not the code. Can you elaborate?

Quoted 8 lines
Quoted 2 lines

Either the DRDY or SPI completion handler will call spi_async(), the lock assures that it's only called by one.

Arguably it's protecting the destination buffer of the spi_async() call. We don't really care if we issue two reads (it's a waste of time and we would store two sets of readings but meh), but we do care about being sure that don't issue a second read into a buffer that we are potentially simultaneously getting data back from.

Indeed, that.

Quoted 10 lines

There are comments where the release is to describe when it can be safely unlocked.

I'm not super keen on this whole structure but I don't really have a better idea. Who builds a device where you have no latched way of seeing if there is new data? (some) Hardware folk love to assume they have a RTOS only talking to their device and that no pulse signals will ever be missed.

We get to educate them when ever the opportunity arises :)

Even on RTOS this chip was a pain - to get it to work reliably I had to set up a DMA controller to run the SPI transactions, which took some smart daisy-chaining (I recall having the DMA controller write to its own control registers to avoid involving the CPU).

It's probably possible to trick audio hardware (I2S controller) into grabbing the data (my chip doesn't have that) without involving the CPU.

As the code is now, I can grab data and display it with the IIO oscilloscope over network at 4kHz without losing samples on an A9 at 600Mhz.

Signature · 10 lines
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl
#14 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

Quoted 37 lines · On Wed, 14 Feb 2024 07:48:40 +0100 Mike Looijmans <[email protected]>…
Quoted 16 lines · Jonathan Cameron
Quoted 13 lines · On Tue, 6 Feb 2024 18:38:29 +0100 Mike Looijmans <[email protected]>…
Quoted 12 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 03:47:45PM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 3 lines

But it's up to you what to do with that.
Maybe Jonathan can advice something different.

The spinlock also protects the call to spi_async().

I don't get this. Locks usually protect the data and not the code. Can you elaborate?

Quoted 8 lines
Quoted 2 lines

Either the DRDY or SPI completion handler will call spi_async(), the lock assures that it's only called by one.

Arguably it's protecting the destination buffer of the spi_async() call. We don't really care if we issue two reads (it's a waste of time and we would store two sets of readings but meh), but we do care about being sure that don't issue a second read into a buffer that we are potentially simultaneously getting data back from.

Indeed, that.

Quoted 9 lines

There are comments where the release is to describe when it can be safely unlocked.

I'm not super keen on this whole structure but I don't really have a better idea. Who builds a device where you have no latched way of seeing if there is new data? (some) Hardware folk love to assume they have a RTOS only talking to their device and that no pulse signals will ever be missed.

Quoted 6 lines
Quoted 1 line

We get to educate them when ever the opportunity arises :)

Even on RTOS this chip was a pain - to get it to work reliably I had to set up a DMA controller to run the SPI transactions, which took some smart daisy-chaining (I recall having the DMA controller write to its own control registers to avoid involving the CPU).

Always fun when that sort of mess is needed!

Quoted 3 lines

It's probably possible to trick audio hardware (I2S controller) into grabbing the data (my chip doesn't have that) without involving the CPU.

Yeah, sometimes it feels like these ADCs have been designed with that sort of bus in mind.

Quoted 3 lines

As the code is now, I can grab data and display it with the IIO oscilloscope over network at 4kHz without losing samples on an A9 at 600Mhz.

Nice.

Quoted 1 line
#15 lore raw

Re: [PATCH v3 2/2] iio: adc: ti-ads1298: Add driver

In reply to Mike Looijmans
Quoted 4 lines · Mike Looijmans
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Mike Looijmans
Quoted 1 line · Andy Shevchenko

On Tue, Feb 06, 2024 at 07:58:18AM +0100, Mike Looijmans wrote:

...

Quoted 4 lines
Quoted 2 lines

You never know what may go wrong in the future :-) That said, I prefer robust code against non-robust.

Maybe: BUG_ON(!priv->rdata_xfer_busy)

Definitely not. Linus T. will scream at us on this.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v3 1/2
#16 lore raw
In reply to Mike Looijmans
Quoted 8 lines · Mike Looijmans

Bindings for the TI ADS1298 medical ADC. This device is typically used for ECG and similar measurements. Supports data acquisition at configurable scale and sampling frequency.

The device has so many options for connecting stuff, at this point the bindings aren't nearly complete but partial bindings are better than no bindings at all.

Quoted 5 lines

---

(no changes since v2)

I think you forgot a tag:
https://lore.kernel.org/all/20240202-lilly-dart-0968dbcc6b17@spud/

Cheers,
Conor.