Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4609237rwl; Mon, 3 Apr 2023 07:20:19 -0700 (PDT) X-Google-Smtp-Source: AKy350ZpxPrhCP6sq1EbXmtGadyUW5wBrpOOtHTgjz/J0JXIt3aehadktl11gu6U4VKHkcacEYhH X-Received: by 2002:a62:38cb:0:b0:626:7c4:9f38 with SMTP id f194-20020a6238cb000000b0062607c49f38mr34368001pfa.31.1680531618874; Mon, 03 Apr 2023 07:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680531618; cv=none; d=google.com; s=arc-20160816; b=Xy8xE3srtW1SLOFECG59M77L9U+yrVVawksITrmzAmYEMiruWQVWZwub89KZOCchDu YKqQcYw83xHAbwna38QSxQAjTMpWYYHJmQxOjUQzlDDKP1qx/YJyWn+eFNl7XxRDXPvp OAdQykCwiWiUmJfd+0ciIR3CuxZ5qd0Ek2md1EmP8D9ZI/KhD/GG51HgCeezivJJFL7r YFEmpu6h6wYBISlIvK5cXD4KdIszXoq566jX5pb4aqBMZYaD/FtoXeuSgf+jfvqPuIhs WGHjeOC3gtUD9BqNdFsbFfx/cbWSZzznd24QMe/r0/P0m3nQPlkPGA1pRFtddQyvSkYU 1N8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=dW2EjOch0f+DSHIS1u/Qy1C0A6k6ekvEIe3GWbFxymo=; b=G4TgpxE6pJ9Cc58oPRgiV6fn13CUIVqGPZHIIe9+r0Lu8q/HqYM5IHnagvsivofid3 VPnG31fuHOPDAfFGPJYCD6VAkYEC4uS4gSLgPLT1j+FLqua20SJyfTNZSr1W+FHnPwDb Dwxhud+XdWsNvYS+S1NJFy+OQHylSm5rUpZAnbLKjOBAxKu3Z17AuG4ePQSgLsVkrAcU /Csc2Ak7Yox95q4VG0x7xxoImm/ysDF6pF673TbnONSpf1xcQ6AF4m6CVV+W1V36SV6V RGDgO0eSXlLpQ1msh8NEgJde0hL8/nwuHnVBI3FBY2y5gg4flCTM/bHLBHFphuxxuYck VcWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Du0VzcQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 64-20020a620443000000b005a8efbddf5esi8092711pfe.238.2023.04.03.07.20.06; Mon, 03 Apr 2023 07:20:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Du0VzcQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233065AbjDCOTf (ORCPT + 99 others); Mon, 3 Apr 2023 10:19:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbjDCOTc (ORCPT ); Mon, 3 Apr 2023 10:19:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF88B2CAF1; Mon, 3 Apr 2023 07:19:31 -0700 (PDT) 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 794F961D17; Mon, 3 Apr 2023 14:19:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D0285C433A7; Mon, 3 Apr 2023 14:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680531570; bh=K7KAs5aTuDiJuhe8a8kO1plBeeVrPyWrzAR3bhvJHMs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Du0VzcQOaqkGl9w2rqwbqKrnw5012VYqJ0kDhb9cOagOXiVlbCTJtPFeyCjOR432q 8z5OBP7IPv1FZIVj4zNN5scT9NhcXAvH4zDwWBqsJ+7dygKmmglbOP0hGwsNpkKqnx prDZMn8+S3ipQyWvS4zXOmz3WGnZfgCJz6Jdh38HIN39BZrH1oVJ6SDBD/DAzl6Ekh ZuzuiEKAd3zCZ2glY0q+uIjc3gcU9mMzA0b2S6nriFcrg0JhIrsefnZw3m/bdmStcA AuK0KbR3c+KrE2gdOKAAiJzK/ufGRwT6DJ7Q3iNfaMUZyxu/Y/9EXoJ/TckyHni4uP YoQ+rnU1WzGAw== 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 C0345C76196; Mon, 3 Apr 2023 14:19:30 +0000 (UTC) From: Sasha Finkelstein via B4 Relay Date: Mon, 03 Apr 2023 16:19:21 +0200 Subject: [PATCH RESEND v9 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-v9-3-f3094107b16b@gmail.com> References: <20230214-fpwm-v9-0-f3094107b16b@gmail.com> In-Reply-To: <20230214-fpwm-v9-0-f3094107b16b@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=1680531567; l=2867; i=fnkl.kernel@gmail.com; s=20230213; h=from:subject:message-id; bh=RJLO7JCmSOkRMNMtOxzdicgaDQkjrnsxFw1lTXw7scM=; b=n2XuECUleiFG/ZcNNcLKxzX4LNnvfJiqpW9DX51j08u7g7jFH4Wif8ox2P5nfaw99bEicGZ7M NBVHNeILPGLCH2rWZyd+PTffiBJwRP3CfYKr2BiDJcWcLRWhAZJdS3U 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: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_REPLYTO,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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-143)