From nobody Wed Jun 17 06:19:25 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5349D3C13E0; Mon, 27 Apr 2026 13:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777296585; cv=none; b=ZmkB4+RNVkiY+yK7/wXkz+zcf2kdMzXN5jNGLqbZkSaZu+bUFECOy5exrJ4nA/6vh82pNZOrDJt1PINkxRWvl+gsNBHrCm2HVHYH1MOA0NlxmqRDhQPlp7sfI7MUu9SfHP/OhPsN0dfwKODmGY7okV0v3XmJvgDrz58m7ox4sYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777296585; c=relaxed/simple; bh=PdBrsgJdcLju2lLvXCoi6TJZsaQTyNj1nP/ou78n1Cs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aO+h0DR8LKNXngoOuiTdX9DiKKCLwqlOBD1oT5Tljzu2+cwMzajkl0RJMzLfrb2up3isxTItE2oS5j/kj/R5jICyAJclEX9gpaE8hpK97uZ0uuSuK9EWl6rsaWjx4QelmDLnZhVeIwPzLp5qrtDSdgoOfJQK6CMYPxJoJ5F9cLE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=qqnLEez+; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="qqnLEez+" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63R9RbZ91695789; Mon, 27 Apr 2026 09:29:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=RSQpY Q5tcAvcqRQ55nHBeU6W1uwDFPtIrN7AeXkVOSk=; b=qqnLEez+3hfje4ci0rNQp +7sEcnSsReIEtS1QgLYo8+TObU/K8UD0iCvWZRah2O1dkKV9oi30bkxwJmaR7v6e +cCKehPVVdprKp8rZa0Uo5EjhCfZlulyxrDhYWbzakmhvKqDSjcFOVJIRurp9UzX DhwOVLRX+5F7NjR6yh+5fh1cii9gaDE+ZjueZrQ7jRNHsPtFW3PbfnrkotP/VfX9 5JyX9aT2ytBG9VeQHildzjaLHwpSdykPbkkq9jkeRpk3O/34TAuw7qhqstvm5FbU i5jx69TnCZ/zVuDLBzC0X9Nlm+FNzGQJV828Bl1o1Ak3c/isn6PjjHtanf61X9qP A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4drth2efym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Apr 2026 09:29:27 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 63RDTQbI003143 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Apr 2026 09:29:26 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Mon, 27 Apr 2026 09:29:26 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Mon, 27 Apr 2026 09:29:26 -0400 Received: from HYB-MkYHBcJRSnh.ad.analog.com (HYB-MkYHBcJRSnh.ad.analog.com [10.48.65.107]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 63RDT8SR028079; Mon, 27 Apr 2026 09:29:21 -0400 From: Liviu Stan To: Lars-Peter Clausen , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Jonathan Cameron , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , CC: Liviu Stan Subject: [PATCH 1/2] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Date: Mon, 27 Apr 2026 16:25:07 +0300 Message-ID: <20260427132526.272716-2-liviu.stan@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260427132526.272716-1-liviu.stan@analog.com> References: <20260427132526.272716-1-liviu.stan@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI3MDE0NCBTYWx0ZWRfX9F/KfmoU2Qxn Y7kudP0T+ipGfZDoh6u58nwwdl0jrd13jAs7qfnBSRPBvJTBZNYJrBSwtDC3aNXSXpF8ZEMV8an +x3PksVzuSuthh5IsQDipK8w8twOjJqNSppjwhCnCAEm4oFud5EFqTDavAvMr0oEEn820dfk+Nr w2VbDTJ4wXckl6rl591u8lZ4g3uoS2CtyLXpjNukoVv1s8v8X9BVCw7i6/2vRnQeMUn+kQjdbAs MeP2isLFHfWnNkIZ3JLyKEr1JCNfXOXcVPgfIKrd/5kui8GnbmcwjQvs9Y3Qy81TKXnnibmQdOS 0i4/qorqjKm8N8fN8Ri9Y38ZcVxAogDjpgMtIsUr8ZTxTT32B7TkArniTULU1w8Se9zV/A5tMbP 3X968yRNH/zxhaDKbjIY9AyRy3UNI+Ry8zPXNH8xI8CAr5kF6AlstneRovbodUY/WBkzasYVO2m 6V/M3QX7YI6OZtkz4zw== X-Proofpoint-GUID: 1MuF8UpZWatRs3GWDU98O607I9U81jh3 X-Proofpoint-ORIG-GUID: 1MuF8UpZWatRs3GWDU98O607I9U81jh3 X-Authority-Analysis: v=2.4 cv=Rsb16imK c=1 sm=1 tr=0 ts=69ef64b7 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=Z0pTeXoby7EwIRygza74:22 a=gEfo2CItAAAA:8 a=gAnH3GRIAAAA:8 a=QD8gAf2Tu3Ybv1wFcsUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1011 phishscore=0 adultscore=0 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604270144 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: Liviu Stan --- .../bindings/iio/temperature/adi,ltc2983.yaml | 170 +++++++++++++++++- 1 file changed, 167 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.= yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index a22725f7619b..e777b37d588d 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -4,14 +4,14 @@ $id: http://devicetree.org/schemas/iio/temperature/adi,ltc2983.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: Analog Devices LTC2983, LTC2986, LTM2985 Multi-sensor Temperature s= ystem +title: Analog Devices LTC2983, LTC2986, LTM2985, ADT7604 Multi-sensor Temp= erature system =20 maintainers: - Nuno S=C3=A1 =20 description: | - Analog Devices LTC2983, LTC2984, LTC2986, LTM2985 Multi-Sensor Digital - Temperature Measurement Systems + Analog Devices LTC2983, LTC2984, LTC2986, LTM2985, ADT7604 Multi-Sensor + Digital Temperature Measurement Systems =20 https://www.analog.com/media/en/technical-documentation/data-sheets/2983= fc.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/2984= fb.pdf @@ -43,6 +43,7 @@ properties: compatible: oneOf: - enum: + - adi,adt7604 - adi,ltc2983 - adi,ltc2986 - adi,ltm2985 @@ -436,6 +437,96 @@ patternProperties: required: - adi,custom-temp =20 + '^copper-trace@': + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false + description: | + Copper trace resistance sensor (ADT7604 only). Uses the custom RTD + sensor type (18). Two variants exist: sub-ohm (< 1 ohm, no custom + table allowed) and standard (> 1 ohm, optional custom table). + + properties: + reg: + minimum: 2 + maximum: 20 + + adi,sensor-type: + description: Sensor type for copper trace sensors. + $ref: /schemas/types.yaml#/definitions/uint32 + const: 18 + + adi,rsense-handle: + description: Associated sense resistor sensor. + $ref: /schemas/types.yaml#/definitions/phandle + + adi,copper-trace-sub-ohm: + description: + Select the sub-ohm (< 1 ohm) copper trace variant. Custom table + and excitation current are not allowed in this mode. + type: boolean + + adi,custom-rtd: + description: + Optional resistance-to-temperature table for copper trace sensors + with resistance > 1 ohm. See Page 62 of the datasheet. + $ref: /schemas/types.yaml#/definitions/uint64-matrix + minItems: 3 + maxItems: 64 + items: + items: + - description: Resistance point in uOhms. + - description: Temperature point in uK. + + required: + - adi,rsense-handle + + allOf: + - if: + required: + - adi,copper-trace-sub-ohm + then: + properties: + adi,custom-rtd: false + + '^leak-detector@': + $ref: '#/$defs/sensor-node' + unevaluatedProperties: false + description: | + Leak detector sensor (ADT7604 only). Uses the custom thermistor sens= or + type (27). Outputs resistance in ohms and, when a custom table is + provided, a coverage percentage via IIO_TEMP (raw/1024 =3D coverage = %). + + properties: + reg: + minimum: 2 + maximum: 20 + + adi,sensor-type: + description: Sensor type for leak detector sensors. + $ref: /schemas/types.yaml#/definitions/uint32 + const: 27 + + adi,rsense-handle: + description: Associated sense resistor sensor. + $ref: /schemas/types.yaml#/definitions/phandle + + adi,custom-leak-detector: + description: | + Lookup table mapping resistance to coverage data. Entries must be + in ascending resistance order. The coverage data field encodes t= he + coverage percentage P as (P + 273.15) expressed in uK, i.e. + (P * 1000000 + 273150000). + $ref: /schemas/types.yaml#/definitions/uint64-matrix + minItems: 3 + maxItems: 64 + items: + items: + - description: Resistance point in uOhms. + - description: Coverage data point (P + 273150000) in uK. + + required: + - adi,rsense-handle + '^rsense@': $ref: '#/$defs/sensor-node' unevaluatedProperties: false @@ -477,6 +568,22 @@ allOf: patternProperties: '^temp@': false =20 + - if: + properties: + compatible: + contains: + const: adi,adt7604 + then: + patternProperties: + '^thermocouple@': false + '^diode@': false + '^adc@': false + '^temp@': false + else: + patternProperties: + '^copper-trace@': false + '^leak-detector@': false + examples: - | #include @@ -556,4 +663,61 @@ examples: }; }; }; + + - | + #include + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + temperature-sensor@0 { + compatible =3D "adi,adt7604"; + reg =3D <0>; + interrupt-parent =3D <&gpio>; + interrupts =3D <25 IRQ_TYPE_EDGE_RISING>; + + #address-cells =3D <1>; + #size-cells =3D <0>; + vdd-supply =3D <&supply>; + + trace_rsense: rsense@2 { + reg =3D <2>; + adi,sensor-type =3D <29>; + adi,rsense-val-milli-ohms =3D <100000>; // 100 ohm + }; + + copper-trace@4 { + reg =3D <4>; + adi,sensor-type =3D <18>; + adi,rsense-handle =3D <&trace_rsense>; + adi,copper-trace-sub-ohm; + }; + + r_sense: rsense@12 { + reg =3D <12>; + adi,sensor-type =3D <29>; + adi,rsense-val-milli-ohms =3D <1000000>; // 1 kohm + }; + + leak-detector@14 { + reg =3D <14>; + adi,sensor-type =3D <27>; + adi,rsense-handle =3D <&r_sense>; + adi,custom-leak-detector =3D + /bits/ 64 < 0 373150000>, + /bits/ 64 < 202020000 372150000>, + /bits/ 64 < 1000000000 293150000>; + }; + + rtd@18 { + reg =3D <18>; + adi,sensor-type =3D <12>; // PT100 + adi,rsense-handle =3D <&r_sense>; + adi,number-of-wires =3D <2>; + adi,rsense-share; + adi,excitation-current-microamp =3D <500>; + adi,rtd-curve =3D <0>; + }; + }; + }; ... --=20 2.43.0 From nobody Wed Jun 17 06:19:25 2026 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F2333C6A56; Mon, 27 Apr 2026 13:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777296589; cv=none; b=Dvh8JcEqIjnrRBZtba5Jrz6ajLP/Ub5W1HXpbu2qQBLSNSAps9DTGYVyDPWEvCwD47ANfz6zFY6Bw+OfWhZFGyo70ppqSAyYEDLsEo8GZ7BdXZjqIKf6/S3knuZT2obik3MmkieEmnA/GDk/7mmpNFNJNOjODcFG1gdyKltpdyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777296589; c=relaxed/simple; bh=McutZREPQMA0xD4Jncn+JADfm18wl1qOIZ9MZxxebxk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BhPnIGb0Abh7bpqFB66VB7x6O4hpMLeFkJf0DcnoIvdp0K0rAURYrhHSuiNKWpZhITlNJ/hVOLJ0GtbmD0lzPKvJmPwRs4aCTbr5LjHmewrmHaZeYIUzjfDbIreWRkA2+BwgHA6cDfSXw4xLsNnTZl/a5NApvlIAIkoHKxwdsqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=vJzEH1Ob; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="vJzEH1Ob" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63RCVlFs2339258; Mon, 27 Apr 2026 09:29:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=Vq14m 5onGQbWtHsY2qRgr8z/Av2kkXPTYDHa5z2xwIk=; b=vJzEH1OblHrABmMQyFUCM 8QtAeWUhKtaeVvI1dKMm3OOxUsP4OLAAfmM9EcEOp1eSITGXWHwbGZXuEyiN6pPk aDUAbCNl1ktbw2q6mofzfqnbTarLHEF/YZEthP1PJrAdXKmsufisbg/tgW0evep6 cetezBQnWdOJWvcAgT6zMBQQ53W83rnN3iB+KlWfZ55Sl+OQUpl97IydgWI43JYw EVLe6US3C5yNfE5drCogOZmdWRj4dNqP895r3/8v6xkDyOozJ5GTbglZSX5hlQqY 4h/l/j3QfByChESRLvjYJubEZgBmWb0fUEfmDYa4OzfWzdBV/etJtW3hxnBV87oz g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 4dsbxcvnya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Apr 2026 09:29:32 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 63RDTVd4003151 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Apr 2026 09:29:31 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Mon, 27 Apr 2026 09:29:30 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Mon, 27 Apr 2026 09:29:30 -0400 Received: from HYB-MkYHBcJRSnh.ad.analog.com (HYB-MkYHBcJRSnh.ad.analog.com [10.48.65.107]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 63RDT8SS028079; Mon, 27 Apr 2026 09:29:24 -0400 From: Liviu Stan To: Lars-Peter Clausen , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Jonathan Cameron , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , CC: Liviu Stan Subject: [PATCH 2/2] iio: temperature: ltc2983: Add support for ADT7604 Date: Mon, 27 Apr 2026 16:25:08 +0300 Message-ID: <20260427132526.272716-3-liviu.stan@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260427132526.272716-1-liviu.stan@analog.com> References: <20260427132526.272716-1-liviu.stan@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI3MDE0NCBTYWx0ZWRfX7N1d6O1bMr2r Tl0uPS4bSnDi2Sh6d5lY4Gj31JIbmNPPzSzI0ErZiZ/obBcuOkENEzmlSmPcJeqSjSIAXXwuUO/ 9/O/QrQRRzbs399Ek7qZIxHFr567dw59dQLSTz0H+Ltpfh8pESrhPwKl+X0ISCyjob/xJ3RT9G3 IUIApJM4GcoRveXRH+FtzbSO2UnM3ka7UT6WotqLulJVNzfXRyHnfWcXNq4ZI841kEzOE1zD1LR axp/T0TqzB6sdARB92yG4/eBv1kfu1WdoPi6lUftZDESAyIWeVX8c4r4WUuY7jZHpgaQ+9f8Wav jp76qV4bb8xp1jVdkAfQBpJB+yVfOM6f888HQ89tqcKyTO4jmKiY6wB+4KJCQvI5NPx4Vd7aP9e sIXk+b+apdCEAKIpZfztGY9/8j/oJ/4X7ib7vOET0yJShFEwpsxv85XRvuk+Dz7VXo21b7J7OUI jD56XOAvYlKkgCHSkgw== X-Proofpoint-GUID: i6qMn2CqtCGufRU1M1b_4AhmU3T7bniw X-Authority-Analysis: v=2.4 cv=SbjHsPRu c=1 sm=1 tr=0 ts=69ef64bc cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=N--XFCr6TIEc_64PeIT2:22 a=gAnH3GRIAAAA:8 a=bP_FyP252IjlB4FLv3kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: i6qMn2CqtCGufRU1M1b_4AhmU3T7bniw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 spamscore=0 impostorscore=0 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604270144 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: Liviu Stan --- drivers/iio/temperature/ltc2983.c | 347 +++++++++++++++++++++--------- 1 file changed, 251 insertions(+), 96 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/lt= c2983.c index 38e6f8dfd3b8..1966f6fb0305 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -28,6 +28,8 @@ #define LTC2983_STATUS_REG 0x0000 #define LTC2983_TEMP_RES_START_REG 0x0010 #define LTC2983_TEMP_RES_END_REG 0x005F +#define ADT7604_RES_RES_START_REG 0x0060 +#define ADT7604_RES_RES_END_REG 0x00AF #define LTC2983_EEPROM_KEY_REG 0x00B0 #define LTC2983_EEPROM_READ_STATUS_REG 0x00D0 #define LTC2983_GLOBAL_CONFIG_REG 0x00F0 @@ -58,8 +60,8 @@ =20 #define LTC2983_CHAN_START_ADDR(chan) \ (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG) -#define LTC2983_CHAN_RES_ADDR(chan) \ - (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG) +#define LTC2983_CHAN_RES_ADDR(chan, base) \ + ((((chan) - 1) * 4) + (base)) #define LTC2983_THERMOCOUPLE_DIFF_MASK BIT(3) #define LTC2983_THERMOCOUPLE_SGL(x) \ FIELD_PREP(LTC2983_THERMOCOUPLE_DIFF_MASK, x) @@ -214,6 +216,7 @@ struct ltc2983_chip_info { unsigned int max_channels_nr; bool has_temp; bool has_eeprom; + bool has_copper_trace; }; =20 struct ltc2983_data { @@ -272,6 +275,7 @@ struct ltc2983_rtd { u32 r_sense_chan; u32 excitation_current; u32 rtd_curve; + bool sub_ohm; }; =20 struct ltc2983_thermistor { @@ -575,6 +579,10 @@ static int ltc2983_rtd_assign_chan(struct ltc2983_data= *st, if (ret) return ret; } + + if (rtd->sub_ohm) + chan_val &=3D ~GENMASK(17, 0); + return __ltc2983_chan_assign_common(st, sensor, chan_val); } =20 @@ -758,83 +766,113 @@ ltc2983_rtd_new(const struct fwnode_handle *child, s= truct ltc2983_data *st, return dev_err_ptr_probe(dev, ret, "Property reg must be given\n"); =20 - ret =3D fwnode_property_read_u32(child, "adi,number-of-wires", &n_wires); - if (!ret) { - switch (n_wires) { - case 2: - rtd->sensor_config =3D LTC2983_RTD_N_WIRES(0); - break; - case 3: - rtd->sensor_config =3D LTC2983_RTD_N_WIRES(1); - break; - case 4: - rtd->sensor_config =3D LTC2983_RTD_N_WIRES(2); - break; - case 5: - /* 4 wires, Kelvin Rsense */ - rtd->sensor_config =3D LTC2983_RTD_N_WIRES(3); - break; - default: + /* ADT7604 requires hardcoding sensor configuration bits to 0b1001 */ + if (st->info->has_copper_trace && + sensor->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM) { + rtd->sensor_config =3D 0x9; + if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) return dev_err_ptr_probe(dev, -EINVAL, - "Invalid number of wires:%u\n", - n_wires); + "Invalid chann:%d for copper trace\n", + sensor->chan); + } else { + ret =3D fwnode_property_read_u32(child, "adi,number-of-wires", &n_wires); + if (!ret) { + switch (n_wires) { + case 2: + rtd->sensor_config =3D LTC2983_RTD_N_WIRES(0); + break; + case 3: + rtd->sensor_config =3D LTC2983_RTD_N_WIRES(1); + break; + case 4: + rtd->sensor_config =3D LTC2983_RTD_N_WIRES(2); + break; + case 5: + /* 4 wires, Kelvin Rsense */ + rtd->sensor_config =3D LTC2983_RTD_N_WIRES(3); + break; + default: + return dev_err_ptr_probe(dev, -EINVAL, + "Invalid number of wires:%u\n", + n_wires); + } } - } =20 - if (fwnode_property_read_bool(child, "adi,rsense-share")) { - /* Current rotation is only available with rsense sharing */ - if (fwnode_property_read_bool(child, "adi,current-rotate")) { - if (n_wires =3D=3D 2 || n_wires =3D=3D 3) + if (fwnode_property_read_bool(child, "adi,rsense-share")) { + /* Current rotation is only available with rsense sharing */ + if (fwnode_property_read_bool(child, "adi,current-rotate")) { + if (n_wires =3D=3D 2 || n_wires =3D=3D 3) + return dev_err_ptr_probe(dev, -EINVAL, + "Rotation not allowed for 2/3 Wire RTDs\n"); + + rtd->sensor_config |=3D LTC2983_RTD_C_ROTATE(1); + } else { + rtd->sensor_config |=3D LTC2983_RTD_R_SHARE(1); + } + } + /* + * rtd channel indexes are a bit more complicated to validate. + * For 4wire RTD with rotation, the channel selection cannot be + * >=3D19 since the chann + 1 is used in this configuration. + * For 4wire RTDs with kelvin rsense, the rsense channel cannot be + * <=3D1 since chanel - 1 and channel - 2 are used. + */ + if (rtd->sensor_config & LTC2983_RTD_4_WIRE_MASK) { + /* 4-wire */ + u8 min =3D LTC2983_DIFFERENTIAL_CHAN_MIN, + max =3D st->info->max_channels_nr; + + if (rtd->sensor_config & LTC2983_RTD_ROTATION_MASK) + max =3D st->info->max_channels_nr - 1; + + if ((rtd->sensor_config & LTC2983_RTD_KELVIN_R_SENSE_MASK) + =3D=3D LTC2983_RTD_KELVIN_R_SENSE_MASK && + rtd->r_sense_chan <=3D min) + /* kelvin rsense*/ return dev_err_ptr_probe(dev, -EINVAL, - "Rotation not allowed for 2/3 Wire RTDs\n"); + "Invalid rsense chann:%d to use in kelvin rsense\n", + rtd->r_sense_chan); =20 - rtd->sensor_config |=3D LTC2983_RTD_C_ROTATE(1); + if (sensor->chan < min || sensor->chan > max) + return dev_err_ptr_probe(dev, -EINVAL, + "Invalid chann:%d for the rtd config\n", + sensor->chan); } else { - rtd->sensor_config |=3D LTC2983_RTD_R_SHARE(1); + /* same as differential case */ + if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) + return dev_err_ptr_probe(&st->spi->dev, -EINVAL, + "Invalid chann:%d for RTD\n", + sensor->chan); } } - /* - * rtd channel indexes are a bit more complicated to validate. - * For 4wire RTD with rotation, the channel selection cannot be - * >=3D19 since the chann + 1 is used in this configuration. - * For 4wire RTDs with kelvin rsense, the rsense channel cannot be - * <=3D1 since channel - 1 and channel - 2 are used. - */ - if (rtd->sensor_config & LTC2983_RTD_4_WIRE_MASK) { - /* 4-wire */ - u8 min =3D LTC2983_DIFFERENTIAL_CHAN_MIN, - max =3D st->info->max_channels_nr; - - if (rtd->sensor_config & LTC2983_RTD_ROTATION_MASK) - max =3D st->info->max_channels_nr - 1; - - if (((rtd->sensor_config & LTC2983_RTD_KELVIN_R_SENSE_MASK) - =3D=3D LTC2983_RTD_KELVIN_R_SENSE_MASK) && - (rtd->r_sense_chan <=3D min)) - /* kelvin rsense*/ - return dev_err_ptr_probe(dev, -EINVAL, - "Invalid rsense chann:%d to use in kelvin rsense\n", - rtd->r_sense_chan); - - if (sensor->chan < min || sensor->chan > max) - return dev_err_ptr_probe(dev, -EINVAL, - "Invalid chann:%d for the rtd config\n", - sensor->chan); - } else { - /* same as differential case */ - if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) - return dev_err_ptr_probe(&st->spi->dev, -EINVAL, - "Invalid chann:%d for RTD\n", - sensor->chan); - } =20 /* check custom sensor */ if (sensor->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM) { - rtd->custom =3D __ltc2983_custom_sensor_new(st, child, - "adi,custom-rtd", - false, 2048, false); - if (IS_ERR(rtd->custom)) - return ERR_CAST(rtd->custom); + if (st->info->has_copper_trace) { + if (fwnode_property_present(child, "adi,custom-rtd")) { + rtd->custom =3D __ltc2983_custom_sensor_new(st, child, + "adi,custom-rtd", + false, 2048, + false); + if (IS_ERR(rtd->custom)) + return ERR_CAST(rtd->custom); + } + } else { + rtd->custom =3D __ltc2983_custom_sensor_new(st, child, + "adi,custom-rtd", + false, 2048, false); + if (IS_ERR(rtd->custom)) + return ERR_CAST(rtd->custom); + } + } + + if (st->info->has_copper_trace && + sensor->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM) { + rtd->sub_ohm =3D fwnode_property_read_bool(child, + "adi,copper-trace-sub-ohm"); + if (rtd->sub_ohm && rtd->custom) + return dev_err_ptr_probe(dev, -EINVAL, + "sub-ohm copper trace cannot have a custom table\n"); } =20 /* set common parameters */ @@ -908,17 +946,27 @@ ltc2983_thermistor_new(const struct fwnode_handle *ch= ild, struct ltc2983_data *s return dev_err_ptr_probe(dev, ret, "rsense channel must be configured...\n"); =20 - if (fwnode_property_read_bool(child, "adi,single-ended")) { - thermistor->sensor_config =3D LTC2983_THERMISTOR_SGL(1); - } else if (fwnode_property_read_bool(child, "adi,rsense-share")) { - /* rotation is only possible if sharing rsense */ - if (fwnode_property_read_bool(child, "adi,current-rotate")) - thermistor->sensor_config =3D - LTC2983_THERMISTOR_C_ROTATE(1); - else - thermistor->sensor_config =3D - LTC2983_THERMISTOR_R_SHARE(1); + if (st->info->has_copper_trace && + sensor->type =3D=3D LTC2983_SENSOR_THERMISTOR_CUSTOM) { + thermistor->sensor_config =3D LTC2983_THERMISTOR_C_ROTATE(1); + if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) + return dev_err_ptr_probe(dev, -EINVAL, + "Invalid chann:%d for leak detector\n", + sensor->chan); + } else { + if (fwnode_property_read_bool(child, "adi,single-ended")) { + thermistor->sensor_config =3D LTC2983_THERMISTOR_SGL(1); + } else if (fwnode_property_read_bool(child, "adi,rsense-share")) { + /* rotation is only possible if sharing rsense */ + if (fwnode_property_read_bool(child, "adi,current-rotate")) + thermistor->sensor_config =3D + LTC2983_THERMISTOR_C_ROTATE(1); + else + thermistor->sensor_config =3D + LTC2983_THERMISTOR_R_SHARE(1); + } } + /* validate channel index */ if (!(thermistor->sensor_config & LTC2983_THERMISTOR_DIFF_MASK) && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) @@ -928,23 +976,36 @@ ltc2983_thermistor_new(const struct fwnode_handle *ch= ild, struct ltc2983_data *s =20 /* check custom sensor */ if (sensor->type >=3D LTC2983_SENSOR_THERMISTOR_STEINHART) { - bool steinhart =3D false; - const char *propname; - - if (sensor->type =3D=3D LTC2983_SENSOR_THERMISTOR_STEINHART) { - steinhart =3D true; - propname =3D "adi,custom-steinhart"; + if (st->info->has_copper_trace && + sensor->type =3D=3D LTC2983_SENSOR_THERMISTOR_CUSTOM) { + if (fwnode_property_present(child, "adi,custom-leak-detector")) { + thermistor->custom =3D + __ltc2983_custom_sensor_new(st, child, + "adi,custom-leak-detector", + false, 16, false); + if (IS_ERR(thermistor->custom)) + return ERR_CAST(thermistor->custom); + } } else { - propname =3D "adi,custom-thermistor"; + bool steinhart =3D false; + const char *propname; + + if (sensor->type =3D=3D LTC2983_SENSOR_THERMISTOR_STEINHART) { + steinhart =3D true; + propname =3D "adi,custom-steinhart"; + } else { + propname =3D "adi,custom-thermistor"; + } + + thermistor->custom =3D __ltc2983_custom_sensor_new(st, child, + propname, + steinhart, + 64, false); + if (IS_ERR(thermistor->custom)) + return ERR_CAST(thermistor->custom); } - - thermistor->custom =3D __ltc2983_custom_sensor_new(st, child, - propname, - steinhart, - 64, false); - if (IS_ERR(thermistor->custom)) - return ERR_CAST(thermistor->custom); } + /* set common parameters */ thermistor->sensor.fault_handler =3D ltc2983_common_fault_handler; thermistor->sensor.assign_chan =3D ltc2983_thermistor_assign_chan; @@ -1167,7 +1228,8 @@ static struct ltc2983_sensor *ltc2983_temp_new(struct= fwnode_handle *child, } =20 static int ltc2983_chan_read(struct ltc2983_data *st, - const struct ltc2983_sensor *sensor, int *val) + const struct ltc2983_sensor *sensor, + u32 base_reg, int *val) { u32 start_conversion =3D 0; int ret; @@ -1197,13 +1259,23 @@ static int ltc2983_chan_read(struct ltc2983_data *s= t, } =20 /* read the converted data */ - ret =3D regmap_bulk_read(st->regmap, LTC2983_CHAN_RES_ADDR(sensor->chan), + ret =3D regmap_bulk_read(st->regmap, LTC2983_CHAN_RES_ADDR(sensor->chan, = base_reg), &st->temp, sizeof(st->temp)); if (ret) return ret; =20 *val =3D __be32_to_cpu(st->temp); =20 + if (base_reg =3D=3D ADT7604_RES_RES_START_REG) { + /* + * Resistance result register gives a plain unsigned value, + * D31 is always 0, no valid bit, no fault bits. Read bits[30:0] + * directly =E2=80=94 the temperature result format does not apply here. + */ + *val &=3D GENMASK(30, 0); + return 0; + } + if (!(LTC2983_RES_VALID_MASK & *val)) { dev_err(&st->spi->dev, "Invalid conversion detected\n"); return -EIO; @@ -1214,6 +1286,7 @@ static int ltc2983_chan_read(struct ltc2983_data *st, return ret; =20 *val =3D sign_extend32((*val) & LTC2983_DATA_MASK, LTC2983_DATA_SIGN_BIT); + return 0; } =20 @@ -1234,7 +1307,12 @@ static int ltc2983_read_raw(struct iio_dev *indio_de= v, switch (mask) { case IIO_CHAN_INFO_RAW: mutex_lock(&st->lock); - ret =3D ltc2983_chan_read(st, st->sensors[chan->address], val); + if (chan->type =3D=3D IIO_RESISTANCE) + ret =3D ltc2983_chan_read(st, st->sensors[chan->address], + ADT7604_RES_RES_START_REG, val); + else + ret =3D ltc2983_chan_read(st, st->sensors[chan->address], + LTC2983_TEMP_RES_START_REG, val); mutex_unlock(&st->lock); return ret ?: IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: @@ -1251,6 +1329,18 @@ static int ltc2983_read_raw(struct iio_dev *indio_de= v, /* 2^21 */ *val2 =3D 2097152; return IIO_VAL_FRACTIONAL; + case IIO_RESISTANCE: + /* value in ohm */ + *val =3D 1; + /* + * Copper trace result is in milliohm with 10 fractional + * bits: divide by 2^10 * 1000 =3D 1024000. + * Leak detector result is in ohm with 10 fractional + * bits: divide by 2^10 =3D 1024. + */ + *val2 =3D (st->sensors[chan->address]->type =3D=3D LTC2983_SENSOR_RTD_C= USTOM) ? + 1024000 : 1024; + return IIO_VAL_FRACTIONAL; default: return -EINVAL; } @@ -1292,6 +1382,17 @@ static irqreturn_t ltc2983_irq_handler(int irq, void= *data) __chan; \ }) =20 +#define LTC2983_RESISTANCE_CHAN(index, __address) ({ \ + struct iio_chan_spec __chan =3D { \ + .type =3D IIO_RESISTANCE, \ + .indexed =3D 1, \ + .channel =3D index, \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE= ), \ + .address =3D __address, \ + }; \ + __chan; \ +}) + static int ltc2983_parse_fw(struct ltc2983_data *st) { struct device *dev =3D &st->spi->dev; @@ -1339,6 +1440,16 @@ static int ltc2983_parse_fw(struct ltc2983_data *st) return dev_err_probe(dev, ret, "adi,sensor-type property must given for child nodes\n"); =20 + if (st->info->has_copper_trace) { + if ((sensor.type >=3D LTC2983_SENSOR_THERMOCOUPLE && + sensor.type <=3D LTC2983_SENSOR_THERMOCOUPLE_CUSTOM) || + sensor.type =3D=3D LTC2983_SENSOR_DIODE || + sensor.type =3D=3D LTC2983_SENSOR_DIRECT_ADC) + return dev_err_probe(dev, -EINVAL, + "sensor type %d not supported on %s\n", + sensor.type, st->info->name); + } + dev_dbg(dev, "Create new sensor, type %u, chann %u", sensor.type, sensor.chan); =20 @@ -1380,6 +1491,15 @@ static int ltc2983_parse_fw(struct ltc2983_data *st) st->sensors[chan]->chan =3D sensor.chan; st->sensors[chan]->type =3D sensor.type; =20 + if (st->info->has_copper_trace) { + if (st->sensors[chan]->type =3D=3D LTC2983_SENSOR_THERMISTOR_CUSTOM && + to_thermistor(st->sensors[chan])->custom) + st->iio_channels++; + else if (st->sensors[chan]->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM && + to_rtd(st->sensors[chan])->custom) + st->iio_channels++; + } + channel_avail_mask |=3D BIT(sensor.chan); chan++; } @@ -1426,7 +1546,7 @@ static int ltc2983_eeprom_cmd(struct ltc2983_data *st= , unsigned int cmd, =20 static int ltc2983_setup(struct ltc2983_data *st, bool assign_iio) { - u32 iio_chan_t =3D 0, iio_chan_v =3D 0, chan, iio_idx =3D 0, status; + u32 iio_chan_t =3D 0, iio_chan_v =3D 0, iio_chan_r =3D 0, chan, iio_idx = =3D 0, status; int ret; =20 /* make sure the device is up: start bit (7) is 0 and done bit (6) is 1 */ @@ -1473,6 +1593,26 @@ static int ltc2983_setup(struct ltc2983_data *st, bo= ol assign_iio) !assign_iio) continue; =20 + /* + * Copper trace and leak detector sensors without a custom table + * produce only a resistance result; the chip does not populate + * the temperature result register. Emit only an IIO_RESISTANCE + * channel in this case. + */ + if (st->info->has_copper_trace) { + bool resistance_only =3D + (st->sensors[chan]->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM && + !to_rtd(st->sensors[chan])->custom) || + (st->sensors[chan]->type =3D=3D LTC2983_SENSOR_THERMISTOR_CUSTOM && + !to_thermistor(st->sensors[chan])->custom); + + if (resistance_only) { + st->iio_chan[iio_idx++] =3D + LTC2983_RESISTANCE_CHAN(iio_chan_r++, chan); + continue; + } + } + /* assign iio channel */ if (st->sensors[chan]->type !=3D LTC2983_SENSOR_DIRECT_ADC) { chan_type =3D IIO_TEMP; @@ -1488,6 +1628,11 @@ static int ltc2983_setup(struct ltc2983_data *st, bo= ol assign_iio) */ st->iio_chan[iio_idx++] =3D LTC2983_CHAN(chan_type, (*iio_chan)++, chan); + + if (st->info->has_copper_trace && + (st->sensors[chan]->type =3D=3D LTC2983_SENSOR_RTD_CUSTOM || + st->sensors[chan]->type =3D=3D LTC2983_SENSOR_THERMISTOR_CUSTOM)) + st->iio_chan[iio_idx++] =3D LTC2983_RESISTANCE_CHAN(iio_chan_r++, chan); } =20 return 0; @@ -1496,6 +1641,7 @@ static int ltc2983_setup(struct ltc2983_data *st, boo= l assign_iio) static const struct regmap_range ltc2983_reg_ranges[] =3D { regmap_reg_range(LTC2983_STATUS_REG, LTC2983_STATUS_REG), regmap_reg_range(LTC2983_TEMP_RES_START_REG, LTC2983_TEMP_RES_END_REG), + regmap_reg_range(ADT7604_RES_RES_START_REG, ADT7604_RES_RES_END_REG), regmap_reg_range(LTC2983_EEPROM_KEY_REG, LTC2983_EEPROM_KEY_REG), regmap_reg_range(LTC2983_EEPROM_READ_STATUS_REG, LTC2983_EEPROM_READ_STATUS_REG), @@ -1659,11 +1805,19 @@ static const struct ltc2983_chip_info ltm2985_chip_= info_data =3D { .has_eeprom =3D true, }; =20 +static const struct ltc2983_chip_info adt7604_chip_info_data =3D { + .name =3D "adt7604", + .max_channels_nr =3D 20, + .has_eeprom =3D true, + .has_copper_trace =3D true, +}; + static const struct spi_device_id ltc2983_id_table[] =3D { { "ltc2983", (kernel_ulong_t)<c2983_chip_info_data }, { "ltc2984", (kernel_ulong_t)<c2984_chip_info_data }, { "ltc2986", (kernel_ulong_t)<c2986_chip_info_data }, { "ltm2985", (kernel_ulong_t)<m2985_chip_info_data }, + { "adt7604", (kernel_ulong_t)&adt7604_chip_info_data }, { } }; MODULE_DEVICE_TABLE(spi, ltc2983_id_table); @@ -1673,6 +1827,7 @@ static const struct of_device_id ltc2983_of_match[] = =3D { { .compatible =3D "adi,ltc2984", .data =3D <c2984_chip_info_data }, { .compatible =3D "adi,ltc2986", .data =3D <c2986_chip_info_data }, { .compatible =3D "adi,ltm2985", .data =3D <m2985_chip_info_data }, + { .compatible =3D "adi,adt7604", .data =3D &adt7604_chip_info_data }, { } }; MODULE_DEVICE_TABLE(of, ltc2983_of_match); --=20 2.43.0