From patchwork Tue Nov 8 16:32:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13036522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A845C4332F for ; Tue, 8 Nov 2022 16:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d+j3n7zccQN4sNUCKk3WGq0HfzMiJ7Md3UdI879NTPg=; b=auWAPE1drHyKyt ngpFFgW9eqkBQCVE7oOqT2Pyyn7ffOj0AyEL//PLmSLDCGVgDt8l3BEYPiTe5cIDCmIYtFIjkoNL7 IR0ltrPmuIxG3Kjo7xIDzhsMJxtM3lN/TuGvKVrerHp0e+9g6CzzEPPNI4SV4ioZpHa4NUX/bfYlQ VwlMMb4NcjfGXzjh5T56NDJD6MLH0q7Tvcm6Xgk6wCFB8cTXNSWhK0cEvRuCkO37tuS0yoEXvMSQ1 nDMb3vzFb4GW6UfVkax58UpyhTbYBiqKMLRke0PSeeZ3p+8oczxuJxHihvNIENkVaeIMVhnGRRDqG U0VdJ1QSbVz1VBXKGtJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osRZF-006h4H-HI; Tue, 08 Nov 2022 16:35:18 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osRZA-006gHi-Oy for linux-arm-kernel@lists.infradead.org; Tue, 08 Nov 2022 16:35:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r3eNyIjxDKk23f9oCDU73gWOczaFl0qT6zUOuTRb0KQ=; b=AzGdUlh9t8JDBnIuNxuDjRNcW0 fFfcdGUwj0KSqsLFPDfXaN9OWeoMQwAwz8WJ13HVKS/VDc2pfYP5S+uYwA61hl+0e2ijMVdW+jynO POEuP+WLohwvLH9sOMp7uEmB3KwYO2gkaBwgX0SUQzAldHI8YofqnNQS1VrwOUurX/LxYMKTZGdrH w/RwBzIxrB4JKwsbBhR88tUPwJ8kN65Z4oppRBtIXJX9XpSB5vZBrXjQ62u9sgQthc2e+DLiZDVT9 HW8DO3+9ax8uuRYzYe70L8AjvLpZWc2gGNz4Jvo9frdtOiRTq1mAKWdOJqPeNYfECF9l7KNm4uBRE tGdTKg4g==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35172) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1osRWm-0003R2-7b; Tue, 08 Nov 2022 16:32:44 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1osRWg-0004su-7V; Tue, 08 Nov 2022 16:32:38 +0000 Date: Tue, 8 Nov 2022 16:32:38 +0000 From: "Russell King (Oracle)" To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones Cc: Alyssa Rosenzweig , Andy Shevchenko , asahi@lists.linux.dev, devicetree@vger.kernel.org, Hector Martin , Jonathan Corbet , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-gpio@vger.kernel.org, Petr Mladek , Rasmus Villemoes , Sergey Senozhatsky , Steven Rostedt , Sven Peter Subject: [PATCH v3 0/7] Add Apple Mac System Management Controller GPIOs Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_083512_837849_21B07ABC X-CRM114-Status: GOOD ( 17.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This is version 3 of the series adds support for the Apple Mac GPIO driver. These GPIOs are hadled via the System Management Controller. The first patch adds the core SMC support to the MFD subsystem. Patch 2 prepares the printf code for printing generic fourccs, as required by patch 4 and 7. Patch 3 adds the DT binding documentation for the rtkit backend. Patch 4 adds the rtkit backend for the SMC core. Patch 5 adds the device tree updates for the rtkit communication channel and gpio sub device to DT. Patch 6 adds the DT binding documentation for the gpio client. Patch 7 adds the gpio client. Patches mostly taken from the Asahi project and then modified due to review comments from the previous postings. I may have missed some comments as there's been quite a lot of discussion on previous postings. Documentation/core-api/printk-formats.rst | 32 ++ .../devicetree/bindings/gpio/apple,smc-gpio.yaml | 37 ++ .../devicetree/bindings/mfd/apple,smc.yaml | 67 +++ arch/arm64/boot/dts/apple/t8103.dtsi | 27 ++ drivers/gpio/Kconfig | 11 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-macsmc.c | 245 +++++++++++ drivers/mfd/Kconfig | 4 + drivers/mfd/Makefile | 1 + drivers/mfd/macsmc.c | 239 +++++++++++ drivers/platform/Kconfig | 2 + drivers/platform/Makefile | 1 + drivers/platform/apple/Kconfig | 34 ++ drivers/platform/apple/Makefile | 7 + drivers/platform/apple/macsmc-rtkit.c | 455 +++++++++++++++++++++ include/linux/mfd/macsmc.h | 104 +++++ lib/test_printf.c | 39 +- lib/vsprintf.c | 35 +- 18 files changed, 1328 insertions(+), 13 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml create mode 100644 Documentation/devicetree/bindings/mfd/apple,smc.yaml create mode 100644 drivers/gpio/gpio-macsmc.c create mode 100644 drivers/mfd/macsmc.c create mode 100644 drivers/platform/apple/Kconfig create mode 100644 drivers/platform/apple/Makefile create mode 100644 drivers/platform/apple/macsmc-rtkit.c create mode 100644 include/linux/mfd/macsmc.h