From patchwork Wed Dec 21 21:06: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: 13079183 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 DEE77C4332F for ; Wed, 21 Dec 2022 21:29: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=AIuoHQPYCiR+rU4Zi8YTr31iq3P4XgBuPzL8DY9OBS8=; b=oUQhamosc2Vgc2 ukjJ23364eR6hjKQgW+DWuH7mvKLDQqtgeHqGBZk+NFHXhbNz6s7zuQ5fVwRNH32fiHD1QuQMIPz9 hkRGCvjFlZnXIiQsbpdfXOps3VsLjNjLgQV232WqM6lwFq2BUgJt2h/fhZAB+/aZk993epZ/Gl6pF 5YmNhwbTkpxA8/cbb7hRRp0fmeLVW8nN6OFMTsqMVX97PyP2mmocry3arFeJNDNarteChFT+LxE+r JKspqv3Cr/CBQAiCu9QczoiMBtyNUFj9UZoM0aQ25sS2PiJINF4riVVwp8Gvt0LmrJFdExf65/ZNg GUCxLE7S8YokDG5s3T3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p86ct-002kiT-G5; Wed, 21 Dec 2022 21:27:49 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p86Iy-002Yjc-7U for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2022 21:07:13 +0000 Received: by mail-wm1-x32c.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso2354218wmp.3 for ; Wed, 21 Dec 2022 13:07:10 -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=5nrHW2nZPS02ZWv3aQJK/QCBWF5IiEBszwRBGZwror8=; b=gnICfvvqTzoxFV9J6OhD0dfy1GMLDNmK/+HGPTgNy7dKVlH4BJtcjnaMWCj0kUHjSb PuUR6Pw/5E0+NzyemYIlh07NYT/DIYBozIoFTNM05Nh5VemjtWNf5stVx/bLlH5yNyQB IjFEW8elV7s6xC9lVWDg8fdLI7MrHrzvdqhxpdjlA7hpSrcn+Q+4JWL35hroS0mR3ZfB b7i4ashBFei/Wf4nHej2MssKZof6oEi/VbgD0AUQUDigRaq5AJoisgNqzDYp3OzbiPuc 48v2tGY8toKeT68Cbg2DGBjecM50txuHjcj3/tkcLvYZTeN73lHQVV4uBAZRK48LKiCr ADXQ== 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=5nrHW2nZPS02ZWv3aQJK/QCBWF5IiEBszwRBGZwror8=; b=BxpLiBSw0/L84K5P2BXDsdu+s4AkyErx0hPT1aPojNzbz06eZLWzPNOznxHh2a0WDx 3r8dluZxtqee+gt7bGHWBo7JLLtFOgAr6YIkT5g8Lxe+3N1SktLQd6VTuS6KcSatdElu Cb+6UObmTA+8eDIse/AIVFDC3MrgzaHi0FrTkVat49rxfJt1qJG2vz1u645iptkDuR5A PDEpTtItna1Ky7nwdBSv0iIRIEF7vCpnBKInz4rcwYVQ3xM1Mfyx3YzVImwViN3SrLj7 qsfkN7+2oomhQm8/vyi1p3xZmj8IWV4hI/R2oon/Zfv9EXieYNS/28vu61n3dqpW0Jv0 irkg== X-Gm-Message-State: AFqh2kpFnQ+I2sofcmycJDjisaH9fquhpXIph4zkfB2IHHFkU755MpTO dF4joucXA8EqX9++IJH1TPw= X-Google-Smtp-Source: AMrXdXsWqORR30ZKUUcvgUiVkQFjXes2NPsOYf28UCYRbqgLunfHxhURs5+D2N0hCE/rzH4p3p7CTA== X-Received: by 2002:a05:600c:3b9d:b0:3d2:3e75:7bb9 with SMTP id n29-20020a05600c3b9d00b003d23e757bb9mr2358068wms.34.1671656829455; Wed, 21 Dec 2022 13:07:09 -0800 (PST) Received: from localhost ([176.234.10.188]) by smtp.gmail.com with UTF8SMTPSA id a1-20020a05600c348100b003b47b80cec3sm3412423wmq.42.2022.12.21.13.07.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 13:07:09 -0800 (PST) From: Sasha Finkelstein To: u.kleine-koenig@pengutronix.de, 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 v5 3/4] arm64: dts: apple: t8103: Add PWM controller Date: Thu, 22 Dec 2022 00:06:47 +0300 Message-Id: <20221221210648.2735-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20221221210648.2735-1-fnkl.kernel@gmail.com> References: <20221221210648.2735-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-20221221_130712_363299_0744F213 X-CRM114-Status: GOOD ( 10.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 | 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..43f79570b458 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>;