From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792750335; b=tBYSNXEL2Q/N9IqT69A2tvYgoyCo1acN1XJJVE3CI7YWKyhlEQBsx4qIvTN94HEj1fnx 9T/YLyJ3NMP2StDUohfz2K44v3LzNHwcQMlJG8fezHuZ+GOLhH8g4ek6naJMqOCn2fH5R QVBvp0Pie+EYqrg1S/p6PjTfDhNWoijiXiX2D4mTRpF+q6K87cnJKCOwpT8bQNgSJK7eI QwOY01cgnYoVITo66k+sxJrd6CUJLGnKbZeUPbhQVgFhZpJ24XJP2jUynd7DN5xdHZXVs 90qHcro2fSMMmc8VxllmHh6snHuKSMHquonQCq4jj485eOBYV3DrJEa+b7kux9pvl8A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792750335; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Subject:Date:Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=xOkdMQgEfZtJLgU0fFwbDzze1EactQ9BVvcxXQMDTo4=; b=u8Rz6zGC9F/juIV+CxqS6Ul4Gqrcmkfg8dpSDAZg6TNteB2ju1nWLBQsATQcYBGHRXv5 tT//YVmNgBoKFi3TZTCAEbsow3+bD+6Nl+6ZPZ5XZY/4Kk+RgQ+EjStprM6/BrHMWTDHn fmzmJQH8ldEn6RVsOdgFgrV1GxvKF+nopk3Bl/jHDyTtUMrz30+A3Q8fJURXdNP3RW+nH TTxSnMnBhkW6s4x6/4lAVFAJl2bbzMEyB1f19YAAd4I5QTW/044k0b4nOq0d4TrKUbHkj xFT2OGiTOLWNXYVhgJ9rUFE8aPBpA3/oF88R2VodxyxSp56PO78oi71zqySfG4JfjJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=Gc7IXAzh; arc=none smtp.remote-ip=209.85.221.50 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB77606A322 for ; Fri, 23 Oct 2026 10:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3DB77606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=Gc7IXAzh Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-48c4be28b82so559235f8f.2 for ; Fri, 23 Oct 2026 03:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1792750333; x=1793355133; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=xOkdMQgEfZtJLgU0fFwbDzze1EactQ9BVvcxXQMDTo4=; b=Gc7IXAzh91GyjohKVdF/dqUtsNyzi4sPLVW0lyc/2BtjrHoPY3BuCMCWOvD34hkCWl n60yTN2FJ1EMUDw7QSmeCBFOup8RfB+2be2lMwAMAManQ52u9j99pHXzo4kgpPBnBCsX R1zSbxojmhxoHKQbVN8ZX2CXKxCfr8r6skio8EFwjBAEJKUQky8PsxBzUuOa+UzPv7pY l2JCR7NLb2MIX+xS3NCnLVaQeAqg/IVTg4lP7wN9HJPUwz8P8hiXa1PsouDTh7h3D45C g9F5/6+prgmRj5i4XwKhgJnS24ANiPI4v29jBHOj5si/fGZTUQPHHUPKm8L2RetuAaB/ CePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792750333; x=1793355133; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=xOkdMQgEfZtJLgU0fFwbDzze1EactQ9BVvcxXQMDTo4=; b=RF0NpK6+mi0kGrKjgeYWqBV5HdrCj+qfk+p2LPcbUgIGHqEcvwLWcO0b4QToHnQgUA PWApRqnwLLPN3HLksHhK4uNi9jRKnoJSPERVrljvURYkUf+mUxQrln2dDBcbYRsDzkiJ MKuNal42PMWZJ2WPiKuUKijmEunZBI31+8dGmqOJo+k5sTtk8WRchCy6qAA4/n9cIHtP GJ+BHcuhEDKMIV/V004EuqA2pHpbFumn+U6Jh7LVKvR69Y0b27KwbKo1ybeOExEWTf77 reQQBCzXl1Vj6+3Uh8QOiJICZ/S5o3X/hkcBIpHFVkt3EsWsE1KSoeh211SeyekJOjPD 0jAQ== X-Forwarded-Encrypted: i=1; AKwUvBzyOpx9LnHPg4y0x6ZzAfZAOISth5W6ZcETxQVsapQ5jfnRzy/TgFiRSpYtNz6NyE2a1KXPrhiirf7f@vger.kernel.org X-Gm-Message-State: AFq9FYIDalcvMKmj1WvJhEjar8AIULG7azD5YmMV0wq8dB+LVrGWHi1d xrXiJ7/2+2L81D4y+U5LUP9tJBPNx7RgkpubT37TM3Rn77zfVkPU5/vdG5KFV9MY4LEppbfIZp/ amynTlXw= X-Gm-Gg: AYBFou2fshwDYhZUorzERumNsmyELhp0p1KYLx2p5iC/t2mqezi3AbF4WqLMqJIfKR7 70kOVO4cvGlsY5k7XodjnmkXjrA64wMRVW3XZvtdJT8nj/za0UPQ+k2F14F9oYHNo9JggPfmKeZ efAt07W+Mwqv5Ve8AlkyXKjFokM8ZZKZXy5A7FYuILNFbafvO6um9CxBlEXqRFe0zQwgYFT44MH oz2u2M557FYjKY78FGLm0U9lhy49WLqa3nA5BFmAvHqkPUFROSJ1lHvrbxaAOVAE182z26GWM4k CxBbtXitaXELRjqCvrujH+iGlVvJ3WGprDOFrPzcd61DqEBeGxMtMx8dcIDXgnpCdXbNz/2Lprj y56Ea8DuEG9D1mM7CQ2DoorV559/d7FjW1KtY/d39KgP2WEnjhVbPVBJF/J1nn+ARxoID58ScQn IOvaGbVqJRE4DF2SV5bmfCcAfrA5m3zCwmmFIKIXmczcH7JPxCVC5lsvTxr+ztD6KVMyNuWatzl KH4o5Ds1RjE4eotr9CUX+J/RZK8kfaOfpA8p+1DNxhnvBT1CVVpOUc= X-Received: by 2002:a5d:6f18:0:b0:48e:f47:273c with SMTP id ffacd0b85a97d-48e3854f342mr2931502f8f.8.1792750331152; Fri, 23 Oct 2026 03:12:11 -0700 (PDT) Received: from localhost ([82.192.120.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3804ccb4sm4289462f8f.38.2026.10.23.03.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2026 03:12:10 -0700 (PDT) From: Andrea della Porta To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Jonathan Corbet , Shuah Khan , Randy Dunlap , Andrea della Porta , =?UTF-8?q?Uwe=20Kleine-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 Subject: [PATCH RFC 0/4] hwmon: Add fan tachometer support for Raspberry Pi RP1 Date: Fri, 23 Oct 2026 12:15:53 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 ++++ 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 -- 2.35.3