From patchwork Fri Nov 11 17:33:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Finkelstein X-Patchwork-Id: 13040664 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 F116AC4332F for ; Fri, 11 Nov 2022 17:50:42 +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=iAZvciuL8SQVNt npGiFp1dFlBXLsWIVMCnJllH8Pm+7Dh0/xw017RsTJS4GWTWo/JQS80I1QmRP2G4xPpSpyv40AfxT xiAutKkjMbb5zNDRHuy/P9lTvFQnR0o1RtKmxNYhJ2bPmuye+p+FhMrPtLICZqUcp+McUhJAVMsO6 JE4P7RstzwpUP19xrM97V2zRCKsYH2YOya0dZvgJiHNFe/Fue6TTE7mTRxLhKjMNPETmKT6zjzT9K PDheWpqTIR4jewskQdWd6KPcNMGBDddb/XzoXGyfaWr1jws7g9HgYGhgaJq9cHLEcrmHYZ5dmwdKQ O+Hd5RUWBk7nQ6M/AFOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otY9l-00HRUV-Pv; Fri, 11 Nov 2022 17:49:34 +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 1otXv4-00HJ9k-6y for linux-arm-kernel@lists.infradead.org; Fri, 11 Nov 2022 17:34:27 +0000 Received: by mail-ej1-x635.google.com with SMTP id n12so14039573eja.11 for ; Fri, 11 Nov 2022 09:34:21 -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=BYViKet/CZKXvHTS3HlQWmBj09BBq1AYiW0SCIXjYp8h4OM4k+MGKh/8MMSBZKGobi ZXQFXI+vEkXyeVYhJYgacvuetIi1/+nNsmH7Pr019WNsaNzUlnbns60k6b65h+HgB/BT QQJaqNyyXa8YvuSMbADbmW8l7wHDmWpjZQOsPcDSCLc8tP5ZlQlvEGy4olnXNYODMIIc iL1kPwBhZB9h4i2sJpBLLlZOB+HvoQl5n9srWG8F7v1R75MWG9bRhAcv/Qoq33beLAq0 mYi2qoNYXnZrvdu1hH6A2msUDybDAA5EtrBpi1mlxypKok/JZzTbZ/Qdoj0/f22V7d0A urZQ== 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=3JSMkJ5R1yN6lQyGnAT/cH/IGqf6/7NMzYfIDLGzOSmmjdbAYP8GgYzCUKzMt8XGQg NTX7Hts0kUCSbJxaJB/MsaCk0hSYkXEHg8llI4uzOeiutopCQYqf4/cJE1ysK/Zc5hPo TdnUJCkM9BmH/zl0VEWnMYcgeQdJQ/9mCTw65r4/fgbPxDLUyP6voOUxh8jXS80ksakY K9cyw9JIZMCxcoGAUxQMuwb7cJRE6NXNZ+4dR8ITjSp3CeSqUXDuCqqMid9DSf7mIIIH jGkpWm+RbphFJPyN/42r8ay0iGiEm+r8/CZBgh0ZuVWgIA1NXIuB5VeaX5SMX8o55uTy 9P2w== X-Gm-Message-State: ANoB5pkpcw9j2MOlpG7b1qTaUwTtGD6z6bj1TvHJiDWDPazMmI2ja+C6 vwhOfROm0flEIBWDvJywtAtSPPxRH5I= X-Google-Smtp-Source: AA0mqf6TJYdmBV4uqcojNktHAUuSrWKh+40hrVO5UjWbk/L98q28A7iRK2dih/ex8yogPUty9MNm1w== X-Received: by 2002:a17:906:2856:b0:7a9:a59c:4be with SMTP id s22-20020a170906285600b007a9a59c04bemr2675063ejc.556.1668188060238; Fri, 11 Nov 2022 09:34:20 -0800 (PST) Received: from localhost ([85.153.204.139]) by smtp.gmail.com with UTF8SMTPSA id wl6-20020a170907310600b007add28659b0sm1098058ejb.140.2022.11.11.09.34.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 09:34:19 -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 v3 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Fri, 11 Nov 2022 20:33:47 +0300 Message-Id: <20221111173348.6537-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20221111173348.6537-1-fnkl.kernel@gmail.com> References: <20221111173348.6537-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-20221111_093422_316236_94BA080C X-CRM114-Status: GOOD ( 11.31 ) 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>;