From: Bogdan Ionescu <bogdan.ionescu.work@gmail.com>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-leds@vger.kernel.or, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bogdan Ionescu <bogdan.ionescu.work@gmail.com>
Subject: [PATCH 1/2] dt-bindings: leds: Document rohm,bd65b60 bindings
Date: Wed, 8 Mar 2023 20:14:50 +0000 [thread overview]
Message-ID: <20230308201451.11629-1-bogdan.ionescu.work@gmail.com> (raw)
Hi all,
This is my first patch to the kernel, so I expect to have made
some mistakes. I did my best to follow the documentation and
submitting patches guidelines, but if I missed something, please
let me know.
I wasn't sure if I had to add myself to the MAINTAINERS file for such a
small patch, so I didn't.
Patch begins here:
Added devicetree bindings documentation for the rohm,bd65b60
led driver.
Signed-off-by: Bogdan Ionescu <bogdan.ionescu.work@gmail.com>
---
.../bindings/leds/rohm,bd65b60-leds.yaml | 77 +++++++++++++++++++
include/dt-bindings/leds/leds-bd65b60.h | 20 +++++
2 files changed, 97 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/rohm,bd65b60-leds.yaml
create mode 100644 include/dt-bindings/leds/leds-bd65b60.h
diff --git a/Documentation/devicetree/bindings/leds/rohm,bd65b60-leds.yaml b/Documentation/devicetree/bindings/leds/rohm,bd65b60-leds.yaml
new file mode 100644
index 000000000000..f69d7acd39c8
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/rohm,bd65b60-leds.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/rohm,bd65b60-leds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ROHM BD65B60 device tree bindings
+
+maintainers:
+ - Bogdan Ionescu <bogdan.ionescu.work+kernel@gmail.com>
+
+description: |
+ BD65B60 is a white LED driver IC that integrates PWM
+ step-up DC/DC converter with boost-capability of up to
+ maximum 28.5V and current driver with drive capability of up
+ to 25mA(Typ.) maximum setting. Precise brightness can be
+ controlled at wide ranges through the external PWM pulse
+ input.
+
+properties:
+ compatible:
+ const: rohm,bd65b60
+
+ reg:
+ maxItems: 1
+
+ led:
+ type: object
+ $ref: common.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ rohm,enable-outputs:
+ description:
+ Select which leds are being controlled.
+ Values defined in <dt-bindings/leds/leds-bd65b60.h>
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ enum: [ 0, 1, 4, 5 ]
+
+ rohm,ovp:
+ description:
+ Select Over-Voltage-Portection level.
+ Values defined in <dt-bindings/leds/leds-bd65b60.h>
+ $ref: "/schemas/types.yaml#/definitions/uint32"
+ enum: [ 0, 8, 16 ]
+ default: 16
+
+ required:
+ - rohm,enable-outputs
+
+required:
+ - compatible
+ - reg
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/common.h>
+ #include <dt-bindings/leds/leds-bd65b60.h>
+
+ i2c {
+
+ led_controler@64 {
+ compatible = "rohm,bd65b60";
+ reg = <0x64>;
+
+ backlight_led: led {
+ function = LED_FUNCTION_BACKLIGHT;
+ color = <LED_COLOR_ID_WHITE>;
+ rohm,enable-outputs = <BD65B60_ENABLE_LED1>;
+ default-state = "keep";
+ linux,default-trigger = "backlight";
+ };
+ };
+ };
+
+...
diff --git a/include/dt-bindings/leds/leds-bd65b60.h b/include/dt-bindings/leds/leds-bd65b60.h
new file mode 100644
index 000000000000..8634faae58f4
--- /dev/null
+++ b/include/dt-bindings/leds/leds-bd65b60.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * This header provides macros for the ROHM BD65B60 device tree bindings.
+ *
+ * Copyright (C) 2023 Bogdan Ionescu <bogdan.ionescu.work+kernel@gmail.com>
+ */
+
+#ifndef _DT_BINDINGS_LEDS_BD65B60_H
+#define _DT_BINDINGS_LEDS_BD65B60_H
+
+#define BD65B60_ENABLE_NONE 0
+#define BD65B60_ENABLE_LED1 1
+#define BD65B60_ENABLE_LED2 4
+#define BD65B60_ENABLE_BOTH (BD65B60_ENABLE_LED1 | BD65B60_ENABLE_LED2)
+
+#define BD65B60_OVP_25V 0
+#define BD65B60_OVP_30V 0x08
+#define BD65B60_OVP_35V 0x10
+
+#endif /* _DT_BINDINGS_LEDS_BD65B60_H */
--
2.39.2
next reply other threads:[~2023-03-08 20:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 20:14 Bogdan Ionescu [this message]
2023-03-08 20:14 ` [PATCH 2/2] leds: Add support for rohm,bd65b60 led driver Bogdan Ionescu
2023-03-09 9:06 ` Krzysztof Kozlowski
[not found] ` <CALfPHoVFVpnLVEjzccbyMvmNR_=3vjJ+Ub8tkriJOvvV0cLzsA@mail.gmail.com>
2023-03-10 10:48 ` Krzysztof Kozlowski
2023-03-18 4:54 ` kernel test robot
2023-03-08 23:16 ` [PATCH 1/2] dt-bindings: leds: Document rohm,bd65b60 bindings Rob Herring
2023-03-09 9:03 ` Krzysztof Kozlowski
[not found] ` <CALfPHoVT007ifyTepr_p-saDQtv5Sk7iYXM4qSMXyaCLL3iE2A@mail.gmail.com>
2023-03-11 9:06 ` Krzysztof Kozlowski
[not found] ` <CALfPHoVR=kmHmbhNzQg-bW-bV6P8e_sE+vEebQXOfL-nEWg5TQ@mail.gmail.com>
2023-03-12 20:42 ` Krzysztof Kozlowski
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=20230308201451.11629-1-bogdan.ionescu.work@gmail.com \
--to=bogdan.ionescu.work@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.or \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/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