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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C79F2C74A44 for ; Fri, 10 Mar 2023 18:44:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbjCJSoX (ORCPT ); Fri, 10 Mar 2023 13:44:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbjCJSoO (ORCPT ); Fri, 10 Mar 2023 13:44:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94FAF123CDE; Fri, 10 Mar 2023 10:44:11 -0800 (PST) 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 02D0961CB0; Fri, 10 Mar 2023 18:44:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 579A4C433A0; Fri, 10 Mar 2023 18:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678473850; bh=PAhBO65+/b8sDxos9NcjPY59ZyKD4hIZ8XfH10uHCyE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=g0B3o93Ew0gqzZT9zntG0DVR3GtixzQ2d8CI7DCNts4QVQmWbIf5wATKQH+3bTkqR D/CFmuTXTuIpyYLeOXJP7+eAopJSpjXh7KjsUTNLbPMQxRsDr68AkXr4rDh9YGCSFf pvNtLAIFtIV3lHkiyWBNtOSbKrK3UUESiTNrqP16a4P59dSclDy7DcGuoOLQTOtFpv sPgcLFgkln2F0prMLnXxXg6GY1aqMxWi/amDcHV5+BMiHFk8Toi5O3jdwr/mgTZwfv 3yjr2cEoI2A9lWoF5iDyDHT7Zw4XLnzkYI1Mbviq0onJbPaM6ZpZwd+4YxbcYVAqP4 3a2LFpdjKMZhA== 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 3F52DC74A5B; Fri, 10 Mar 2023 18:44:10 +0000 (UTC) From: Sasha Finkelstein via B4 Relay Date: Fri, 10 Mar 2023 19:44:09 +0100 Subject: [PATCH v8 3/5] arm64: dts: apple: t8103: Add PWM controller MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230214-fpwm-v8-3-65518a0d4944@gmail.com> References: <20230214-fpwm-v8-0-65518a0d4944@gmail.com> In-Reply-To: <20230214-fpwm-v8-0-65518a0d4944@gmail.com> To: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , 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=1678473848; l=2869; i=fnkl.kernel@gmail.com; s=20230213; h=from:subject:message-id; bh=R6FVHucw/1bUgNYLGZV8OMhopQA9RB5yXaUd/bpvUDM=; b=cUg8P9AdXnzmDv14iHCuwOq60Rj1JRnKQrxEUbnY4smKJpzzZjIc95Yp40CWdTAgTpZapOS0J xW7z222gB53CNJxEh7CbjOjJTTs1JTUuHGpV5QAo+8wCeTXA2zDGd/J 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 Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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..fc55ce0fa40d 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"; +}; 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>; -- Git-137.1)