From patchwork Fri Oct 28 16:52:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 12463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp938760wru; Fri, 28 Oct 2022 09:59:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6URxKZJRw8oENJpqNYK7j4wfocUxIiha6Q/N2o4LhY6WmTY+Q0BcUpx9RhZKM28o/Ig9Jk X-Received: by 2002:aa7:d650:0:b0:462:d945:3801 with SMTP id v16-20020aa7d650000000b00462d9453801mr361427edr.117.1666976379417; Fri, 28 Oct 2022 09:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666976379; cv=none; d=google.com; s=arc-20160816; b=WeQj6tywh/tjYsW3k2mmGBgQvX+p2hRQY5XAB1HXkHCWYUYsh60ryKLKQ8aHYCGx35 8fN8Pip2/SF5PObuwyC8dizQ2F/mGmsjAvAi44RkcFooREG04tDpbCackhupj8l1O928 jz7z7la670r5GWEScm/bIudRxN7x9dh/N6UyGDtQ5imCBl/aFFpewswn2bW84zhnsDNQ 55OLh5b62rGzITE2vKMTp07k/gg6x7MRA0H7wHCebP8lgkbXsSXWft687FqO+bV/VaQQ TKrDNuIYaFuuZd3pDxDOLhTJTRoTCUP7NrhBSYpRZ7qQ/hQdffAAwZ61iNk+VlcGqGua szUQ== 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=tV6s01AbwYkQdjpJZBm9lXEp2eoEWm0Fi1fj3eRupAY=; b=MO1qw1GKQA5X7bxc96QyEx70PeqJmaFyyWg5Bg1DWCLnHSo4wP1e+X3ktEYWq8hHuP 6IZRLykbgkHlzOAmyFkZUknr9dGYMnFdgFEc96o0PIfYECkpx8de+0c/XwGS8I8wpq/G tPLmafyyKgLzllHJ+eXIgp/EnnGC2Tg3f81yuvVyoymfYTAzdMZdum1iI6aIjaex+TOT J0xie4fZQAW1QKS6KrO37K+3N3UFXZV9S8YvZQnua8/btWaAYUIqS7UgOSsMo9WbbhGA bZL6w0ZtAqA+0NpG8SivrAqr8GGj2x4hlFgTm1dLQfWGH3lbpTqY7xgPK0mrP5vhvgcO pG5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wn9mroTi; 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 gt41-20020a1709072da900b007ad6a0afbc6si5960913ejc.7.2022.10.28.09.59.15; Fri, 28 Oct 2022 09:59:39 -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=Wn9mroTi; 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 S230168AbiJ1QyF (ORCPT + 99 others); Fri, 28 Oct 2022 12:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJ1Qx6 (ORCPT ); Fri, 28 Oct 2022 12:53:58 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A3D219FDF; Fri, 28 Oct 2022 09:53:56 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id d26so14268139eje.10; Fri, 28 Oct 2022 09:53:56 -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=tV6s01AbwYkQdjpJZBm9lXEp2eoEWm0Fi1fj3eRupAY=; b=Wn9mroTiWrsQWcPC2y9SPU+AWLR0J/+mQ9Z7st9E6665BwycRdVhkW9c5wyoUmNlvT zGJyuxLu8/mm32FU4tc1F+nXq7mbRR42aMuITUgi17Ss4IIRxkryRbaghfOkWZK78kiU YrsocUg5ylWvI3xeVofu8JYCH8/0n4K0YZave2QHsnuUoH5iLVaQwHHYKEQGlb7+TjTq M4Jkdx0QPfuEFWiLowDUzBgwzYzBMlI7Lu+ry8OwJ2ecg+RkJkHZoz63PF2rwfSCaPHe BpMpxTuw0Dno0bNBbf2wnuIe6L7rOLhSxMSmm1wKnDW1jooaGJYWaxfS3IPBkHWHhWMe c6KA== 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=tV6s01AbwYkQdjpJZBm9lXEp2eoEWm0Fi1fj3eRupAY=; b=vvQ6f7H03TPkiU43Ssk7XwtfJG4rXCPD9khtWdjBzVKQa/rGGprd66wYo4Eclx7os6 kWZI5bOxJy3aQ9Ak5KhbFCjCrnka1RRLX1u/iSSfSBN4iljmi+5HbMuOC1IAHzrr7a+E D/yxBT9F8j6QBrdTHCyGSLELka+akPNhpBAiQehGD6R1jBka4o/myux2PYM0Vy7IpGZT pyE590E46ZbCjbDWExZ0PIsQoCF9L8OgNPUSYfXPHVg+BMi7qvi6vdfT6ICVTvaTgtur CVmYIEzkOavW4y/KhpXzM2wcIQ3M9pOwCI86EQfh62LNs2lgrS3yG/TXwG/g8eePmYuU bIfQ== X-Gm-Message-State: ACrzQf15wsVIO0f312/GrD8F2Ae/AOYHj0zfrCbYso+WwdOtApa6luxp Wo9/1zNGdctpNgUUJys3OBw= X-Received: by 2002:a17:907:2719:b0:7ad:2da5:3ba7 with SMTP id w25-20020a170907271900b007ad2da53ba7mr258719ejk.340.1666976035297; Fri, 28 Oct 2022 09:53:55 -0700 (PDT) Received: from localhost ([88.227.58.131]) by smtp.gmail.com with UTF8SMTPSA id x12-20020a170906b08c00b0079800b81709sm2407440ejy.219.2022.10.28.09.53.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 09:53:54 -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 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Fri, 28 Oct 2022 19:52:15 +0300 Message-Id: <20221028165215.43662-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20221028165215.43662-1-fnkl.kernel@gmail.com> References: <20221028165215.43662-1-fnkl.kernel@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1747951423476492325?= X-GMAIL-MSGID: =?utf-8?q?1747951423476492325?= 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..5652cd41730a 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"; }; + +/ { + pwmleds { + compatible = "pwm-leds"; + kbd-backlight { + pwms = <&fpwm1 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + pwm-names = "kbd-backlight"; + }; + }; +}; + +&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..cff53f8770f3 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; + +/ { + pwmleds { + compatible = "pwm-leds"; + kbd-backlight { + pwms = <&fpwm1 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + pwm-names = "kbd-backlight"; + }; + }; +}; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index 51a63b29d404..a95dc482102e 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: fpwm@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>;