From nobody Sat Jul 25 00:54:25 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 D1192445AF1 for ; Tue, 21 Jul 2026 09:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627343; cv=none; b=b41H52+TKwiF3XXastpqKwOTClZLKRhQ335aktJ2lgo6oBwz58hHh+nX8QNw2CCv/BPLFuprq2JPGYP5dhoPKKS9jOpyBJiwLklBmzf4sjO+gngjeMbCWKxWQinTyFtUrb4HCDeEpWphZ5sOjRBAYQqbdLJx3blj1ZBiNhXXeuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627343; c=relaxed/simple; bh=612r3AG72QRyYEjk5fbNd5SB1mpMpgIAzo+3/vrc600=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mXJpmLViFa3rcMf/VsunTCa55qZPIPkVHrD+eCTFnlTuHP53ilfgJLWNJC3pBC41wLgKWL6irg3sytX3MDe7CV+8pwNBzV3Iojq2EEnNz9Fh7/0T8J48npxIqogGfgpm1XEQ5oUhVDH1+jixReSzwToLeOZTTgCbKWNo+xLu8M0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=R1QVjBNO; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="R1QVjBNO" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yW0a7NecQZu8tgs68hPXWQu1JjvNLTiVMw9Gd5E5ZSk=; b=R1QVjBNObzrVZoAzzhS18ns7eQ/nfN83ZZsTluCtR6BUhNdVarBCKu+fVJz+IFNWbxPgbx mscmDr+wGMchsOyEpm3ro/TjSWACBQEWMPfp2fsOhS5GvH1p5IaNCeyFAl+XEza+xnJXPj XlE366aKqAdxlgAGcB/I4x8qdgLb2wk= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:27 -0700 Subject: [PATCH v2 1/6] dt-bindings: vendor-prefixes: Add Sensylink 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 Message-Id: <20260721-ctl2301-v2-1-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=841; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=612r3AG72QRyYEjk5fbNd5SB1mpMpgIAzo+3/vrc600=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDvkvkq8plZgnyf9e8OZEu6zaDOZXLhe/h6jLzbtns 1/kfvm+jlIWBjEuBlkxRZbuBzzbCnyibAsECn1h5rAygQxh4OIUgImcu83IsEFLrD5uYQD/h5ts 195rfLCLfOnwunTugjb3MxsfSaTZdjMynJR8//lJQO3LS4/sGLQ07K/M4vyt29fAt6Qmw/klY2c iAwA= X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT Add the vendor prefix for Sensylink Microelectronics. Signed-off-by: Troy Mitchell --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Docum= entation/devicetree/bindings/vendor-prefixes.yaml index 396044f368e7..22d0d26f1bbd 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -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,.*": --=20 2.55.0 From nobody Sat Jul 25 00:54:25 2026 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 7FB78446076 for ; Tue, 21 Jul 2026 09:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627369; cv=none; b=LwFjOVy2vLEQghYFz7YUtH+d3x/d6Ciq68/MayPWqLft8eWkpAac9l7xIuObAM+oZ6es+mCPPakf24yo9iR+jhmYVK8f5yoq/5KH5A5q+zKvEShRVzNA3I9mT8aesAK3Q/qA/gOJ5BUsj8+dvszKwLBW8AFeXbyFwI4DYUzpF4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627369; c=relaxed/simple; bh=pwHdc4xDidEyHRzJlxAAc+R3pcovIEipUYbPKrufAeo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e6NUoRdXj9idGVDU1KQsM5/dIdt0aFJbQ+ETtTunJxEYJQWCQ8iDcNPhn330FPUG35R1JlCOSoW8RG3dz8CTMsBRgEBYK7IHIKckfxLy6S1GSlQHKXInAAUXHZil/FG0s/qDjQ//s1kjpGCGkOA+naFvzGdmmS4lihwjKzM+WLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=pyvXEh1+; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="pyvXEh1+" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ecIDF5Sj0XPmZVRlQb90B073F56+xkmiRBC5iOSs/nA=; b=pyvXEh1+tlrCfD2VnkLJbAfteZBLn39pr99L6lmszmLHtinreRBBDArdcZjgYuZNHkqqTE NO06fqccFmNerAHyLk3wU59+aNwIFPzgxJMOhNjhOYlGT2GHz0tV1IotTaARQ58wOcxmQw ms+t+HrO5tZn9D5Xuz1CO7xThthOGTE= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:28 -0700 Subject: [PATCH v2 2/6] dt-bindings: hwmon: Move LM63 family to a dedicated binding 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 Message-Id: <20260721-ctl2301-v2-2-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=2985; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=pwHdc4xDidEyHRzJlxAAc+R3pcovIEipUYbPKrufAeo=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDoUK8sesD0n7ZXzec1bwxBm2mQ8fLFnsdtdQUvluj unMVdGVHaUsDGJcDLJiiizdD3i2FfhE2RYIFPrCzGFlAhnCwMUpABPJ+MXw3/dd99plMv+ar02Z xXJCaOI7z6030o5MMHPbffrIBanstd6MDF21YTs+PHZ1Xmlxc2XD4rlac35PXPAi1V96FZuU9aO pDhwA X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT 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. Signed-off-by: Troy Mitchell --- .../devicetree/bindings/hwmon/national,lm63.yaml | 50 ++++++++++++++++++= ++++ .../devicetree/bindings/trivial-devices.yaml | 6 --- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm63.yaml b/D= ocumentation/devicetree/bindings/hwmon/national,lm63.yaml new file mode 100644 index 000000000000..92b0094ff303 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/national,lm63.yaml @@ -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 + +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 =3D <1>; + #size-cells =3D <0>; + + temperature-sensor@4c { + compatible =3D "national,lm63"; + reg =3D <0x4c>; + #cooling-cells =3D <2>; + }; + }; diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Docum= entation/devicetree/bindings/trivial-devices.yaml index 435c4baab436..aa62d245464c 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -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 Hardw= are Monitor - national,lm80 # Serial Interface ACPI-Compatible Microprocessor System Hardw= are Monitor --=20 2.55.0 From nobody Sat Jul 25 00:54:25 2026 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 A71B8446BF2 for ; Tue, 21 Jul 2026 09:49:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627376; cv=none; b=SWSk5ncyG98dDtdo2VGZdLxGT49790htCP1xMTnbcbRVkv4fuWiLzjKe5yZgXk9muJseUSgAEk/bIbD5C6r1qHsSlCLih6FtJOfDd7vC7ROKdsd91jeGFEFV1dT+Fb5vNG37PZcQ/Xy2u2pfMG1jMxYIe3uaZkyXWIcB1+ry0UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627376; c=relaxed/simple; bh=7P27P6ju6I4cnl3ul9wP1C3dtnMbhkQQdst2PiSJx64=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XXvPkeapfpFoeKuMXVPcGZ4E1KerGlMeqyy895qeE3B573bB3ASt95hmgvmDj1UDYG+YL1MAP9CP2spTIBR4cfsiOLpbR1xZQoIHoqr1VIofUKEYx9l688J0TQ9ZzIKZJfjz7bt0KPZSEOSx0FvUzaoScODqm8a/CNtVbZWTP0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nHkbTD2y; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nHkbTD2y" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=To+PeiUG1xpdz90ubRrVLr6OYAbpZVaZf3etlt4FW6o=; b=nHkbTD2y4qxyLqzmCsPzQKVkVxQH8OooIcqvjSmfpd7sPykTdb2nkNPjavfMmP6oKqKOB5 t5XdXzIdARhkRiVek8gW7rXFQ4RwYq/FkTbrrGsjQ29HNxSty84QhA25KfK8CYpNxYAKKN FUjrnEH8uP4yitH+skso+ks8vshMDrc= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:29 -0700 Subject: [PATCH v2 3/6] dt-bindings: hwmon: Add Sensylink CTF2301 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 Message-Id: <20260721-ctl2301-v2-3-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1267; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=7P27P6ju6I4cnl3ul9wP1C3dtnMbhkQQdst2PiSJx64=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDkW/LVOnezR3rU9KvbKyaqqC0b9PtUtOWe75IBnye 79yQGVHRykLgxgXg6yYIkv3A55tBT5RtgUChb4wc1iZQIYwcHEKwESeKTL8r1zSvyLAcU53Ue1b CSFG7mgv5cMbvM0m9Ncb9lzfsPNqFMN/zxrbBedyxPlCH3NtfaHHNkd1gUVGnOPpwIPLJzSdVVN lAgA= X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT 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. Signed-off-by: Troy Mitchell --- Documentation/devicetree/bindings/hwmon/national,lm63.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/hwmon/national,lm63.yaml b/D= ocumentation/devicetree/bindings/hwmon/national,lm63.yaml index 92b0094ff303..4a1ffebfdbef 100644 --- a/Documentation/devicetree/bindings/hwmon/national,lm63.yaml +++ b/Documentation/devicetree/bindings/hwmon/national,lm63.yaml @@ -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. =20 allOf: - $ref: hwmon-common.yaml# @@ -23,6 +24,7 @@ properties: - national,lm63 - national,lm64 - national,lm96163 + - sensylink,ctf2301 =20 reg: maxItems: 1 --=20 2.55.0 From nobody Sat Jul 25 00:54:25 2026 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 AE615446BFA for ; Tue, 21 Jul 2026 09:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627385; cv=none; b=JJvKD3kIAXQ0bebozXEaNUwfpkTHCxVTCKkcaG/C2bKI4byo0/6D+/j3CGg/O23fUAGRTFbFIeQUY22Iq1RZlP3L7ccioETwHe7AISFzlPxU0+Si9OnnNigP2VxUZdKfV8tGYnjQZk2LHDNSCO7PQS+DjFLCEYlm3NpRReqi/ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627385; c=relaxed/simple; bh=CozGFCkyI4qr8wDw5Rq2LJfB8pM8qX1wqf+57AGDziM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y1DNtz9YdRk71jiMcSmSiDuEKLt5eyVsQR9rpiIwHeCm0RJJyTD4P/MlaUp6ilhMMHjZPzkWpvuPsd5OC2Tz+LYWvFF3CrN4m2YV5IrYjyIZ4r4rJ45/uVIW1p1/B6Z+0ZCDqj+Sy2vA0r7p7b3+qmMCYzNNt8k/dQwkf1m7PjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ndlHhdQ1; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ndlHhdQ1" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h1c2KjxanP9oPt1/Dztdjsw6kVpMrOdEQG/Hy1Iedwc=; b=ndlHhdQ12k1Sxl16hrcil+odnSvw0P0wkjTByEd8Dz0frF/Fh8BTgMnExDd9xxxnGdrFEv CUzTSUcCQ81Qe7C8D+Unk54y8CCGTT6IlGoaLv970zfNboxDJDjDxzLh1PQCtbM43DyaUF lOsWqH4myhaomcAR7XgSv4W6OchRZpM= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:30 -0700 Subject: [PATCH v2 4/6] hwmon: (lm63) Add Sensylink CTF2301 support 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 Message-Id: <20260721-ctl2301-v2-4-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org, Jean Delvare X-Developer-Signature: v=1; a=openpgp-sha256; l=24939; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=CozGFCkyI4qr8wDw5Rq2LJfB8pM8qX1wqf+57AGDziM=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDsWZqZf6HR3rLnmo8WrriR83be76EXpMc3ey6bFMy d2Cuj0dpSwMYlwMsmKKLN0PeLYV+ETZFggU+sLMYWUCGcLAxSkAE5n9leF/hZc+4+97/9IPnMoL jHIIX2mrvz9x9by/D77aZUuXlGnvZ2T49uW78s8kp1dsk+fPusHVqBy65dSFgjLGF5HCHdd3/OX mBgA= X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT 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. Signed-off-by: Troy Mitchell --- Documentation/hwmon/lm63.rst | 22 +++ drivers/hwmon/Kconfig | 8 +- drivers/hwmon/lm63.c | 393 +++++++++++++++++++++++++++++++++++----= ---- 3 files changed, 349 insertions(+), 74 deletions(-) diff --git a/Documentation/hwmon/lm63.rst b/Documentation/hwmon/lm63.rst index 9e27367d7405..c40bd0dfe591 100644 --- a/Documentation/hwmon/lm63.rst +++ b/Documentation/hwmon/lm63.rst @@ -33,6 +33,16 @@ Supported chips: =20 http://www.national.com/pf/LM/LM96163.html =20 + * Sensylink CTF2301 + + Prefix: 'ctf2301' + + Addresses scanned: none + + Datasheet: https://www.sensylink.com/upload/1/net.sensylink.portal/168= 9557281035.pdf + + Register description: https://github.com/TroyMitchell911/ctf2301-datas= heet + =20 Author: Jean Delvare =20 @@ -62,6 +72,8 @@ value have to be masked out. The value is still 16 bit in= width. =20 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. =20 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 accur= acy and better PWM resolution. For LM96163, the external temperature sensor ty= pe 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 config= ured +for a 22.5 kHz PWM frequency. + +Device tree nodes may declare ``#cooling-cells`` to register the fan contr= oller +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 ma= nual +fan control mode during probe and switches to manual control when the ther= mal +framework first requests a cooling state. diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 2bfbcc033d59..abb1af8664fb 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -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. =20 This driver can also be built as a module. If so, the module will be called lm63. diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index e2a429e579ac..764a7467afa6 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c @@ -35,13 +35,14 @@ #include #include #include +#include #include =20 /* * Addresses to scan * Address is fully defined internally and cannot be changed except for * LM64 which has one pin dedicated to address selection. - * LM63 and LM96163 have address 0x4c. + * LM63, LM96163, and CTF2301 have address 0x4c. * LM64 can have address 0x18 or 0x4e. */ =20 @@ -70,6 +71,9 @@ static const unsigned short normal_i2c[] =3D { 0x18, 0x4c= , 0x4e, I2C_CLIENT_END }; #define LM63_REG_LOCAL_TEMP 0x00 #define LM63_REG_LOCAL_HIGH 0x05 =20 +#define CTF2301_REG_LOCAL_TEMP_LSB 0x15 +#define CTF2301_REG_LOCAL_HIGH_LSB 0x06 + #define LM63_REG_REMOTE_TEMP_MSB 0x01 #define LM63_REG_REMOTE_TEMP_LSB 0x10 #define LM63_REG_REMOTE_OFFSET_MSB 0x11 @@ -94,6 +98,7 @@ static const unsigned short normal_i2c[] =3D { 0x18, 0x4c= , 0x4e, I2C_CLIENT_END }; =20 #define LM63_PWM_BASE_FAST_HZ 180000 #define LM63_PWM_BASE_SLOW_HZ 700 +#define LM63_MAX_PWM 255 =20 #define LM63_MAX_CONVRATE 9 =20 @@ -121,6 +126,9 @@ static const unsigned short normal_i2c[] =3D { 0x18, 0x= 4c, 0x4e, I2C_CLIENT_END }; 127000), 1000) #define TEMP8U_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, \ 255000), 1000) +#define TEMP12_FROM_REG(reg) DIV_ROUND_CLOSEST((s16)(reg) * 1000, 256) +#define TEMP12_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ + 127937) * 256, 1000) #define TEMP11_FROM_REG(reg) ((reg) / 32 * 125) #define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ 127875), 125) * 32) @@ -132,7 +140,11 @@ static const unsigned short normal_i2c[] =3D { 0x18, 0= x4c, 0x4e, I2C_CLIENT_END }; #define UPDATE_INTERVAL(max, rate) \ ((1000 << (LM63_MAX_CONVRATE - (rate))) / (max)) =20 -enum chips { lm63, lm64, lm96163 }; +enum chips { lm63, lm64, lm96163, ctf2301 }; + +static const unsigned int ctf2301_update_intervals[] =3D { + 20000, 10000, 4902, 2463, 1000, 615, 307, 154, 107 +}; =20 /* * Client data (each client gets its own) @@ -164,6 +176,8 @@ struct lm63_data { 1: local high limit 2: remote critical limit 3-14: lookup table */ + s16 temp1_input; /* local input for chips with extended resolution */ + s16 temp1_max; /* local limit for chips with extended resolution */ s16 temp11[4]; /* 0: remote input 1: remote low limit 2: remote high limit @@ -256,8 +270,16 @@ static struct lm63_data *lm63_update_device(struct dev= ice *dev) =20 data->temp8[0] =3D i2c_smbus_read_byte_data(client, LM63_REG_LOCAL_TEMP); + if (data->kind =3D=3D ctf2301) + data->temp1_input =3D ((u16)(u8)data->temp8[0] << 8) + | i2c_smbus_read_byte_data(client, + CTF2301_REG_LOCAL_TEMP_LSB); data->temp8[1] =3D i2c_smbus_read_byte_data(client, LM63_REG_LOCAL_HIGH); + if (data->kind =3D=3D ctf2301) + data->temp1_max =3D ((u16)(u8)data->temp8[1] << 8) + | i2c_smbus_read_byte_data(client, + CTF2301_REG_LOCAL_HIGH_LSB); =20 /* order matters for temp2_input */ data->temp11[0] =3D i2c_smbus_read_byte_data(client, @@ -277,7 +299,7 @@ static struct lm63_data *lm63_update_device(struct devi= ce *dev) | i2c_smbus_read_byte_data(client, LM63_REG_REMOTE_OFFSET_LSB); =20 - if (data->kind =3D=3D lm96163) + if (data->kind =3D=3D lm96163 || data->kind =3D=3D ctf2301) data->temp11u =3D (i2c_smbus_read_byte_data(client, LM96163_REG_REMOTE_TEMP_U_MSB) << 8) | i2c_smbus_read_byte_data(client, @@ -367,6 +389,41 @@ static ssize_t set_fan(struct device *dev, struct devi= ce_attribute *dummy, return count; } =20 +static int lm63_pwm_from_reg(struct lm63_data *data, u8 reg) +{ + if (data->pwm_highres) + return reg; + + return reg >=3D 2 * data->pwm1_freq ? + LM63_MAX_PWM : + (reg * LM63_MAX_PWM + data->pwm1_freq) / (2 * data->pwm1_freq); +} + +static u8 lm63_pwm_to_reg(struct lm63_data *data, unsigned long val) +{ + val =3D clamp_val(val, 0, LM63_MAX_PWM); + + if (data->pwm_highres) + return val; + + return (val * data->pwm1_freq * 2 + LM63_MAX_PWM / 2) / LM63_MAX_PWM; +} + +static int lm63_write_pwm(struct lm63_data *data, int nr, unsigned long va= l) +{ + struct i2c_client *client =3D data->client; + u8 reg =3D nr ? LM63_REG_LUT_PWM(nr - 1) : LM63_REG_PWM_VALUE; + u8 regval =3D lm63_pwm_to_reg(data, val); + int ret; + + ret =3D i2c_smbus_write_byte_data(client, reg, regval); + if (ret) + return ret; + data->pwm1[nr] =3D regval; + + return 0; +} + static ssize_t show_pwm1(struct device *dev, struct device_attribute *deva= ttr, char *buf) { @@ -376,12 +433,7 @@ static ssize_t show_pwm1(struct device *dev, struct de= vice_attribute *devattr, int pwm; =20 mutex_lock(&data->update_lock); - if (data->pwm_highres) - pwm =3D data->pwm1[nr]; - else - pwm =3D data->pwm1[nr] >=3D 2 * data->pwm1_freq ? - 255 : (data->pwm1[nr] * 255 + data->pwm1_freq) / - (2 * data->pwm1_freq); + pwm =3D lm63_pwm_from_reg(data, data->pwm1[nr]); mutex_unlock(&data->update_lock); =20 return sprintf(buf, "%d\n", pwm); @@ -392,11 +444,9 @@ static ssize_t set_pwm1(struct device *dev, struct dev= ice_attribute *devattr, { struct sensor_device_attribute *attr =3D to_sensor_dev_attr(devattr); struct lm63_data *data =3D dev_get_drvdata(dev); - struct i2c_client *client =3D data->client; int nr =3D attr->index; unsigned long val; int err; - u8 reg; =20 if (!(data->config_fan & 0x20)) /* register is read-only */ return -EPERM; @@ -405,15 +455,11 @@ static ssize_t set_pwm1(struct device *dev, struct de= vice_attribute *devattr, if (err) return err; =20 - reg =3D nr ? LM63_REG_LUT_PWM(nr - 1) : LM63_REG_PWM_VALUE; - val =3D clamp_val(val, 0, 255); - mutex_lock(&data->update_lock); - data->pwm1[nr] =3D data->pwm_highres ? val : - (val * data->pwm1_freq * 2 + 127) / 255; - i2c_smbus_write_byte_data(client, reg, data->pwm1[nr]); + err =3D lm63_write_pwm(data, nr, val); mutex_unlock(&data->update_lock); - return count; + + return err ? err : count; } =20 static ssize_t pwm1_enable_show(struct device *dev, @@ -486,7 +532,9 @@ static ssize_t pwm1_freq_store(struct device *dev, struct lm63_data *data =3D dev_get_drvdata(dev); struct i2c_client *client =3D data->client; unsigned long val, pfr_fast, pfr_slow, err_fast, err_slow, pfr; + u8 config_fan; bool slow_clock; + int config_enhanced =3D 0; int ret; =20 ret =3D kstrtoul(buf, 10, &val); @@ -512,35 +560,55 @@ static ssize_t pwm1_freq_store(struct device *dev, =20 mutex_lock(&data->update_lock); ret =3D i2c_smbus_read_byte_data(client, LM63_REG_CONFIG_FAN); - if (ret < 0) { - mutex_unlock(&data->update_lock); - return ret; - } - data->config_fan =3D ret; + if (ret < 0) + goto unlock; + config_fan =3D ret; =20 - if (!(data->config_fan & 0x20)) { /* register is read-only */ - mutex_unlock(&data->update_lock); - return -EPERM; + if (!(config_fan & 0x20)) { /* register is read-only */ + ret =3D -EPERM; + goto unlock; } =20 - if (data->kind =3D=3D lm96163) { - ret =3D i2c_smbus_read_byte_data(client, LM96163_REG_CONFIG_ENHANCED); - if (ret < 0) { - mutex_unlock(&data->update_lock); - return ret; + if (data->kind =3D=3D lm96163 || data->kind =3D=3D ctf2301) { + ret =3D i2c_smbus_read_byte_data(client, + LM96163_REG_CONFIG_ENHANCED); + if (ret < 0) + goto unlock; + config_enhanced =3D ret; + + if (data->kind =3D=3D ctf2301) { + if (!slow_clock && pfr =3D=3D 8) + config_enhanced |=3D 0x10; + else + config_enhanced &=3D ~0x10; + ret =3D i2c_smbus_write_byte_data(client, + LM96163_REG_CONFIG_ENHANCED, + config_enhanced); + if (ret) + goto unlock; } - data->pwm_highres =3D !slow_clock && pfr =3D=3D 8 && (ret & 0x10); } =20 if (slow_clock) - data->config_fan |=3D 0x08; + config_fan |=3D 0x08; else - data->config_fan &=3D ~0x08; - i2c_smbus_write_byte_data(client, LM63_REG_CONFIG_FAN, data->config_fan); - i2c_smbus_write_byte_data(client, LM63_REG_PWM_FREQ, pfr); + config_fan &=3D ~0x08; + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_PWM_FREQ, pfr); + if (ret) + goto unlock; + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_CONFIG_FAN, + config_fan); + if (ret) + goto unlock; + + data->config_fan =3D config_fan; data->pwm1_freq =3D pfr; + data->pwm_highres =3D !slow_clock && pfr =3D=3D 8 && + (config_enhanced & 0x10); +unlock: mutex_unlock(&data->update_lock); - return count; + + return ret ? ret : count; } =20 /* @@ -555,6 +623,11 @@ static ssize_t show_local_temp8(struct device *dev, { struct sensor_device_attribute *attr =3D to_sensor_dev_attr(devattr); struct lm63_data *data =3D lm63_update_device(dev); + + if (data->kind =3D=3D ctf2301) + return sprintf(buf, "%d\n", TEMP12_FROM_REG(attr->index ? + data->temp1_max : data->temp1_input)); + return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp8[attr->index])); } =20 @@ -595,6 +668,23 @@ static ssize_t set_temp8(struct device *dev, struct de= vice_attribute *devattr, return err; =20 mutex_lock(&data->update_lock); + if (data->kind =3D=3D ctf2301 && nr =3D=3D 1) { + temp =3D TEMP12_TO_REG(val); + err =3D i2c_smbus_write_byte_data(client, LM63_REG_LOCAL_HIGH, + temp >> 8); + if (!err) + err =3D i2c_smbus_write_byte_data(client, + CTF2301_REG_LOCAL_HIGH_LSB, + temp & 0xf0); + if (!err) { + data->temp8[nr] =3D temp >> 8; + data->temp1_max =3D temp; + } + mutex_unlock(&data->update_lock); + + return err ? err : count; + } + switch (nr) { case 2: reg =3D LM63_REG_REMOTE_TCRIT; @@ -611,10 +701,12 @@ static ssize_t set_temp8(struct device *dev, struct d= evice_attribute *devattr, reg =3D LM63_REG_LUT_TEMP(nr - 3); temp =3D lut_temp_to_reg(data, val); } - data->temp8[nr] =3D temp; - i2c_smbus_write_byte_data(client, reg, temp); + err =3D i2c_smbus_write_byte_data(client, reg, temp); + if (!err) + data->temp8[nr] =3D temp; mutex_unlock(&data->update_lock); - return count; + + return err ? err : count; } =20 static ssize_t show_temp11(struct device *dev, struct device_attribute *de= vattr, @@ -788,11 +880,40 @@ static ssize_t temp2_crit_hyst_store(struct device *d= ev, * Set conversion rate. * client->update_lock must be held when calling this function. */ -static void lm63_set_convrate(struct lm63_data *data, unsigned int interva= l) +static unsigned int lm63_update_interval(struct lm63_data *data, u8 rate) +{ + if (data->kind =3D=3D ctf2301) + return ctf2301_update_intervals[min_t(unsigned int, rate, + ARRAY_SIZE(ctf2301_update_intervals) - 1)]; + + return UPDATE_INTERVAL(data->max_convrate_hz, rate); +} + +static int lm63_set_convrate(struct lm63_data *data, unsigned int interval) { struct i2c_client *client =3D data->client; - unsigned int update_interval; - int i; + unsigned int update_interval, error, best_error =3D ~0U; + unsigned int best =3D 0; + unsigned int i; + int ret; + + if (data->kind =3D=3D ctf2301) { + for (i =3D 0; i < ARRAY_SIZE(ctf2301_update_intervals); i++) { + error =3D abs_diff(interval, ctf2301_update_intervals[i]); + if (error < best_error) { + best_error =3D error; + best =3D i; + } + } + + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_CONVRATE, + best); + if (ret) + return ret; + data->update_interval =3D ctf2301_update_intervals[best]; + + return 0; + } =20 /* Shift calculations to avoid rounding errors */ interval <<=3D 6; @@ -804,8 +925,12 @@ static void lm63_set_convrate(struct lm63_data *data, = unsigned int interval) if (interval >=3D update_interval * 3 / 4) break; =20 - i2c_smbus_write_byte_data(client, LM63_REG_CONVRATE, i); + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_CONVRATE, i); + if (ret) + return ret; data->update_interval =3D UPDATE_INTERVAL(data->max_convrate_hz, i); + + return 0; } =20 static ssize_t update_interval_show(struct device *dev, @@ -829,10 +954,10 @@ static ssize_t update_interval_store(struct device *d= ev, return err; =20 mutex_lock(&data->update_lock); - lm63_set_convrate(data, clamp_val(val, 0, 100000)); + err =3D lm63_set_convrate(data, clamp_val(val, 0, 100000)); mutex_unlock(&data->update_lock); =20 - return count; + return err ? err : count; } =20 static ssize_t temp2_type_show(struct device *dev, @@ -997,6 +1122,75 @@ static DEVICE_ATTR_RO(alarms); =20 static DEVICE_ATTR_RW(update_interval); =20 +static int lm63_get_max_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + *state =3D LM63_MAX_PWM; + + return 0; +} + +static int lm63_get_cur_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct lm63_data *data =3D cdev->devdata; + int ret; + + mutex_lock(&data->update_lock); + ret =3D i2c_smbus_read_byte_data(data->client, LM63_REG_PWM_VALUE); + if (ret < 0) + goto unlock; + + data->pwm1[0] =3D ret; + *state =3D lm63_pwm_from_reg(data, data->pwm1[0]); +unlock: + mutex_unlock(&data->update_lock); + + return ret < 0 ? ret : 0; +} + +static int lm63_set_cur_state(struct thermal_cooling_device *cdev, + unsigned long state) +{ + struct lm63_data *data =3D cdev->devdata; + int config_fan; + int ret; + + if (state > LM63_MAX_PWM) + return -EINVAL; + + mutex_lock(&data->update_lock); + config_fan =3D i2c_smbus_read_byte_data(data->client, + LM63_REG_CONFIG_FAN); + if (config_fan < 0) { + ret =3D config_fan; + goto unlock; + } + data->config_fan =3D config_fan; + + if (!(config_fan & 0x20)) { + config_fan |=3D 0x20; + ret =3D i2c_smbus_write_byte_data(data->client, + LM63_REG_CONFIG_FAN, + config_fan); + if (ret) + goto unlock; + data->config_fan =3D config_fan; + } + + ret =3D lm63_write_pwm(data, 0, state); +unlock: + mutex_unlock(&data->update_lock); + + return ret; +} + +static const struct thermal_cooling_device_ops lm63_cooling_ops =3D { + .get_max_state =3D lm63_get_max_state, + .get_cur_state =3D lm63_get_cur_state, + .set_cur_state =3D lm63_set_cur_state, +}; + static struct attribute *lm63_attributes[] =3D { &sensor_dev_attr_pwm1.dev_attr.attr, &dev_attr_pwm1_enable.attr, @@ -1079,8 +1273,8 @@ static const struct attribute_group lm63_group_extra_= lut =3D { * On LM63, temp2_crit can be set only once, which should be job * of the bootloader. * On LM64, temp2_crit can always be set. - * On LM96163, temp2_crit can be set if bit 1 of the configuration - * register is true. + * On LM96163 and CTF2301, temp2_crit can be set if bit 1 of the + * configuration register is true. */ static umode_t lm63_attribute_mode(struct kobject *kobj, struct attribute *attr, int index) @@ -1090,7 +1284,8 @@ static umode_t lm63_attribute_mode(struct kobject *ko= bj, =20 if (attr =3D=3D &sensor_dev_attr_temp2_crit.dev_attr.attr && (data->kind =3D=3D lm64 || - (data->kind =3D=3D lm96163 && (data->config & 0x02)))) + ((data->kind =3D=3D lm96163 || data->kind =3D=3D ctf2301) && + (data->config & 0x02)))) return attr->mode | S_IWUSR; =20 return attr->mode; @@ -1165,29 +1360,48 @@ static int lm63_detect(struct i2c_client *client, * Ideally we shouldn't have to initialize anything, since the BIOS * should have taken care of everything */ -static void lm63_init_client(struct lm63_data *data) +static int lm63_init_client(struct lm63_data *data) { struct i2c_client *client =3D data->client; struct device *dev =3D &client->dev; u8 convrate; + int ret; =20 - data->config =3D i2c_smbus_read_byte_data(client, LM63_REG_CONFIG1); - data->config_fan =3D i2c_smbus_read_byte_data(client, - LM63_REG_CONFIG_FAN); + ret =3D i2c_smbus_read_byte_data(client, LM63_REG_CONFIG1); + if (ret < 0) + return ret; + data->config =3D ret; + ret =3D i2c_smbus_read_byte_data(client, LM63_REG_CONFIG_FAN); + if (ret < 0) + return ret; + data->config_fan =3D ret; =20 /* Start converting if needed */ if (data->config & 0x40) { /* standby */ dev_dbg(dev, "Switching to operational mode\n"); data->config &=3D 0xA7; - i2c_smbus_write_byte_data(client, LM63_REG_CONFIG1, - data->config); + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_CONFIG1, + data->config); + if (ret) + return ret; } /* Tachometer is always enabled on LM64 */ if (data->kind =3D=3D lm64) data->config |=3D 0x04; + if (data->kind =3D=3D ctf2301 && !client->irq && !(data->config & 0x04)) { + dev_dbg(dev, "Configuring ALERT/TACH pin for tachometer input\n"); + data->config |=3D 0x04; + ret =3D i2c_smbus_write_byte_data(client, LM63_REG_CONFIG1, + data->config); + if (ret) + return ret; + } =20 /* We may need pwm1_freq before ever updating the client data */ - data->pwm1_freq =3D i2c_smbus_read_byte_data(client, LM63_REG_PWM_FREQ); + ret =3D i2c_smbus_read_byte_data(client, LM63_REG_PWM_FREQ); + if (ret < 0) + return ret; + data->pwm1_freq =3D ret; if (data->pwm1_freq =3D=3D 0) data->pwm1_freq =3D 1; =20 @@ -1200,25 +1414,38 @@ static void lm63_init_client(struct lm63_data *data) case lm96163: data->max_convrate_hz =3D LM96163_MAX_CONVRATE_HZ; data->lut_size =3D 12; - data->trutherm - =3D i2c_smbus_read_byte_data(client, - LM96163_REG_TRUTHERM) & 0x02; + ret =3D i2c_smbus_read_byte_data(client, LM96163_REG_TRUTHERM); + if (ret < 0) + return ret; + data->trutherm =3D ret & 0x02; + break; + case ctf2301: + data->lut_size =3D 12; break; } - convrate =3D i2c_smbus_read_byte_data(client, LM63_REG_CONVRATE); - if (unlikely(convrate > LM63_MAX_CONVRATE)) + ret =3D i2c_smbus_read_byte_data(client, LM63_REG_CONVRATE); + if (ret < 0) + return ret; + convrate =3D ret; + if (data->kind =3D=3D ctf2301 && + convrate >=3D ARRAY_SIZE(ctf2301_update_intervals)) + convrate =3D ARRAY_SIZE(ctf2301_update_intervals) - 1; + else if (unlikely(convrate > LM63_MAX_CONVRATE)) convrate =3D LM63_MAX_CONVRATE; - data->update_interval =3D UPDATE_INTERVAL(data->max_convrate_hz, - convrate); + data->update_interval =3D lm63_update_interval(data, convrate); =20 /* - * For LM96163, check if high resolution PWM + * For LM96163 and CTF2301, check if high resolution PWM * and unsigned temperature format is enabled. */ - if (data->kind =3D=3D lm96163) { - u8 config_enhanced - =3D i2c_smbus_read_byte_data(client, - LM96163_REG_CONFIG_ENHANCED); + if (data->kind =3D=3D lm96163 || data->kind =3D=3D ctf2301) { + u8 config_enhanced; + + ret =3D i2c_smbus_read_byte_data(client, + LM96163_REG_CONFIG_ENHANCED); + if (ret < 0) + return ret; + config_enhanced =3D ret; if (config_enhanced & 0x20) data->lut_temp_highres =3D true; if ((config_enhanced & 0x10) @@ -1239,6 +1466,8 @@ static void lm63_init_client(struct lm63_data *data) dev_dbg(dev, "PWM output active %s, %s mode\n", (data->config_fan & 0x10) ? "low" : "high", (data->config_fan & 0x20) ? "manual" : "auto"); + + return 0; } =20 static const struct i2c_device_id lm63_id[]; @@ -1246,9 +1475,11 @@ static const struct i2c_device_id lm63_id[]; static int lm63_probe(struct i2c_client *client) { struct device *dev =3D &client->dev; + struct thermal_cooling_device *cdev; struct device *hwmon_dev; struct lm63_data *data; int groups =3D 0; + int ret; =20 data =3D devm_kzalloc(dev, sizeof(struct lm63_data), GFP_KERNEL); if (!data) @@ -1263,7 +1494,9 @@ static int lm63_probe(struct i2c_client *client) data->temp2_offset =3D 16000; =20 /* Initialize chip */ - lm63_init_client(data); + ret =3D lm63_init_client(data); + if (ret) + return dev_err_probe(dev, ret, "failed to initialize device\n"); =20 /* Register sysfs hooks */ data->groups[groups++] =3D &lm63_group; @@ -1273,11 +1506,26 @@ static int lm63_probe(struct i2c_client *client) if (data->kind =3D=3D lm96163) { data->groups[groups++] =3D &lm63_group_temp2_type; data->groups[groups++] =3D &lm63_group_extra_lut; + } else if (data->kind =3D=3D ctf2301) { + data->groups[groups++] =3D &lm63_group_extra_lut; } =20 hwmon_dev =3D devm_hwmon_device_register_with_groups(dev, client->name, data, data->groups); - return PTR_ERR_OR_ZERO(hwmon_dev); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + if (IS_ENABLED(CONFIG_THERMAL_OF) && + of_property_present(dev->of_node, "#cooling-cells")) { + cdev =3D devm_thermal_of_cooling_device_register(dev, 0, + client->name, + data, + &lm63_cooling_ops); + if (IS_ERR(cdev)) + return PTR_ERR(cdev); + } + + return 0; } =20 /* @@ -1288,6 +1536,7 @@ static const struct i2c_device_id lm63_id[] =3D { { .name =3D "lm63", .driver_data =3D lm63 }, { .name =3D "lm64", .driver_data =3D lm64 }, { .name =3D "lm96163", .driver_data =3D lm96163 }, + { .name =3D "ctf2301", .driver_data =3D ctf2301 }, { } }; MODULE_DEVICE_TABLE(i2c, lm63_id); @@ -1305,6 +1554,10 @@ static const struct of_device_id __maybe_unused lm63= _of_match[] =3D { .compatible =3D "national,lm96163", .data =3D (void *)lm96163 }, + { + .compatible =3D "sensylink,ctf2301", + .data =3D (void *)ctf2301 + }, { }, }; MODULE_DEVICE_TABLE(of, lm63_of_match); --=20 2.55.0 From nobody Sat Jul 25 00:54:25 2026 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 D0556446BFF for ; Tue, 21 Jul 2026 09:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627402; cv=none; b=GgWaaauNah1sYdYcG1uCbD50cOld16RBmlVftIFj/WAAf2xmwYtbeL9qwHBYo5FTZizA6l37hq+3iQ4ZAPXA1OxJI5vkM1dG+mGF9WEVCBdmi/mGfx79Atl+60MF/rrjEP31xX4G0C3Xv7ucS+OIx3CJwuqeNhuAMpwgcV9l25w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627402; c=relaxed/simple; bh=7uMF/zan9gnF7cZMHx9exe4LLPPvRgc33P/RP9t39e0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jHcodWQcTPWiKfpImohOkDkITcl1ZNHTt+aExVKVa0TTMIInWatnRljaD3ftZ3AsiNC9ozXnzpHEltPU4foGdxpGBTLYHKHpi0ssSvp3VPc310uaoB0kxteAIWTrLy52lmV8Lzlf52yw2ipn8pSeB9a0l7AYjnw8l2xicq7mvfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OeuoYatB; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OeuoYatB" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uYgDvv/8zUBPOt0Bkan5pLK6f5pZoY2kPjTQUy/vRm4=; b=OeuoYatBX+ioCnxSVS4R6sBmsKaLpqM7WjDK8FzR8/j5Kt+29+c5kshBOf1j8+F4ifvCqZ lY0HCaIytaGZjHhluZYjzhLbIvNoZpmkBlPGIHFUx/JPOLDPBdWRVwKiGYNNv4mpqUE4Jh NvsUldndmot4LxPvgpBsaKcCZTAgtaE= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:31 -0700 Subject: [PATCH v2 5/6] riscv: dts: spacemit: Add K3 I2C6 pinctrl state 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 Message-Id: <20260721-ctl2301-v2-5-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=913; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=7uMF/zan9gnF7cZMHx9exe4LLPPvRgc33P/RP9t39e0=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDqWiHyoN9T7VLE+U33ts00PlQBO+N2Wxyz332nGrc a9d8elVRykLgxgXg6yYIkv3A55tBT5RtgUChb4wc1iZQIYwcHEKwESmb2dkmLeBsSz8+4kE41yL rmPZ246sLnl08YeyX+HU2z6LtWf9n8rI8MEntiN/txV/SdWR/G8CjS6HUm6+5DlmKV7qOduqz6i DCQA= X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT 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. Signed-off-by: Troy Mitchell --- arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi b/arch/riscv/boot= /dts/spacemit/k3-pinctrl.dtsi index 3ee1471f3798..91cd08099e27 100644 --- a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +++ b/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi @@ -78,6 +78,17 @@ gmac1-phy-0-pins { }; }; =20 + /omit-if-no-ref/ + i2c6_1_cfg: i2c6-1-cfg { + i2c6-1-pins { + pinmux =3D , /* i2c6 scl */ + ; /* i2c6 sda */ + + bias-pull-up =3D <0>; + drive-strength =3D <18>; + }; + }; + /omit-if-no-ref/ i2c8_cfg: i2c8-cfg { i2c8-pins { --=20 2.55.0 From nobody Sat Jul 25 00:54:25 2026 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 F36D1446C1F for ; Tue, 21 Jul 2026 09:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627401; cv=none; b=o+ViYKKAL4iIVvilKxg9KIcOTDmiMWy93+VbgIL2j1YiJToV7XbdYdiy9GCkGPsXsBggtse6RYdDyLtO9IsAs6mQHNntpaSNe2xRpU7oQNWfgLhVs/pcbZO/hR2cx2/zS6QTZ24OUIUmQgFYtbPyikEBNkOLtuJcIL+NpocvHn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784627401; c=relaxed/simple; bh=qkSmO+AW5LxoIXLT9GpKbrSpSAJky3A3GfHMGrIZGak=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l/oyKqWUOJIQnEPQGSQagnHBa2K4ZtgEgOSyl59T49ciQHih+kIB0bwz7oILusyYQQX2mXvtluiNQgHsLnolAYfk2xGU/M+tVjzUntoshwqA9euPFJhEIOxvLtwIMYSLnvau7HCOsecYsCMGlkzNA/RZ9/hYMGpEpaSHymLG69Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=R8MqBTQV; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="R8MqBTQV" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784627397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MLkmEy2Qv+au8QUwUsCORU0DDXMr6v1e63PHv69jpg4=; b=R8MqBTQV/VZCzIfaOmSDgHRXhiqrHc3ynsukEZgGcJfd1sqZjb5D8RXUmliHBdvj//vF05 vClkgHYF6FtD49ZCH47V0QfWXgssJ/HRj2b5J6wC0k6BnHnm9PSI9AaznNDWVvtiUbwZQa Cml++9LwzlGZTIlxBG45ALi+u/L6WSs= From: Troy Mitchell Date: Tue, 21 Jul 2026 02:48:32 -0700 Subject: [PATCH v2 6/6] riscv: dts: spacemit: Add CTF2301 on K3 CoM260 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 Message-Id: <20260721-ctl2301-v2-6-ef5fb342872a@linux.dev> References: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> In-Reply-To: <20260721-ctl2301-v2-0-ef5fb342872a@linux.dev> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guenter Roeck , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Jonathan Corbet , Shuah Khan Cc: Troy Mitchell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-doc@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1093; i=troy.mitchell@linux.dev; h=from:subject:message-id; bh=qkSmO+AW5LxoIXLT9GpKbrSpSAJky3A3GfHMGrIZGak=; b=owGbwMvMwCU2g/N9w09jE33G02pJDFnxDmXnMj4uePKr43+v4L+PZxbemrtdYnHV45WfLxRyh 7bVGQpUdZSyMIhxMciKKbJ0P+DZVuATZVsgUOgLM4eVCWQIAxenAExEJJHhn0HspsyvM86rMvC0 6hQv4V1YsSXt1Pm5Hvvkri/8ue6IwTFGhr29HE9XTF/KyjbtdZ/KtojGVfscbr94c3/+vetOH+4 8F+cHAA== X-Developer-Key: i=troy.mitchell@linux.dev; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-Migadu-Flow: FLOW_OUT 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. Signed-off-by: Troy Mitchell --- arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k3-com260.dtsi b/arch/riscv/boot/= dts/spacemit/k3-com260.dtsi index a38d7b738258..95a60fbb411f 100644 --- a/arch/riscv/boot/dts/spacemit/k3-com260.dtsi +++ b/arch/riscv/boot/dts/spacemit/k3-com260.dtsi @@ -26,6 +26,25 @@ reg_5v_sys: regulator-5v-sys { }; }; =20 +&pinctrl { + i2c6-1-cfg { + i2c6-1-pins { + power-source =3D <3300>; + }; + }; +}; + +&i2c6 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&i2c6_1_cfg>; + status =3D "okay"; + + temperature-sensor@4c { + compatible =3D "sensylink,ctf2301"; + reg =3D <0x4c>; + }; +}; + &i2c8 { pinctrl-names =3D "default"; pinctrl-0 =3D <&i2c8_cfg>; --=20 2.55.0