From patchwork Wed Nov 2 14:15:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 14265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3649095wru; Wed, 2 Nov 2022 07:20:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78IbnNbbo0qmYLaerP8jTTO9uJ0VuyRESyHYXj7vEvC05C0/PzBBBYAiK3EKF1QBUtz/+x X-Received: by 2002:a17:903:32d1:b0:187:143f:4c5b with SMTP id i17-20020a17090332d100b00187143f4c5bmr20208177plr.54.1667398843060; Wed, 02 Nov 2022 07:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667398843; cv=none; d=google.com; s=arc-20160816; b=Zc+xUgySqZf74RJfRnfAuNU3hG9zNeSu8rGZvMnqorXqS1VKzUhGM9ii16v8vCXyL/ tx4ZHvERen+lXFm1cSMT9qB6F4qTQ2Kb4QRcMFNT1/nIHo+ol0350da5kBnrifTiG+YA xc53T6pHvdNYorcrIq10Rj9VRwKM4CMmOaaBa4iWybfnzEl5aCvKlBD7nGC+srogBMNo WkxbNEtwRBaCg2qI/9ZORRITkBYQD0uM/n5ZxeDSuv9cKWKHG0EbOAOC+YPBsqQ15n/G GfVewbgWuGlDEzuK3Qnrlv7JfiJKcrLd/O2aZ0mfcIg6zJwrhVcLWqdVMGiqn0UDvFJI mIzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0n4mZvFvck3T3rrfQ9rSgkc96Wcu4vbjw0wqQZmCTT8=; b=0V/btrFrCoo6BlIccpQ9UWREf1O0m+dhEUTSpNCL4URXwRTw4lvKofAuRcxP4W2/Jn CzwV6IxraVvlpQiEFaUGQxGAjpqh9xuao0KIgRJJU7ijnSgQZbQ1I2+DnhTlFzbTWxg7 rDdYmZ1xkjdWEohaiNn5pkWc5H2CP7kigolzFDgftin9gx7b4w/YM1d1uiPKqJPYa/wQ l3wh4TQIS2zyAbfTIJR0bl7+/+o8S/Mk0IylIt29XycHIVrUlSBSFqGYcYfm3pR09DTX 9H4Zsek278i8b1ddmrCPgiSZBgSA8CZo8erKI/4ltYiBGXoEK3Kz5aO3aRPSEtRBQdKw VmKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=buxhVMqC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a17090b010600b0020305fa091csi2065670pjz.140.2022.11.02.07.20.30; Wed, 02 Nov 2022 07:20:43 -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=@gmail.com header.s=20210112 header.b=buxhVMqC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231463AbiKBORj (ORCPT + 99 others); Wed, 2 Nov 2022 10:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiKBORa (ORCPT ); Wed, 2 Nov 2022 10:17:30 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6F6227CC6; Wed, 2 Nov 2022 07:17:22 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id kt23so45620406ejc.7; Wed, 02 Nov 2022 07:17:22 -0700 (PDT) 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=0n4mZvFvck3T3rrfQ9rSgkc96Wcu4vbjw0wqQZmCTT8=; b=buxhVMqCdIEJlX44xa53eEaCR2cbl9OSqVZRxuS7pD4aeF0CWccB2ltiOBS0cNgMX4 DisAdaH4fQPyuswXY8mVrNu/7euYRzRDdNtKNtsN51lGD+99PKgbDALVFhoBMN+cmot9 fn7yeb9EjsaqOyZwK013AISF1cpQRA+Yp39a27gl3aT2p2h5Hn28d0wx6qx2pn1VrPKT NTxouVy7rM/l4nOEJ5Acou5ZCHUT832R7egaqXzyvXlozybZFJcfDHe1TuWDs9tbASBh FPtX9F+vYjwOZP1PLOlMe/fcS/0+qrhgg/0Nzg139fODDkrB6HmPAbgrGrIS+48geAws DoIw== 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=0n4mZvFvck3T3rrfQ9rSgkc96Wcu4vbjw0wqQZmCTT8=; b=eCKavCxSMC9NVu7STGnlh59FtUU6hRmGeorg6s5DnPaHgLrsvNMiP6USv4r0VZ/Nyo kZupYGkCT7U8qf9CYIHSG7jN9FIn9CZj+p8kzwWNkbV9bs4I+4Bo5F08NIMWLaSgBD9C f5DZLfzpxxhpg+3CqeNtkhMoNpcSBBvhYscNARJTPDd+Mcm6eocAIHFCdU+J7eOdlwPO FWaEcGXMNfdu9Dijtb1waJK4s9jh7SnuauENXEr3kW3zC0kG37ml20Exbt6UdVezVNrx 4gIz+V7w3ba6NuFgZ/X8IogppR6h0hi3HTu1SaULvRKVLx8baXvUbDydZ4bUs5XSG7tv in5A== X-Gm-Message-State: ACrzQf3t0yXVvUjPXSAfM6nq0+iaw+bA62isnSmki/qabR+J2YdZyIU3 DUZpDJlaKXekADIJaubzBFW9mtwYyfA= X-Received: by 2002:a17:907:6d9b:b0:78d:f24b:e358 with SMTP id sb27-20020a1709076d9b00b0078df24be358mr23291374ejc.714.1667398641424; Wed, 02 Nov 2022 07:17:21 -0700 (PDT) Received: from localhost ([88.227.60.86]) by smtp.gmail.com with UTF8SMTPSA id r16-20020a170906365000b007ad9c826d75sm5465266ejb.61.2022.11.02.07.17.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Nov 2022 07:17:21 -0700 (PDT) From: Sasha Finkelstein To: 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 v2 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Wed, 2 Nov 2022 17:15:12 +0300 Message-Id: <20221102141513.49289-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20221102141513.49289-1-fnkl.kernel@gmail.com> References: <20221102141513.49289-1-fnkl.kernel@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748394409183933463?= X-GMAIL-MSGID: =?utf-8?q?1748394409183933463?= Adds PWM controller and keyboard backlight bindings for M1 MacBooks Signed-off-by: Sasha Finkelstein --- arch/arm64/boot/dts/apple/t8103-j293.dts | 20 ++++++++++++++++++++ arch/arm64/boot/dts/apple/t8103-j313.dts | 20 ++++++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 9 +++++++++ 3 files changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts index ecb10d237a05..0b4b7e8e0726 100644 --- a/arch/arm64/boot/dts/apple/t8103-j293.dts +++ b/arch/arm64/boot/dts/apple/t8103-j293.dts @@ -11,6 +11,7 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j293", "apple,t8103", "apple,arm-platform"; @@ -43,3 +44,22 @@ &i2c2 { &i2c4 { status = "okay"; }; + +/ { + led-controller { + compatible = "pwm-leds"; + led-0 { + pwms = <&fpwm1 0 40000>; + pwm-names = "kbd-backlight"; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; +}; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8103-j313.dts b/arch/arm64/boot/dts/apple/t8103-j313.dts index df741737b8e6..0e0f57dee96b 100644 --- a/arch/arm64/boot/dts/apple/t8103-j313.dts +++ b/arch/arm64/boot/dts/apple/t8103-j313.dts @@ -11,6 +11,7 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j313", "apple,t8103", "apple,arm-platform"; @@ -35,3 +36,22 @@ &pcie0_dart_2 { /delete-node/ &port01; /delete-node/ &port02; + +/ { + led-controller { + compatible = "pwm-leds"; + led-0 { + pwms = <&fpwm1 0 40000>; + pwm-names = "kbd-backlight"; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; +}; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index 51a63b29d404..ccdb26ef6b22 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -191,6 +191,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>;