From patchwork Tue Feb 14 15:57:25 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: 13140449 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 6A389C05027 for ; Tue, 14 Feb 2023 15:59:03 +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:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GoUseLFcbL2pVA2E3qCnCsYaoek5vThXEzhaC1CT4zU=; b=eE1dhh1RB5l8O/ QttlpwkWaNO++oASwaXUoy0T3ORzh4uy93F2/iFUtiqLh07KjdSrB5XaPE2LL4HXp+0EXXZTtupPT WHTWAtlJr/N56MXNldRnHd8zdH1IzUETSCtuTam819nR0wa90JD5CKEDk/aX3a1IBdh3V406oHuMS b9Dqf6jT3kxyV3evy8G4sHblw1Hh2aB6I+TeUESWQmJjDnL60lH98ON2WEMz6kfQ2sjZ7PuHgi2LH hq3QWbvXYa5mnqqALzCyjI+3Oruzkazr5gKYtHFA/RX7VgiA0My39YjfOPDbFY30EbbllFoxys5X7 bWo8aqr25WzRPffJIYVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRxgy-002g0B-IQ; Tue, 14 Feb 2023 15:58:04 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRxgf-002fu8-2N for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2023 15:57:47 +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 440BF61745; Tue, 14 Feb 2023 15:57:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 5763EC433A0; Tue, 14 Feb 2023 15:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676390262; bh=bd22GtPmWPipNXDyfrZ2Gq2UCaJZTLghuNgzdi0NEkk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sH62gTk6NImWvGPVl8dDoS/JFvO1YcCvrQH63pSk4PpZJeB/aRFOjEisBPedxY/kX i3VZys1vgY+y/Lk4kCsX8e3q5juUP15AicYp59Q6pwl6DDjj4zbaQEP+G1UcgOYdTd XDdwPXRUgTw0br2DUMsea9Edkp8eE1Hcx1huQjampU71LxgtPT0rvhb1G9rmWyxSKH mxhCQRiIVsBpf1YMCLfEw962k7sm7mlrjq2UuTbSNSBhHfEzZj3qcmN+3a51339rae pjqOb1BOGIcgLAdGj2OtS4fggX+e7DOiobw/D26316BJejJrfcPJCq711r8SQ2g4a7 Sqv2c250whjwQ== 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 3F63CC64EC7; Tue, 14 Feb 2023 15:57:42 +0000 (UTC) From: Sasha Finkelstein via B4 Submission Endpoint Date: Tue, 14 Feb 2023 16:57:25 +0100 Subject: [PATCH RESEND 2 v7 3/5] arm64: dts: apple: t8103: Add PWM controller MIME-Version: 1.0 Message-Id: <20230214-fpwm-v7-3-fb0a6bfbd037@gmail.com> References: <20230214-fpwm-v7-0-fb0a6bfbd037@gmail.com> In-Reply-To: <20230214-fpwm-v7-0-fb0a6bfbd037@gmail.com> To: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Rob Herring , Krzysztof Kozlowski , - , Sasha Finkelstein , Hector Martin , Sven Peter , Alyssa Rosenzweig Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676390260; l=2898; i=fnkl.kernel@gmail.com; s=20230213; h=from:subject:message-id; bh=X/0B/iNzJLmduQtxNfWIcVJ9VO4Au0DVrk19Cp1+og4=; b=2Qs/rzTqfOfByMYiDzfa6CMGo+v+mIbZrc0lsg+2odCPm+zufQb6hAHFBeaUCJzxcW0J1aRJK tkJnn7qgCSLD9lJxrmcq07IjdEq9lP8wHwDyC9Kj+I0jW4jyZhEaj54 X-Developer-Key: i=fnkl.kernel@gmail.com; a=ed25519; pk=7LFSAJtxIWAs9LzCIyX0sSvCZy2wQTyEIu1zch6o804= X-Endpoint-Received: by B4 Submission Endpoint 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-20230214_075745_275744_3BEDA7F9 X-CRM114-Status: GOOD ( 11.91 ) 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 Adds PWM controller and keyboard backlight bindings for M1 MacBooks Signed-off-by: Sasha Finkelstein Acked-by: Sven Peter --- arch/arm64/boot/dts/apple/t8103-j293.dts | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103-j313.dts | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 9 +++++++++ 3 files changed, 43 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts index 151074109a11..7381dccc1613 100644 --- a/arch/arm64/boot/dts/apple/t8103-j293.dts +++ b/arch/arm64/boot/dts/apple/t8103-j293.dts @@ -11,10 +11,23 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j293", "apple,t8103", "apple,arm-platform"; model = "Apple MacBook Pro (13-inch, M1, 2020)"; + + 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"; + }; + }; }; &bluetooth0 { @@ -47,3 +60,7 @@ &i2c2 { &i2c4 { status = "okay"; }; + +&fpwm1 { + status = "okay"; +}; \ No newline at end of file diff --git a/arch/arm64/boot/dts/apple/t8103-j313.dts b/arch/arm64/boot/dts/apple/t8103-j313.dts index bc1f865aa790..1e26aa1ef525 100644 --- a/arch/arm64/boot/dts/apple/t8103-j313.dts +++ b/arch/arm64/boot/dts/apple/t8103-j313.dts @@ -11,10 +11,23 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j313", "apple,t8103", "apple,arm-platform"; model = "Apple MacBook Air (M1, 2020)"; + + 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"; + }; + }; }; &bluetooth0 { @@ -39,3 +52,7 @@ &pcie0_dart_2 { /delete-node/ &port01; /delete-node/ &port02; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index 9859219699f4..5300fd115561 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -432,6 +432,15 @@ i2c4: i2c@235020000 { status = "disabled"; /* only used in J293 */ }; + fpwm1: pwm@235044000 { + compatible = "apple,t8103-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>;