Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp588786pxb; Wed, 27 Jan 2021 16:01:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx2/fT7BbP36Oryvdu7cemPNL/lP49nQ9PsO94jV9MeEntU2mFRThMOUJqmn90aIISovQ8 X-Received: by 2002:a17:906:538c:: with SMTP id g12mr8651536ejo.248.1611792073673; Wed, 27 Jan 2021 16:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792073; cv=none; d=google.com; s=arc-20160816; b=bSEaHyk/oybcxvBRAgV9rIn1M8y2WAPl+FfUzy8ff2tqd5w+wLtuCLZYCxL60fnivL NdKy0XyJHBW3uWg69pEoXKqRly9J7CjD8Te1LqCte1WRp9g3WKchy9z+UlhX93Aphgwb vkPI+CcCm8bAWRoMT6lpFV1POegBeOKRdtNrvNuPuxr7ex0YTtq7WAW4+fm2eHo9S3GJ InWVYF99BMvu9bYkDuKyCCAaDNv/G1viIdQPUoOqD6iFWmcB8GKVNKIUZ4gwKn5A/z6G S0uUve9kwS7Q/VMFpOuRv29XmySSl36zEAGha6rzK6Yj1n8SB1p6aOdxTaSwy6nJF3Fy 2nbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uZa34iNLZXzZFgCkFyw7+98Rs100rokiObLD8pmRuUY=; b=zMdBSJG5MTuOCjZOWQheVal0bCkPQWI9FzeFB7HsheoEa5342uD8sj8MegFhlcrX5Q FgvmbJbF762ThS5qG9uK1ZBHzkf1507GOB0ANcU/QRuDY/iPEOwIwp3yDGJ8s7Rkz+0v WxXeUS6QlmtlZ6EG5GYt4s3Iufp6+D3IM4lQRcboRzaKEj0u0P6t+IbF0eEjRQjOIYFz weBcd+2XR3ujHfxYbEkNzanjQdvtT81r0XQK5ci31DAAu6MrQVcWECqBomvoj5WISLer xsy181R2JJNmD8pnjw6j5BdphxeOmc9MZ1PLAemm2L+HD3pfVCGe+UjJrxbJO2NsLxlK ZSSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yHqCtsgE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc22si60998edb.145.2021.01.27.16.00.48; Wed, 27 Jan 2021 16:01:13 -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=@linaro.org header.s=google header.b=yHqCtsgE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbhA0O3i (ORCPT + 99 others); Wed, 27 Jan 2021 09:29:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233800AbhA0O3D (ORCPT ); Wed, 27 Jan 2021 09:29:03 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF3CC061756 for ; Wed, 27 Jan 2021 06:28:23 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id k25so2266877oik.13 for ; Wed, 27 Jan 2021 06:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=uZa34iNLZXzZFgCkFyw7+98Rs100rokiObLD8pmRuUY=; b=yHqCtsgEWEiNMgr3d8KZv+/5sk6UJ89UeB9BAL3BFj9o4ADvdN6+u8tG5k/Gl6GYZc CRTLYHmkqbDMJNBBwu7ATXI3LVZ3IK1o5GUuZQ9dXt+kr1DddbDURJoAlR+ccpYq7+4A 9ge0Bsdk//cV/+T4qkXpLSfOjbt3IAIrsi3GWAnheW2ESPhOLsekKEYyrL27yP4Ck5bD QhvOwdZJwS+PDNLXLl4FG6NXmo50Luqyb8czBlyzMcmrqvaE0UGMbopQaONAfs6e6gqU vsJnALNRxfYLw91zQ8zZ8Fw4qBkiuLDwVC84tuO3Xl6VVIjahKvxSMsMbFYtMBLqXe6x qBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=uZa34iNLZXzZFgCkFyw7+98Rs100rokiObLD8pmRuUY=; b=jqs5uHDMTuuLHBLM58Q+PtLObTU33+BcYxAaKDmeEgsOnkSvFU4FGL8L/BdqjZtxM9 q3axyEZbcvR1hJOLzeEUykyQ/P3s5553qBrDMRaOrWSuy9WqX+ubukWFQkJwzwsGUFaa KPKWtMqlruNKJsfVcvxzD1uzPtevCp5zrzhHfGrGmgFM0TutiIzvUt7NCMyWx0NO4W1f XKM6VcX1y4wV4VCPGQkPp7K+mnHtwoGOLQTQy5qCIsNxRFZkJnaLWMlhyB/Tw9AdsisT Paq0rUK1f020NfIa2MgM7dYMEn8GJ3IW0fUe2C54pn6tgX+W1GhOcAtfMM8dfebN6zoJ 2kVg== X-Gm-Message-State: AOAM530js+TcpHnDPSMZ0/HaFt+Q1nT3pOYQHLDciCRT3FcRTTve8EQR 3Uhww0PKUglnoHBWJbQXGf93jw== X-Received: by 2002:aca:1a17:: with SMTP id a23mr3323036oia.120.1611757702385; Wed, 27 Jan 2021 06:28:22 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 68sm380107otr.16.2021.01.27.06.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 06:28:21 -0800 (PST) Date: Wed, 27 Jan 2021 08:28:19 -0600 From: Bjorn Andersson To: "N?colas F. R. A. Prado" Cc: Pavel Machek , Dan Murphy , Andy Gross , Rob Herring , 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 Subject: Re: [PATCH v2 1/4] dt-bindings: leds: Add binding for qcom-spmi-flash Message-ID: References: <20210126140240.1517044-1-nfraprado@protonmail.com> <20210126140240.1517044-2-nfraprado@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210126140240.1517044-2-nfraprado@protonmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26 Jan 08:04 CST 2021, N?colas F. R. A. Prado wrote: > 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?colas 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-flash.yaml > create mode 100644 include/dt-bindings/leds/leds-qcom-spmi-flash.h > > diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-spmi-flash.yaml 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?colas F. R. A. Prado > + > +description: | > + The Qualcomm SPMI Flash LEDs are part of Qualcomm PMICs and are used primarily > + as a camera or video flash. They can also be used as a lantern when on torch > + 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 in > + include/dt-bindings/leds/leds-qcom-spmi-flash.h Please make the unit of this property millivolts, instead of describing it indirectly using the defines in the header file. > + $ref: /schemas/types.yaml#definitions/uint32 > + minimum: 0 > + maximum: 3 And you can then list out the valid values here. > + > + 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 As above, please describe this in microseconds. > + $ref: /schemas/types.yaml#definitions/uint32 > + minimum: 0 > + maximum: 3 > + > + qcom,safety-timer: > + description: include for safety timer use, otherwise watchdog timer will be used > + type: boolean > + > +required: > + - compatible > + - reg > + - flash-boost-supply > + - torch-boost-supply > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + > + qcom,leds@d300 { Please no "qcom," in the node name. Regards, Bjorn > + compatible = "qcom,spmi-flash"; > + reg = <0xd300 0x100>; > + flash-boost-supply = <&pm8941_5vs1>; > + torch-boost-supply = <&pm8941_5v>; > + > + 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; > + }; > + }; > +... > diff --git a/include/dt-bindings/leds/leds-qcom-spmi-flash.h b/include/dt-bindings/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 0 > +#define QCOM_SPMI_FLASH_HEADROOM_300MV 1 > +#define QCOM_SPMI_FLASH_HEADROOM_400MV 2 > +#define QCOM_SPMI_FLASH_HEADROOM_500MV 3 > + > +#define QCOM_SPMI_FLASH_STARTUP_DLY_10US 0 > +#define QCOM_SPMI_FLASH_STARTUP_DLY_32US 1 > +#define QCOM_SPMI_FLASH_STARTUP_DLY_64US 2 > +#define QCOM_SPMI_FLASH_STARTUP_DLY_128US 3 > + > +#endif > -- > 2.30.0 > >