From patchwork Fri Jan 6 13:58:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 13091401 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 B5C6CC4708D for ; Fri, 6 Jan 2023 14:01:23 +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=UONxi005UEb8Bd 8S5+U4BDCjinGihcnL52dwLdbSsMpdYChG5MI0gJiaRSS3c/G7Ej0bpvCWKYqLyYrwh4hP95lqciB tQL3515D4eg+KpZWwyufGDfYUVzEDCxv0kCXlSiuSw4+K5CKSPV//uClD0khIPsbpF0CRhxxlw8Lm rFQFjkrZbnODkvz85GNVniMd+7JKjkPVyoOt2KGa8O63kKGlCdHKWCC/AiEIS4RjxNjWDTujDoOne gRI/2G1vhYbmYb8Oum7MRjL41dyTW3P0sxQ3uxghm1je5j36mZ1tXnO9UbgaKdGZlggnzDLUCoEAe deBGmZKDX7tAHSaqVugQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDnGe-008cvX-I2; Fri, 06 Jan 2023 14:00:20 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDnGa-008ctH-NC for linux-arm-kernel@lists.infradead.org; Fri, 06 Jan 2023 14:00:18 +0000 Received: by mail-wm1-x32e.google.com with SMTP id g25-20020a7bc4d9000000b003d97c8d4941so3580157wmk.4 for ; Fri, 06 Jan 2023 06:00:15 -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=JIOlZ/Nx0g107umrYRbaqvobCR6S11fvHIgf4M1VeCTHgVTR5BO7ilFAatFWxVZAcH AbfDbThGcBs/JVtVcKOGYeZuOh5nljp+QtqvfAxbT1b53cmFqHw0FZXCUrj7ZXMd3pkj +OtHqOwPbIqn41qMeyKRHz6OUHhg1SMMsJDT93cFrvJ9k0XyNdWAai2ggqn8w64DFdLF oyIC4CKtrgH6PGhuZdXIZ2BaznuO0YtNTK0U6jU7IamLf50aNUWaVD5Zn9To2h/qhr9t 1eN44rEm+GOh24KU9enUB2P+oz+iv8mDFGt8Mf1O8X6V2SKvv4hpazG0olnZGbEmG9Ap NJ8Q== 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=6hZpS6vDyOzchQFRP/kuGEQ5Pw/8QmTWc6DUaS3V0e9yO5yMtSSWPvk/JPSeQsRWdq tyx7NAtvT5Bf+ox7GrOyQwJ8Se1206yERdCFn4tV7wbq9JpXZ+U6v61Oi6owsoP3R/YN +Fay2ajwD87KQYK5vJrp4RoiPvQNiGK8B3NKpAld0COtWU3+CqwtJO9I09DSkrDh1+aj DTjLkYhr3J15pFg6jYXi5r1I4ixS1kj2EBzB1fPnsrj38zk8rGVOODhx/nUpXQYAkFp2 edUcMa5uuWTwLSlyZpTDN5ZN5Py05s3186+QVxn0Iw7/Wky5WbZHwBqFGAvi1XWoHmr+ k16w== X-Gm-Message-State: AFqh2kooC1JWPFEWR7k9kBFbdR684dWn7qPEmmHvdN67LHepNavbZ3yF wpkV6wiPc3M5uAsp3v4mP10= X-Google-Smtp-Source: AMrXdXsYq4D+WnUsWLyK0xKopnwsG6pFgkxKUMrZEJ6/pn3r8RHOzSWaRJYnqCuDU7F1PH/2JWFV3w== X-Received: by 2002:a05:600c:3b0a:b0:3d9:91cb:bbff with SMTP id m10-20020a05600c3b0a00b003d991cbbbffmr24761921wms.26.1673013614525; Fri, 06 Jan 2023 06:00:14 -0800 (PST) Received: from localhost ([212.253.112.114]) by smtp.gmail.com with UTF8SMTPSA id r5-20020a05600c35c500b003d98f92692fsm2102274wmq.17.2023.01.06.06.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Jan 2023 06:00:14 -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 v6 3/5] arm64: dts: apple: t8103: Add PWM controller Date: Fri, 6 Jan 2023 16:58:41 +0300 Message-Id: <20230106135839.18676-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230106135839.18676-1-fnkl.kernel@gmail.com> References: <20230106135839.18676-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-20230106_060016_820757_F55C6B0B X-CRM114-Status: GOOD ( 11.40 ) 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>;