History log of /linux/drivers/leds/trigger/ledtrig-gpio.c (Results 1 – 17 of 17)
Revision Date Author Comments
# 804073f5 03-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

leds: trigger: gpio: Convert to DEVICE_ATTR_RW()

Instead of custom wrapper, use DEVICE_ATTR_RW() directly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Wall

leds: trigger: gpio: Convert to DEVICE_ATTR_RW()

Instead of custom wrapper, use DEVICE_ATTR_RW() directly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231103195310.948327-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

show more ...


# 7b9c5500 03-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

leds: trigger: gpio: Use sysfs_emit() to instead of s*printf()

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting

leds: trigger: gpio: Use sysfs_emit() to instead of s*printf()

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231103195310.948327-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

show more ...


# 7d6766f5 03-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

leds: trigger: gpio: Convert to use kstrtox()

sscanf() is a heavy one and moreover requires additional boundary checks.
Convert driver to use kstrtou8() in gpio_trig_inverted_store().

Signed-off-by

leds: trigger: gpio: Convert to use kstrtox()

sscanf() is a heavy one and moreover requires additional boundary checks.
Convert driver to use kstrtou8() in gpio_trig_inverted_store().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231103195310.948327-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

show more ...


# 9bbd6b72 03-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

leds: trigger: gpio: Replace custom code for gpiod_get_optional()

gpiod_get_optional() and currently used fwnode_gpiod_get_index()
are both wrappers against the same engine internally. Since we
have

leds: trigger: gpio: Replace custom code for gpiod_get_optional()

gpiod_get_optional() and currently used fwnode_gpiod_get_index()
are both wrappers against the same engine internally. Since we
have a pointer to struct device there is no reason to use fwnode
type of GPIO call. So, replace the current fwnode call by respective
gpiod ones.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231103195310.948327-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

show more ...


# 4a11dbf0 26-Sep-2023 Linus Walleij <linus.walleij@linaro.org>

leds: triggers: gpio: Rewrite to use trigger-sources

By providing a GPIO line as "trigger-sources" in the FWNODE
(such as from the device tree) and combining with the
GPIO trigger, we can support a

leds: triggers: gpio: Rewrite to use trigger-sources

By providing a GPIO line as "trigger-sources" in the FWNODE
(such as from the device tree) and combining with the
GPIO trigger, we can support a GPIO LED trigger in a natural
way from the hardware description instead of using the
custom sysfs and deprecated global GPIO numberspace.

Example:

gpio: gpio@0 {
compatible "my-gpio";
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
#trigger-source-cells = <2>;
};

leds {
compatible = "gpio-leds";
led-my-gpio {
label = "device:blue:myled";
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
default-state = "off";
linux,default-trigger = "gpio";
trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
};

Make this the norm, unmark the driver as broken.

Delete the sysfs handling of GPIOs.

Since GPIO descriptors inherently can describe inversion,
the inversion handling can just be deleted.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230926-gpio-led-trigger-dt-v2-3-e06e458b788e@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

show more ...


# 5ad79c20 13-Jun-2020 Jan Kiszka <jan.kiszka@siemens.com>

leds: trigger: gpio: Avoid warning on update of inverted

If the GPIO has not been configured yet, writing to inverted will raise
a kernel warning.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

leds: trigger: gpio: Avoid warning on update of inverted

If the GPIO has not been configured yet, writing to inverted will raise
a kernel warning.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>

show more ...


# 4e421040 30-Aug-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

leds: trigger: gpio: GPIO 0 is valid

Allow all valid GPIOs to be used in the driver.

Fixes: 17354bfe8527 ("leds: Add gpio-led trigger")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel

leds: trigger: gpio: GPIO 0 is valid

Allow all valid GPIOs to be used in the driver.

Fixes: 17354bfe8527 ("leds: Add gpio-led trigger")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of th

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

show more ...


# 9bfd7d9e 02-Jul-2018 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

leds: gpio trigger: simplifications from core changes

The trigger core learned error handling for the activate callback and
to handle device attributes. Also make use of the module_led_trigger()
hel

leds: gpio trigger: simplifications from core changes

The trigger core learned error handling for the activate callback and
to handle device attributes. Also make use of the module_led_trigger()
helper to simplify trigger registration.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# 2282e125 02-Jul-2018 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

leds: triggers: let struct led_trigger::activate() return an error code

Given that activating a trigger can fail, let the callback return an
indication. This prevents to have a trigger active accord

leds: triggers: let struct led_trigger::activate() return an error code

Given that activating a trigger can fail, let the callback return an
indication. This prevents to have a trigger active according to the
"trigger" sysfs attribute but not functional.

All users are changed accordingly to return 0 for now. There is no intended
change in behaviour.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# 033692eb 02-Jul-2018 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

leds: triggers: make the MODULE_LICENSE string match the actual license

These files are licensed under GPL version 2 only. So use "GPL v2"
instead of "GPL" (which means v2 or later).

Also remove an

leds: triggers: make the MODULE_LICENSE string match the actual license

These files are licensed under GPL version 2 only. So use "GPL v2"
instead of "GPL" (which means v2 or later).

Also remove an empty (but commented) line at the end of the license
header which nicely proves in the context that the drivers are really v2
only :-)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# 71c17b06 26-May-2017 Jan Kiszka <jan.kiszka@siemens.com>

leds: trigger: gpio: Use threaded IRQ

This both simplifies the code because we can drop the workqueue
indirection, and it enables using the trigger for GPIOs that work with
threaded IRQs themselves.

leds: trigger: gpio: Use threaded IRQ

This both simplifies the code because we can drop the workqueue
indirection, and it enables using the trigger for GPIOs that work with
threaded IRQs themselves.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# 71afe3cb 26-May-2017 Jan Kiszka <jan.kiszka@siemens.com>

leds: trigger: gpio: Refresh LED state after GPIO change

The new GPIO may have a different state than the old one.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <a

leds: trigger: gpio: Refresh LED state after GPIO change

The new GPIO may have a different state than the old one.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

show more ...


# 81fe8e5b 07-Oct-2015 Jacek Anaszewski <j.anaszewski@samsung.com>

leds: core: Add led_set_brightness_nosleep{nopm} functions

This patch adds led_set_brightness_nosleep() and led_set_brightness_nopm()
functions, that guarantee setting LED brightness in a non-blocki

leds: core: Add led_set_brightness_nosleep{nopm} functions

This patch adds led_set_brightness_nosleep() and led_set_brightness_nopm()
functions, that guarantee setting LED brightness in a non-blocking way.
The latter is used from pm_ops context and doesn't modify the brightness
cached in the struct led_classdev. Its execution always ends up with
a call to brightness setting op - either directly or through
a set_brightness_work, regardless of LED_SUSPENDED flag state.

The patch also replaces led_set_brightness_async() with
led_set_brightness_nosleep() in all places where the most vital was setting
brightness in a non sleeping way but not necessarily asynchronously, which
is not needed for non-blocking drivers.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

show more ...


# 4d71a4a1 14-Nov-2014 Jacek Anaszewski <j.anaszewski@samsung.com>

leds: Add support for setting brightness in a synchronous way

There are use cases when setting a LED brightness has to
have immediate effect (e.g. setting a torch LED brightness).
This patch extends

leds: Add support for setting brightness in a synchronous way

There are use cases when setting a LED brightness has to
have immediate effect (e.g. setting a torch LED brightness).
This patch extends LED subsystem to support such operations.
The LED subsystem internal API __led_set_brightness is changed
to led_set_brightness_async and new led_set_brightness_sync API
is added.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

show more ...


# 914ae25a 09-Sep-2014 Lothar Waßmann <LW@karo-electronics.de>

leds: trigger: gpio: fix warning in gpio trigger for gpios whose accessor function may sleep

When using a GPIO driver whose accessor functions may sleep (e.g. an
I2C GPIO extender like PCA9554) the

leds: trigger: gpio: fix warning in gpio trigger for gpios whose accessor function may sleep

When using a GPIO driver whose accessor functions may sleep (e.g. an
I2C GPIO extender like PCA9554) the following warning is issued:
WARNING: CPU: 0 PID: 665 at drivers/gpio/gpiolib.c:2274 gpiod_get_raw_value+0x3c/0x48()
Modules linked in:
CPU: 0 PID: 665 Comm: kworker/0:2 Not tainted 3.16.0-karo+ #115
Workqueue: events gpio_trig_work
[<c00142cc>] (unwind_backtrace) from [<c00118f8>] (show_stack+0x10/0x14)
[<c00118f8>] (show_stack) from [<c001bf10>] (warn_slowpath_common+0x64/0x84)
[<c001bf10>] (warn_slowpath_common) from [<c001bf4c>] (warn_slowpath_null+0x1c/0x24)
[<c001bf4c>] (warn_slowpath_null) from [<c020a1b8>] (gpiod_get_raw_value+0x3c/0x48)
[<c020a1b8>] (gpiod_get_raw_value) from [<c02f68a0>] (gpio_trig_work+0x1c/0xb0)
[<c02f68a0>] (gpio_trig_work) from [<c0030c1c>] (process_one_work+0x144/0x38c)
[<c0030c1c>] (process_one_work) from [<c0030ef8>] (worker_thread+0x60/0x5cc)
[<c0030ef8>] (worker_thread) from [<c0036dd4>] (kthread+0xb4/0xd0)
[<c0036dd4>] (kthread) from [<c000f0f0>] (ret_from_fork+0x14/0x24)
---[ end trace cd51a1dad8b86c9c ]---

Fix this by using the _cansleep() variant of gpio_get_value().

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

show more ...


# f07fb521 20-Feb-2013 Kim, Milo <Milo.Kim@ti.com>

leds: move LED trigger drivers into new subdirectory

For better driver management, new subdirectory, 'trigger' is created.
All LED trigger drivers are moved into this directory.

Internal header, 'l

leds: move LED trigger drivers into new subdirectory

For better driver management, new subdirectory, 'trigger' is created.
All LED trigger drivers are moved into this directory.

Internal header, 'leds.h' is included in each LED trigger drivers.
Fix the location of header file, "leds.h" -> "../leds.h" in driver files.
One exception is here, 'ledtrig-timer.c'.
There is no need to include 'leds.h'. so '#include "leds.h"' line was removed.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

show more ...