Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2124706pxu; Fri, 9 Oct 2020 08:32:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8P8tg9cmr4iL5DOoyfixCUtQleLZC/HT7mA4S4c1fZqfQgR0tJlZatqPXoRxLcNzc2/wt X-Received: by 2002:aa7:c2c4:: with SMTP id m4mr15685611edp.172.1602257538425; Fri, 09 Oct 2020 08:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602257538; cv=none; d=google.com; s=arc-20160816; b=KNyvX42UuWKHRwEdQfuQ2XDPvpw1xuHRGoIgDOWqw4upZ/6+XMrTLx9+eu9KGBD7SP //xJyEog9tsuOCKhMiwi0JiILQSMmG9FdGuz4QMzpbJYm5Muni4wAgFTjjmmpouz49p7 OXBqup5oI2vmFDMsEDx1QrszLJ0t+hoWJT0oR117h44TNM1bAjhxsi6C7aek5x6JEuwO ZP/PGLH5LgEZ1uH0eiRkpyOKPVhtgzDoNMvQxzXTYTEwxzcuqozm1u95B20SC7MoGl4N PBiVCEktAly+UNt0kqtlIRpJQLCGDwpazI9Z6rhK2uhmIZzIeYUfAo83fyhkS1bVgI81 Wwmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1ZGL98TBg+6H45z8a4dcKpBTbNVEZNKClZEycJF0bNI=; b=ccIb+n5Uhep2JxhdQT5DA8NzbVog4IamTSuQ/JGNS/agWkwpaNjqbcjvKQptAIch2q rvi1gef4BEHW2bMw0lomo4GABVH1UvQT7w+QgJLmN4uMg11K9K32nEzmiFC/vNtIZYZO YFMYWvawzaBI1Sk9Z7+i4heblYYgLG28ZXQ0SWILx+Ooz6sqb73YDmodG2O3d+PCNv7d y6ZtgW4GWJBcX4Jr3Cv6ySLT9ITFRfJUKvIlhNz6mlOrrTLsftTxISXmfH43skG8gsji qNrZLMlDJcLKXrwP0VRNX8cdYTh6Y+q+nngAqmUN89nGS8O29fwADxBmoSWG0sLeuaz2 t2Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si5850905ejb.734.2020.10.09.08.31.54; Fri, 09 Oct 2020 08:32:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389289AbgJIPas (ORCPT + 99 others); Fri, 9 Oct 2020 11:30:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:34384 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388473AbgJIPas (ORCPT ); Fri, 9 Oct 2020 11:30:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C218CAC8C; Fri, 9 Oct 2020 15:30:46 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, linux@roeck-us.net, jdelvare@suse.com, wahrenst@gmx.net, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pwm@vger.kernel.org Cc: linux-hwmon@vger.kernel.org, robh+dt@kernel.org, Nicolas Saenz Julienne , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] Raspberry Pi 4 PoE HAT fan support Date: Fri, 9 Oct 2020 17:30:27 +0200 Message-Id: <20201009153031.986-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everyone, this series aims at adding support to RPi's official PoE HAT fan[1]. The HW setup is the following: | Raspberry Pi | PoE HAT | arm core -> Mailbox -> RPi co-processor -> I2C -> Atmel MCU -> PWM -> FAN The arm cores have only access to the mailbox interface, as i2c0, even if physically accessible, is to be used solely by the co-processor (VideoCore 4/6). This series implements a PWM bus, and has pwm-fan sitting on top of it as per this discussion: https://lkml.org/lkml/2018/9/2/486. Although this design has a series of shortcomings: - It depends on a DT binding: it's not flexible if a new hat shows up with new functionality, we're not 100% sure we'll be able to expand it without breaking backwards compatibility. But without it we can't make use of DT thermal-zones, which IMO is overkill. - We're using pwm-fan, writing a hwmon driver would, again, give us more flexibility, but it's not really needed at the moment. I personally think that it's not worth the effort, it's unlikely we'll get things right in advance. And ultimately, if the RPi people come up with something new, we can always write a new driver/bindings from scratch (as in not reusing previous code). That said, I'm more than happy to change things if there is a consensus that another design will do the trick. [1] https://www.raspberrypi.org/blog/introducing-power-over-ethernet-poe-hat/ --- Nicolas Saenz Julienne (3): dt-bindings: pwm: Add binding for RPi firmware PWM bus DO NOT MERGE: ARM: dts: Add RPi's official PoE hat support pwm: Add Raspberry Pi Firmware based PWM bus .../arm/bcm/raspberrypi,bcm2835-firmware.yaml | 21 ++ arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 54 +++++ drivers/pwm/Kconfig | 7 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-raspberrypi.c | 216 ++++++++++++++++++ .../pwm/raspberrypi,firmware-pwm.h | 13 ++ 6 files changed, 312 insertions(+) create mode 100644 drivers/pwm/pwm-raspberrypi.c create mode 100644 include/dt-bindings/pwm/raspberrypi,firmware-pwm.h -- 2.28.0