dri-devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings
@ 2024-03-02 21:27 Patrick Gansterer
  2024-03-02 21:27 ` [PATCH 2/2] backlight: Add new lm3509 backlight driver Patrick Gansterer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Patrick Gansterer @ 2024-03-02 21:27 UTC (permalink / raw
  To: dri-devel, devicetree
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Patrick Gansterer

Add Device Tree bindings for Texas Instruments LM3509 - a
High Efficiency Boost for White LED's and/or OLED Displays

Signed-off-by: Patrick Gansterer <paroga@paroga.com>
---
 .../bindings/leds/backlight/ti,lm3509.yaml    | 81 +++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml

diff --git a/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml
new file mode 100644
index 000000000000..8fbb83934e30
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/ti,lm3509.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI LM3509 High Efficiency Boost for White LED's and/or OLED Displays
+
+maintainers:
+  - Patrick Gansterer <paroga@paroga.com>
+
+description: |
+  The LM3509 current mode boost converter offers two separate outputs.
+  https://www.ti.com/product/LM3509
+
+properties:
+  compatible:
+    const: ti,lm3509
+
+  reg:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  default-brightness:
+    minimum: 0
+    maximum: 15
+
+  max-brightness:
+    minimum: 0
+    maximum: 15
+
+  ti,brightness-rate-of-change-us:
+    description: Brightness Rate of Change in microseconds.
+    enum: [51, 13000, 26000, 52000]
+
+  ti,oled-mode:
+    description: Enable OLED mode.
+    type: boolean
+
+  ti,unison-mode:
+    description: |
+      Enable unison mode. If disabled, then it will provide two
+      independent controllable LED currents for BMAIN and BSUB.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        backlight@36 {
+            compatible = "ti,lm3509";
+            reg = <0x36>;
+
+            reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
+
+            ti,unison-mode;
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        backlight@36 {
+            compatible = "ti,lm3509";
+            reg = <0x36>;
+
+            ti,brightness-rate-of-change-us = <52000>;
+        };
+    };
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] backlight: Add new lm3509 backlight driver
  2024-03-02 21:27 [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Patrick Gansterer
@ 2024-03-02 21:27 ` Patrick Gansterer
  2024-03-04  8:23   ` Krzysztof Kozlowski
  2024-03-04  8:19 ` [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Krzysztof Kozlowski
  2024-03-04 11:29 ` Daniel Thompson
  2 siblings, 1 reply; 6+ messages in thread
From: Patrick Gansterer @ 2024-03-02 21:27 UTC (permalink / raw
  To: dri-devel, devicetree
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Patrick Gansterer

This is a general driver for LM3509 backlight chip of TI.
LM3509 is High Efficiency Boost for White LEDs and/or OLED Displays with
Dual Current Sinks. This driver supports OLED/White LED select, brightness
control and sub/main control.
The datasheet can be found at http://www.ti.com/product/lm3509.

Signed-off-by: Patrick Gansterer <paroga@paroga.com>
---
 drivers/video/backlight/Kconfig     |   7 +
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3509_bl.c | 247 ++++++++++++++++++++++++++++
 3 files changed, 255 insertions(+)
 create mode 100644 drivers/video/backlight/lm3509_bl.c

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index ea2d0d69bd8c..96ad5dc584b6 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -366,6 +366,13 @@ config BACKLIGHT_AAT2870
 	  If you have a AnalogicTech AAT2870 say Y to enable the
 	  backlight driver.
 
+config BACKLIGHT_LM3509
+	tristate "Backlight Driver for LM3509"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This supports TI LM3509 Backlight Driver
+
 config BACKLIGHT_LM3630A
 	tristate "Backlight Driver for LM3630A"
 	depends on I2C && PWM
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 06966cb20459..51a4ac5d0530 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_BACKLIGHT_HP700)		+= jornada720_bl.o
 obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO)	+= ipaq_micro_bl.o
 obj-$(CONFIG_BACKLIGHT_KTD253)		+= ktd253-backlight.o
 obj-$(CONFIG_BACKLIGHT_KTZ8866)		+= ktz8866.o
+obj-$(CONFIG_BACKLIGHT_LM3509)		+= lm3509_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
diff --git a/drivers/video/backlight/lm3509_bl.c b/drivers/video/backlight/lm3509_bl.c
new file mode 100644
index 000000000000..977145374641
--- /dev/null
+++ b/drivers/video/backlight/lm3509_bl.c
@@ -0,0 +1,247 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+
+#define LM3509_NAME "lm3509_bl"
+
+#define LM3509_DEF_BRIGHTNESS 0x12
+#define LM3509_MAX_BRIGHTNESS 0x1F
+
+#define REG_GP 0x10
+#define REG_BMAIN 0xA0
+#define REG_BSUB 0xB0
+#define REG_MAX 0xFF
+
+enum {
+	REG_GP_ENM_BIT = 0,
+	REG_GP_ENS_BIT,
+	REG_GP_UNI_BIT,
+	REG_GP_RMP0_BIT,
+	REG_GP_RMP1_BIT,
+	REG_GP_OLED_BIT,
+};
+
+struct lm3509_bl {
+	struct regmap *regmap;
+	struct backlight_device *bl_main;
+	struct backlight_device *bl_sub;
+	struct gpio_desc *reset_gpio;
+};
+
+static void lm3509_reset(struct lm3509_bl *data)
+{
+	if (data->reset_gpio) {
+		gpiod_set_value(data->reset_gpio, 1);
+		udelay(1);
+		gpiod_set_value(data->reset_gpio, 0);
+		udelay(10);
+	}
+}
+
+static int lm3509_update_status(struct backlight_device *bl,
+				unsigned int en_mask, unsigned int br_reg)
+{
+	struct lm3509_bl *data = bl_get_data(bl);
+	int ret;
+	bool en;
+
+	ret = regmap_write(data->regmap, br_reg, bl->props.brightness);
+	if (ret < 0)
+		return ret;
+
+	en = bl->props.power <= FB_BLANK_NORMAL;
+	return regmap_update_bits(data->regmap, REG_GP, en_mask,
+				  en ? en_mask : 0);
+}
+
+static int lm3509_main_update_status(struct backlight_device *bl)
+{
+	return lm3509_update_status(bl, BIT(REG_GP_ENM_BIT), REG_BMAIN);
+}
+
+static const struct backlight_ops lm3509_main_ops = {
+	.options = BL_CORE_SUSPENDRESUME,
+	.update_status = lm3509_main_update_status,
+};
+
+static int lm3509_sub_update_status(struct backlight_device *bl)
+{
+	return lm3509_update_status(bl, BIT(REG_GP_ENS_BIT), REG_BSUB);
+}
+
+static const struct backlight_ops lm3509_sub_ops = {
+	.options = BL_CORE_SUSPENDRESUME,
+	.update_status = lm3509_sub_update_status,
+};
+
+static struct backlight_device *lm3509_backlight_register(
+	struct device *dev, const char *name_suffix, struct lm3509_bl *data,
+	const struct backlight_ops *ops, int brightness, int max_brightness)
+
+{
+	struct backlight_device *bd;
+	struct backlight_properties props;
+	char name[64];
+
+	memset(&props, 0, sizeof(props));
+	props.type = BACKLIGHT_RAW;
+	props.brightness = brightness;
+	props.max_brightness = max_brightness;
+	props.power = brightness > 0 ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
+
+	snprintf(name, sizeof(name), "lm3509-%s-%s", dev_name(dev),
+		 name_suffix);
+
+	bd = devm_backlight_device_register(dev, name, dev, data, ops, &props);
+	if (bd)
+		backlight_update_status(bd);
+
+	return bd;
+}
+
+static const struct regmap_config lm3509_regmap = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = REG_MAX,
+};
+
+static int lm3509_probe(struct i2c_client *client)
+{
+	struct lm3509_bl *data;
+	struct device *dev = &client->dev;
+	int ret;
+	bool unison_mode = false;
+	bool oled_mode = false;
+	unsigned int reg_gp_val = 0;
+	u32 rate_of_change = 0;
+	u32 brightness = LM3509_DEF_BRIGHTNESS;
+	u32 max_brightness = LM3509_MAX_BRIGHTNESS;
+
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+		dev_err(dev, "fail : i2c functionality check\n");
+		return -EOPNOTSUPP;
+	}
+
+	data = devm_kzalloc(dev, sizeof(struct lm3509_bl), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->regmap = devm_regmap_init_i2c(client, &lm3509_regmap);
+	if (IS_ERR(data->regmap)) {
+		dev_err(dev, "fail : allocate register map\n");
+		return PTR_ERR(data->regmap);
+	}
+	i2c_set_clientdata(client, data);
+
+	data->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+	if (IS_ERR(data->reset_gpio)) {
+		ret = PTR_ERR(data->reset_gpio);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "fail : get reset GPIO: %d\n", ret);
+		return ret;
+	}
+
+	lm3509_reset(data);
+
+	of_property_read_u32(dev->of_node, "default-brightness", &brightness);
+	of_property_read_u32(dev->of_node, "max-brightness", &max_brightness);
+	unison_mode = of_property_read_bool(dev->of_node, "ti,unison-mode");
+	oled_mode = of_property_read_bool(dev->of_node, "ti,oled-mode");
+
+	if (!of_property_read_u32(dev->of_node,
+				  "ti,brightness-rate-of-change-us",
+				  &rate_of_change)) {
+		switch (rate_of_change) {
+		case 51:
+			reg_gp_val = 0;
+			break;
+		case 13000:
+			reg_gp_val = BIT(REG_GP_RMP1_BIT);
+			break;
+		case 26000:
+			reg_gp_val = BIT(REG_GP_RMP0_BIT);
+			break;
+		case 52000:
+			reg_gp_val = BIT(REG_GP_RMP0_BIT) |
+				     BIT(REG_GP_RMP1_BIT);
+			break;
+		default:
+			dev_warn(dev, "invalid rate of change %u\n",
+				 rate_of_change);
+			break;
+		}
+	}
+
+	if (unison_mode)
+		reg_gp_val |= BIT(REG_GP_UNI_BIT);
+	if (oled_mode)
+		reg_gp_val |= BIT(REG_GP_OLED_BIT);
+
+	ret = regmap_write(data->regmap, REG_GP, reg_gp_val);
+	if (ret < 0)
+		return ret;
+
+	max_brightness = min_t(u32, max_brightness, LM3509_MAX_BRIGHTNESS);
+	brightness = min_t(u32, brightness, max_brightness);
+
+	data->bl_main = lm3509_backlight_register(dev, "main", data,
+						  &lm3509_main_ops, brightness,
+						  max_brightness);
+	if (IS_ERR(data->bl_main)) {
+		dev_err(dev, "fail : register main backlight\n");
+		return PTR_ERR(data->bl_main);
+	}
+
+	if (!unison_mode) {
+		data->bl_sub = lm3509_backlight_register(dev, "sub", data,
+							 &lm3509_sub_ops,
+							 brightness,
+							 max_brightness);
+		if (IS_ERR(data->bl_sub)) {
+			dev_err(dev, "fail : register secondary backlight\n");
+			return PTR_ERR(data->bl_sub);
+		}
+	}
+
+	return 0;
+}
+
+static void lm3509_remove(struct i2c_client *client)
+{
+	struct lm3509_bl *data = i2c_get_clientdata(client);
+
+	regmap_write(data->regmap, REG_GP, 0x00);
+}
+
+static const struct i2c_device_id lm3509_id[] = { { LM3509_NAME, 0 }, {} };
+
+MODULE_DEVICE_TABLE(i2c, lm3509_id);
+
+static const struct of_device_id lm3509_match_table[] = {
+	{
+		.compatible = "ti,lm3509",
+	},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, lm3509_match_table);
+
+static struct i2c_driver lm3509_i2c_driver = {
+	.driver = {
+		.name = LM3509_NAME,
+		.of_match_table = lm3509_match_table,
+	},
+	.probe = lm3509_probe,
+	.remove = lm3509_remove,
+	.id_table = lm3509_id,
+};
+
+module_i2c_driver(lm3509_i2c_driver);
+
+MODULE_DESCRIPTION("Texas Instruments Backlight driver for LM3509");
+MODULE_AUTHOR("Patrick Gansterer <paroga@paroga.com>");
+MODULE_LICENSE("GPL");
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings
  2024-03-02 21:27 [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Patrick Gansterer
  2024-03-02 21:27 ` [PATCH 2/2] backlight: Add new lm3509 backlight driver Patrick Gansterer
@ 2024-03-04  8:19 ` Krzysztof Kozlowski
  2024-03-04 11:29 ` Daniel Thompson
  2 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-04  8:19 UTC (permalink / raw
  To: Patrick Gansterer, dri-devel, devicetree
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On 02/03/2024 22:27, Patrick Gansterer wrote:
> Add Device Tree bindings for Texas Instruments LM3509 - a
> High Efficiency Boost for White LED's and/or OLED Displays
> 
> Signed-off-by: Patrick Gansterer <paroga@paroga.com>

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> ---
>  .../bindings/leds/backlight/ti,lm3509.yaml    | 81 +++++++++++++++++++
>  1 file changed, 81 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml
> new file mode 100644
> index 000000000000..8fbb83934e30
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml
> @@ -0,0 +1,81 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/backlight/ti,lm3509.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI LM3509 High Efficiency Boost for White LED's and/or OLED Displays
> +
> +maintainers:
> +  - Patrick Gansterer <paroga@paroga.com>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  The LM3509 current mode boost converter offers two separate outputs.
> +  https://www.ti.com/product/LM3509
> +

Missing allOf with ref to common.yaml

> +properties:
> +  compatible:
> +    const: ti,lm3509
> +
> +  reg:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  default-brightness:
> +    minimum: 0
> +    maximum: 15
> +
> +  max-brightness:
> +    minimum: 0
> +    maximum: 15
> +
> +  ti,brightness-rate-of-change-us:
> +    description: Brightness Rate of Change in microseconds.
> +    enum: [51, 13000, 26000, 52000]
> +
> +  ti,oled-mode:
> +    description: Enable OLED mode.
> +    type: boolean
> +
> +  ti,unison-mode:
> +    description: |

Do not need '|' unless you need to preserve formatting.

> +      Enable unison mode. If disabled, then it will provide two
> +      independent controllable LED currents for BMAIN and BSUB.
> +    type: boolean
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false

unevaluatedProperties instead (open existing bindings and look how they
do it).

> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        backlight@36 {
> +            compatible = "ti,lm3509";
> +            reg = <0x36>;
> +
> +            reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
> +
> +            ti,unison-mode;
> +        };
> +    };
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        backlight@36 {
> +            compatible = "ti,lm3509";
> +            reg = <0x36>;
> +
> +            ti,brightness-rate-of-change-us = <52000>;

Just combine these examples.

> +        };
> +    };

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] backlight: Add new lm3509 backlight driver
  2024-03-02 21:27 ` [PATCH 2/2] backlight: Add new lm3509 backlight driver Patrick Gansterer
@ 2024-03-04  8:23   ` Krzysztof Kozlowski
  2024-03-04  8:30     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-04  8:23 UTC (permalink / raw
  To: Patrick Gansterer, dri-devel, devicetree
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On 02/03/2024 22:27, Patrick Gansterer wrote:
> This is a general driver for LM3509 backlight chip of TI.
> LM3509 is High Efficiency Boost for White LEDs and/or OLED Displays with
> Dual Current Sinks. This driver supports OLED/White LED select, brightness
> control and sub/main control.
> The datasheet can be found at http://www.ti.com/product/lm3509.
> 
> Signed-off-by: Patrick Gansterer <paroga@paroga.com>
> ---


...

> +
> +static int lm3509_probe(struct i2c_client *client)
> +{
> +	struct lm3509_bl *data;
> +	struct device *dev = &client->dev;
> +	int ret;
> +	bool unison_mode = false;
> +	bool oled_mode = false;
> +	unsigned int reg_gp_val = 0;
> +	u32 rate_of_change = 0;
> +	u32 brightness = LM3509_DEF_BRIGHTNESS;
> +	u32 max_brightness = LM3509_MAX_BRIGHTNESS;
> +
> +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
> +		dev_err(dev, "fail : i2c functionality check\n");

Drop the "fail : " everywhere and instead write something useful.


> +		return -EOPNOTSUPP;
> +	}
> +
> +	data = devm_kzalloc(dev, sizeof(struct lm3509_bl), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	data->regmap = devm_regmap_init_i2c(client, &lm3509_regmap);
> +	if (IS_ERR(data->regmap)) {
> +		dev_err(dev, "fail : allocate register map\n");

This message can be dropped entirely.

> +		return PTR_ERR(data->regmap);
> +	}
> +	i2c_set_clientdata(client, data);
> +
> +	data->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> +	if (IS_ERR(data->reset_gpio)) {
> +		ret = PTR_ERR(data->reset_gpio);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(dev, "fail : get reset GPIO: %d\n", ret);

No, don't upstream old vendor code directly but instead choose existing
mainline driver and customize it. The syntax is `return dev_err_probe()`.

> +		return ret;
> +	}
> +
> +	lm3509_reset(data);
> +
> +	of_property_read_u32(dev->of_node, "default-brightness", &brightness);
> +	of_property_read_u32(dev->of_node, "max-brightness", &max_brightness);
> +	unison_mode = of_property_read_bool(dev->of_node, "ti,unison-mode");
> +	oled_mode = of_property_read_bool(dev->of_node, "ti,oled-mode");
> +

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] backlight: Add new lm3509 backlight driver
  2024-03-04  8:23   ` Krzysztof Kozlowski
@ 2024-03-04  8:30     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-04  8:30 UTC (permalink / raw
  To: Patrick Gansterer, dri-devel, devicetree
  Cc: Lee Jones, Daniel Thompson, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On 04/03/2024 09:23, Krzysztof Kozlowski wrote:
> 
>> +		return PTR_ERR(data->regmap);
>> +	}
>> +	i2c_set_clientdata(client, data);
>> +
>> +	data->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
>> +	if (IS_ERR(data->reset_gpio)) {
>> +		ret = PTR_ERR(data->reset_gpio);
>> +		if (ret != -EPROBE_DEFER)
>> +			dev_err(dev, "fail : get reset GPIO: %d\n", ret);
> 
> No, don't upstream old vendor code directly but instead choose existing
> mainline driver and customize it. The syntax is `return dev_err_probe()

Hm, I found such pattern in gpio backlight. I'll fix it.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings
  2024-03-02 21:27 [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Patrick Gansterer
  2024-03-02 21:27 ` [PATCH 2/2] backlight: Add new lm3509 backlight driver Patrick Gansterer
  2024-03-04  8:19 ` [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Krzysztof Kozlowski
@ 2024-03-04 11:29 ` Daniel Thompson
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Thompson @ 2024-03-04 11:29 UTC (permalink / raw
  To: Patrick Gansterer
  Cc: dri-devel, devicetree, Lee Jones, Jingoo Han, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On Sat, Mar 02, 2024 at 10:27:56PM +0100, Patrick Gansterer wrote:
> Add Device Tree bindings for Texas Instruments LM3509 - a
> High Efficiency Boost for White LED's and/or OLED Displays
>
> Signed-off-by: Patrick Gansterer <paroga@paroga.com>
> ---
> <snip>
> +  ti,unison-mode:
> +    description: |
> +      Enable unison mode. If disabled, then it will provide two
> +      independent controllable LED currents for BMAIN and BSUB.
> +    type: boolean

How does not-unison mode interact with the backlight property in
panel-common.yaml ?

If this mode intended to provide two strings that can be controlled by
different panels then a phandle link will no longer be sufficient to
describe the connectivity.


Daniel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-04 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-02 21:27 [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Patrick Gansterer
2024-03-02 21:27 ` [PATCH 2/2] backlight: Add new lm3509 backlight driver Patrick Gansterer
2024-03-04  8:23   ` Krzysztof Kozlowski
2024-03-04  8:30     ` Krzysztof Kozlowski
2024-03-04  8:19 ` [PATCH 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 bindings Krzysztof Kozlowski
2024-03-04 11:29 ` Daniel Thompson

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 read-only IMAP folder(s) and NNTP newsgroup(s).