From patchwork Sat Jan 14 13:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 13101959 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 B5274C3DA78 for ; Sat, 14 Jan 2023 13:28:31 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o5m8j1SSeSrMQ5KJ/Kkbn1Mb6zCig9Y91DIDa7oeTfU=; b=Y1u6uDZnV0B40F j6MFIhqaVvS3yZYRr/IlJy1DTVaGcMupw8ZhcKTGYuZvoTIhHsXP0RN7OdQzFnyVLEnsSgPLlCIfB QHkvUO/dGhCIgAEsqSH9Q0otvmFxrdgae3xCzKItKSLwiCi5bRFszVJLuNNWfMBE2Y1aVFkRD9G/1 axxhVcrLHxcE/A1mxgZmhBb5KSM70HT3mRIWDMYizq53Gbr6dvc+/nDaMblD2O8ViNOznP3HRWVZq OmU7wILf8RSlCM7ue7/PfYE08qe0MFMo9rY4ICs10Z3ij3bobzY6VtPqbajDrbGnnzuoloIK1chW7 v7IhnGSar7ZFEBYxLJOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGgZB-005ro4-DY; Sat, 14 Jan 2023 13:27:25 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGgYn-005rbB-GO for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2023 13:27:02 +0000 Received: by mail-wr1-x430.google.com with SMTP id z5so22336887wrt.6 for ; Sat, 14 Jan 2023 05:27:00 -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=pbFyCviih8VQPUB7txIKy8vlSLeMi1nXlBWiVdtlIQaZlU/Fi7wNKU0p8fxUbneMV4 3PaWN0szqHSBs9Se4sIpzBDQBAulbUUe24mk+37CprSRXPiflCoMJY87Uw+VDwYsO0Ms jbp11KwqaA729p1mvAQmMoDUNbtTOJR4HqVWOfnyeI7NIPWtsla3jtu8ujEeHwphli00 VCISBCU79ftydyS1TQcL4lV2mZU9mWkIVAi0pMXNN2IYHFkUBEEJ56XZ3cS7IH2ZQml6 mEWpKFhHNQRV8mM7Y6ZmX/lmgwedMQOjOiQGqT8aTKQVtZ/Kv+ndZ0PO9CGx3Vsy5OIy YOEg== 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=71nrx5cknMYhz2VnchYx07cVCyhvzHvz2cw+5UZYXYycY3Zhdg6EszRd3xI2JgTXNy Gw3Caz4AHVxbeaE2kPADKy968jPgAy4ppM5NtPva07ya1eS7nMPFX+cYLHA6ubGvBL9y zJUEuoPeUERpNWNgGNwSOZhz2T+o4rbhA7JO3RekFKMUMDlKLRK2M/HZn8+V60ftREqb 6X1s5RbPgUf/wC4P2kvJ87H9mDS7H+UdOu75NrHSzv1z8JUTlxuCWGFDB8t1Yb1Vvj79 xkLSDATGeVyqLHqXDQ4r8xO7HnY7pHQMQ9QdZWHPNTvr7TWMpUeRzqLPh7EMgjTLMUuU D7Zg== X-Gm-Message-State: AFqh2kptjkgXgg3KcUo/XgULYKXivoaxfKgluBdq5p2E3FBfrPrx3TJ9 4MgEwicr9dkCfAHUTo1OF2Q= X-Google-Smtp-Source: AMrXdXtA+z1KEpmc6DTllds+TJMItwHfv9cgQMfGzXKntFgdGc8gS+f0+rsfPMZD+JQ2m5jSlkNprg== X-Received: by 2002:adf:fd4b:0:b0:2bd:d966:7ffd with SMTP id h11-20020adffd4b000000b002bdd9667ffdmr5870139wrs.9.1673702819108; Sat, 14 Jan 2023 05:26:59 -0800 (PST) Received: from localhost ([176.234.9.57]) by smtp.gmail.com with UTF8SMTPSA id m9-20020a056000024900b002bdec340a1csm1812630wrz.110.2023.01.14.05.26.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Jan 2023 05:26:58 -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: Sat, 14 Jan 2023 16:25:06 +0300 Message-Id: <20230114132508.96600-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230114132508.96600-1-fnkl.kernel@gmail.com> References: <20230114132508.96600-1-fnkl.kernel@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230114_052701_577413_287F9025 X-CRM114-Status: GOOD ( 10.59 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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>;