From patchwork Tue Apr 21 19:13:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 201665 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 A7BB6C54FC9 for ; Tue, 21 Apr 2020 19:14:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 837F1206D9 for ; Tue, 21 Apr 2020 19:14:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=z3ntu.xyz header.i=@z3ntu.xyz header.b="beL8A6cY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726117AbgDUTOd (ORCPT ); Tue, 21 Apr 2020 15:14:33 -0400 Received: from mail.z3ntu.xyz ([128.199.32.197]:60988 "EHLO mail.z3ntu.xyz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbgDUTOc (ORCPT ); Tue, 21 Apr 2020 15:14:32 -0400 Received: from localhost.localdomain (80-110-124-168.cgn.dynamic.surfer.at [80.110.124.168]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 12403C4CB7; Tue, 21 Apr 2020 19:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1587496470; bh=mOLV8x1mo4P72BrSbNMNW0QKdQku/B/uSphwcxsPkns=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=beL8A6cYYL5HNRXvU7KfvfJkPppTqMlfRmrP2DiuLuwZZJJVzj6KJqdBHTloi+45T PE04g6RTWgrydlgWbwVEV/Mp0sQMiSlCn5D20D1BFnGOXKrloToIEGbxyIcwaINfE0 VsaTLUFp8H4tSzTUzBZY8jlVKA5Pm1WGnE5qLXiM= From: Luca Weiss To: linux-leds@vger.kernel.org Cc: Dan Murphy , Heiko Stuebner , Icenowy Zheng , Jacek Anaszewski , Laurent Pinchart , Mark Rutland , Maxime Ripard , Pavel Machek , Rob Herring , Shawn Guo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Luca Weiss , Rob Herring Subject: [PATCH v3 1/2] dt-bindings: leds: Add binding for sgm3140 Date: Tue, 21 Apr 2020 21:13:53 +0200 Message-Id: <20200421191354.1443017-2-luca@z3ntu.xyz> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200421191354.1443017-1-luca@z3ntu.xyz> References: <20200421191354.1443017-1-luca@z3ntu.xyz> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add YAML devicetree binding for SGMICRO SGM3140 charge pump used for camera flash LEDs. Signed-off-by: Luca Weiss Reviewed-by: Dan Murphy Reviewed-by: Rob Herring --- Changes since v2: - add 'type: object' to led property - rename dt node in example from sgm3140 to led-controller to match dt spec .../bindings/leds/leds-sgm3140.yaml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-sgm3140.yaml diff --git a/Documentation/devicetree/bindings/leds/leds-sgm3140.yaml b/Documentation/devicetree/bindings/leds/leds-sgm3140.yaml new file mode 100644 index 0000000000000..ecf7ac9ab0673 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-sgm3140.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-sgm3140.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SGMICRO SGM3140 500mA Buck/Boost Charge Pump LED Driver + +maintainers: + - Luca Weiss + +description: | + The SGM3140 is a current-regulated charge pump which can regulate two current + levels for Flash and Torch modes. + + The data sheet can be found at: + http://www.sg-micro.com/uploads/soft/20190626/1561535688.pdf + +properties: + compatible: + const: sgmicro,sgm3140 + + enable-gpios: + maxItems: 1 + description: A connection to the 'EN' pin. + + flash-gpios: + maxItems: 1 + description: A connection to the 'FLASH' pin. + + vin-supply: + description: Regulator providing power to the 'VIN' pin. + + led: + type: object + allOf: + - $ref: common.yaml# + +required: + - compatible + - flash-gpios + - enable-gpios + +additionalProperties: false + +examples: + - | + #include + #include + + led-controller { + compatible = "sgmicro,sgm3140"; + flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ + vin-supply = <®_dcdc1>; + + sgm3140_flash: led { + function = LED_FUNCTION_FLASH; + color = ; + flash-max-timeout-us = <250000>; + }; + };