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: 13024086 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 9CF92ECAAA1 for ; Fri, 28 Oct 2022 16:57:04 +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=HJ6XQuiI0FL8ozgaq7gj4mYnfrfWReHeT8acdSI9k/k=; b=Bh4rR8umuQpqkD 7Q2T2DAiZH2NYEKoNlcoA/TxBNKx5Qj84CJbCCcQ7idQ6WRatw9AeYnBq0gsVAI+SAnSFLH0B6LJu WttPD99ShodIm8rLOGmhfJV1J3R0HwuGuZwGlRZY6YnR9ziAkw3ib4N61h3VT7ra1Jy7cqwhEQnEo Br3fKbZogJTjH3eEDPTAW8gn7bkYv9e85dSBmYFcJ2dZmmsTaeziJTFSi8lhoGla8+PuX2JcXVgzF /33dWoWETgqlkvFmI8TdPQ146UhvEAbRqTyaOL7qpyuUOYbwBoE8ioYDH7+ZbdRV38CHx9VVb3D/a K2aKaxYdomFIFsxNn83w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooSe1-0014Sd-Ki; Fri, 28 Oct 2022 16:55:47 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooScL-0013gP-BN for linux-arm-kernel@lists.infradead.org; Fri, 28 Oct 2022 16:54:02 +0000 Received: by mail-ej1-x635.google.com with SMTP id bj12so14234849ejb.13 for ; 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=JUWpl9HT6lbP69XqH9ykJPqqW9mHeklRDwZ/lw6Lh3njg0IpEK4ARbEhLENj0c9nop lR7ofqxnTTsJzprErjX7L/yB9Mf8PHNoh9TtjmX03lxxPxLn3OaPJVsD9Fr7PI6c9xUw JwdeWll97tB4tG+vy1SKRIKCuQKxVylUd6L6uxSGNsyMG1D03xIGebexEBxtFKNeRp0H 3HQbsvA9Nlh4/0ovEpgY2Osj57YCX9xD+9szB9Lxvh0TScvT2krO/pzVOBGiWRdbBQOM Yeck3ctkzaw1bQzoF1pBY9mKA7uTlyxNNk0TDTirtABb8qrT8ZdqRwx7ja0mCb8jxZo9 s1VQ== X-Gm-Message-State: ACrzQf2bjxkndvOvQI5Mt18rTmZzc0W699sJE+DKaRfmsxUDaGV8Xn2L 8+/W3ad3h50WJ0relakGmJ0= X-Google-Smtp-Source: AMsMyM6GtYiFzraRR/zi84/PsPHqlixqpyeG+7KA8z9hAYWO5Xok23W+3VEy/yBLXAPw2n9IAdWgBA== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_095401_432347_A88CC165 X-CRM114-Status: GOOD ( 11.83 ) 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 --- 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>;