From patchwork Tue Jan 26 14:06:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 370935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C25B9C4332B for ; Tue, 26 Jan 2021 14:07:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E65022B2C for ; Tue, 26 Jan 2021 14:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405704AbhAZOHf (ORCPT ); Tue, 26 Jan 2021 09:07:35 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:16953 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392713AbhAZOHN (ORCPT ); Tue, 26 Jan 2021 09:07:13 -0500 Date: Tue, 26 Jan 2021 14:06:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1611669988; bh=xmb8JiMZ0qx9ONDljEb7E5aB5mcbUdJjKenPUDfOyPQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=uUFWznkp8eoW+NjmZWxGUqIaeWNxq03xsZtc+3vb/Wq/S9qz91T50bTpBlWOes7Bz lgr5ZmTZrdZsq9XHyEn4r/QA4ZNz8i78DyX/dB5kH8CYIjW/XcOWnCKEE2D/MKsJkm gCxLig/uHPh4dvcoNt2mviYnZwgDQT+CZWmuqunI= To: Pavel Machek , Dan Murphy , Bjorn Andersson , Andy Gross , Rob Herring From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Brian Masney , Luca Weiss , Russell King , Georgi Djakov , linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Subject: [PATCH v2 3/4] ARM: qcom_defconfig: Enable QCOM SPMI Flash LEDs Message-ID: <20210126140240.1517044-4-nfraprado@protonmail.com> In-Reply-To: <20210126140240.1517044-1-nfraprado@protonmail.com> References: <20210126140240.1517044-1-nfraprado@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Enable module for the Qualcomm SPMI Flash LEDs present on the PM8941 PMIC. Signed-off-by: NĂ­colas F. R. A. Prado --- Changes in v2: - Enabled CONFIG_LEDS_CLASS_FLASH since the driver now depends on it. arch/arm/configs/qcom_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/qcom_defconfig b/arch/arm/configs/qcom_defconfig index f6e9675f639c..05cacc59087e 100644 --- a/arch/arm/configs/qcom_defconfig +++ b/arch/arm/configs/qcom_defconfig @@ -202,6 +202,7 @@ CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_MSM=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y +CONFIG_LEDS_CLASS_FLASH=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_PM8058=y CONFIG_LEDS_TRIGGERS=y @@ -284,3 +285,4 @@ CONFIG_DYNAMIC_DEBUG=y CONFIG_DEBUG_INFO=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set +CONFIG_LEDS_QCOM_SPMI_FLASH=m From patchwork Tue Jan 26 14:06:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 370934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1229C433E0 for ; Tue, 26 Jan 2021 14:09:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BBD422B3B for ; Tue, 26 Jan 2021 14:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405570AbhAZOI6 (ORCPT ); Tue, 26 Jan 2021 09:08:58 -0500 Received: from mail-02.mail-europe.com ([51.89.119.103]:58828 "EHLO mail-02.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405745AbhAZOIg (ORCPT ); Tue, 26 Jan 2021 09:08:36 -0500 Date: Tue, 26 Jan 2021 14:06:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1611670025; bh=salyD/WHDIurAfXLaRdlHjy/N3gO/EgJ38mXhbWj+8A=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=q+HTsB7Uqut7TDSqzeqkeRLfypg5t9zC4sq5LSGRFXYLjJ4ngWqoirWhUky/juxGQ rN7eNCEZGezvPUctVw4/tc5Rbg+bY8AbpHw33S4jL4mdDogThy2JFU+eLWJNfBLAma fJu7BQd7ZQmcn9HjcaXfniqfIEedKnoIcXypjjEw= To: Pavel Machek , Dan Murphy , Bjorn Andersson , Andy Gross , Rob Herring From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Brian Masney , Luca Weiss , Russell King , Georgi Djakov , linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Subject: [PATCH v2 4/4] ARM: dts: qcom: pm8941: Add nodes for QCOM SPMI Flash LEDs Message-ID: <20210126140240.1517044-5-nfraprado@protonmail.com> In-Reply-To: <20210126140240.1517044-1-nfraprado@protonmail.com> References: <20210126140240.1517044-1-nfraprado@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Add the necessary devicetree nodes for the Qualcomm SPMI Flash LEDs present in PM8941. Signed-off-by: NĂ­colas F. R. A. Prado --- Changes in v2: - Moved from hammerhead dts to pm8941 dtsi, as it was this way downstream - Now using values from leds-qcom-spmi-flash.h arch/arm/boot/dts/qcom-pm8941.dtsi | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm/boot/dts/qcom-pm8941.dtsi b/arch/arm/boot/dts/qcom-pm8941.dtsi index c1f2012d1c8b..89309d3c777c 100644 --- a/arch/arm/boot/dts/qcom-pm8941.dtsi +++ b/arch/arm/boot/dts/qcom-pm8941.dtsi @@ -2,6 +2,8 @@ #include #include #include +#include +#include &spmi_bus { @@ -189,5 +191,41 @@ pm8941_5vs2: 5vs2 { regulator-initial-mode = <1>; }; }; + + qcom,spmi-flash@d300 { + status = "okay"; + + compatible = "qcom,spmi-flash"; + reg = <0xd300 0x100>; + flash-boost-supply = <&pm8941_5vs1>; + torch-boost-supply = <&pm8941_5v>; + pm8941_flash0: led0 { + led-sources = <0>; + function = LED_FUNCTION_FLASH; + color = ; + led-max-microamp = <200000>; + flash-max-microamp = <1000000>; + flash-max-timeout-us = <1280000>; + default-state = "off"; + qcom,clamp-curr = <200000>; + qcom,headroom = ; + qcom,startup-dly = ; + qcom,safety-timer; + }; + + pm8941_flash1: led1 { + led-sources = <1>; + function = LED_FUNCTION_FLASH; + color = ; + led-max-microamp = <200000>; + flash-max-microamp = <1000000>; + flash-max-timeout-us = <1280000>; + default-state = "off"; + qcom,clamp-curr = <200000>; + qcom,headroom = ; + qcom,startup-dly = ; + qcom,safety-timer; + }; + }; }; };