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: 13028193 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 45FDAC433FE for ; Wed, 2 Nov 2022 14:19:05 +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=TH+iQ61dOpJ+0YUhFxYO5V9UbuFtZcUG00ptw6LXYb8=; b=MVFQPym32n8XrH 4+YDZfCkcm1tuXwu+hxGGdNG+my44kC4V2xd+RZ346L8Q+6ArvxM+rE4q1BrbRblGE46Y651JU3VD mzdZqfei6qkbkThsGNo0hEgWKxDA148IjNGPB7KAlimqGCMHT43A7GZHzL1DoeBehAxIT7eRderuu 24vOR62flksRpY3H27uCy005OszT0lFhIWujYfYUhVHTrZRV/ZMyFsNQOtHlJg8PwiSoT4L6vTQIp XIx7Iq8l5Tn6p5DumxnvTc/5i+lk7XqC/TbdYF7nuXRAfwGcA3a3KAP29Nf1mS0DZiZo5M7kEqDjc uFqBwft4U7k+9Eux9LYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqEYo-00BSTL-VU; Wed, 02 Nov 2022 14:17:43 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqEYV-00BSMZ-Hw for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 14:17:25 +0000 Received: by mail-ej1-x636.google.com with SMTP id f27so45690256eje.1 for ; 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=zWlArX9j+QRbZsgCwXAvGYxkfRnZXxIo5+BAi7FVf/BIBR0bz6eGHzN5gqHA5txzsb nq6RHo0vxdzd/sn5V/giQj1dZLeGCLRUHDMvNjqpfj4OiTnDsZClbdnYnRPnCm3oYPbx b712909I/Ww6zRze2zGYhCgKHdczPpiLKmWodM/nlRLVgL9wZvD6IUIL2O2SrQeYu33o mHudB/otzXaLtLSggD5t8EUDEZA5nyGl/KM3J6SJ2Eak9hN3DN8VcTCkiCEa3Y/Qyqft /Rp9FtFmTQLtfHY4LsJ33P/o47z+0jp4ZWeP9a8HO3p2KVFIhHPbL1Pemv+d0ewxs3Ur zFxA== X-Gm-Message-State: ACrzQf3fmTuDlUPznNX4DaMyyV67szPIYExjDxc4+/ziSRw9KvybRaeP I1YhxdajPscEwGL4IhXichw= X-Google-Smtp-Source: AMsMyM4UO4LPIkeJUPkXOsfooljJbLt0HcMi9N88XdOTQPepALYXqc7eYSiyc0/cuRaRL24dJu/mLw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_071723_615860_D471CAF3 X-CRM114-Status: GOOD ( 12.19 ) 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..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>;