From patchwork Wed May 17 18:21:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Van Assche X-Patchwork-Id: 95474 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1337144vqo; Wed, 17 May 2023 11:25:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wiIEO5s05+flJgaK/rxR5qecozzKRk4O/0riWfOnECEB9Eqs7IG+LzKJ/ohFvRDgn02ot X-Received: by 2002:a05:6a20:8f15:b0:103:b073:7a57 with SMTP id b21-20020a056a208f1500b00103b0737a57mr31803196pzk.23.1684347921320; Wed, 17 May 2023 11:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684347921; cv=none; d=google.com; s=arc-20160816; b=usmy04BKN//dmLJnnmDZ8RTH0ClWAKHQJpr6ganQ3nNwE4TmOe8z0Kw7xpGTWrsxzi aIJz3O6A7GExn5DXdnwjvveKjmbmOcl3stNAXr3ORa23whWEC4egM9aY0h7Zmrar4Lk1 rWV9z4al52jjV2VbvLVhLG7t3LQDZ/xw9ROKvJ8ZSga6gLPJruJwdjycD46zLZzAJfNq FypqtL2jHiRzaNmE15O9FuYGnAN076eDiNS8FTXCvF4wkmylyEF43NZXW22C29i8j9X0 7RgSykVXGB09Qgrv/oAHdOLcW542AHdFTSKcdkwZ1/GtlrRGMIx7NX/LkcSnTKDMZ315 DGMw== 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=AKhFIBENbm+x57efQqNUL+MpkzQuf72J2Na/e8+68Qg=; b=rRfKU21cGxhltpnYWv33MBsFYgc+614jWxTYUzyXstMoEXmADZnOw4gCuatTp7e4M+ xZxedENe6BpTepmGeF+TDKVcFY21ehM9Dqaxht3Ib/WtiwM9b7twoZ/tIjnvwgzoS3kw FOIIZgVK9PdzMyKaqwuc8NVRuUFv5mpf2uhwTxg9Kqxy9sElHDgk8cMOAA/uscRXd4fj owG3BgIN4RoKXwmenVmFr+yHyPcb/5TtOCtuJDPDnj6IPlZMb6Cf9QilRON4BVaT+M1b xjI/w4UmcvMQW8Vs0t3FLBCny+hhSoJw2EG762PT/gMAH109roTyuHktMZWlqi5mHReD X+og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=Z7rv4tlU; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a63b257000000b0053079f84a1csi15959956pgo.529.2023.05.17.11.25.05; Wed, 17 May 2023 11:25:21 -0700 (PDT) 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=@dylanvanassche.be header.s=MBO0001 header.b=Z7rv4tlU; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjEQSV7 (ORCPT + 99 others); Wed, 17 May 2023 14:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjEQSVx (ORCPT ); Wed, 17 May 2023 14:21:53 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 781475BB3; Wed, 17 May 2023 11:21:51 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4QM1f22KRRz9sps; Wed, 17 May 2023 20:21:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1684347706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AKhFIBENbm+x57efQqNUL+MpkzQuf72J2Na/e8+68Qg=; b=Z7rv4tlUYbSR+QiMIboqSZR9DXWdS9bGMZA/lPo1VhoWF4IjKB0I9OJqrPrIQ2xEb8gwIU fLodr9NjkGsGNcaz/GoTl9AaM2uN2QWIo+HMPp/8szQvA+4xozP6J1P2/i/IMTDDFwWDSp eZ/x/PPcjbmDL2NUhWWA44067Q9kmKQV20iIU6jlqSy9FWHKAfjNuOBMLtd5AW+WcEwhs1 SrL5dVKNrsV3Q/rmZC8d9Ee6c0ngt6xcSLKq8ZWpsiHhqqvcPKSXq7ibCi9wAOaDjlB6On TsRYVT2SRXUU66g2nC0DeJRRGCMw3rUDoWR5mHqmbDeR13JD8goEo9vlTeWx2g== From: Dylan Van Assche To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, amartinz@shiftphones.com, Dylan Van Assche Subject: [PATCH 1/2] arm64: dts: qcom: pmi8998: add flash LED Date: Wed, 17 May 2023 20:21:32 +0200 Message-Id: <20230517182133.72590-2-me@dylanvanassche.be> In-Reply-To: <20230517182133.72590-1-me@dylanvanassche.be> References: <20230517182133.72590-1-me@dylanvanassche.be> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766166805786475911?= X-GMAIL-MSGID: =?utf-8?q?1766166805786475911?= Qualcomm PMIC PMI8998 has a 3 channel flash LED driver which is used by many phones for 1 or 2 flash LEDs. Each LED can be used in flash mode or torch mode. Add the flash LED node to PMI8998 DTS. Signed-off-by: Dylan Van Assche --- arch/arm64/boot/dts/qcom/pmi8998.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi index ffe587f281d8..89f959353ad5 100644 --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi @@ -60,6 +60,12 @@ pmi8998_lpg: pwm { status = "disabled"; }; + pmi8998_flash: led-controller@d300 { + compatible = "qcom,spmi-flash-led"; + reg = <0xd300>; + status = "disabled"; + }; + pmi8998_wled: leds@d800 { compatible = "qcom,pmi8998-wled"; reg = <0xd800>, <0xd900>; From patchwork Wed May 17 18:21:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Van Assche X-Patchwork-Id: 95476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1337772vqo; Wed, 17 May 2023 11:26:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5E35XAigmZ3UOA3YkGmI3/WxGo0VFs8Xqh3LVzDHHaQjoJbGlAAlhYONqNOFHA+hZy9+Jq X-Received: by 2002:a05:6a00:1255:b0:64c:aa98:a69f with SMTP id u21-20020a056a00125500b0064caa98a69fmr905155pfi.1.1684347997092; Wed, 17 May 2023 11:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684347997; cv=none; d=google.com; s=arc-20160816; b=Jql+KYDUBNBFpo1ok9eut41Pu0C5sHnvsL+KNBehk/Z+FZhw+a0uS10Gw2UFi5KLK5 oJi9TXxVBwHZjA2hsM7MG0VvuFm/osC13p9gjJhvELTFJ5L7f2xg0bqC/xxwBsOnpQGe X9GDeW8TmhNs9rIt/u2nfIodwNjGtibi5P/lG+9s0PJFb3lNpHbmWkge30LOvWw0EqBr DR7pgBd0NHhWZ8VKDHOH39T6TkSeyp2MZSACShdOlbjM50DXgfBAPH7sL0FLnPHmYqUV DG9JeipFYrnRmXJcIm90Mhdl/bBA0pYFn8d72cV+XQkXYLjD79WIGeSsCDJnNovHnFtC g69w== 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=OUTW/1nl21rkbLxL1BJ2Mi9Ky/aG3WBLvZCR8496Gfs=; b=Ra59hwfXkNOrLjd4yGwLNj1z4aBdP0w+GG9NviP3CPxILIagNJeL/M0bsnlykGJfS/ 0+64ODiv48J+totDnbW5vy6h7QD67E5+fTlUA1+MkwyzSLyRfN5CXVTVyekD6BJSslNY zmRH1EtnHPbhruhuhLfO0YkzGeVSo8lURB+1HprzQOzl7Cf8BRGcgnl7/uYk6znzsZh5 kBiFHEfzzhDpUJakvgmNrcvRARBODCtlog0sUDeWQauQZTGBMos/QKjJes0pl785rM0W 25l18O6/e4+rpEIdXw5TO8Q17K8Zu5ljpJRGqBDDr/741KHgyrdnq7zdxzBCYFkWDKUO ObvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=w0HCpVe9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020aa79e91000000b006452ad45992si22844852pfq.3.2023.05.17.11.26.22; Wed, 17 May 2023 11:26:37 -0700 (PDT) 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=@dylanvanassche.be header.s=MBO0001 header.b=w0HCpVe9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbjEQSV4 (ORCPT + 99 others); Wed, 17 May 2023 14:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjEQSVx (ORCPT ); Wed, 17 May 2023 14:21:53 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 419C77EC5; Wed, 17 May 2023 11:21:52 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4QM1f50hvRz9sjK; Wed, 17 May 2023 20:21:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1684347709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OUTW/1nl21rkbLxL1BJ2Mi9Ky/aG3WBLvZCR8496Gfs=; b=w0HCpVe9Kotu/fkyqY2cfKBbv77oO28uUCYSzLZnCvp/agfv5jqwAH8mgzXj0KrxJirrn1 um+rkgAHzOa34d6ZhBSMs0ULabSrpQRq0h0tn+23lrkS/Oy6BVvY1pHhaU4KQ/Zh8SxyAx yfxHlGAfsoiiVKWaGIwfB6PTTMnkGOPO1VXyRYHXLXmiIel99xgCa6HPH4NSLN84z0NIUe igov0CNskxLwSWUflZNoxKD17vsHn7GSNVMQDWQjUifkZEaKVHTJ38M/0wi+wxNS2Wph1f D9RWLEiZZHAP9XhFXXVMQ+s97ksAS1x2/mVj58diwtBgmCUMPLoKqZNtltW+cA== From: Dylan Van Assche To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, amartinz@shiftphones.com, Dylan Van Assche Subject: [PATCH 2/2] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LED Date: Wed, 17 May 2023 20:21:33 +0200 Message-Id: <20230517182133.72590-3-me@dylanvanassche.be> In-Reply-To: <20230517182133.72590-1-me@dylanvanassche.be> References: <20230517182133.72590-1-me@dylanvanassche.be> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766166885121938837?= X-GMAIL-MSGID: =?utf-8?q?1766166885121938837?= The SHIFT6mq (axolotl) is an SDM845-based smartphone with 2 flash LEDs. One LED is white, the other one is yellow. Define both LEDs in the DTS so they can be used as flash or torch. Signed-off-by: Dylan Van Assche --- .../boot/dts/qcom/sdm845-shift-axolotl.dts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts index 0ad891348e0c..e7fc0c3cae58 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts @@ -554,6 +554,28 @@ led@5 { }; }; +&pmi8998_flash { + status = "okay"; + + led-0 { + function = LED_FUNCTION_FLASH; + color = ; + led-sources = <1>; + led-max-microamp = <180000>; + flash-max-microamp = <1000000>; + flash-max-timeout-us = <1280000>; + }; + + led-1 { + function = LED_FUNCTION_FLASH; + color = ; + led-sources = <2>; + led-max-microamp = <180000>; + flash-max-microamp = <1000000>; + flash-max-timeout-us = <1280000>; + }; +}; + &qup_uart9_rx { drive-strength = <2>; bias-pull-up;