Skip to contentSkip to conversation

hwmon: (lm63) Add Sensylink CTF2301 support

PATCH Superseded Troy Mitchell 4 participants 24 messages Jul 21 – Jul 27

Subsystems (5)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover hwmon: (lm63) Add Sensylink CTF2301 support

Sensylink CTF2301 is a system-level thermal management solution chip.

The CTF2301 is an I2C/SMBus compatible device featuring:
- One local temperature sensor with +/-0.5 degree C accuracy and

    0.0625 degree C resolution.

- One remote temperature sensor for external diode-connected transistors, offering +/-1 degree C accuracy and 0.125 degree C resolution (temperature range: -40 degree C to +125 degree C).
- An integrated PWM fan controller capable of operating in two modes:
1. Direct-DCY: Open-loop direct duty cycle control.
2. Auto-Temp: Closed-loop automatic fan speed control based on measured temperature.
- A 1-channel fan speed monitor (TACH input) for RPM measurement.

As Guenter pointed out on v1, the CTF2301 register map is a near match for the LM63/LM96163 family (local and remote temperature, tachometer and PWM fan control), so this version drops the standalone ctf2301 driver and instead adds CTF2301 as a new chip type in the existing lm63 driver. This reuses the shared temperature, limit, alarm and PWM handling instead of duplicating it.

The CTF2301-specific differences are handled on top of lm63: 12-bit local temperature input and high-limit values, nine conversion rates, 12 fan-control lookup table entries, and optional 22.5 kHz high-resolution PWM. When no IRQ is described, the shared ALERT/TACH pin is configured as a tachometer input. The LM63 family can also register as a thermal cooling device when the device tree provides the #cooling-cells property.

The required SpacemiT I2C controller clock series has been merged but is not yet included in an rc release:
https://lore.kernel.org/all/[email protected]/

Apply that series before testing this series on K3. Without it, the I2C controller cannot generate an accurate 400 kHz SCL clock and CTF2301 accesses may fail.

Tested on a SpacemiT K3 CoM260 by booting an initramfs and verifying the CTF2301 probe. Temperature, tachometer, PWM, and conversion-rate behavior were checked against direct I2C register accesses and the datasheet.

Datasheet:
https://www.sensylink.com/upload/1/net.sensylink.portal/1689557281035.pdf

Register description:
https://github.com/TroyMitchell911/ctf2301-datasheet

---
Changes in v2:
- Replace the standalone CTF2301 driver with a new lm63 chip type, as suggested by Guenter, reusing the existing temperature, limit, alarm, tachometer, PWM, and automatic fan-control paths.
- Add the temperature thresholds, alarms, and automatic fan-control lookup table support which were missing from the v1 driver.
- Handle CTF2301-specific 12-bit local temperature values, nine conversion rates, 12 lookup table entries, shared ALERT/TACH pin, and optional 22.5 kHz high-resolution PWM.
- Propagate SMBus failures from lm63 initialization and write paths.
- Add optional thermal cooling-device support for the LM63 family using the existing manual PWM control path.
- Move the National LM63-family compatibles from trivial-devices.yaml to a dedicated binding which permits #cooling-cells.
- Add CTF2301 to the LM63-family binding instead of keeping the standalone schema from v1. Do not declare #cooling-cells on K3 CoM260 yet because the board has no thermal consumer.
- Fix the binding errors reported by Rob by using a plain compatible string and wrapping the description.
- Document CTF2301 support in the lm63 hwmon documentation and provide the detailed register description used for review.
- Add the K3 CoM260 I2C6 pinctrl state and CTF2301 device node for hardware testing.
- Link to v1: https://lore.kernel.org/r/[email protected]

To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Guenter Roeck <[email protected]>
To: Paul Walmsley <[email protected]>
To: Palmer Dabbelt <[email protected]>
To: Albert Ou <[email protected]>
To: Alexandre Ghiti <[email protected]>
To: Yixun Lan <[email protected]>
To: Jonathan Corbet <[email protected]>
To: Shuah Khan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Troy Mitchell (6):
dt-bindings: vendor-prefixes: Add Sensylink
dt-bindings: hwmon: Move LM63 family to a dedicated binding
dt-bindings: hwmon: Add Sensylink CTF2301
hwmon: (lm63) Add Sensylink CTF2301 support
riscv: dts: spacemit: Add K3 I2C6 pinctrl state
riscv: dts: spacemit: Add CTF2301 on K3 CoM260

 .../devicetree/bindings/hwmon/national,lm63.yaml   |  52 +++
 .../devicetree/bindings/trivial-devices.yaml       |   6 -
 .../devicetree/bindings/vendor-prefixes.yaml       |   2 +
 Documentation/hwmon/lm63.rst                       |  22 ++
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi        |  19 +
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi       |  11 +
 drivers/hwmon/Kconfig                              |   8 +-
 drivers/hwmon/lm63.c                               | 393 +++++++++++++++++----
 8 files changed, 433 insertions(+), 80 deletions(-)

---
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
change-id: 20250916-ctl2301-0416b073c280

Best regards,

Signature · 1 line
Troy Mitchell <[email protected]>
#1 lore raw

PATCH v2 1/6 dt-bindings: vendor-prefixes: Add Sensylink

Add the vendor prefix for Sensylink Microelectronics.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 396044f368e7..22d0d26f1bbd 100644
@@ -1467,6 +1467,8 @@ patternProperties:
     description: Sensirion AG
   "^sensortek,.*":
     description: Sensortek Technology Corporation
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.
   "^sercomm,.*":
     description: Sercomm (Suzhou) Corporation
   "^sff,.*":
Signature · 1 line
2.55.0
#2 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines

Add the vendor prefix for Sensylink Microelectronics.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

In reply to Troy Mitchell
Quoted 12 lines · Troy Mitchell

Add the vendor prefix for Sensylink Microelectronics.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 396044f368e7..22d0d26f1bbd 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1471

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1467,6 +1467,8 @@ patternProperties:
     description: Sensirion AG
   "^sensortek,.*":
     description: Sensortek Technology Corporation
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.

Googling the company to see what their website is, I seem to see a different name for the company: Shanghai Sensylink Microelectronics Inc. Their website has that with the Shanghai dropped.

Also, probably the commit message should contain

pw-bot: changes-requested

Thanks,
Conor.

Quoted 7 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
   "^sercomm,.*":
     description: Sercomm (Suzhou) Corporation
   "^sff,.*":
Signature · 2 lines
-- 
2.55.0
maintainer
#4 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

Quoted 23 lines · Conor Dooley
Quoted 12 lines · Troy Mitchell

Add the vendor prefix for Sensylink Microelectronics.

---
  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
  1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 396044f368e7..22d0d26f1bbd 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1471

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1467,6 +1467,8 @@ patternProperties:
      description: Sensirion AG
    "^sensortek,.*":
      description: Sensortek Technology Corporation
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.

Googling the company to see what their website is, I seem to see a different name for the company: Shanghai Sensylink Microelectronics Inc. Their website has that with the Shanghai dropped.

Quoted 3 lines

Also, probably the commit message should contain

Asking Google search: "Why the two names ? Did they rename themselves at some point ?"

Response:

Understanding the Name Structure

1. English Legal Name vs. Marketing Abbreviation

Sensylink Microelectronics Technology Co., Ltd.:
This is the literal translation of their full, formal registered corporate name used for international trade, customs, and legal documentation.

Sensylink Microelectronics Inc.:
This is a simplified, Westernized abbreviation used on their official English website and marketing materials for cleaner global branding.

2. The Native Chinese Name

上海申矽凌微电子科技股份有限公司 (Shanghai Shenxiling Microelectronics Technology Co., Ltd.): This is the company's sole, official legal name registered with the Chinese government.

"Sensylink" is a portmanteau created specifically for international markets, blending "Sensing" (their core technology) and "Link" (their interface and connectivity products).

Prodding further, asking if the previous response was complete, it tells me that there was a name change:

According to Chinese corporate registry data (via Tianyancha and Qcc), they did change their official Chinese legal name:

Old Name: 上海申矽凌微电子科技有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd.)

New Name: 上海申矽凌微电子科技股份有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd. by Shares / Joint-Stock Company)

I don't know if Linux has a policy about Legal vs. Marketing names. Personally I don't have an opinion. Your call, really.

Guenter

#5 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

Quoted 24 lines · Guenter Roeck
Quoted 23 lines · Conor Dooley
Quoted 12 lines · Troy Mitchell

Add the vendor prefix for Sensylink Microelectronics.

---
  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
  1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 396044f368e7..22d0d26f1bbd 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1471

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1467,6 +1467,8 @@ patternProperties:
      description: Sensirion AG
    "^sensortek,.*":
      description: Sensortek Technology Corporation
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.

Googling the company to see what their website is, I seem to see a different name for the company: Shanghai Sensylink Microelectronics Inc. Their website has that with the Shanghai dropped.

Quoted 5 lines
Quoted 3 lines

Also, probably the commit message should contain

Asking Google search: "Why the two names ? Did they rename themselves at some point ?"

The google search "AI" response was what showed me the different name, sounds like I should have questioned it some more!

Quoted 31 lines

Response:

Understanding the Name Structure

1. English Legal Name vs. Marketing Abbreviation

Sensylink Microelectronics Technology Co., Ltd.:
This is the literal translation of their full, formal registered corporate name used for international trade, customs, and legal documentation.

Sensylink Microelectronics Inc.:
This is a simplified, Westernized abbreviation used on their official English website and marketing materials for cleaner global branding.

2. The Native Chinese Name

上海申矽凌微电子科技股份有限公司 (Shanghai Shenxiling Microelectronics Technology Co., Ltd.): This is the company's sole, official legal name registered with the Chinese government.

"Sensylink" is a portmanteau created specifically for international markets, blending "Sensing" (their core technology) and "Link" (their interface and connectivity products).

Prodding further, asking if the previous response was complete, it tells me that there was a name change:

According to Chinese corporate registry data (via Tianyancha and Qcc), they did change their official Chinese legal name:

Quoted 8 lines

Old Name: 上海申矽凌微电子科技有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd.)

New Name: 上海申矽凌微电子科技股份有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd. by Shares / Joint-Stock Company)

I don't know if Linux has a policy about Legal vs. Marketing names. Personally I don't have an opinion. Your call, really.

I don't know what the policy is, or if there is one, but personally I wouldn't use the westernised abbreviation since they may decide to rebrand that etc and the vendor prefix information should remain static.

So this is probably fine as-is, just I'd like to see that link added to their website.

Thanks (and thanks for doing the extra digging),
Conor.

maintainer
#6 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

Quoted 74 lines · Conor Dooley
Quoted 24 lines · Guenter Roeck
Quoted 23 lines · Conor Dooley
Quoted 12 lines · Troy Mitchell

Add the vendor prefix for Sensylink Microelectronics.

---
   Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
   1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 396044f368e7..22d0d26f1bbd 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1471

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1467,6 +1467,8 @@ patternProperties:
       description: Sensirion AG
     "^sensortek,.*":
       description: Sensortek Technology Corporation
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.

Googling the company to see what their website is, I seem to see a different name for the company: Shanghai Sensylink Microelectronics Inc. Their website has that with the Shanghai dropped.

Quoted 5 lines
Quoted 3 lines

Also, probably the commit message should contain

Asking Google search: "Why the two names ? Did they rename themselves at some point ?"

The google search "AI" response was what showed me the different name, sounds like I should have questioned it some more!

Quoted 31 lines

Response:

Understanding the Name Structure

1. English Legal Name vs. Marketing Abbreviation

Sensylink Microelectronics Technology Co., Ltd.:
This is the literal translation of their full, formal registered corporate name used for international trade, customs, and legal documentation.

Sensylink Microelectronics Inc.:
This is a simplified, Westernized abbreviation used on their official English website and marketing materials for cleaner global branding.

2. The Native Chinese Name

上海申矽凌微电子科技股份有限公司 (Shanghai Shenxiling Microelectronics Technology Co., Ltd.): This is the company's sole, official legal name registered with the Chinese government.

"Sensylink" is a portmanteau created specifically for international markets, blending "Sensing" (their core technology) and "Link" (their interface and connectivity products).

Prodding further, asking if the previous response was complete, it tells me that there was a name change:

According to Chinese corporate registry data (via Tianyancha and Qcc), they did change their official Chinese legal name:

Quoted 8 lines

Old Name: 上海申矽凌微电子科技有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd.)

New Name: 上海申矽凌微电子科技股份有限公司 (Shanghai Sensylink Microelectronics Technology Co., Ltd. by Shares / Joint-Stock Company)

I don't know if Linux has a policy about Legal vs. Marketing names. Personally I don't have an opinion. Your call, really.

Quoted 8 lines

I don't know what the policy is, or if there is one, but personally I wouldn't use the westernised abbreviation since they may decide to rebrand that etc and the vendor prefix information should remain static.

So this is probably fine as-is, just I'd like to see that link added to their website.

Thanks (and thanks for doing the extra digging),

Part of that extra digging nowadays is to ask it if its initial response is real or if it was hallucinated. Sadly enough, most of the time it will admit that at least part of the initial response does not match reality. That was the case here as well, because it initially did claim that the company never changed their name (of course, the next question to ask would be if it really changed its name or if that was another hallucination ;-).

Guenter

#7 lore raw

Re: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink

In reply to Conor Dooley
Quoted 28 lines · Guenter Roeck
Quoted 13 lines · Conor Dooley
Quoted 12 lines · Troy Mitchell

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1471

Quoted 6 lines

Add the vendor prefix for Sensylink Microelectronics.

[...]

Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
+  "^sensylink,.*":
+    description: Sensylink Microelectronics Technology Co., Ltd.

Googling the company to see what their website is, I seem to see a different name for the company: Shanghai Sensylink Microelectronics Inc. Their website has that with the Shanghai dropped.

Quoted 5 lines
Quoted 2 lines

Also, probably the commit message should contain

Asking Google search: "Why the two names ? Did they rename themselves at some point ?"

The google search "AI" response was what showed me the different name, sounds like I should have questioned it some more!

Quoted 4 lines

[...]

I don't know if Linux has a policy about Legal vs. Marketing names. Personally I don't have an opinion. Your call, really.

Quoted 6 lines

I don't know what the policy is, or if there is one, but personally I wouldn't use the westernised abbreviation since they may decide to rebrand that etc and the vendor prefix information should remain static.

So this is probably fine as-is, just I'd like to see that link added to their website.

Understood. I will keep the current vendor name and add the following link to the commit message in the next version:

- Troy

#8 lore raw

PATCH v2 2/6 dt-bindings: hwmon: Move LM63 family to a dedicated binding

In reply to Troy Mitchell

Move the National Semiconductor LM63, LM64, and LM96163 compatibles out of trivial-devices.yaml and into a dedicated binding. Describe their integrated fan control and permit use as thermal cooling devices through the #cooling-cells property.

---
 .../devicetree/bindings/hwmon/national,lm63.yaml   | 50 ++++++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml       |  6 ---
 2 files changed, 50 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/hwmon/national,lm63.yaml new file +50 -0
new file mode 100644
index 000000000000..92b0094ff303
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/national,lm63.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LM63-compatible temperature sensors with integrated fan control
+
+maintainers:
+  - Guenter Roeck <[email protected]>
+
+description: |
+  The LM63 family provides local and remote temperature monitoring together
+  with fan speed monitoring and PWM fan control. Supported devices include
+  the National Semiconductor LM63, LM64 and LM96163.
+
+allOf:
+  - $ref: hwmon-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - national,lm63
+      - national,lm64
+      - national,lm96163
+
+  reg:
+    maxItems: 1
+
+  "#cooling-cells":
+    const: 2
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@4c {
+            compatible = "national,lm63";
+            reg = <0x4c>;
+            #cooling-cells = <2>;
+        };
+    };
Documentation/devicetree/bindings/trivial-devices.yaml +0 -6
index 435c4baab436..aa62d245464c 100644
@@ -364,16 +364,10 @@ properties:
           - mps,mp9945
             # Murata D1U74T-W power supply unit
           - murata,d1u74t
-            # Temperature sensor with integrated fan control
-          - national,lm63
-            # Temperature sensor with integrated fan control
-          - national,lm64
             # Temperature sensor
           - national,lm95235
             # Temperature sensor
           - national,lm95245
-            # Temperature sensor with integrated fan control
-          - national,lm96163
             # Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor
           - national,lm80
             # Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor
Signature · 1 line
2.55.0
#9 lore raw

Re: [PATCH v2 2/6] dt-bindings: hwmon: Move LM63 family to a dedicated binding

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Missing `interrupts` property in the newly created LM63 device tree binding. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing interrupts property in the newly created LM63 device tree binding. --

--- Patch [2]: [PATCH v2 2/6] dt-bindings: hwmon: Move LM63 family to a dedicated binding --- commit 5cb7233d8984d02f9823102bcec286ee4ef134d5
Author: Troy Mitchell <[email protected]>

dt-bindings: hwmon: Move LM63 family to a dedicated binding

This commit moves the National Semiconductor LM63, LM64, and LM96163 compatibles out of trivial-devices.yaml and into a dedicated schema. It also describes their integrated fan control and thermal cooling device capabilities.

Quoted 5 lines
Documentation/devicetree/bindings/hwmon/national,lm63.yaml new file +0 -0
new file mode 100644
index 0000000000000..92b0094ff3034

[ ... ]

Documentation/devicetree/bindings/hwmon/national,lm63.yaml line 31

Quoted 12 lines
Documentation/devicetree/bindings/hwmon/national,lm63.yaml new file +12 -0
+properties:
+  compatible:
+    enum:
+      - national,lm63
+      - national,lm64
+      - national,lm96163
+
+  reg:
+    maxItems: 1
+
+  "#cooling-cells":
+    const: 2

[Severity: Medium]
Should the interrupts property be explicitly defined in this block?

Because the LM63 family was moved out of trivial-devices.yaml (which broadly permitted the interrupts property) to a dedicated schema using
unevaluatedProperties: false, device trees that correctly describe the hardware's interrupt capability via the ALERT# pin will now incorrectly fail dtbs_check validation.

Quoted 6 lines
Documentation/devicetree/bindings/hwmon/national,lm63.yaml new file +6 -0
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#10 lore raw

Re: [PATCH v2 2/6] dt-bindings: hwmon: Move LM63 family to a dedicated binding

Quoted 8 lines · On Tue, Jul 21, 2026 at 09:58:20AM +0000, [email protected] wrote:

[Severity: Medium]
Should the interrupts property be explicitly defined in this block?

Because the LM63 family was moved out of trivial-devices.yaml (which broadly permitted the interrupts property) to a dedicated schema using
unevaluatedProperties: false, device trees that correctly describe the hardware's interrupt capability via the ALERT# pin will now incorrectly fail dtbs_check validation.

Good catch. The trivial-devices binding allowed one interrupt, and the LM63 family has an ALERT output. I will preserve that part of the existing binding contract by adding the following to the dedicated binding:

interrupts:
maxItems: 1

- Troy

#11 lore raw

PATCH v2 3/6 dt-bindings: hwmon: Add Sensylink CTF2301

In reply to Troy Mitchell

Add the Sensylink CTF2301 temperature sensor and fan controller to the LM63 family binding. The chip follows the LM63 register model and can provide a thermal cooling device when #cooling-cells is present.

---
 Documentation/devicetree/bindings/hwmon/national,lm63.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/hwmon/national,lm63.yaml +3 -1
index 92b0094ff303..4a1ffebfdbef 100644
@@ -12,7 +12,8 @@ maintainers:
 description: |
   The LM63 family provides local and remote temperature monitoring together
   with fan speed monitoring and PWM fan control. Supported devices include
-  the National Semiconductor LM63, LM64 and LM96163.
+  the National Semiconductor LM63, LM64 and LM96163, and the Sensylink
+  CTF2301.
 
 allOf:
   - $ref: hwmon-common.yaml#
@@ -23,6 +24,7 @@ properties:
       - national,lm63
       - national,lm64
       - national,lm96163
+      - sensylink,ctf2301
 
   reg:
     maxItems: 1
Signature · 1 line
2.55.0
#12 lore raw

Re: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `sensylink,ctf2301` compatible string is added to a flat `enum` instead of allowing a…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The sensylink,ctf2301 compatible string is added to a flat enum instead of allowing a fallback, preventing the device from using existing driver support. --

--- Patch [3]: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301 --- commit 2d1df9d4d4d9fa27f7828b7715766842a51c0154
Author: Troy Mitchell <[email protected]>
Subject: dt-bindings: hwmon: Add Sensylink CTF2301

This commit adds the Sensylink CTF2301 temperature sensor and fan controller to the LM63 family binding. It updates the device tree schema to accept the new compatible string.

Quoted 4 lines
Documentation/devicetree/bindings/hwmon/national,lm63.yaml +0 -0
index 92b0094ff3034..4a1ffebfdbef6 100644

[ ... ]

Documentation/devicetree/bindings/hwmon/national,lm63.yaml properties: · line 27

Quoted 5 lines
Documentation/devicetree/bindings/hwmon/national,lm63.yaml +1 -0
@@ -23,6 +24,7 @@ properties:
       - national,lm63
       - national,lm64
       - national,lm96163
+      - sensylink,ctf2301

[Severity: Medium]
Since the commit message mentions this device follows the LM63 register model, should this compatible string allow a fallback to "national,lm63" instead of being added to this flat enum?

Without a fallback, and since no driver update is included to add the new ID, could this cause a regression where the existing Linux driver fails to match and probe the device when a device tree specifies only "sensylink,ctf2301"?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#13 lore raw

Re: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301

In reply to Troy Mitchell
Quoted 3 lines · Troy Mitchell

Add the Sensylink CTF2301 temperature sensor and fan controller to the LM63 family binding. The chip follows the LM63 register model and can provide a thermal cooling device when #cooling-cells is present.

Commit message should explain why a fallback compatible is not suitable.

pw-bot: changes-requested

Thanks,
Conor.

Quoted 32 lines
---
 Documentation/devicetree/bindings/hwmon/national,lm63.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/hwmon/national,lm63.yaml +3 -1
index 92b0094ff303..4a1ffebfdbef 100644
@@ -12,7 +12,8 @@ maintainers:
 description: |
   The LM63 family provides local and remote temperature monitoring together
   with fan speed monitoring and PWM fan control. Supported devices include
-  the National Semiconductor LM63, LM64 and LM96163.
+  the National Semiconductor LM63, LM64 and LM96163, and the Sensylink
+  CTF2301.
 
 allOf:
   - $ref: hwmon-common.yaml#
@@ -23,6 +24,7 @@ properties:
       - national,lm63
       - national,lm64
       - national,lm96163
+      - sensylink,ctf2301
 
   reg:
     maxItems: 1
Signature · 2 lines
-- 
2.55.0
#14 lore raw

Re: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301

Quoted 6 lines · Troy Mitchell
Quoted 3 lines

Add the Sensylink CTF2301 temperature sensor and fan controller to the LM63 family binding. The chip follows the LM63 register model and can provide a thermal cooling device when #cooling-cells is present.

Commit message should explain why a fallback compatible is not suitable.

The CTF2301 shares the overall register layout with LM63, but it is not fully compatible. In particular, it uses different conversion-rate encodings, extended local-temperature registers, additional fan lookup table entries, and device-specific PWM and ALERT/TACH configuration. An older driver matching the "national,lm63" fallback would therefore not operate the device correctly.

I will explain why a fallback compatible is not suitable in the commit message in the next version.

- Troy

#15 lore raw

Re: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301

In reply to Conor Dooley
Quoted 6 lines · Troy Mitchell
Quoted 3 lines

Add the Sensylink CTF2301 temperature sensor and fan controller to the LM63 family binding. The chip follows the LM63 register model and can provide a thermal cooling device when #cooling-cells is present.

Commit message should explain why a fallback compatible is not suitable.

The CTF2301 shares the overall register layout with LM63, but it is not fully compatible. In particular, it uses different conversion-rate encodings, extended local-temperature registers, additional fan lookup table entries, and device-specific PWM and ALERT/TACH configuration. An older driver matching the "national,lm63" fallback would therefore not operate the device correctly.

I will explain why a fallback compatible is not suitable in the commit message in the next version.

- Troy

#16 lore raw

PATCH v2 4/6 hwmon: (lm63) Add Sensylink CTF2301 support

In reply to Troy Mitchell

Add Sensylink CTF2301 support to the LM63 driver. CTF2301 follows the LM63-style temperature, tachometer, and PWM register layout, while using a 12-bit local temperature register and requiring the ALERT/TACH pin to be configured for tachometer input.

Register an optional thermal cooling device when the device tree node provides #cooling-cells, allowing thermal zones to control the fan through the existing PWM path without changing behavior for existing LM63-family users.

---
 Documentation/hwmon/lm63.rst |  22 +++
 drivers/hwmon/Kconfig        |   8 +-
 drivers/hwmon/lm63.c         | 393 +++++++++++++++++++++++++++++++++++--------
 3 files changed, 349 insertions(+), 74 deletions(-)
Documentation/hwmon/lm63.rst +22 -0
index 9e27367d7405..c40bd0dfe591 100644
@@ -33,6 +33,16 @@ Supported chips:
 
 	       http://www.national.com/pf/LM/LM96163.html
 
+  * Sensylink CTF2301
+
+    Prefix: 'ctf2301'
+
+    Addresses scanned: none
+
+    Datasheet: https://www.sensylink.com/upload/1/net.sensylink.portal/1689557281035.pdf
+
+    Register description: https://github.com/TroyMitchell911/ctf2301-datasheet
+
 
 Author: Jean Delvare <[email protected]>
 
@@ -62,6 +72,8 @@ value have to be masked out. The value is still 16 bit in width.
 
 All temperature values are given in degrees Celsius. Resolution is 1.0
 degree for the local temperature, 0.125 degree for the remote temperature.
+The CTF2301 local temperature input and limit have a resolution of 0.0625
+degree.
 
 The fan speed is measured using a tachometer. Contrary to most chips which
 store the value in an 8-bit register and have a selectable clock divider
@@ -93,3 +105,13 @@ support these GPIO lines at present.
 The LM96163 is an enhanced version of LM63 with improved temperature accuracy
 and better PWM resolution. For LM96163, the external temperature sensor type is
 configurable as CPU embedded diode(1) or 3904 transistor(2).
+
+The CTF2301 is register-compatible with the LM63 family and provides 12 fan
+control lookup table entries. It supports 8-bit PWM resolution when configured
+for a 22.5 kHz PWM frequency.
+
+Device tree nodes may declare ``#cooling-cells`` to register the fan controller
+with the thermal framework. The cooling state is mapped to the existing
+``pwm1`` range from 0 to 255. The driver keeps the current automatic or manual
+fan control mode during probe and switches to manual control when the thermal
+framework first requests a cooling state.
drivers/hwmon/Kconfig +4 -4
index 2bfbcc033d59..abb1af8664fb 100644
@@ -1501,10 +1501,10 @@ config SENSORS_LM63
 	depends on I2C
 	help
 	  If you say yes here you get support for the National
-	  Semiconductor LM63, LM64, and LM96163 remote diode digital temperature
-	  sensors with integrated fan control.  Such chips are found
-	  on the Tyan S4882 (Thunder K8QS Pro) motherboard, among
-	  others.
+	  Semiconductor LM63, LM64, LM96163, and Sensylink CTF2301
+	  remote diode digital temperature sensors with integrated fan
+	  control. Such chips are found on the Tyan S4882 (Thunder K8QS
+	  Pro) motherboard, among others.
 
 	  This driver can also be built as a module. If so, the module
 	  will be called lm63.
drivers/hwmon/lm63.c +323 -70

639 lines not on this page · raw message

Signature · 1 line
2.55.0
#17 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Unchecked I2C reads for LSB are bitwise-ORed into 16-bit register values, corrupting data on…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unchecked I2C reads for LSB are bitwise-ORed into 16-bit register values, corrupting data on read errors. --

--- Patch [4]: [PATCH v2 4/6] hwmon: (lm63) Add Sensylink CTF2301 support --- commit bbf54143e45eb1b3b9599d60a55904a5184333c9
Author: Troy Mitchell <[email protected]>

hwmon: (lm63) Add Sensylink CTF2301 support

This commit adds support for the Sensylink CTF2301 chip to the lm63 driver. It introduces extended local temperature resolution and optional thermal cooling device registration.

Quoted 4 lines
drivers/hwmon/lm63.c +0 -0
index e2a429e579ac1..764a7467afa60 100644

[ ... ]

Quoted 4 lines
drivers/hwmon/lm63.c +0 -0
@@ -256,8 +270,16 @@ static struct lm63_data *lm63_update_device(struct device *dev)
 
 		data->temp8[0] = i2c_smbus_read_byte_data(client,
 				 LM63_REG_LOCAL_TEMP);

drivers/hwmon/lm63.c static struct lm63_data *lm63_update_device(struct device *dev) · line 282

Quoted 10 lines
drivers/hwmon/lm63.c +8 -0
+		if (data->kind == ctf2301)
+			data->temp1_input = ((u16)(u8)data->temp8[0] << 8)
+					  | i2c_smbus_read_byte_data(client,
+						CTF2301_REG_LOCAL_TEMP_LSB);
 		data->temp8[1] = i2c_smbus_read_byte_data(client,
 				 LM63_REG_LOCAL_HIGH);
+		if (data->kind == ctf2301)
+			data->temp1_max = ((u16)(u8)data->temp8[1] << 8)
+					  | i2c_smbus_read_byte_data(client,
+						CTF2301_REG_LOCAL_HIGH_LSB);

[Severity: Medium]
Will this corrupt the temperature reading if the I2C read fails?

In lm63_update_device(), if i2c_smbus_read_byte_data() for the LSB returns a negative error code (such as -EIO), it gets bitwise-ORed with the shifted MSB. The negative s32 error code would sign-extend, overwriting the MSB bits entirely and resulting in a large negative temperature spike instead of propagating the error or maintaining the previous valid reading.

Could we check the return value of i2c_smbus_read_byte_data() before merging it into temp1_input and temp1_max?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#18 lore raw
Quoted 11 lines · On Tue, Jul 21, 2026 at 10:00:04AM +0000, [email protected] wrote:

[Severity: Medium]
Will this corrupt the temperature reading if the I2C read fails?

In lm63_update_device(), if i2c_smbus_read_byte_data() for the LSB returns a negative error code (such as -EIO), it gets bitwise-ORed with the shifted MSB. The negative s32 error code would sign-extend, overwriting the MSB bits entirely and resulting in a large negative temperature spike instead of propagating the error or maintaining the previous valid reading.

Could we check the return value of i2c_smbus_read_byte_data() before merging it into temp1_input and temp1_max?

Good catch. A failed read must not be combined with the other temperature byte. I will read both bytes into temporary integers, check both return values, and update the cached 12-bit value only after both reads succeed.

The existing lm63_update_device() also truncates or combines unchecked i2c_smbus_read_byte_data() results in several other paths. I will address those existing error-handling issues in a separate patch, rather than mix that broader change into the CTF2301 support patch.

- Troy

#19 lore raw

PATCH v2 5/6 riscv: dts: spacemit: Add K3 I2C6 pinctrl state

In reply to Troy Mitchell

Add the K3 I2C6 pinctrl state used by boards that route I2C6 to pads 7 and 8. Leave board-specific IO voltage selection to board files.

---
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +11 -0
index 3ee1471f3798..91cd08099e27 100644
@@ -78,6 +78,17 @@ gmac1-phy-0-pins {
 		};
 	};
 
+	/omit-if-no-ref/
+	i2c6_1_cfg: i2c6-1-cfg {
+		i2c6-1-pins {
+			pinmux = <K3_PADCONF(7, 6)>,	/* i2c6 scl */
+				 <K3_PADCONF(8, 6)>;	/* i2c6 sda */
+
+			bias-pull-up = <0>;
+			drive-strength = <18>;
+		};
+	};
+
 	/omit-if-no-ref/
 	i2c8_cfg: i2c8-cfg {
 		i2c8-pins {
Signature · 1 line
2.55.0
#20 lore raw

Re: [PATCH v2 5/6] riscv: dts: spacemit: Add K3 I2C6 pinctrl state

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The `drive-strength` value `18` is invalid according to the SpacemiT K3 pinctrl binding schema…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The drive-strength value 18 is invalid according to the SpacemiT K3 pinctrl binding schema, causing dtbs_check validation failures. --

--- Patch [5]: [PATCH v2 5/6] riscv: dts: spacemit: Add K3 I2C6 pinctrl state --- commit 7b36908eb32982b060ee59a7f9ad3d2f49fdd88e
Author: Troy Mitchell <[email protected]>

riscv: dts: spacemit: Add K3 I2C6 pinctrl state

This commit adds the I2C6 pinctrl state for K3 boards that route to pads 7 and 8, omitting the board-specific IO voltage selection.

Quoted 5 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +0 -0
index 3ee1471f37985..91cd08099e276 100644
@@ -78,6 +78,17 @@ gmac1-phy-0-pins {

[ ... ]

arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi gmac1-phy-0-pins { · line 88

Quoted 8 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +8 -0
+	/omit-if-no-ref/
+	i2c6_1_cfg: i2c6-1-cfg {
+		i2c6-1-pins {
+			pinmux = <K3_PADCONF(7, 6)>,	/* i2c6 scl */
+				 <K3_PADCONF(8, 6)>;	/* i2c6 sda */
+
+			bias-pull-up = <0>;
+			drive-strength = <18>;

[Severity: Low]
Is this drive-strength value supported by the binding? The value 18 doesn't appear to be valid according to the SpacemiT K3 pinctrl binding schema (spacemit,k1-pinctrl.yaml), which triggers a dtbs_check validation failure.

Since the driver's spacemit_get_ds_value() will silently fall back to the next highest valid value (like 21mA or 25mA depending on voltage), could this cause an unexpected mismatch between the requested devicetree state and the actual hardware configuration?

Quoted 2 lines
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +2 -0
+		};
+	};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#21 lore raw

Re: [PATCH v2 5/6] riscv: dts: spacemit: Add K3 I2C6 pinctrl state

Quoted 10 lines · On Tue, Jul 21, 2026 at 10:00:38AM +0000, [email protected] wrote:

[Severity: Low]
Is this drive-strength value supported by the binding? The value 18 doesn't appear to be valid according to the SpacemiT K3 pinctrl binding schema (spacemit,k1-pinctrl.yaml), which triggers a dtbs_check validation failure.

Since the driver's spacemit_get_ds_value() will silently fall back to the next highest valid value (like 21mA or 25mA depending on voltage), could this cause an unexpected mismatch between the requested devicetree state and the actual hardware configuration?

Good catch. This pin group uses the 3.3 V power domain, for which 18 mA is not a valid K3 drive-strength value. The driver rounds that request up to 25 mA, so I will use 25 mA in the devicetree to describe the configuration that is actually programmed and to satisfy the binding.

- Troy

#22 lore raw

PATCH v2 6/6 riscv: dts: spacemit: Add CTF2301 on K3 CoM260

In reply to Troy Mitchell

Enable I2C6 on the K3 CoM260 module and describe the Sensylink CTF2301 temperature sensor and fan controller at address 0x4c.

Set the I2C6 pin power source in the board-level pinctrl node because the IO rail voltage is board-specific.

---
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +19 -0
index a38d7b738258..95a60fbb411f 100644
@@ -26,6 +26,25 @@ reg_5v_sys: regulator-5v-sys {
 	};
 };
 
+&pinctrl {
+	i2c6-1-cfg {
+		i2c6-1-pins {
+			power-source = <3300>;
+		};
+	};
+};
+
+&i2c6 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c6_1_cfg>;
+	status = "okay";
+
+	temperature-sensor@4c {
+		compatible = "sensylink,ctf2301";
+		reg = <0x4c>;
+	};
+};
+
 &i2c8 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c8_cfg>;
Signature · 1 line
2.55.0
#23 lore raw

Re: [PATCH v2 6/6] riscv: dts: spacemit: Add CTF2301 on K3 CoM260

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] PWM duty cycle calculation can overflow and wrap around to 0, completely turning off the fan when maximum speed is requested. --

--- Patch [6]: [PATCH v2 6/6] riscv: dts: spacemit: Add CTF2301 on K3 CoM260 --- commit 2adeea2e46046fc26168a60ad26929de961f2f43
Author: Troy Mitchell <[email protected]>

riscv: dts: spacemit: Add CTF2301 on K3 CoM260

This commit enables I2C6 on the K3 CoM260 module. It sets the I2C6 pin power source and describes the Sensylink CTF2301 temperature sensor and fan controller.

Quoted 13 lines
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +5 -0
index a38d7b738258d..95a60fbb411f8 100644
@@ -26,6 +26,25 @@ reg_5v_sys: regulator-5v-sys {
 	};
 };
 
+&pinctrl {
+	i2c6-1-cfg {
+		i2c6-1-pins {
+			power-source = <3300>;
+		};

arch/riscv/boot/dts/spacemit/k3-com260.dtsi reg_5v_sys: regulator-5v-sys { · line 43

Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +10 -0
+	};
+};
+
+&i2c6 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c6_1_cfg>;
+	status = "okay";
+
+	temperature-sensor@4c {
+		compatible = "sensylink,ctf2301";

[Severity: High]
This isn't a bug introduced by this patch, but adding this sensor node exposes a pre-existing PWM duty cycle calculation overflow in the lm63 driver.

When the fan controller computes the duty cycle in drivers/hwmon/lm63.c:

drivers/hwmon/lm63.c:lm63_pwm_to_reg() {
    ...
    return (val * data->pwm1_freq * 2 + LM63_MAX_PWM / 2) / LM63_MAX_PWM;
}

If the bootloader configures a low PWM frequency (setting the register > 127), data->pwm1_freq will exceed 127 without bounds checking.

When maximum cooling is requested (val = 255), the arithmetic evaluates to 256 or more. Because the function returns a u8, the value implicitly truncates and wraps around to 0.

Can this completely turn off the fan when maximum cooling is requested?

Quoted 3 lines
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +3 -0
+		reg = <0x4c>;
+	};
+};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6