From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792750335; b=Cyzg7yvFOcW4Wg23M2CkV0Lakv76tasoR4dEU6XPQBacn34KNH0hxQ/6TuhFBAcPKEqT 9+DPKOkKcdTRRQmVsKfDIHGIv6xmVAomH4h9GaJOh/6GNT6Z2ZflCzG1taV+W+s/4AWFc DH5ep3haNnG1+HhTgn25GbR9d1656+9vHKPBWMxDt3RsFbxCmXiyfOYHUoGA9L9piQWW/ 6VUcC7u4RoV1uGrTuj+dDdZry2oGJVCownEvt45aVOywmyfsldwFLvKfkkz3VZd1p7hRA 1ed+6I9onkNZDUYd61qpX6tG86SE9lGeyqy1+3+L/nmCnEE5AEDX+dU4Zvj8vn0r6Tg== 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=e0/WyVlozo9PJONksoef1qv0Ucw+FbyOFlIvLR16w8FUUk4mPPa+S3/oaqmbLiED8RaG eEpKWUQUoHg5nXIwnIPVEsOrrnZ62QyOCNMuPvlwPLeVMlKBTlBHjq2blUqn9XcYiOJsb mjvKuuxhFeFblvZDlEwB0aMaLFdDs3pOT+9Hr41/5EVZqhRJv3/6b1DRJBOKX916TPL5h C+RyZzeznEeNKmnoCFbwRUjTZKskAXc4ZiiKyfsBdjSpZjNpGFc4UQJZvQzY9be0H+ORH 3jAR3qXqf8HrgA0oYxgox7ONfQHAaecUwAv7eTa8w7go7vMXvi05VHenr188wF4nJ8g== 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.48 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 3F8E0606A323 for ; Fri, 23 Oct 2026 10:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F8E0606A323 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-f48.google.com with SMTP id ffacd0b85a97d-48dfdd0678dso491858f8f.0 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=rCU9fL2AYUijVG0SGaQuxyVs+OXCawdJn2c+5heRIFbNA7Sk6unuu3wQ8duvIoVmFZ UYTFLIVpfL7atlCpMGLgfj5A53ruJSSWhWeGoOV535X4eWANVH5qKLiGMvHttF63F9cB oS9bh9+Xy/0oJgcaqh7MXHbbG4Ejo6QcHDKz1R4wKMg7OPPIqnDNFi6+s1yoTXBdOohv Qwszomhu7cKDfB5l48kqiWQ7wHTqTrh3XTs4EAvfHRfQJsiK9mAlHWfjwF0YMwmUxzXN 2yoVJGKHdH7p6VThoUiXc4oZN5sjGqjAymceG3b3XLVAZSE0ugNulCZWwEGq+ewNBa20 Rv6Q== X-Forwarded-Encrypted: i=1; AKwUvBzdGTD9U2BR/m1B5tBPQQTus/f6AWD7yAka9mdmpkwxReDFCHX4emsIb8jxCdclLymjHqd6QvbTktQWUg==@vger.kernel.org X-Gm-Message-State: AFq9FYJ1ZGCWGAHeGdpsRaaJ3JLtbRSySL+7D5XNkwLFCXl4cwgy8Sxe OBMdMxM5gdGZEAUM0LIGJuaoQO5CG2oCXtH4+di3Gt6cYFzeCsDU6PhqTEpOmhGPiVU= X-Gm-Gg: AYBFou3dpeEo04R6xsP8cO+HafIWILjPaxWDoMq1jEbLfPE/ENqh/eCDKTz/nL2Dlda 7cydmLw4CBcFlrEdfHZDTPN0tm2U0cH7MrdBw/8gqQguLrcDRdoBFLDMZs2hwFb1h6OqqdYvOkw 2tkUrpdJi043cUf6HXY2wMq7vz+agTEHGmHQy6/4mc63BxJCEEu9M0nMASHJ3zvgsmRbKtEKMX0 qARXEwVthXa0jLQDIY++GqO28YSj7z/02avS+EWZ/irPzuBC4VFN96V/AEtDyX15Y73exg3RhnA BcEXGlgEWG0sC6Knb0KYcPnlMpJhG44fqod+0dcjLwjQ/rjjXZnQmeMrej2GkBdpqKCvhN5rl49 payACkADsduLtXQA1XemDNeF5FbIpm/UxecuYH+YJYVgsmYQldIvTkAoERx/0l67mgOMdA4yU/a +IgcDy5nQ2SSswpRPAOenLHNdrAdLtmhoLITgPhrrFASGwyW8yz5+LUQa7xOhGH2l2Ca0+Y5QO5 PCX6nlFQEu3TtrFObvWhCbXZqNLyCVutsi6YgXWZUVl6rnSoOjIpv4= 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: linux-hwmon@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