[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150820152157.GD27457@lunn.ch>
Date: Thu, 20 Aug 2015 17:21:57 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jacek Anaszewski <j.anaszewski@...sung.com>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Pavel Machek <pavel@....cz>,
Stas Sergeev <stsp@...rs.sourceforge.net>
Subject: Re: [PATCH/RFC v6 01/36] leds: Add brightness_set_blocking op
On Thu, Aug 20, 2015 at 04:43:31PM +0200, Jacek Anaszewski wrote:
> This patch adds a new brightness_set_blocking op to the LED subsystem.
> The op is intended for drivers that set brightness in a blocking way,
> i.e. they either can sleep or use delays while setting brightness.
Thanks for adding this. This is the correct way to go.
Acked-by: Andrew Lunn <andrew@...n.ch>
Andrew
> Signed-off-by: Jacek Anaszewski <j.anaszewski@...sung.com>
> Cc: Andrew Lunn <andrew@...n.ch>
> Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>
> Cc: Pavel Machek <pavel@....cz>
> Cc: Stas Sergeev <stsp@...rs.sourceforge.net>
> ---
> drivers/leds/led-class.c | 3 +++
> include/linux/leds.h | 6 ++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index ca51d58..93a2414 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -267,6 +267,9 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
> dev_warn(parent, "Led %s renamed to %s due to name collision",
> led_cdev->name, dev_name(led_cdev->dev));
>
> + WARN_ON(led_cdev->brightness_set &&
> + led_cdev->brightness_set_blocking);
> +
> #ifdef CONFIG_LEDS_TRIGGERS
> init_rwsem(&led_cdev->trigger_lock);
> #endif
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index b122eea..85fad6b 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -54,6 +54,12 @@ struct led_classdev {
> void (*brightness_set)(struct led_classdev *led_cdev,
> enum led_brightness brightness);
> /*
> + * Intended for drivers that either can sleep or use delays while
> + * setting brightness.
> + */
> + int (*brightness_set_blocking)(struct led_classdev *led_cdev,
> + enum led_brightness brightness);
> + /*
> * Set LED brightness level immediately - it can block the caller for
> * the time required for accessing a LED device register.
> */
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists