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 00D11C27C76 for ; Wed, 25 Jan 2023 15:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbjAYPL0 (ORCPT ); Wed, 25 Jan 2023 10:11:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235986AbjAYPLU (ORCPT ); Wed, 25 Jan 2023 10:11:20 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C90B59B43; Wed, 25 Jan 2023 07:11:11 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id d14so13684071wrr.9; Wed, 25 Jan 2023 07:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K3DSO2nFSdxMzrHJBYG74NM4oJgLnjp9dkanZv0gHOQ=; b=GzphiZhuHao9jPC9vjQFPlzT9IJrCylsU+4m3KXtOX00+BmO5IRM1GSRoAugm694zR 93SM/T/Tze+uTscTLgK2IEFkLvPHUWkwtdLa5wnVYhrA9N4y+CW7OiD06zf3ckv9VWNF gpiFPVIqUkfz6ujLO5vRasiZNQv7Krd3rQaxtpOd9rGYO6cbpbwz+YNxR3sRUbZMtclw lsc/8ATNTLld2Z2U175ps/mp3HSM/987iDnnXgoDGcJJtpGLXc05FpN0Y870m8Rxb3VT kPm1q/2YIUFsE45dSU3Sk9huw55o2VlWtt7mqwTJ57gKMMRVAfcTzIUOjIDhN7E/THXr h/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K3DSO2nFSdxMzrHJBYG74NM4oJgLnjp9dkanZv0gHOQ=; b=3O5jFBCy3GsaSB2lbNT0DXkObk2lOGCB1+YF3E5xRLDIonJRVzs1ZwmUVC8UF3QtWX fnOOOs/l4Yewe45xd9TwYBvn1JHgzcb5NuQWrjGugwvs+0WXIQscsGoyXIidwnwF6ctJ IX5iwWIvlzJ7z6MGqHTaDB/i5t0ngalzW0umGnDfDiNCklz8rK+vlHBKZrqHs0c3F1Nz qTD+r8FsJjMLSwKa5FqTzpwuiEkJhwa/5EbC/afn54Cjfi3Fe/sET+cUVMg4+GfjQGTt Y3DljN75AZF9Ap1AVxWYD2ZpuzKHsDmjViKKH4MLmczMYu7RON8PPTum7ZbZDrnt7r/m tSAA== X-Gm-Message-State: AFqh2ko2w9enykwD8SFKL3kHcPwzpEqLS9gvO8a8e1ScriYDuoSEb2k8 sLkvMCTZnQEfzsYytwG1eH4= X-Google-Smtp-Source: AMrXdXsCJOUQOjCBEGo9t9JRbe1DNwBYlQw2Rgo557yI4jIZI9Y+nSYoPF2LjDtzy3XZEkdvsqX0Rw== X-Received: by 2002:adf:e9d2:0:b0:2bd:dca8:a4b with SMTP id l18-20020adfe9d2000000b002bddca80a4bmr27598619wrn.63.1674659469853; Wed, 25 Jan 2023 07:11:09 -0800 (PST) Received: from localhost ([82.222.96.52]) by smtp.gmail.com with UTF8SMTPSA id a17-20020a5d53d1000000b0024274a5db0asm4739095wrw.2.2023.01.25.07.11.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Jan 2023 07:11:09 -0800 (PST) From: Sasha Finkelstein To: u.kleine-koenig@pengutronix.de, thierry.reding@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sasha Finkelstein Subject: [PATCH v7 3/5] arm64: dts: apple: t8103: Add PWM controller Date: Wed, 25 Jan 2023 18:10:39 +0300 Message-Id: <20230125151041.55483-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230125151041.55483-1-fnkl.kernel@gmail.com> References: <20230125151041.55483-1-fnkl.kernel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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>; -- 2.37.1 (Apple Git-137.1)