Add ADT7604 support to LTC2983 driver#3278
Conversation
e1ce410 to
ca97a88
Compare
|
Modified sign-off messages to fix DCO error |
The ADT7604 shares the same die as the LTC2984. It repurposes the custom RTD sensor type (18) as a copper trace resistance sensor and the custom thermistor type (27) as a leak detector, and removes thermocouple, diode and direct ADC sensor types. Add adi,adt7604 to the compatible list and introduce two new sensor node types specific to this device: - copper-trace@: maps to the custom RTD sensor type (18). Two variants: sub-ohm (< 1 ohm, adi,copper-trace-sub-ohm boolean, no custom table) and standard (> 1 ohm, optional adi,custom-rtd table). Primary output is resistance in mOhm. - leak-detector@: maps to the custom thermistor sensor type (27). Takes an optional adi,custom-leak-detector lookup table encoding resistance (uOhm) against coverage data (P + 273.15 in uK). Primary output is resistance in Ohm; when a table is provided, IIO_TEMP reports coverage percentage (raw / 1024). allOf conditions are added to restrict thermocouple, diode, direct ADC and active temperature nodes to non-ADT7604 devices, and to restrict copper-trace and leak-detector nodes to the ADT7604. Signed-off-by: leaveyoustun <liviu.stan@analog.com>
The ADT7604 shares the same die as the LTC2984. It repurposes the custom RTD sensor type (18) as a copper trace resistance sensor and the custom thermistor type (27) as a leak detector, and removes thermocouple, diode and direct ADC sensor types. Custom RTD (type 18) becomes the copper trace sensor. Sensor configuration bits 21:18 are hardcoded to 0b1001 per the datasheet. Two variants are supported via the new adi,copper-trace-sub-ohm DT property: sub-ohm traces (< 1 ohm) have bits 17:0 cleared with no excitation current or custom table; standard traces (> 1 ohm) accept an optional resistance-to-temperature table. Custom thermistor (type 27) becomes the leak detector. Sensor configuration bits are hardcoded to 0b001. The custom table uses a resolution of 16 (20+4 bit resistance field) instead of 64, and is specified via the new adi,custom-leak-detector DT property. Both sensor types expose an IIO_RESISTANCE channel reading from the resistance result register bank (0x060-0x00AF), added to the regmap readable ranges. Scales are 1/1,024,000 for copper trace (result in mOhm) and 1/1024 for leak detector (result in Ohm). A has_copper_trace capability flag is introduced in ltc2983_chip_info to identify the ADT7604, following the existing has_temp and has_eeprom pattern. Tested on EVAL-ADT7604-AZ connected to Raspberry Pi 5 via SPI. Signed-off-by: leaveyoustun <liviu.stan@analog.com>
ca97a88 to
6f2d03e
Compare
|
Changes in v2:
|
LLM reviewThis series adds ADT7604 support (copper trace resistance sensor + leak detector) run: 25067352091
|
PR Description
This series adds support for the ADT7604 multi-sensor temperature
measurement and leak detection system to the ltc2983 driver.
The ADT7604 shares the same die as the LTC2984, reusing its register
map and SPI interface. It repurposes the custom RTD sensor type as a
copper trace resistance sensor and the custom thermistor type as a
leak detector, removing thermocouple, diode and direct ADC support.
Initial patch updates the device-tree bindings:
standard variants, new adi,copper-trace-sub-ohm property);
adi,custom-leak-detector property).
Driver changes:
readable ranges;
and leak detector (0b001) per datasheet;
ADC) at probe time for ADT7604;
and leak detector (adi,custom-leak-detector); sensors without
a table are valid and produce resistance output only;
temperature and resistance result registers;
early for resistance registers, the temperature result format
(valid bit, fault bits, sign extension) does not apply;
channels with info_mask_separate for RAW and SCALE, with
scale 1/1,024,000 for copper trace and 1/1024 for
leak detector;
custom table emit only IIO_RESISTANCE; sensors with
a custom table emit both IIO_TEMP and IIO_RESISTANCE;
DT property parsing;
two-argument LTC2983_CHAN_RES_ADDR(chan, base).
PR Type
PR Checklist
Requesting internal review before proceeding with the upstream
submission process. Data sheet is not yet publicly available.