linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] tps6105x add devicetree and leds support
@ 2019-11-20 14:43 Sven Van Asbroeck
  2019-11-20 14:43 ` [PATCH v3 1/3] tps6105x: add optional devicetree support Sven Van Asbroeck
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sven Van Asbroeck @ 2019-11-20 14:43 UTC (permalink / raw)
  To: Lee Jones, Jacek Anaszewski, Pavel Machek, Rob Herring
  Cc: Linus Walleij, Grigoryev Denis, Axel Lin, Dan Murphy,
	Mark Rutland, devicetree, linux-kernel, linux-leds

v2 -> v3:
	Removed tps6105x regulator patch - it was accepted (Mark Brown).
	
	Removed devicetree/platdata bindings for tps6105x led naming.
	I can test only with a 4.19 vendor kernel, which does not have the
	latest led naming infrastructure (function/color). Drop devicetree/
	fwnode/pdata led naming in favour of hard-coding to "tps6105x::torch",
	so the patch can be tested by me, yet remains acceptable to upstream.

v1 -> v2:
	Select chip operational mode by looking at subnode name, _not_ its
	compatible property. Suggested by Mark Brown.

I needed led operation for this mfd chip, so I added a very simple
driver for this.

My platform (arm imx6q) is devicetree-based, so I added optional
devicetree support for this chip and its sub-drivers.

Sven Van Asbroeck (3):
  tps6105x: add optional devicetree support
  leds: tps6105x: add driver for mfd chip led mode
  dt-bindings: mfd: update TI tps6105x chip bindings

 .../devicetree/bindings/mfd/tps6105x.txt      | 39 ++++++++++-
 drivers/leds/Kconfig                          | 10 +++
 drivers/leds/Makefile                         |  1 +
 drivers/leds/leds-tps6105x.c                  | 67 +++++++++++++++++++
 drivers/mfd/tps6105x.c                        | 34 +++++++++-
 5 files changed, 147 insertions(+), 4 deletions(-)
 create mode 100644 drivers/leds/leds-tps6105x.c

-- 
2.17.1


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

* [PATCH v3 1/3] tps6105x: add optional devicetree support
  2019-11-20 14:43 [PATCH v3 0/3] tps6105x add devicetree and leds support Sven Van Asbroeck
@ 2019-11-20 14:43 ` Sven Van Asbroeck
  2019-11-20 14:44 ` [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode Sven Van Asbroeck
  2019-11-20 14:44 ` [PATCH v3 3/3] dt-bindings: mfd: update TI tps6105x chip bindings Sven Van Asbroeck
  2 siblings, 0 replies; 7+ messages in thread
From: Sven Van Asbroeck @ 2019-11-20 14:43 UTC (permalink / raw)
  To: Lee Jones, Jacek Anaszewski, Pavel Machek, Rob Herring
  Cc: Linus Walleij, Grigoryev Denis, Axel Lin, Dan Murphy,
	Mark Rutland, devicetree, linux-kernel, linux-leds

This driver currently requires platform data to specify the
operational mode and regulator init data (in case of regulator
mode).

Optionally specify the operational mode by looking at the name
of the devicetree child node.

Example: put chip in regulator mode:

i2c0 {
	tps61052@33 {
		compatible = "ti,tps61052";
		reg = <0x33>;

		regulator {
                            regulator-min-microvolt = <5000000>;
                            regulator-max-microvolt = <5000000>;
                            regulator-always-on;
		};
	};
};

Tree: linux-next
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
---
 drivers/mfd/tps6105x.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c
index 6ac3607a79c2..c906324d293e 100644
--- a/drivers/mfd/tps6105x.c
+++ b/drivers/mfd/tps6105x.c
@@ -91,6 +91,32 @@ static int tps6105x_add_device(struct tps6105x *tps6105x,
 			       PLATFORM_DEVID_AUTO, cell, 1, NULL, 0, NULL);
 }
 
+static struct tps6105x_platform_data *tps6105x_parse_dt(struct device *dev)
+{
+	struct device_node *np = dev->of_node;
+	struct tps6105x_platform_data *pdata;
+	struct device_node *child;
+
+	if (!np)
+		return ERR_PTR(-EINVAL);
+	if (of_get_available_child_count(np) > 1) {
+		dev_err(dev, "cannot support multiple operational modes");
+		return ERR_PTR(-EINVAL);
+	}
+	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		return ERR_PTR(-ENOMEM);
+	pdata->mode = TPS6105X_MODE_SHUTDOWN;
+	for_each_available_child_of_node(np, child) {
+		if (child->name && !of_node_cmp(child->name, "regulator"))
+			pdata->mode = TPS6105X_MODE_VOLTAGE;
+		else if (child->name && !of_node_cmp(child->name, "led"))
+			pdata->mode = TPS6105X_MODE_TORCH;
+	}
+
+	return pdata;
+}
+
 static int tps6105x_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
@@ -99,9 +125,11 @@ static int tps6105x_probe(struct i2c_client *client,
 	int ret;
 
 	pdata = dev_get_platdata(&client->dev);
-	if (!pdata) {
-		dev_err(&client->dev, "missing platform data\n");
-		return -ENODEV;
+	if (!pdata)
+		pdata = tps6105x_parse_dt(&client->dev);
+	if (IS_ERR(pdata)) {
+		dev_err(&client->dev, "No platform data or DT found");
+		return PTR_ERR(pdata);
 	}
 
 	tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL);
-- 
2.17.1


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

* [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode
  2019-11-20 14:43 [PATCH v3 0/3] tps6105x add devicetree and leds support Sven Van Asbroeck
  2019-11-20 14:43 ` [PATCH v3 1/3] tps6105x: add optional devicetree support Sven Van Asbroeck
@ 2019-11-20 14:44 ` Sven Van Asbroeck
  2019-11-20 21:33   ` Jacek Anaszewski
  2019-11-20 14:44 ` [PATCH v3 3/3] dt-bindings: mfd: update TI tps6105x chip bindings Sven Van Asbroeck
  2 siblings, 1 reply; 7+ messages in thread
From: Sven Van Asbroeck @ 2019-11-20 14:44 UTC (permalink / raw)
  To: Lee Jones, Jacek Anaszewski, Pavel Machek, Rob Herring
  Cc: Linus Walleij, Grigoryev Denis, Axel Lin, Dan Murphy,
	Mark Rutland, devicetree, linux-kernel, linux-leds

This driver adds support for the led operational mode of the
tps6105x mfd device.

Example usage, devicetree:

i2c0 {
	tps61052@33 {
		compatible = "ti,tps61052";
		reg = <0x33>;

		led {
		};
	};
};

Tree: next-20191118
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
---
 drivers/leds/Kconfig         | 10 ++++++
 drivers/leds/Makefile        |  1 +
 drivers/leds/leds-tps6105x.c | 67 ++++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
 create mode 100644 drivers/leds/leds-tps6105x.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 4b68520ac251..7c7ceaa824a2 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -836,6 +836,16 @@ config LEDS_LM36274
 	  Say Y to enable the LM36274 LED driver for TI LMU devices.
 	  This supports the LED device LM36274.
 
+config LEDS_TPS6105X
+	tristate "LED support for TI TPS6105X"
+	depends on LEDS_CLASS
+	depends on TPS6105X
+	default y if TPS6105X
+	help
+	  This driver supports TPS61050/TPS61052 led chips.
+	  It is a single boost converter primarily for white LEDs and
+	  audio amplifiers.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"
 
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 2da39e896ce8..d7e1107753fb 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -85,6 +85,7 @@ obj-$(CONFIG_LEDS_LM3601X)		+= leds-lm3601x.o
 obj-$(CONFIG_LEDS_TI_LMU_COMMON)	+= leds-ti-lmu-common.o
 obj-$(CONFIG_LEDS_LM3697)		+= leds-lm3697.o
 obj-$(CONFIG_LEDS_LM36274)		+= leds-lm36274.o
+obj-$(CONFIG_LEDS_TPS6105X)		+= leds-tps6105x.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
diff --git a/drivers/leds/leds-tps6105x.c b/drivers/leds/leds-tps6105x.c
new file mode 100644
index 000000000000..44325251b3d6
--- /dev/null
+++ b/drivers/leds/leds-tps6105x.c
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/tps6105x.h>
+#include <linux/regmap.h>
+
+struct tps6105x_priv {
+	struct regmap *regmap;
+	struct led_classdev cdev;
+};
+
+static int tps6105x_brightness_set(struct led_classdev *cdev,
+				  enum led_brightness brightness)
+{
+	struct tps6105x_priv *priv = container_of(cdev, struct tps6105x_priv,
+							cdev);
+
+	return regmap_update_bits(priv->regmap, TPS6105X_REG_0,
+		TPS6105X_REG0_TORCHC_MASK,
+		brightness << TPS6105X_REG0_TORCHC_SHIFT);
+}
+
+static int tps6105x_led_probe(struct platform_device *pdev)
+{
+	struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
+	struct tps6105x_platform_data *pdata = tps6105x->pdata;
+	struct tps6105x_priv *priv;
+	int ret;
+
+	/* This instance is not set for torch mode so bail out */
+	if (pdata->mode != TPS6105X_MODE_TORCH) {
+		dev_info(&pdev->dev,
+			"chip not in torch mode, exit probe");
+		return -EINVAL;
+	}
+
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+	priv->regmap = tps6105x->regmap;
+	priv->cdev.name = "tps6105x::torch";
+	priv->cdev.brightness_set_blocking = tps6105x_brightness_set;
+	priv->cdev.max_brightness = 7;
+
+	ret = regmap_update_bits(tps6105x->regmap, TPS6105X_REG_0,
+		TPS6105X_REG0_MODE_MASK | TPS6105X_REG0_TORCHC_MASK,
+		TPS6105X_REG0_MODE_TORCH << TPS6105X_REG0_MODE_SHIFT);
+	if (ret)
+		return ret;
+
+	return devm_led_classdev_register(&pdev->dev, &priv->cdev);
+}
+
+static struct platform_driver led_driver = {
+	.probe = tps6105x_led_probe,
+	.driver = {
+		.name = "tps6105x-leds",
+	},
+};
+
+module_platform_driver(led_driver);
+
+MODULE_DESCRIPTION("TPS6105x led driver");
+MODULE_AUTHOR("Sven Van Asbroeck <TheSven73@gmail.com>");
+MODULE_LICENSE("GPL v2");
-- 
2.17.1


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

* [PATCH v3 3/3] dt-bindings: mfd: update TI tps6105x chip bindings
  2019-11-20 14:43 [PATCH v3 0/3] tps6105x add devicetree and leds support Sven Van Asbroeck
  2019-11-20 14:43 ` [PATCH v3 1/3] tps6105x: add optional devicetree support Sven Van Asbroeck
  2019-11-20 14:44 ` [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode Sven Van Asbroeck
@ 2019-11-20 14:44 ` Sven Van Asbroeck
  2 siblings, 0 replies; 7+ messages in thread
From: Sven Van Asbroeck @ 2019-11-20 14:44 UTC (permalink / raw)
  To: Lee Jones, Jacek Anaszewski, Pavel Machek, Rob Herring
  Cc: Linus Walleij, Grigoryev Denis, Axel Lin, Dan Murphy,
	Mark Rutland, devicetree, linux-kernel, linux-leds

The driver has been extended to optionally get its operational
mode, regulator init data and led label from the devicetree.

Tree: next-20191118
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
---
 .../devicetree/bindings/mfd/tps6105x.txt      | 39 ++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/tps6105x.txt b/Documentation/devicetree/bindings/mfd/tps6105x.txt
index 93602c7a19c8..1fa8fc35e0bc 100644
--- a/Documentation/devicetree/bindings/mfd/tps6105x.txt
+++ b/Documentation/devicetree/bindings/mfd/tps6105x.txt
@@ -7,11 +7,48 @@ Required properties:
 - compatible:		"ti,tps61050" or "ti,tps61052"
 - reg:			Specifies the I2C slave address
 
-Example:
+Optional sub-node:
+
+This subnode selects the chip's operational mode.
+There can be at most one single available subnode.
+
+- regulator: presence of this sub-node puts the chip in regulator mode.
+	see Documentation/devicetree/bindings/regulator/regulator.txt
+
+- led: presence of this sub-node puts the chip in led mode.
+
+Example (GPIO operation only):
+
+i2c0 {
+	tps61052@33 {
+		compatible = "ti,tps61052";
+		reg = <0x33>;
+	};
+};
+
+Example (GPIO + regulator operation):
 
 i2c0 {
 	tps61052@33 {
 		compatible = "ti,tps61052";
 		reg = <0x33>;
+
+		regulator {
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			regulator-always-on;
+		};
+	};
+};
+
+Example (GPIO + led operation):
+
+i2c0 {
+	tps61052@33 {
+		compatible = "ti,tps61052";
+		reg = <0x33>;
+
+		led {
+		};
 	};
 };
-- 
2.17.1


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

* Re: [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode
  2019-11-20 14:44 ` [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode Sven Van Asbroeck
@ 2019-11-20 21:33   ` Jacek Anaszewski
  2019-11-20 21:41     ` Sven Van Asbroeck
  0 siblings, 1 reply; 7+ messages in thread
From: Jacek Anaszewski @ 2019-11-20 21:33 UTC (permalink / raw)
  To: Sven Van Asbroeck, Lee Jones, Pavel Machek, Rob Herring
  Cc: Linus Walleij, Grigoryev Denis, Axel Lin, Dan Murphy,
	Mark Rutland, devicetree, linux-kernel, linux-leds

Hi Sven,

On 11/20/19 3:44 PM, Sven Van Asbroeck wrote:
> This driver adds support for the led operational mode of the
> tps6105x mfd device.
> 
> Example usage, devicetree:
> 
> i2c0 {
> 	tps61052@33 {
> 		compatible = "ti,tps61052";
> 		reg = <0x33>;
> 
> 		led {
> 		};
> 	};
> };

This is covered in DT bindings, it is redundant in the commit message.

> 
> Tree: next-20191118
> Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
> ---
>  drivers/leds/Kconfig         | 10 ++++++
>  drivers/leds/Makefile        |  1 +
>  drivers/leds/leds-tps6105x.c | 67 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 78 insertions(+)
>  create mode 100644 drivers/leds/leds-tps6105x.c
> 
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 4b68520ac251..7c7ceaa824a2 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -836,6 +836,16 @@ config LEDS_LM36274
>  	  Say Y to enable the LM36274 LED driver for TI LMU devices.
>  	  This supports the LED device LM36274.
>  
> +config LEDS_TPS6105X
> +	tristate "LED support for TI TPS6105X"
> +	depends on LEDS_CLASS
> +	depends on TPS6105X
> +	default y if TPS6105X
> +	help
> +	  This driver supports TPS61050/TPS61052 led chips.
> +	  It is a single boost converter primarily for white LEDs and
> +	  audio amplifiers.
> +
>  comment "LED Triggers"
>  source "drivers/leds/trigger/Kconfig"
>  
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index 2da39e896ce8..d7e1107753fb 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -85,6 +85,7 @@ obj-$(CONFIG_LEDS_LM3601X)		+= leds-lm3601x.o
>  obj-$(CONFIG_LEDS_TI_LMU_COMMON)	+= leds-ti-lmu-common.o
>  obj-$(CONFIG_LEDS_LM3697)		+= leds-lm3697.o
>  obj-$(CONFIG_LEDS_LM36274)		+= leds-lm36274.o
> +obj-$(CONFIG_LEDS_TPS6105X)		+= leds-tps6105x.o
>  
>  # LED SPI Drivers
>  obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
> diff --git a/drivers/leds/leds-tps6105x.c b/drivers/leds/leds-tps6105x.c
> new file mode 100644
> index 000000000000..44325251b3d6
> --- /dev/null
> +++ b/drivers/leds/leds-tps6105x.c
> @@ -0,0 +1,67 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include <linux/leds.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/mfd/tps6105x.h>
> +#include <linux/regmap.h>
> +
> +struct tps6105x_priv {
> +	struct regmap *regmap;
> +	struct led_classdev cdev;
> +};
> +
> +static int tps6105x_brightness_set(struct led_classdev *cdev,
> +				  enum led_brightness brightness)
> +{
> +	struct tps6105x_priv *priv = container_of(cdev, struct tps6105x_priv,
> +							cdev);
> +
> +	return regmap_update_bits(priv->regmap, TPS6105X_REG_0,
> +		TPS6105X_REG0_TORCHC_MASK,
> +		brightness << TPS6105X_REG0_TORCHC_SHIFT);
> +}
> +
> +static int tps6105x_led_probe(struct platform_device *pdev)
> +{
> +	struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
> +	struct tps6105x_platform_data *pdata = tps6105x->pdata;
> +	struct tps6105x_priv *priv;
> +	int ret;
> +
> +	/* This instance is not set for torch mode so bail out */
> +	if (pdata->mode != TPS6105X_MODE_TORCH) {
> +		dev_info(&pdev->dev,
> +			"chip not in torch mode, exit probe");
> +		return -EINVAL;
> +	}
> +
> +	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +	priv->regmap = tps6105x->regmap;
> +	priv->cdev.name = "tps6105x::torch";

Please remove above line.

> +	priv->cdev.brightness_set_blocking = tps6105x_brightness_set;
> +	priv->cdev.max_brightness = 7;
> +
> +	ret = regmap_update_bits(tps6105x->regmap, TPS6105X_REG_0,
> +		TPS6105X_REG0_MODE_MASK | TPS6105X_REG0_TORCHC_MASK,
> +		TPS6105X_REG0_MODE_TORCH << TPS6105X_REG0_MODE_SHIFT);
> +	if (ret)
> +		return ret;
>

And use new LED registration API like below:

struct led_init_data init_data = {
	.devicename = "tps6105x",
	.default_label = ":torch" };

return devm_led_classdev_register_ext(&pdev->dev, &priv->cdev, &init_data);

This way you will make the driver capable of using LED core mechanism
for composing LED names, which will allow to use function and color
properties in DT, and automatically override the defaults from the
driver. If both properties are missing in DT, then you will get the LED
named tps6105x::torch.

> +	return devm_led_classdev_register(&pdev->dev, &priv->cdev);
> +}
> +
> +static struct platform_driver led_driver = {
> +	.probe = tps6105x_led_probe,
> +	.driver = {
> +		.name = "tps6105x-leds",
> +	},
> +};
> +
> +module_platform_driver(led_driver);
> +
> +MODULE_DESCRIPTION("TPS6105x led driver");
> +MODULE_AUTHOR("Sven Van Asbroeck <TheSven73@gmail.com>");
> +MODULE_LICENSE("GPL v2");
> 

-- 
Best regards,
Jacek Anaszewski

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

* Re: [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode
  2019-11-20 21:33   ` Jacek Anaszewski
@ 2019-11-20 21:41     ` Sven Van Asbroeck
  2019-11-20 21:50       ` Jacek Anaszewski
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Van Asbroeck @ 2019-11-20 21:41 UTC (permalink / raw)
  To: Jacek Anaszewski
  Cc: Lee Jones, Pavel Machek, Rob Herring, Linus Walleij,
	Grigoryev Denis, Axel Lin, Dan Murphy, Mark Rutland, devicetree,
	Linux Kernel Mailing List, linux-leds

Hi Jacek,

On Wed, Nov 20, 2019 at 4:33 PM Jacek Anaszewski
<jacek.anaszewski@gmail.com> wrote:
> This is covered in DT bindings, it is redundant in the commit message.

Ok, I will remove it from the commit message.

> > +     priv->cdev.name = "tps6105x::torch";
>
> Please remove above line.
>
> And use new LED registration API like below:
>
> struct led_init_data init_data = {
>         .devicename = "tps6105x",
>         .default_label = ":torch" };
>
> return devm_led_classdev_register_ext(&pdev->dev, &priv->cdev, &init_data);

I would love to do that, but my platform (with a tps6105x) can only boot a lts
vendor kernel (4.14). classdev_register_ext() is not available there.

I can make the change you suggest, but cannot test to check if it will actually
work. Is that ok for you?

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

* Re: [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode
  2019-11-20 21:41     ` Sven Van Asbroeck
@ 2019-11-20 21:50       ` Jacek Anaszewski
  0 siblings, 0 replies; 7+ messages in thread
From: Jacek Anaszewski @ 2019-11-20 21:50 UTC (permalink / raw)
  To: Sven Van Asbroeck
  Cc: Lee Jones, Pavel Machek, Rob Herring, Linus Walleij,
	Grigoryev Denis, Axel Lin, Dan Murphy, Mark Rutland, devicetree,
	Linux Kernel Mailing List, linux-leds

On 11/20/19 10:41 PM, Sven Van Asbroeck wrote:
> Hi Jacek,
> 
> On Wed, Nov 20, 2019 at 4:33 PM Jacek Anaszewski
> <jacek.anaszewski@gmail.com> wrote:
>> This is covered in DT bindings, it is redundant in the commit message.
> 
> Ok, I will remove it from the commit message.
> 
>>> +     priv->cdev.name = "tps6105x::torch";
>>
>> Please remove above line.
>>
>> And use new LED registration API like below:
>>
>> struct led_init_data init_data = {
>>         .devicename = "tps6105x",
>>         .default_label = ":torch" };
>>
>> return devm_led_classdev_register_ext(&pdev->dev, &priv->cdev, &init_data);
> 
> I would love to do that, but my platform (with a tps6105x) can only boot a lts
> vendor kernel (4.14). classdev_register_ext() is not available there.
> 
> I can make the change you suggest, but cannot test to check if it will actually
> work. Is that ok for you?

Can't you backport also the LED core patches with *ext API?

-- 
Best regards,
Jacek Anaszewski

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

end of thread, other threads:[~2019-11-20 21:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 14:43 [PATCH v3 0/3] tps6105x add devicetree and leds support Sven Van Asbroeck
2019-11-20 14:43 ` [PATCH v3 1/3] tps6105x: add optional devicetree support Sven Van Asbroeck
2019-11-20 14:44 ` [PATCH v3 2/3] leds: tps6105x: add driver for mfd chip led mode Sven Van Asbroeck
2019-11-20 21:33   ` Jacek Anaszewski
2019-11-20 21:41     ` Sven Van Asbroeck
2019-11-20 21:50       ` Jacek Anaszewski
2019-11-20 14:44 ` [PATCH v3 3/3] dt-bindings: mfd: update TI tps6105x chip bindings Sven Van Asbroeck

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).