From: Luca Weiss <luca@z3ntu.xyz>
To: linux-leds@vger.kernel.org
Cc: Dan Murphy <dmurphy@ti.com>, Heiko Stuebner <heiko@sntech.de>,
Icenowy Zheng <icenowy@aosc.io>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mark Rutland <mark.rutland@arm.com>,
Maxime Ripard <mripard@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht,
Luca Weiss <luca@z3ntu.xyz>, Rob Herring <robh@kernel.org>
Subject: [PATCH v3 1/2] dt-bindings: leds: Add binding for sgm3140
Date: Tue, 21 Apr 2020 21:13:53 +0200 [thread overview]
Message-ID: <20200421191354.1443017-2-luca@z3ntu.xyz> (raw)
In-Reply-To: <20200421191354.1443017-1-luca@z3ntu.xyz>
Add YAML devicetree binding for SGMICRO SGM3140 charge pump used for
camera flash LEDs.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
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 <luca@z3ntu.xyz>
+
+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 <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/leds/common.h>
+
+ 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 = <LED_COLOR_ID_WHITE>;
+ flash-max-timeout-us = <250000>;
+ };
+ };
--
2.26.1
next prev parent reply other threads:[~2020-04-21 19:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 19:13 [PATCH v3 0/2] Add sgm3140 flash led driver Luca Weiss
2020-04-21 19:13 ` Luca Weiss [this message]
2020-04-21 19:13 ` [PATCH v3 2/2] leds: add sgm3140 driver Luca Weiss
2020-04-27 9:51 ` Pavel Machek
2020-04-27 19:49 ` Luca Weiss
2020-04-27 21:10 ` Jacek Anaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200421191354.1443017-2-luca@z3ntu.xyz \
--to=luca@z3ntu.xyz \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=heiko@sntech.de \
--cc=icenowy@aosc.io \
--cc=jacek.anaszewski@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mripard@kernel.org \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=shawnguo@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).