From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793031865; b=J4j7PvIo1Ca1Fp0lzccvwfdLq1uEU1U7qehERjxraU8mqZtkeo75nkCqcEgSRa5U028J ps3qegAOaUKIqQP4elBhskmQHVFamg8to68AIx8pMexchEkvdgP58Y2Zf/VChKdg+pwDa dZrMTyM8M0renG78zZPyOeZVc/c7EcAUIcaZVP8ISTXhdKwYPmqBSg2axJkZrsVvkNCxG kF6O6fKJyxq2zV+30mOEGxAzE5ttb0tXdb4pD3W+XJ9lItzpANxPq9SvzhzooMzBl9/bH kjKmwB1h6Z61OS9K5tIOqotfTJAIjcAmUOplFd9k35jJktQHw8ce6rEGAyGXaXpw3ZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793031865; h=DMARC-Filter:Received:Received:X-Authority-Analysis:DKIM-Signature: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To: References:Content-Language:From:Autocrypt:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-AntiAbuse:X-AntiAbuse:X-AntiAbuse: X-AntiAbuse:X-AntiAbuse:X-BWhitelist:X-Source-IP:X-Source-L:X-Exim-ID: X-Source:X-Source-Args:X-Source-Dir:X-Source-Sender:X-Source-Auth: X-Email-Count:X-Org:X-Source-Cap:X-Local-Domain:X-CMAE-Envelope; bh=DajPTuRGlwcD4J4PQkOl0tYDfpyADr1jZ7qC3/V/b3M=; b=HrpGh8QnJZTA1P/pL81ilddZWr65AmrNC/qFJNByPGH2+FmgeLVf8Pl9jHaX4GH8hk/8 SxIAMq+GWov5s+XEeNYjaya5NR/AwLncN3Yo0E0WCd3iKUnzoyZq3Q4crcAGQFux/x5L0 LPvniO0jQlO+cbVLOYqM1to5U3P/VBGpYAVXS2aYabsqCrGD38bgWu9iHFAKsvB85P/+8 sc3uiv5At65pKVFMT70A/3yUeB61CIPnc1Cnsb8n+2OGmi8Lw+a69BnFZ2cLLAXugSiwG moVwXXsP6hO4/aSPLkCN3vxN+D3enTgN82LheYwla3aqWWiiqy9ffzDixk7oqm+8t6g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=roeck-us.net; spf=fail smtp.mailfrom=roeck-us.net; dkim=pass header.d=roeck-us.net header.i=@roeck-us.net header.a=rsa-sha256 header.s=default header.b=lsNrZREB; arc=none smtp.remote-ip=35.89.44.37 Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5F9E606A31E for ; Mon, 26 Oct 2026 16:24:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D5F9E606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=roeck-us.net header.i=@roeck-us.net header.a=rsa-sha256 header.s=default header.b=lsNrZREB Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id LKqZxsdv5v0ndLNUmxBFSu; Mon, 26 Oct 2026 16:24:24 +0000 Received: from 162-215-252-36.unifiedlayer.com ([208.91.199.152]) by cmsmtp with ESMTPS id LNUlxM0Mx9VGYLNUmxuMBA; Mon, 26 Oct 2026 16:24:24 +0000 X-Authority-Analysis: v=2.4 cv=VrYjA/2n c=1 sm=1 tr=0 ts=6adf7eb8 a=QNED+QcLUkoL9qulTODnwA==:117 a=2cfIYNtKkjgZNaOwnGXpGw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=M0FbrtG7MMAA:10 a=VwQbUJbxAAAA:8 a=iox4zFpeAAAA:8 a=tt6zo4tp7eAlrjPKee4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=WzC6qhA0u3u7Ye7llzcV:22 a=KPbNTLLc3YvdawN95zVk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:To:Subject:MIME-Version:Date:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner: List-Archive; bh=DajPTuRGlwcD4J4PQkOl0tYDfpyADr1jZ7qC3/V/b3M=; b=lsNrZREBaNyV 34I/2MbZZFS63thif2qT+LwMsLC5dLGoqiCLbUJia0eyD7/PVaTnwaZHHWBpIRHUpZ+kP/A9qlsnH LqSVDEQc4PwHDdqZElYdGktKtpvwrnoiWjROMvd4FIMmyEezANBlLwMHzae7YjSJjqa2NJ5umz4wc +NYwr866ZOiDKLpxuf7nDfNXJm6ykgXrQNvHi5lixAMBJC6/MC9cpSZc1vt4cFDy7cGaWf7O/RPLN UDkdRAa2PNjqUHhh3tLciDF5bwZZUKJjwIEzW3utdUXbkZoSkLtEUaSrtcIUnP+M2iPZOOkdGWCNC LOnjiQRDB+ichCBDvYCJDA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:55640) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xLNUh-00000000J3G-11yk; Mon, 26 Oct 2026 21:54:19 +0530 Message-ID: <7df58d42-517c-4936-88b0-9d044d30882c@roeck-us.net> Date: Mon, 26 Oct 2026 09:24:16 -0700 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 0/4] hwmon: Add fan tachometer support for Raspberry Pi RP1 To: Andrea della Porta , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Jonathan Corbet , Shuah Khan , Randy Dunlap , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Ray Jui , Scott Branden , Laurent Pinchart , Gregor Herburger , Stanimir Varbanov , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-pwm@vger.kernel.org, Gary Guo , Christophe JAILLET References: Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5e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6N3HxJpXQ/RY/EX35neH2/F7B RgSloce2+zWfpELyS1qRkCUTt1tlGV2p+y2BPfXzrHn2vxvbhEn1QpQ6t+85FKN8YEhJEygJ F0WaMvQMNrk9UAUziVcUkLU52NS9SXqpVg8vgrO0JKx97IXFPcNh0DWsSj/0Y8HO/RDkGXYn FDMj7fZSPKyPQPmEHg+W/KzxSSfdgWIHF2QaQ0b2q1wOSec4Rti52ohmNSY+KNIW/zODhugJ np3900V20aS7eD9K8GTU0TGC1pyz6IVJwIE= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1xLNUh-00000000J3G-11yk X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net [108.223.40.66]:55640 X-Source-Auth: guenter@roeck-us.net X-Email-Count: 17 X-Org: HG=direseller_whb_net_legacy;ORG=directi; X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOYLIe0VVykCKt8uJpe7+h5FLf4B50MZjMMmpJLmfS19AFueV4pI9UISvxOFkc/8ifLFbBjjHFBH0GH+j6/A599ViNoZZ/mDDSaGS/A8l36j0xfI8EAD h4xEyI2CTI5gxXhHCijnwQKFt/1n5kYxohzsHwf+IFGp7G6wGNbgYIl9whVY9WibPV4KNq3k1ovymOg/vqZxN85AWEKFO1bdXGIbNMVOeR7WIr4iKi9DeoQL On 10/23/26 03:15, Andrea della Porta wrote: > Hi, > > This patch series adds fan tachometer / RPM monitoring support for the > Raspberry Pi RP1 southbridge found on the Raspberry Pi 5. > Please note that the patchset in [1] is a prerequisite for this one. > > On the Raspberry Pi RP1, the active cooling fan speed is controlled via > the RP1 PWM controller. In addition to generating PWM signals, the RP1 > monitors fan tachometer pulses. The pulse measurement and RPM calculation > are performed autonomously by the RP1's onboard Cortex-M microcontroller > core, which periodically writes the computed RPM value directly into > dedicated MMIO registers located within the RP1 PWM hardware block. > > During earlier discussions, Uwe Kleine-König explicitly indicated a > preference to keep the core PWM controller driver (drivers/pwm/pwm-rp1.c) > focused strictly on PWM duties, rather than bloating it by registering an > hwmon device directly from within the PWM driver (see [2]). > > Because the Linux PWM subsystem currently lacks a generic framework or > consumer API for reporting hardware-calculated tachometer readings, this > series implements a standalone hwmon driver (rp1-fan) using the following > structure: > > - The PWM driver exposes and exports rp1_pwm_read_tachometer() within a > dedicated symbol namespace ('RP1_PWM') to read the RPM value from > the MMIO block. > - A companion DT binding (raspberrypi,rp1-fan.yaml) introduces a vendor > property, 'raspberrypi,pwm-tachometer', to link the fan node to the > PWM controller node without overloading or abusing the standard 'pwms' > property. > - The rp1-fan hwmon driver parses this phandle, establishes a device link > for proper runtime and unbind dependency management, and registers the > standard hwmon 'fan1_input' sysfs attribute. > > An alternative architectural approach to the DT phandle + exported helper > method would be to model the tachometer as a child device using the > auxiliary bus framework (drivers/base/auxiliary.c). In that model, the RP1 > PWM driver would instantiate an auxiliary device for the tachometer, and > the hwmon driver would bind to that auxiliary bus device without requiring > a separate DT node. > > However, adopting the auxiliary bus would require a more significant > rework and refactoring of the existing RP1 PWM driver. > > I'd appreciate any feedback on whether the current companion driver with > a dedicated DT property is acceptable, or if an auxiliary bus-based > refactoring of the PWM driver is the preferred upstream path. > > Patch Breakdown > --------------- > Patch 1: pwm: rp1: Export helper to read fan tachometer RPM > Patch 2: dt-bindings: hwmon: Add Raspberry Pi RP1 fan binding > Patch 3: hwmon: Add driver for Raspberry Pi RP1 fan tachometer This seems conceptually wrong. Have you considered implementing the hwmon driver as auxiliary driver and accessing the register in question through regmap ? > Patch 4: arm64: dts: broadcom: bcm2712-rpi-5-b: Add RP1 fan tachometer node > > Thanks, > Andrea > > > LINKS: > [1] - https://lore.kernel.org/all/cover.1790686331.git.andrea.porta@suse.com/ > [2] - https://lore.kernel.org/all/adLTwOTbkJ0VQXy6@monoceros/ > > Andrea della Porta (4): > pwm: rp1: Export helper to read fan tachometer RPM > dt-bindings: hwmon: Add Raspberry Pi RP1 fan binding > hwmon: Add driver for Raspberry Pi RP1 fan tachometer > arm64: dts: broadcom: bcm2712-rpi-5-b: Add RP1 fan tachometer node > > .../bindings/hwmon/raspberrypi,rp1-fan.yaml | 39 +++++ > Documentation/hwmon/index.rst | 1 + > Documentation/hwmon/rp1-fan.rst | 41 ++++++ > MAINTAINERS | 1 + > .../boot/dts/broadcom/bcm2712-rpi-5-b.dts | 5 + > drivers/hwmon/Kconfig | 11 ++ > drivers/hwmon/Makefile | 1 + > drivers/hwmon/rp1-hwmon.c | 136 ++++++++++++++++++ > drivers/pwm/pwm-rp1.c | 27 ++++ Either case, there is no such driver in mainline or linux-next. Guenter > include/soc/bcm2835/raspberrypi-pwm-rp1.h | 10 ++ > 10 files changed, 272 insertions(+) > create mode 100644 Documentation/devicetree/bindings/hwmon/raspberrypi,rp1-fan.yaml > create mode 100644 Documentation/hwmon/rp1-fan.rst > create mode 100644 drivers/hwmon/rp1-hwmon.c > create mode 100644 include/soc/bcm2835/raspberrypi-pwm-rp1.h >