From patchwork Wed Jan 25 15:10:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 13115782 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 A110EC27C76 for ; Wed, 25 Jan 2023 15:13:54 +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=q9dZkC45Oo7aoy 7PA3PmEuP7Rosgl/D/4DjKNq4JFM8KIIx1/11ewi8nopFaGgcxPHyqsuIi/AVmZgSGovqotXg8D5U S1XUWPtB/RgNckUlYJTSG6VLSSeWVEDr+I4RSP9URGHr14BOSp60jndwWC107vFHAWBEAZtFkqfnx 6AoHiLCNDBR3rNsnIZlYKaC0hmclMGcTFOJ/1Z1QlIYEgze0JqzpjZhzVUx/G8U41zRLgkUcTfMhw xf/nidcUcjkqJTftPLeCUSrVkLAekGbgt75J0vzedCu/g09V4FZWVgsGAP1Itx1fFYMbYumfOUW8X 4Z4/PbuEjm25FyZVqN5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKhSG-007kjv-BP; Wed, 25 Jan 2023 15:12:52 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKhQf-007k5p-OW for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 15:11:15 +0000 Received: by mail-wr1-x435.google.com with SMTP id y1so12884301wru.2 for ; 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=A7DHYpnTlOUngiX391s6fOyKX/g19NfnKkk1iKNDp/uwcmFcYttZImzTCFJAX7MD+y XnCbKFFZvoBNja74o/Yo5lcEffRM0eB1jlaEaUS0xVDyWVBn64DF/kcl8urh5tVcWLqd +I5GQqlGFZTi068z1zirpBC46rtRRRdO8AAltpazpe3ZPtP4mD+dpynHXVRQjn00xif6 KiEUuTr52rTGmcSH27fxE+DhLmXsZQ6b1jVHMMDFJdkROI6nU5CpPqIgFffOw+2Y3dzE ByvDeCBW2WapO9MDLed8im52kN23M8p56pSaQ1VHtmQb2ZQgzDiVpxVi1kKaV6/1aIAv 8pwA== X-Gm-Message-State: AFqh2kpEbPKdLQt7qQxyTlY0tJpXHwcNRNvV9JzKo05YYa0X/NiOZArm F5dY352w8Jb6hNzH8LglG3I= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230125_071113_855006_BD1A07AC X-CRM114-Status: GOOD ( 11.21 ) 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>;