From patchwork Mon Nov 21 17:42:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 13051496 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 05007C4332F for ; Mon, 21 Nov 2022 17:46:35 +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=tgXp27gPDOLbk5GulYtkIFbb+F6bJ30SGZEJRpI6yNI=; b=Eqer/vh0U07WQb LsIFyHVTfq03NdsjNb527SzTAFh5/BZzXa1I+H3XOItU8iBLBwT18b3YAB4gHACu6q5rv2m/8DnDo wGKDW1F4TRA/pI+cgE6I4dTWY1x4YbcAan+OuFhUvxmEsdKGgOH4ipH+chdkAa4N0JdQY9i4D7aS2 Ouq+kXJ2g1xC5DoK/ioUfJ1eJfy59Nmwi5D3V7hN7Z8De4a03mjiD0VuzTHD57yuY3751I3LOdqhH TFAAA2qLTKzv4dnZBXmKP69X/cu39FBABXlwV2N3n8/qcq4iVMCkGkp6Z6Pn7g9XP5zlKZyZwtSqF 5KKh8Siu6l9mxc8kcoEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxArL-00GSbh-T9; Mon, 21 Nov 2022 17:45:32 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxAr6-00GSUD-Sf for linux-arm-kernel@lists.infradead.org; Mon, 21 Nov 2022 17:45:18 +0000 Received: by mail-ed1-x52d.google.com with SMTP id e13so17316454edj.7 for ; Mon, 21 Nov 2022 09:45: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=u5GqgUQltU/UwWJVmKB9yBrhZ1yrd9RICIJ3rDIHDxU=; b=EEQfpiS80XVVx5sLX7hxmEe6Nc+y9aFvjbVDbccbOjamDOnaEeSuuTP9cyjVQmHaEq RAeC5m7UPE16AP/Qe1/9HOJUWGg48B62MMSa8VOrWdNX66bj6g+SyDJbDSnMjQuoXD7o ZoeMcpvr7kFG+oX9fW4DuJFATYerf1o+IbwZQN4Lo9hNq0MLbLXOaNQ5PgG9YaU9EsAe XyGRYc+8xGtXbYyj9W6bOm8Lix67z9ectnuHhnU3WrEhyrcKQb5maUCdqLLyVFgG8dt1 tYqdX+qgQrC9JGANOEjoWFa40ck27oAmDOFhNPEe6q5tHXEVj43J+JZztCxi7f5vyjgQ ALTg== 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=u5GqgUQltU/UwWJVmKB9yBrhZ1yrd9RICIJ3rDIHDxU=; b=Jy2b/qlo5cuoGhAykdTkNnp47pD5NYYrN7F/OYJtUOrOqCPS0+uBFDoI0vfYuQqqP8 Rw5hFpdQfgiUdB3l/XskhVJigFOTSPh+eqYYcjxL+qH6TPTEwlG8xOb826NBI+Ushp8e bJTYOPPnWqDH3w4tczeck4dc+u8NO0ifHNzv7Eakxh6FvE0wodPGI2gXeBb+izj/vhHH wncchEWPhZF4XMJx59v99OElD4VpMOTbEVAiQZpQKAEdCCPFV3I7MMaNxfgS70gYoXo7 BQA6r+bnn6mUA0QcykkEhRCnNbsK5MoipWN+O0md1mXw5Dd1n90Ml7iXNqxI2eh0RejH ZbCQ== X-Gm-Message-State: ANoB5pkV8E1LrWkB9yNN0LrwHx3XlzXktrDHOJGxyrQ3Rd4DwyiTkYCX xBq8z+u4FQzmBzEks6zN+TM= X-Google-Smtp-Source: AA0mqf6LYJRmuao1b8/FmHyF8hM9rGcOvUl8k9MzKzg4AB1fNO2tR3YxlSSFoYQG1Y4rrMZVM+c70A== X-Received: by 2002:a05:6402:2929:b0:469:b603:ca21 with SMTP id ee41-20020a056402292900b00469b603ca21mr1615945edb.350.1669052714455; Mon, 21 Nov 2022 09:45:14 -0800 (PST) Received: from localhost ([217.131.81.52]) by smtp.gmail.com with UTF8SMTPSA id d7-20020a170906304700b007b29d292852sm2418180ejd.148.2022.11.21.09.45.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Nov 2022 09:45:13 -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 RESEND v3 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Mon, 21 Nov 2022 20:42:27 +0300 Message-Id: <20221121174228.93670-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221121174228.93670-1-fnkl.kernel@gmail.com> References: <20221121174228.93670-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-20221121_094516_945296_AE411D04 X-CRM114-Status: GOOD ( 11.55 ) 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 | 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>;