Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp610741rwb; Sat, 14 Jan 2023 05:44:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXuIr2OeazojXNwo/F0U62OlEu3P17cUJLsd0eKQtpJhB6jmaASv7lVQHlzXEd6cs2vqbVQY X-Received: by 2002:a17:902:b718:b0:194:476b:1af0 with SMTP id d24-20020a170902b71800b00194476b1af0mr15007110pls.65.1673703856967; Sat, 14 Jan 2023 05:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673703856; cv=none; d=google.com; s=arc-20160816; b=xK311qx9+BU4g07NoD6M+BkfSC/Q1yFiwS1N+Cf8fkw+L8I6+/Hyew14K9PiS+7S9M ezJQm7M2xLOL+9QyYcXDFK74w9paW+S2z7VYMn0CdUEPEM9Cs5O1xv96J9M4GeW2dujQ 1aIou/E904msMzujXLTC1Q1kHMpAANjKmgI3ZbWgwcUDC2ZHxfOl2IdGhipu5V/78lT/ 5YfgzAZ0JpiV9C4wuGXxW504soAAHl57OeUScv1pj+kGSPpYZ2xj5boRYDSxQIaAv/Uk BTmqIdxnk5Qvs44b49y+eJwCZpvbQYC0Drc0nlFlmfC2xHjjXP0WmQHBO+2sMeshC4hY inGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K3DSO2nFSdxMzrHJBYG74NM4oJgLnjp9dkanZv0gHOQ=; b=r5Po+DWnM4xRBNY9CHqSZk/5zASblsq3dlEDjUKpEacSu5CT4+ZuMwt2eBtT3dbigC vWhnC2U1t3QAZivp2kPl+EG1avHrKlf/VO6/ng1dDPHbyqAayuDnXuaIQFn2yiv/nVxU 38UY4t7/UQaHnt5EdxXkDdz0hMltmGp+fqs5vwLeopRg+CrMBNc3yfS0KDi12hBN2iY/ dCWvfSYmoKQxDDwkOo48I4KmXC67lX/9NSmc57OCkuG5g3DiWCh/P/MLf6EG3pUXvD+4 pKDF9pfoHThqrehFH9oL7LjRstQR9k9XYr8Ec9qjtHOwXsVM6XJcPdtckw6XF8T5hl8k vO1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pbFyCvii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a170902f70e00b00192a2db815dsi23850482plo.375.2023.01.14.05.44.10; Sat, 14 Jan 2023 05:44:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pbFyCvii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjANN1S (ORCPT + 53 others); Sat, 14 Jan 2023 08:27:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjANN1C (ORCPT ); Sat, 14 Jan 2023 08:27:02 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CABF6E88; Sat, 14 Jan 2023 05:27:00 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id b5so2231937wrn.0; Sat, 14 Jan 2023 05:27:00 -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=K3DSO2nFSdxMzrHJBYG74NM4oJgLnjp9dkanZv0gHOQ=; b=pbFyCviih8VQPUB7txIKy8vlSLeMi1nXlBWiVdtlIQaZlU/Fi7wNKU0p8fxUbneMV4 3PaWN0szqHSBs9Se4sIpzBDQBAulbUUe24mk+37CprSRXPiflCoMJY87Uw+VDwYsO0Ms jbp11KwqaA729p1mvAQmMoDUNbtTOJR4HqVWOfnyeI7NIPWtsla3jtu8ujEeHwphli00 VCISBCU79ftydyS1TQcL4lV2mZU9mWkIVAi0pMXNN2IYHFkUBEEJ56XZ3cS7IH2ZQml6 mEWpKFhHNQRV8mM7Y6ZmX/lmgwedMQOjOiQGqT8aTKQVtZ/Kv+ndZ0PO9CGx3Vsy5OIy YOEg== 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=K3DSO2nFSdxMzrHJBYG74NM4oJgLnjp9dkanZv0gHOQ=; b=rkXwLc+VtYFAPcNTMhbGN/ih1I6mjxNyTMYnyhGMN5arQA/CGrkpaPLsoYanJFdCOA dc6MZ0KPbxRwguH1AngJUbBk1RlruQ1yGoQHoTApweNFXDQPfy3ktq/2tuTmWpPnnMUo Ob0fssEfSzWQB0YQUb49c4zf8KdXpBz3F+E1H5BmI5T/Yu4rDSYTwsGiFecnPzzF+Phb wfnq2ncTUj5xu5eO7mPmvm3470mGe5oViYnfFma3n6fkuQTG9XmT6qLPnKhq462Zqwz7 bMApuL/DiLeLtmy1EKBU/T+zi3PIXydrdL6oDHvNRXRjsI007G6aJTACAmlamw3D235f /Dmg== X-Gm-Message-State: AFqh2kp6/V2MiWvVLXrq+9GEE81qKwBTSh/DxGWUiPFsVmEI0Fok8HxA RiHcYXdoDt8jhGifeHShA6Y= X-Received: by 2002:adf:fd4b:0:b0:2bd:d966:7ffd with SMTP id h11-20020adffd4b000000b002bdd9667ffdmr5870139wrs.9.1673702819108; Sat, 14 Jan 2023 05:26:59 -0800 (PST) Received: from localhost ([176.234.9.57]) by smtp.gmail.com with UTF8SMTPSA id m9-20020a056000024900b002bdec340a1csm1812630wrz.110.2023.01.14.05.26.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Jan 2023 05:26:58 -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 v7 3/5] arm64: dts: apple: t8103: Add PWM controller Date: Sat, 14 Jan 2023 16:25:06 +0300 Message-Id: <20230114132508.96600-4-fnkl.kernel@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230114132508.96600-1-fnkl.kernel@gmail.com> References: <20230114132508.96600-1-fnkl.kernel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103-j313.dts | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 9 +++++++++ 3 files changed, 43 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts index 151074109a11..7381dccc1613 100644 --- a/arch/arm64/boot/dts/apple/t8103-j293.dts +++ b/arch/arm64/boot/dts/apple/t8103-j293.dts @@ -11,10 +11,23 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j293", "apple,t8103", "apple,arm-platform"; model = "Apple MacBook Pro (13-inch, M1, 2020)"; + + 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"; + }; + }; }; &bluetooth0 { @@ -47,3 +60,7 @@ &i2c2 { &i2c4 { status = "okay"; }; + +&fpwm1 { + status = "okay"; +}; \ No newline at end of file diff --git a/arch/arm64/boot/dts/apple/t8103-j313.dts b/arch/arm64/boot/dts/apple/t8103-j313.dts index bc1f865aa790..1e26aa1ef525 100644 --- a/arch/arm64/boot/dts/apple/t8103-j313.dts +++ b/arch/arm64/boot/dts/apple/t8103-j313.dts @@ -11,10 +11,23 @@ #include "t8103.dtsi" #include "t8103-jxxx.dtsi" +#include / { compatible = "apple,j313", "apple,t8103", "apple,arm-platform"; model = "Apple MacBook Air (M1, 2020)"; + + 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"; + }; + }; }; &bluetooth0 { @@ -39,3 +52,7 @@ &pcie0_dart_2 { /delete-node/ &port01; /delete-node/ &port02; + +&fpwm1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index 9859219699f4..5300fd115561 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -432,6 +432,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>; -- 2.37.1 (Apple Git-137.1)