From patchwork Sun Apr 9 09:18:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein via B4 Relay X-Patchwork-Id: 13205911 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 CB045C77B61 for ; Sun, 9 Apr 2023 09:20:10 +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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version :Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cQvRtSDtYOjC54knIZWW2GUakqBUcPDBgN8lywJHzq8=; b=AZGnMyaWYKbxtT mqWCMaMJ+E3T39MWb/bqnMterDKhww3LxFmw55yrhGCk0fVTukk4gqipOZa6x/EA3ZInMvF7ZIH5D HEAQ30zioratz8Q0Jz1p2t+qKxrMtlwJc3GbX7OFn1WOfhpY5RbMAUCqgQTihwt8dDNUNpjRZMTUK +hflTxcHa1SUD6hHnIktOfNmNy0mX8u/IUnwLCgslwezq7qxeZuYJw0776yx/zszZ/4kz4t/uKSV8 bylWnfK3gqVG5g3WXXINft+rN3qKr7UvXjCY7dxhLjJCNmClEv1cs5tG6311y67c/YJOfg5/mk2Kt oI+MzSC45myFWoimx96A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1plRCJ-00DMNz-2G; Sun, 09 Apr 2023 09:18:55 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1plRCG-00DMNB-2x for linux-arm-kernel@lists.infradead.org; Sun, 09 Apr 2023 09:18:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 17E3560B5F; Sun, 9 Apr 2023 09:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 6D133C433EF; Sun, 9 Apr 2023 09:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681031928; bh=c2I0yJTyQr3Uyst/ro4wytwPfIU+WGszhyD9VTJ7OqU=; h=From:Date:Subject:To:Cc:Reply-To:From; b=iQ678+S5SD4L2NIJKyc6o7UoG6nKCLzPMuC57jnBRsYv/BddCSFczRmsPavRk7Pxk tbgp9cxLBM1czMMRRk4ReElYd3rKH8pVyuJBP5RlPR9SQewtORy7DcFwtVXkYhgJIe //dQULHyFtYoL6X+ER4JcGz//BZ6t7Sx/SjNf0pxsTSyvhGWl35/kWqBSuIHmrl5qE KKfdxeapb9GUOIpvmTlXZoGM9yA+UdDgSZuL9KwZ9PwbRK2AWdgkJAJid025BF9h18 gqYo8Fz8SF6ul23EakKCq5U7nkdCnBj7fLKeox5aF0+fWnZ8vMyrDpEkPeV9xPrMK+ JeyfUUwkafSwg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A9C6C77B70; Sun, 9 Apr 2023 09:18:48 +0000 (UTC) From: Sasha Finkelstein via B4 Relay Date: Sun, 09 Apr 2023 11:18:46 +0200 Subject: [PATCH] arm64: dts: apple: t8112: Add PWM controller MIME-Version: 1.0 Message-Id: <20230409-t8112-fpwm-v1-1-feffa5f8b99b@gmail.com> X-B4-Tracking: v=1; b=H4sIAPaCMmQC/x2NywrCMBAAf6Xs2cW8lOqvFA/bZGv2YFqyRYXSf zf1OAzDbKBchRXu3QaV36Iylwb21EHMVJ6MkhqDM86bYG649tY6nJbPC82Vgw8x+kufoAUjKeN YqcR8JKSUBXWO57Qeeqk8yff/Gh77/gOATlWmewAAAA== To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sasha Finkelstein X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681031927; l=3074; i=fnkl.kernel@gmail.com; s=20230213; h=from:subject:message-id; bh=oZH+o0OuBKtAeL1N+AILko2fVUAecOJUeYZVbst1W5o=; b=C18AutLzDFanW7c9JjMjZfk0eZAnVX7s7KUp5iGQQ+Xga9D+G1Fwk2ky0g2IDzDC1+b6xsTgs 6muF/T8FkQ9AAYwfsTeW9Q/xO9EOCGv3VJO3ck8bLAS5cJohh33NURk X-Developer-Key: i=fnkl.kernel@gmail.com; a=ed25519; pk=7LFSAJtxIWAs9LzCIyX0sSvCZy2wQTyEIu1zch6o804= X-Endpoint-Received: by B4 Relay for fnkl.kernel@gmail.com/20230213 with auth_id=28 X-Original-From: Sasha Finkelstein X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230409_021853_051505_36E2C1D2 X-CRM114-Status: GOOD ( 12.86 ) 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: , Reply-To: fnkl.kernel@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sasha Finkelstein This patch adds the device tree entries for the PWM controller present on M2 macbooks that is connected to the keyboard backlight. Signed-off-by: Sasha Finkelstein --- arch/arm64/boot/dts/apple/t8112-j413.dts | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8112-j493.dts | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8112.dtsi | 9 +++++++++ 3 files changed, 43 insertions(+) --- base-commit: 8d59efc33fdaa2c82072b4d3ba5f67d7dd9270d0 change-id: 20230409-t8112-fpwm-06e434cc358d Best regards, diff --git a/arch/arm64/boot/dts/apple/t8112-j413.dts b/arch/arm64/boot/dts/apple/t8112-j413.dts index 9e758edeaa82..6f69658623bf 100644 --- a/arch/arm64/boot/dts/apple/t8112-j413.dts +++ b/arch/arm64/boot/dts/apple/t8112-j413.dts @@ -11,6 +11,7 @@ #include "t8112.dtsi" #include "t8112-jxxx.dtsi" +#include / { compatible = "apple,j413", "apple,t8112", "apple,arm-platform"; @@ -20,6 +21,18 @@ aliases { bluetooth0 = &bluetooth0; wifi0 = &wifi0; }; + + led-controller { + compatible = "pwm-leds"; + led-0 { + pwms = <&fpwm1 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; }; /* @@ -61,3 +74,7 @@ hpm5: usb-pd@3a { &i2c4 { status = "okay"; }; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8112-j493.dts b/arch/arm64/boot/dts/apple/t8112-j493.dts index 8552c15be265..0ad908349f55 100644 --- a/arch/arm64/boot/dts/apple/t8112-j493.dts +++ b/arch/arm64/boot/dts/apple/t8112-j493.dts @@ -11,6 +11,7 @@ #include "t8112.dtsi" #include "t8112-jxxx.dtsi" +#include / { compatible = "apple,j493", "apple,t8112", "apple,arm-platform"; @@ -20,6 +21,18 @@ aliases { bluetooth0 = &bluetooth0; wifi0 = &wifi0; }; + + led-controller { + compatible = "pwm-leds"; + led-0 { + pwms = <&fpwm1 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; }; /* @@ -50,3 +63,7 @@ bluetooth0: bluetooth@0,1 { &i2c4 { status = "okay"; }; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8112.dtsi b/arch/arm64/boot/dts/apple/t8112.dtsi index 698a436e7dac..1666e6ab250b 100644 --- a/arch/arm64/boot/dts/apple/t8112.dtsi +++ b/arch/arm64/boot/dts/apple/t8112.dtsi @@ -458,6 +458,15 @@ i2c4: i2c@235020000 { status = "disabled"; }; + fpwm1: pwm@235044000 { + compatible = "apple,t8112-fpwm", "apple,s5l-fpwm"; + reg = <0x2 0x35044000 0x0 0x4000>; + power-domains = <&ps_fpwm1>; + clocks = <&clkref>; + #pwm-cells = <2>; + status = "disabled"; + }; + serial0: serial@235200000 { compatible = "apple,s5l-uart"; reg = <0x2 0x35200000 0x0 0x1000>;