From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F31613D79F9 for ; Mon, 20 Jul 2026 09:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540447; cv=none; b=nO1oFa3Wb1Fh18K4zgF7h72XmLossVeCg1i2QUmNUdQ9bHRIeT4Zam++AX2QgwJsADKrEKE+Pvb8+xa+Xm9P06CCiRwpK1O6bOtHomJxNjzyciTC9aDt4ENw96bPJ/+o5PnJ1/kSKe2nD4V9c7W6uk5e9IUhI0HC7po2G/SKoDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784540447; c=relaxed/simple; bh=XBZjd0SYl2Y548z0ARMPGLiYpC3DE5EZ46YkWEKytGw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=m3qT90lcBvp8HnSy8lrKVHKXhFoPYqUWBosJ7XwQMTjjLcNs8fIrWJhQgr/Es+xsvEQilYpco8IBZ+bb2tv4Ysg1lrkkDL2NQkN4NwrUCLz58hrDLjXuX33RVMxLktwA7fEF/hS+5YgUCdI+g37YRSjNWbpZSeBgVTJspNj35V4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Zgt/QY39; arc=none smtp.client-ip=209.85.221.48 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) header.d=suse.com header.i=@suse.com header.b="Zgt/QY39" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-471eeac43bfso9239457f8f.3 for ; Mon, 20 Jul 2026 02:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1784540443; x=1785145243; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=3u1CwozotVn5LDWLD1V9wVLi4fj6wktLd2vv686ZRBI=; b=Zgt/QY39MVCzeqtKXFZQl4FMSThS16NZJpTvHtLRqAPcflNEMPEXHZIizv7+b5RU15 HgdNSMUdOSiW1JdTSaODUvSZFhYeVeGDRMIDwA6IO7tQRF7EgtrVLC40xY4T+cWq8kov /msyeNOgOfdaKfsQLx+VgE7H5es5ZF8kojzHWYsqwSeGMsR1TG/5fupOE5mXh9MEj0fm 0IhUi86lL6d7q2hWocKNYtwj155MF+ioUMlEpj/kArPLZq4tLdzKOVd2JWno1hShMrbc t1uyS/V6KhkJi4cwrsK6AEGGws7r5+Fs+NcAeqnx7SV4GiiIj4+cS7Kk6YYIEKVWcRnC +sfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784540443; x=1785145243; h=content-transfer-encoding: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=3u1CwozotVn5LDWLD1V9wVLi4fj6wktLd2vv686ZRBI=; b=S0N5yZftWwP2hJyXpxGUszmZyoLmtt33V8AhK+5fUgObaiK8RZsrHRSRkBrvny+pV8 WU641ezfyGPt2c/amA8j5b8xEtiYzTzqV1HY73M/tgt3yMgg9TreopO6y8eUyNgzdjVv mi1hR5afgVsVpU4dNF85OOxoRoNlsWA50b96vwA72si+kmPk153Is1aFYniplkMvnW4b d6O4S3LtVc//E8T0osVffE/6rULwzz5kHaTa2rqmUNgvnxEtbTNV22Dl1MI1jpt+Qtkw Z5A9srj71eKocIqBDvWdOuvpep93Bu/3xa6woAEWJkO89Vhvn1pbo54hGoa2HTwUygts +8zQ== X-Forwarded-Encrypted: i=1; AHgh+RroWmi8fyUz2/pdbjnkWOOVQxx05mIFwhUYyvcmOdqt4ubsOhTeU6Gtuhaqn6pS0RNU4eWcwfC7lAYF9HU=@vger.kernel.org X-Gm-Message-State: AOJu0YxggAQYeuSzF6kyZxn7iTpxKCr0a5WHa/BxIblxtxwAgMQxH6In Q5KZiqgLFsbmRAKduwxlawX0oMlgBCsA5A7IqrI1utx/gi+Ix1P+k7lNo5+TRFdotxQ= X-Gm-Gg: AfdE7cljtemayGF/8JsBg31jEDQREk0DSSy5z306a9ltzQqHGRzB6qat9EZOIr8USRd D99ETNdioEkMPe46iC4osYgSqyH62PKqPc5Q6hoDpxBrw6a2OdiwuTVQyZadE8GLYv5z1OxK76q /7KNeYhn7dyqLa3mG2tkObxjuvc/yEjGxAUTt7rDxZx5x+kiC4t5Uh0LXaBFGYITmoPQoJY3ys4 wIzQ7XPffHOJ4kltGr5HzDUVC6N+mjYx/bUfKEWzYzuze6v0hDbbVGbvwWkAo/hNC8QIAM/S5Lt BHabzWl1CtzNgOmi7+GmOybc7ovJiqU4/Pn++c7A/8RHrIG+q1oztUmVJxWgOLPtLbpWM1qVNBt g85MDGG9hcKY7IK/zP6n5R3h/aoylHYlFhGv7HR0U8pr1uVUTUSDUpD1ZzPht1fOWANizF+OzIR tQIYYdLhaHmF8= X-Received: by 2002:a05:600c:4585:b0:492:437a:a653 with SMTP id 5b1f17b1804b1-4954a50b811mr138696825e9.26.1784540443117; Mon, 20 Jul 2026 02:40:43 -0700 (PDT) Received: from localhost ([195.94.145.62]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49563969482sm15082875e9.3.2026.07.20.02.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 02:40:42 -0700 (PDT) From: Andrea della Porta To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-pwm@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Andrea della Porta , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Naushir Patuck , Stanimir Varbanov , mbrugger@suse.com, Sean Young , Julian Braha Subject: [PATCH v7 0/3] Add RP1 PWM controller support Date: Mon, 20 Jul 2026 11:44:04 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patchset adds support for the PWM controller found on the Raspberry Pi RP1 southbridge. This is necessary to operate the cooling fan connected to one of the PWM channels. The tachometer pin for the fan speed is managed by the firmware running on the RP1's M-core. It uses the PHASE2 register to report the RPM, which is then exported by this driver via syscon registers. A subsequent patch will add a new device and driver to read the RPM and export this value via hwmon. Subsequent patches will also add the CPU thermal zone, which acts as a consumer of the PWM device. Best regards, Andrea CHANGES in V7: - _tohw(): use *wfhw = (typeof(*wfhw)){...} to initialize the structure in the disable case - _tohw(): fixed the offset_ticks calculation - _fromhw(): fixed a rounding error in the duty_offset_ns calculation - _write_waveform(): dropped the goto in favor of return in diasble channel exit path - _read_waveform(): use *wfhw = (typeof(*wfhw)){...} to initialize the structure in the disable case - dropped rp1_pwm_remove() since this driver depends on syscon and cannot be removed/unbound (added a comment to explain that) Naushir Patuck (2): dt-bindings: pwm: Add Raspberry Pi RP1 PWM controller pwm: rp1: Add RP1 PWM controller driver Stanimir Varbanov (1): arm64: dts: broadcom: rpi-5: Add RP1 PWM node .../bindings/pwm/raspberrypi,rp1-pwm.yaml | 66 +++ .../boot/dts/broadcom/bcm2712-rpi-5-b.dts | 12 + arch/arm64/boot/dts/broadcom/rp1-common.dtsi | 9 + drivers/pwm/Kconfig | 9 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-rp1.c | 428 ++++++++++++++++++ 6 files changed, 525 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/raspberrypi,rp1-pwm.yaml create mode 100644 drivers/pwm/pwm-rp1.c -- 2.35.3