Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4054041pxb; Tue, 26 Jan 2021 11:07:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJz217zFN5S7wOa1heuZUjyRJ/o6fDFLODPpUYmjRTwBESgMSCEiNJhDXN1kBOmNZAxv6qRd X-Received: by 2002:a17:906:43c5:: with SMTP id j5mr4551149ejn.530.1611688056702; Tue, 26 Jan 2021 11:07:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611688056; cv=none; d=google.com; s=arc-20160816; b=eZCmR5Zf3Eul7BRQFm09rG5WjkiFHL28zgGaYBuw8MzZPzQkTgBo0MMBeHszYOEmSs bNxONbACmJ1t6hVuabDytsaQMFcmxxJ7b2DqxP+zAr9pmor+dCJ5IDNMan3enO0Ob60A 5tfuooXMFveqe3/2054uJqo9Z27ZIwrEbiBo1SG7kmcGqqT7zINgXISvoIw1xVnp0uq6 PTGdEt0/5Q5gFlOZNqGXDORRFd+ah+15WxFk8OU69cAtAH9myo8n2R3i/uqPKaed/YZ2 bsMBhVT/7iltcWIfxoS952+qra9YnYjQBmiGOYZ75eR+UXP1l0RGJvEk1iJIR6s2i2t2 WDOA== 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:subject:reply-to:cc:from:to :dkim-signature:date; bh=mbQbonKTWOJG/8gSURwb2HOD/90QOtBxSCKvG2gI4So=; b=T4MpsZUJeepyS7uR8e+GwaB3qsZ/M68aLLpDMhjZcwlJheLONljQeoNLcwf6gSF7kI KjrDT19H4hNTYEv1gHjx+KEeQtoJZRK+8WkpWnQFvtSAk6w7lUqK98QzJHu6NwM7eXTz 2FaIIZQ+7DN2llAytQdt1FaVtpmrTHVSPDYBF1De0VvRoP8hqjyyrs3Q5+gr+DA6Zc+z RW98soeSkxDKuYXi/nyWDNOXVYiDoyHVN8t/In1yb+IpI3/zvlEGkQqylef/t6/tq24B grB/q43GKlT4hE24CJEdhJBf7vEqPR/cpVFMrkAPHSkWZyHERggPej7QxC2ktaZigoJK 5GcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=asITbJ20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds6si4059137ejc.350.2021.01.26.11.07.08; Tue, 26 Jan 2021 11:07:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=asITbJ20; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405697AbhAZOFs (ORCPT + 99 others); Tue, 26 Jan 2021 09:05:48 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:38260 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405608AbhAZOEz (ORCPT ); Tue, 26 Jan 2021 09:04:55 -0500 Date: Tue, 26 Jan 2021 14:04:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1611669852; bh=mbQbonKTWOJG/8gSURwb2HOD/90QOtBxSCKvG2gI4So=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=asITbJ20piki8V4dq2FdGySHW4Jz9wuRLKpSqWyrGCxQPMshDoQ/XcALmQeSuyzz4 P0eiekzy+SfZaNA9+NNENnX04w/6I5M7a2MEm894adRHiGdTYySJLBhQrACjywokPB X8I9M7BUJXOly0k33ZSgzwMDhwhXkAUoelhSjv/w= To: Pavel Machek , Dan Murphy , Bjorn Andersson , Andy Gross , Rob Herring From: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= 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?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Subject: [PATCH v2 1/4] dt-bindings: leds: Add binding for qcom-spmi-flash Message-ID: <20210126140240.1517044-2-nfraprado@protonmail.com> In-Reply-To: <20210126140240.1517044-1-nfraprado@protonmail.com> References: <20210126140240.1517044-1-nfraprado@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add devicetree binding for QCOM SPMI Flash LEDs, which are part of PM8941, and are used both as lantern and camera flash. Signed-off-by: N=C3=ADcolas F. R. A. Prado --- Changes in v2: - Add this commit .../bindings/leds/leds-qcom-spmi-flash.yaml | 94 +++++++++++++++++++ .../dt-bindings/leds/leds-qcom-spmi-flash.h | 15 +++ 2 files changed, 109 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-qcom-spmi-f= lash.yaml create mode 100644 include/dt-bindings/leds/leds-qcom-spmi-flash.h diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-spmi-flash.ya= ml b/Documentation/devicetree/bindings/leds/leds-qcom-spmi-flash.yaml new file mode 100644 index 000000000000..169716e14f67 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-qcom-spmi-flash.yaml @@ -0,0 +1,94 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-qcom-spmi-flash.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SPMI Flash LEDs + +maintainers: + - N=C3=ADcolas F. R. A. Prado + +description: | + The Qualcomm SPMI Flash LEDs are part of Qualcomm PMICs and are used pri= marily + as a camera or video flash. They can also be used as a lantern when on t= orch + mode. + The PMIC is connected to Host processor via SPMI bus. + +properties: + compatible: + const: qcom,spmi-flash + + reg: + maxItems: 1 + + flash-boost-supply: + description: SMBB regulator for LED flash mode + + torch-boost-supply: + description: SMBB regulator for LED torch mode + +patternProperties: + "^led[0-1]$": + type: object + $ref: common.yaml# + + properties: + qcom,clamp-curr: + description: current to clamp at, in uA + $ref: /schemas/types.yaml#definitions/uint32 + + qcom,headroom: + description: | + headroom to use. Use one of QCOM_SPMI_FLASH_HEADROOM_* defined i= n + include/dt-bindings/leds/leds-qcom-spmi-flash.h + $ref: /schemas/types.yaml#definitions/uint32 + minimum: 0 + maximum: 3 + + qcom,startup-dly: + description: | + delay before flashing. Use one of QCOM_SPMI_FLASH_STARTUP_DLY_* + defined in include/dt-bindings/leds/leds-qcom-spmi-flash.h + $ref: /schemas/types.yaml#definitions/uint32 + minimum: 0 + maximum: 3 + + qcom,safety-timer: + description: include for safety timer use, otherwise watchdog time= r will be used + type: boolean + +required: + - compatible + - reg + - flash-boost-supply + - torch-boost-supply + +additionalProperties: false + +examples: + - | + #include + #include + + qcom,leds@d300 { + compatible =3D "qcom,spmi-flash"; + reg =3D <0xd300 0x100>; + flash-boost-supply =3D <&pm8941_5vs1>; + torch-boost-supply =3D <&pm8941_5v>; + + led0 { + led-sources =3D <0>; + function =3D LED_FUNCTION_FLASH; + color =3D ; + led-max-microamp =3D <200000>; + flash-max-microamp =3D <1000000>; + flash-max-timeout-us =3D <1280000>; + default-state =3D "off"; + qcom,clamp-curr =3D <200000>; + qcom,headroom =3D ; + qcom,startup-dly =3D ; + qcom,safety-timer; + }; + }; +... diff --git a/include/dt-bindings/leds/leds-qcom-spmi-flash.h b/include/dt-b= indings/leds/leds-qcom-spmi-flash.h new file mode 100644 index 000000000000..8bd54a8e831d --- /dev/null +++ b/include/dt-bindings/leds/leds-qcom-spmi-flash.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _DT_BINDINGS_LEDS_QCOM_SPMI_FLASH_H +#define _DT_BINDINGS_LEDS_QCOM_SPMI_FLASH_H + +#define QCOM_SPMI_FLASH_HEADROOM_250MV=090 +#define QCOM_SPMI_FLASH_HEADROOM_300MV=091 +#define QCOM_SPMI_FLASH_HEADROOM_400MV=092 +#define QCOM_SPMI_FLASH_HEADROOM_500MV=093 + +#define QCOM_SPMI_FLASH_STARTUP_DLY_10US=090 +#define QCOM_SPMI_FLASH_STARTUP_DLY_32US=091 +#define QCOM_SPMI_FLASH_STARTUP_DLY_64US=092 +#define QCOM_SPMI_FLASH_STARTUP_DLY_128US=093 + +#endif --=20 2.30.0