From patchwork Fri Dec 9 11:13: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: 13069502 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 00B00C4332F for ; Fri, 9 Dec 2022 11:16:36 +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=w+FGFs9ZkWMVBZO/kkM69LY0k/8UrZRwJRb/rsoUjBc=; b=wb4Q3sAQuulEe9 +mgKP1vvEKesjpvTvHlQDhFIRq72bCEYY5/aLW8Qdd0z4GlNVadJRKvcQXlLHoC9Zc3r5mIAdTPsF A5HBAuwhds1pvk772uCkNCbNWhAoF99kgXkDOJbgmVslLEuWnDMsIWk7FnLgdvaJCf6hdbV42Clev 6zfOGoFob7FU7DyzIwWV2eHlQ+Id2Rvgpxxi2b6OhMkoT+8w+v92W9zmRjr2oXU5UpgnR3r0g+yYq iZG+pPM/JgmnMPXW9S8VNxbd15d1JmKmZDB9nQL1Tk9m1QNu1Hm1+f3vi8iuPacx32Bkp+LcZTrun sqrKvFT6GynT82oO+Z/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3bLl-0074cV-3J; Fri, 09 Dec 2022 11:15:29 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3bLZ-0074XX-3d for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 11:15:18 +0000 Received: by mail-wm1-x332.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso3172354wmo.1 for ; Fri, 09 Dec 2022 03:15:16 -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=ZXoAAIlGGmSpSwozdUzhwnxLFmPcWjZw/9cTYhXVqxI=; b=M5jxKsenoI+siJcelcoKbcTImniNIi1BQte27vlsaE0ygxtv84jC2u59I6Rgf37gvw 8Eam4anacGuvXVYxQHDAuJ+Ei0eNQOBUY1VXD1909PEWQ0oXkGAzMWvDydmGXemWoMoQ FgLPt8kboH7bwqyJZ8xwMgqp5femrsDhrqTycElpXJ7/s6MfOoAUR7PGXUQZ3ldQgN6i kEryYp0djWap27ZAwj/sBJ/6Dnn3kkb6dqi9nU81JabtVLUwBAfbFhv7o3wwPgylNWUF RDcp2USBDguLPYm3lugrSwkxmrNWUxJLWfvAkiF1WE3u1g3z84K3KuC52dq57C7Vx5YQ L1kA== 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=ZXoAAIlGGmSpSwozdUzhwnxLFmPcWjZw/9cTYhXVqxI=; b=pHood/9whbbppRYIW2tyCytJUsHEq3BnB7vS3XDhA7oasm6wj+FzJBh/uTO+p03fnN 31UZTe2qwzCo6tl65LSv3Z/2CQo2q6up2vKXTIvJj57zn8qlhQUG9qO6Fcb5Ju/u2WqE kIkgnc6qA7heezQreztLlIYdDOnA4DdXC3ABQ5SJFntm/A0Ni6OcbWgwFdXe6+4N+9oq KSEb/VSHxkfo2RwTUIrmEF2MW6nWT+6qyBL8iFWVK8PBm79yN1/VWc/fAO5sPFn0SLDW NGTVbaYUNlD9LI3Kn5EE8cytxhu44ixCpH9Xzvn1baXlxdiRa3ORqPdNt1uw+gqnrNwL XrpQ== X-Gm-Message-State: ANoB5pnWxGPabxz4bF9CQnJcizhTPx2/l8VNWV4nRElEo1h9reEHRzjx RXt2IDDNYJ4yEHKhYQ0/Oa4= X-Google-Smtp-Source: AA0mqf6uCKLeDXGU5PrIOdjYUngC7zdqdd3A6gVV+huIsnmNL0AsnrGLW8L02lPepgTdTJv+YLXF3A== X-Received: by 2002:a05:600c:502c:b0:3cf:900c:de6b with SMTP id n44-20020a05600c502c00b003cf900cde6bmr4699711wmr.15.1670584514729; Fri, 09 Dec 2022 03:15:14 -0800 (PST) Received: from localhost ([217.131.81.52]) by smtp.gmail.com with UTF8SMTPSA id n4-20020a1ca404000000b003d1cf67460esm7746763wme.40.2022.12.09.03.15.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Dec 2022 03:15:14 -0800 (PST) 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 v4 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Fri, 9 Dec 2022 14:13:12 +0300 Message-Id: <20221209111313.2701-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20221209111313.2701-1-fnkl.kernel@gmail.com> References: <20221209111313.2701-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-20221209_031517_180695_1B64A54C X-CRM114-Status: GOOD ( 10.71 ) 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 | 19 +++++++++++++++++++ arch/arm64/boot/dts/apple/t8103-j313.dts | 19 +++++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 9 +++++++++ 3 files changed, 47 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts index ecb10d237a05..b28d6f9ed3eb 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,21 @@ &i2c2 { &i2c4 { status = "okay"; }; + +/ { + 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"; + }; + }; +}; + +&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..57e75e6ddf63 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,21 @@ &pcie0_dart_2 { /delete-node/ &port01; /delete-node/ &port02; + +/ { + 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"; + }; + }; +}; + +&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>;