lkml.org 
[lkml]   [2021]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver
Hi!

> + priv = devm_kzalloc(dev, sizeof(struct gpio_dual_leds_priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->low_gpio = devm_gpiod_get(dev, "low", GPIOD_OUT_LOW);
> + ret = PTR_ERR_OR_ZERO(priv->low_gpio);
> + if (ret) {
> + dev_err(dev, "cannot get low-gpios %d\n", ret);
> + return ret;
> + }
> +
> + priv->high_gpio = devm_gpiod_get(dev, "high", GPIOD_OUT_LOW);
> + ret = PTR_ERR_OR_ZERO(priv->high_gpio);
> + if (ret) {
> + dev_err(dev, "cannot get high-gpios %d\n", ret);
> + return ret;
> + }

Actually... I'd call it led-0 and led-1 or something. Someone may/will
come with 4-bit GPIO LED one day, and it would be cool if this could
be used with minimal effort.

Calling it multi_led in the driver/bindings would bnot be bad, either.

Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-03-11 19:04    [W:0.156 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site