Add support for Texas Instruments INA4230 power monitor
Subsystems (2)
v5 cover Add support for Texas Instruments INA4230 power monitor
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it together
- Avoid division by zero when setting the conversion time with all inputs disabled (Sashiko)
- Added the missed HWMON_I_ENABLE bits (Sashiko)
- Dropped extra sysfs attributes for reading/writing shunt values, as the implementation was potentially racy and it's unlikely anyone would resolder the shunts on a running system (Sashiko)
- Skip pm_runtime_put_noidle() for disabled (not just disconnected) channels in remove and probe error path to avoid refcount underflow (Sashiko)
- Mark CONFIG2 register as volatile, as the reset bits in it are self-clearing
- NB: Sashiko's inquiry about the update interval being underreported due to not accounting for the number of averaging samples: no, the hardware still reports updates after each channels * (vbus_ct + vsh_ct), but the reported value changes slowly due to the averaging
- NB: Sashiko's inquiry about regmap_noinc_read(): same as Guenter's AI feedback. No, it doesn't break the byte order, as it uses byte-sized reads
- NB: Sashiko's inquiry about potential falling of ina->reg_config1 out of sync with the hardware upon failed regmap_write() calls: yes, but it will be written at the next successful write call, so the worst that can happen is the averaging / conversion time can be wrong for a while. And it will return a failed status for the failed write call too, so no big deal.
- NB: Sashiko's inquiry about reg_config1 not being written out during probe:
it is written out when the device is runtime-resumed as the refcount gets incremented during the probe function
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Aligned the maximum value of ti,maximum-expected-current-microamp property in the binding with the one expected by the driver (Guenter Roeck)
"2147A ought to be enough for anybody (c)"
- Actually requested the optional vs-supply regulator in the driver (Guenter Roeck)
- Program the ALERT_POL bit according to the value of ti,alert-polarity-active-high even though the alerts themselves are not yet implemented (Guenter Roeck)
- Added a check for manually disabled channels in the is_enabled() function to avoid reading invalid data from them (Guenter Roeck)
- Dropped support for the single-shot mode as its operation is not clearly documented in the datasheet and there is no pressing need to support it (Guenter Roeck)
- NB: AI feedback regarding regmap_noinc_read() producing incorrect byte order on LE hosts is incorrect, as its implementation does a byte-wise read and doesn't care about the regmap value width or endianness flags, so it produces a 4-byte output buffer in the same byte order as the device returns, which is BE in this case
- NB: AI feedback regarding fail-path pm_runtime_put_noidle() potentially being unbalanced if the probe loop failed early is technically correct but practically irrelevant, as the driver will simply fail to load, and the usage count won't decrease beyond zero anyway. The alternatives are cumbersome for no real benefit
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Updated the description of the ti,maximum-expected-current-microamp property in the binding to clarify how it is used, and drop the irrelevant mention of the PMbus (Guenter Roeck)
- Use div64_u64() instead of do_div() for the final division in the calibration value calculation to avoid overflows in the denominator (Guenter Roeck)
- Avoid overflow while scaling the voltage values on 32-bit platforms (Guenter Roeck)
- Use regmap_noinc_read() instead of regmap_raw_read() for reading the energy values to ensure that the regmap / bus driver don't wander off to adjacent registers during the read operation (on INA4230 the whole 32 bits should be read from the same register offset) (Guenter Roeck)
- Remove redundant call to ina4230_set_calibration() in the current read path, as the calibration value is already set when enabling the channel and restored across PM changes via regcache_sync() (Guenter Roeck)
- Add missing write_enable() function to make hwmon_in_enable writes work as advertised in is_visible() (Guenter Roeck)
- Add a check for disabled channels before calling pm_runtime_put_noidle() on them to avoid refcount underflow due to imbalanced get_sync/put_noidle calls (Guenter Roeck)
- Dropped unused include of linux/debugfs.h
- Add missing return checks on regmap_write() calls
- uO -> uOhm in the error message to avoid confusion
- Move probe-time calibration after enabling runtime PM to avoid it being reverted by the PM sync
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Replace u64/u64 division with do_div() (kernel test robot)
- Add an example with ti,maximum-expected-current-microamp property in bindings (Krzysztof Kozlowski)
- Include the newly added binding in MAINTAINERS file (Krzysztof Kozlowski)
- Use dev_err_probe() where appropriate in the driver (Krzysztof Kozlowski)
- Switch to devm_regmap_field_bulk_alloc() instead of an open-coded loop
- Add a bounds check for the calculated calibration value,
and a corresponding error message
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Alexey Charkov (2):
dt-bindings: hwmon: Add TI INA4230 4-channel I2C power monitor
hwmon: Add support for TI INA4230 power monitor
.../devicetree/bindings/hwmon/ti,ina4230.yaml | 134 +++ MAINTAINERS | 7 + drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/ina4230.c | 986 +++++++++++++++++++++ 5 files changed, 1139 insertions(+)
---
base-commit: 3b058d1aeeeff27a7289529c4944291613b364e9
change-id: 20260219-ina4230-74a02409153d
Best regards,
Signature · 1 line
Alexey Charkov <[email protected]>
PATCH v5 1/2 dt-bindings: hwmon: Add TI INA4230 4-channel I2C power monitor
Add TI INA4230, which is a 48V 4-channel 16-bit I2C-based current/voltage/power/energy monitor with alert function.
--- .../devicetree/bindings/hwmon/ti,ina4230.yaml | 134 +++++++++++++++++++++ MAINTAINERS | 6 + 2 files changed, 140 insertions(+)
Documentation/devicetree/bindings/hwmon/ti,ina4230.yaml new file +134 -0
@@ -0,0 +1,134 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/ti,ina4230.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments INA4230 quad-channel power monitors + +maintainers: + - Alexey Charkov <[email protected]> + +description: | + The INA4230 is a 48V quad-channel 16-bit current, voltage, power and energy + monitor with an I2C interface. + + Datasheet: + https://www.ti.com/product/INA4230 + +properties: + compatible: + enum: + - ti,ina4230 + + reg: + maxItems: 1 + + "#address-cells": + description: Required only if a child node is present. + const: 1 + + "#size-cells": + description: Required only if a child node is present. + const: 0 + + vs-supply: + description: phandle to the regulator that provides the VS supply typically + in range from 1.7 V to 5.5 V. + + ti,alert-polarity-active-high: + description: Alert pin is asserted based on the value of Alert polarity Bit + of the CONFIG2 register. Default value is 0, for which the alert pin + toggles from high to low during faults. When this property is set, the + corresponding register bit is set to 1, and the alert pin toggles from + low to high during faults. + $ref: /schemas/types.yaml#/definitions/flag + +patternProperties: + "^input@[0-3]$": + description: Optional subnodes for four input channels. Each subnode + describes one input channel. Input channels default to enabled in the + chip. Unless channels are explicitly disabled in device-tree, input + channels will be enabled. + type: object + additionalProperties: false + properties: + reg: + description: Must be 0, 1, 2 or 3, corresponding to the IN1, IN2, IN3 + or IN4 ports of the INA4230, respectively. + enum: [ 0, 1, 2, 3 ] + + label: + description: name of the input source + + shunt-resistor-micro-ohms: + description: shunt resistor value in micro-Ohm + + ti,maximum-expected-current-microamp: + description: | + This value indicates the maximum current in microamps that you can + expect to measure with ina4230 in your circuit. + + This value will be used to calculate the Current_LSB to maximize the + available precision while ensuring your expected maximum current fits + within the chip's ADC range. It will also enable built-in shunt gain + to increase ADC granularity by a factor of 4 if the provided maximum + current / shunt resistance combination does not produce more than + 20.48 mV drop at the shunt. + minimum: 32768 + maximum: 2147483647 + default: 32768000 + + required: + - reg + +required: + - compatible + - reg + +allOf: + - $ref: hwmon-common.yaml# + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + power-sensor@44 { + compatible = "ti,ina4230"; + reg = <0x44>; + vs-supply = <&vdd_3v0>; + ti,alert-polarity-active-high; + #address-cells = <1>; + #size-cells = <0>; + + input@0 { + reg = <0x0>; + /* + * Input channels are enabled by default in the device and so + * to disable, must be explicitly disabled in device-tree. + */ + status = "disabled"; + }; + + input@1 { + reg = <0x1>; + shunt-resistor-micro-ohms = <50000>; + ti,maximum-expected-current-microamp = <300000>; + }; + + input@2 { + reg = <0x2>; + label = "VDD_5V"; + shunt-resistor-micro-ohms = <10000>; + ti,maximum-expected-current-microamp = <5000000>; + }; + + input@3 { + reg = <0x3>; + }; + }; + };
MAINTAINERS +6 -0
@@ -12574,6 +12574,12 @@ S: Maintained F: Documentation/hwmon/ina233.rst F: drivers/hwmon/pmbus/ina233.c +INA4230 HWMON DRIVER +M: Alexey Charkov <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/hwmon/ti,ina4230.yaml + INDEX OF FURTHER KERNEL DOCUMENTATION M: Carlos Bilbao <[email protected]> S: Maintained
Signature · 1 line
2.52.0
PATCH v5 2/2 hwmon: Add support for TI INA4230 power monitor
In reply to Alexey CharkovAdd a driver for the TI INA4230, a 4-channel power monitor with I2C interface.
The driver supports voltage, current, power and energy measurements, but skips the alert functionality in this initial implementation.
--- MAINTAINERS | 1 + drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/ina4230.c | 986 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 999 insertions(+)
MAINTAINERS +1 -0
@@ -12579,6 +12579,7 @@ M: Alexey Charkov <[email protected]> L: [email protected] S: Maintained F: Documentation/devicetree/bindings/hwmon/ti,ina4230.yaml +F: drivers/hwmon/ina4230.c INDEX OF FURTHER KERNEL DOCUMENTATION M: Carlos Bilbao <[email protected]>
drivers/hwmon/Kconfig +11 -0
@@ -2296,6 +2296,17 @@ config SENSORS_INA3221 This driver can also be built as a module. If so, the module will be called ina3221. +config SENSORS_INA4230 + tristate "Texas Instruments INA4230 Quad Current/Voltage Monitor" + depends on I2C + select REGMAP_I2C + help + If you say yes here you get support for the TI INA4230 Quad + Current/Voltage Monitor. + + This driver can also be built as a module. If so, the module + will be called ina4230. + config SENSORS_SPD5118 tristate "SPD5118 Compliant Temperature Sensors" depends on I2C
drivers/hwmon/Makefile +1 -0
@@ -104,6 +104,7 @@ obj-$(CONFIG_SENSORS_INA209) += ina209.o obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o obj-$(CONFIG_SENSORS_INA238) += ina238.o obj-$(CONFIG_SENSORS_INA3221) += ina3221.o +obj-$(CONFIG_SENSORS_INA4230) += ina4230.o obj-$(CONFIG_SENSORS_INTEL_M10_BMC_HWMON) += intel-m10-bmc-hwmon.o obj-$(CONFIG_SENSORS_ISL28022) += isl28022.o obj-$(CONFIG_SENSORS_IT87) += it87.o
drivers/hwmon/ina4230.c new file +986 -0
986 lines not on this page · raw message
Signature · 1 line
2.52.0
Guenter Roeck
maintainerRe: [PATCH v5 2/2] hwmon: Add support for TI INA4230 power monitor
Quoted 7 lines · Alexey Charkov
Add a driver for the TI INA4230, a 4-channel power monitor with I2C interface.
The driver supports voltage, current, power and energy measurements, but skips the alert functionality in this initial implementation.
Signed-off-by Alexey Charkov <[email protected]>
Sashiko report is at
https://sashiko.dev/#/patchset/20260330-ina4230-v5-0-eeb322d95b3a%40flipper.net
Valid concerns, as far as I can see, are:
- There are various overflow issues. Please address, either by making sure that the operations can not overflow, or that all parameters such as the shunt resistor value or the interval are bound such that an overflow can not occur. This includes implicit conversions. For example, the interval passed to ina4230_interval_ms_to_conv_time() is int, but the parameter is actually long. There is not even a signed check, meaning the resulting interval can be pretty much anything.
- power is reported by the chip as unsigned value. Yet, it is converted via type cast to int16_t.
- Please add a comment to the energy reading to confirm that regmap_noinc_read() performs as expected.
- The definition of ina4230_curr_reg[] is wasteful. There is only an entry for hwmon_curr_input. Why specify an unnecessary two-dimensional array ?
- The dummy channel 0 for voltage is not acceptable. Make it 0-based as expected by the ABI. Yes, I know, but that is how the ABI was defined.
I can not comment on Saskiko's pm related feedback. PM is and has always been a mystery to me, so I just assume that it is WAI and that there are no problems. I do assume that you have tested the code thoroughly across suspend/resume cycles to make sure that it works as intended.
Thanks,
Guenter
Guenter Roeck
maintainerQuoted 19 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Quoted 8 lines
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it together
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Thanks,
Guenter
Rob Herring
maintainerQuoted 29 lines · Guenter Roeck
Quoted 19 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Quoted 8 lines
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it together
Quoted 2 lines
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Given ti,alert-polarity-active-high is added seems like the interrupt should be too. And the interrupt can specify the polarity, so is that property really needed? There's alway the possibility that you have some inverter on the board too and the interrupt polarity is not enough, but solve that problem when it actually exists.
Rob
Guenter Roeck
maintainerQuoted 30 lines · Rob Herring
Quoted 29 lines · Guenter Roeck
Quoted 27 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it together
Quoted 9 lines
Quoted 2 lines
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Given ti,alert-polarity-active-high is added seems like the interrupt should be too. And the interrupt can specify the polarity, so is that property really needed? There's alway the possibility that you have some inverter on the board too and the interrupt polarity is not enough, but solve that problem when it actually exists.
The alert pin can be attached to a board interrupt, or (more likely) it can be attached to the I2C controller's alert pin. In the latter case there is no interrupt property.
Guenter
Quoted 42 lines · Guenter Roeck
Quoted 30 lines · Rob Herring
Quoted 29 lines · Guenter Roeck
Quoted 27 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it togetherQuoted 9 lines
Quoted 2 lines
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Given ti,alert-polarity-active-high is added seems like the interrupt should be too. And the interrupt can specify the polarity, so is that property really needed? There's alway the possibility that you have some inverter on the board too and the interrupt polarity is not enough, but solve that problem when it actually exists.
Quoted 3 lines
The alert pin can be attached to a board interrupt, or (more likely) it can be attached to the I2C controller's alert pin. In the latter case there is no interrupt property.
Alright, I will add the interrupt property and keep the dedicated flag for alert polarity.
Following the logic of binding completeness, should I add a flag for the single-shot mode too, even though I dropped that functionality from the driver in one of the prior iterations?
Thanks a lot,
Alexey
Rob Herring
maintainerQuoted 48 lines · Alexey Charkov
Quoted 42 lines · Guenter Roeck
Quoted 30 lines · Rob Herring
Quoted 29 lines · Guenter Roeck
Quoted 27 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it togetherQuoted 9 lines
Quoted 2 lines
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Given ti,alert-polarity-active-high is added seems like the interrupt should be too. And the interrupt can specify the polarity, so is that property really needed? There's alway the possibility that you have some inverter on the board too and the interrupt polarity is not enough, but solve that problem when it actually exists.
Quoted 3 lines
The alert pin can be attached to a board interrupt, or (more likely) it can be attached to the I2C controller's alert pin. In the latter case there is no interrupt property.
Quoted 6 lines
Alright, I will add the interrupt property and keep the dedicated flag for alert polarity.
Following the logic of binding completeness, should I add a flag for the single-shot mode too, even though I dropped that functionality from the driver in one of the prior iterations?
I don't remember what that was exactly, but that sounds like a user selection which would be some sysfs or other runtime control rather than in DT. Unless the h/w design dictates what mode should be used.
Rob
Guenter Roeck
maintainerQuoted 52 lines · Rob Herring
Quoted 51 lines · Alexey Charkov
Quoted 42 lines · Guenter Roeck
Quoted 30 lines · Rob Herring
Quoted 29 lines · Guenter Roeck
Quoted 27 lines · Alexey Charkov
TI INA4230 is a 4-channel power monitor with I2C interface, similar in operation to INA3221 (3-channel) and INA219 (single-channel) but with a different register layout, different alerting mechanism and slightly different support for directly reading calculated current/power/energy values (pre-multiplied by the device itself and needing only to be scaled by the driver depending on its selected LSB unit values).
In this initial implementation, the driver supports reading voltage, current, power and energy values, but does not yet support alerts, which can be added separately if needed. Also the overflows during hardware calculations are not yet handled, nor is the support for the device's internal 32-bit energy counter reset.
An example device tree using this binding and driver is available at [1] (not currently upstreamed, as the device in question is in engineering phase and not yet publicly available)
Signed-off-by Alexey Charkov <[email protected]>---
Changes in v5:
- Reworded per-channel subnodes description in the binding for clarity (Sashiko)
- NB: Sashiko's suggestion to allow interrupts in the binding sounds premature, as the alerts mechanism is not implemented yet and there are no known users to test it. If anyone has hardware with the alert pins wired to an interrupt line - please shout and we can test/extend it togetherQuoted 9 lines
Quoted 2 lines
The bindings are supposed to be complete, even if not implemented, so I am not sure if the DT maintainers will agree here. We'll see.
Given ti,alert-polarity-active-high is added seems like the interrupt should be too. And the interrupt can specify the polarity, so is that property really needed? There's alway the possibility that you have some inverter on the board too and the interrupt polarity is not enough, but solve that problem when it actually exists.
Quoted 3 lines
The alert pin can be attached to a board interrupt, or (more likely) it can be attached to the I2C controller's alert pin. In the latter case there is no interrupt property.
Alright, I will add the interrupt property and keep the dedicated flag for alert polarity.
Quoted 8 lines
Quoted 3 lines
Following the logic of binding completeness, should I add a flag for the single-shot mode too, even though I dropped that functionality from the driver in one of the prior iterations?
I don't remember what that was exactly, but that sounds like a user selection which would be some sysfs or other runtime control rather than in DT. Unless the h/w design dictates what mode should be used.
I agree. I can not imagine that to be a hardware design constraint.
Thanks,
Guenter