- 14 3月, 2016 6 次提交
-
-
由 Amitoj Kaur Chawla 提交于
Switch to resource-managed function devm_led_classdev_register instead of led_classdev_register and remove unneeded led_classdev_unregister. To be compatible with this change, remove an unnecessary label by replacing it with direct return statement. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @platform@ identifier p, probefn, removefn; @@ struct platform_driver p = { .probe = probefn, .remove = removefn, }; @prb@ identifier platform.probefn, pdev; expression e; @@ probefn(struct platform_device *pdev, ...) { ... e = - led_classdev_register + devm_led_classdev_register (...); ... ?- led_classdev_unregister(...); ... } @remove depends on prb@ identifier platform.removefn; @@ removefn(...) { ... ?- led_classdev_unregister(...); ... } //</smpl> Signed-off-by: NAmitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Geert Uytterhoeven 提交于
Use the GPIO flag definition instead of a numeric literal, so the casual reader grepping for GPIOF_ will find the GPIO flags used. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Heiner Kallweit 提交于
Add helpers for calling brightness_set(_blocking) allowing to simplify the code and make it better readable. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Wei Yongjun 提交于
In case of error, the function gpio_to_desc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Antonio Ospite 提交于
Improve the wording for the comment about the led status, and while at it also use the standard formatting for multi-line comments. Signed-off-by: NAntonio Ospite <ao2@ao2.it> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Heiner Kallweit 提交于
When a USB LED device is unplugged the remove call chain calls led_classdev_unregister which tries to switch the LED off. As the device has been removed already this results in a ENODEV error message in dmesg. Avoid this error message by ignoring ENODEV in calls from led_classdev_unregister if the LED device is flagged as pluggable. Therefore a new flag LED_HW_PLUGGABLE was introduced which should be set by all LED drivers handling pluggable LED devices (mainly USB LED devices). Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
- 07 1月, 2016 2 次提交
-
-
由 Linus Walleij 提交于
This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Acked-by: NJacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Linus Walleij 提交于
This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Acked-by: NJacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 04 1月, 2016 32 次提交
-
-
由 Vegard Nossum 提交于
Ran into this on UML: drivers/built-in.o: In function `bcm6328_leds_probe': drivers/leds/leds-bcm6328.c:340: undefined reference to `devm_ioremap_resource' drivers/built-in.o: In function `bcm6358_leds_probe': drivers/leds/leds-bcm6358.c:173: undefined reference to `devm_ioremap_resource' collect2: error: ld returned 1 exit status devm_ioremap_resource() is defined only when HAS_IOMEM is selected. Signed-off-by: NVegard Nossum <vegard.nossum@oracle.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Heiner Kallweit 提交于
Complementing devm_led_classdev_register add a managed version of led_trigger_register. I omit a managed version of led_classdev_unregister as the equivalent devm_led_classdev_unregister isn't used in the kernel as of today. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
The busy status checking isn't needed while reading initial LED status. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
BCM6328 controller has a margin of 20ms per blink step, which means that we can only set it to 20, 40, 60 ... 1260 ms (0x3f * 20ms). However, when checking if delay_on == delay_off, we were not considering the case when the user had set delay_on=20 and delay_off=21, since this will cause the driver to fallback to software blinking. This update fixes this issue and improves blink steps by rounding them in a more sensible way. Now 30-49ms is rounded to 40 ms, and previous behaviour implied 40-59ms being rounded to 40 ms. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
bcm6358_led_mode is now only called by bcm6358_led_set, so merge both in one single function. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
Instead of duplicating the unlock we can store the return value and use a single unlock before returning that value, which simplifies the code. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
This adds little endian support while keeping big endian support. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
This adds little endian support while keeping big endian support. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
This lock isn't really needed, since we're only reading the register and changes made to other LEDs aren't relevant. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
Replaces bcm6358_led_mode with bcm6358_led_set so we don't need to handle the lock. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
This lock isn't really needed, since we're only reading the register and changes made to other LEDs aren't relevant. Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Álvaro Fernández Rojas 提交于
- Remove double whitespace - Add missing brackets - Add spinlock info Signed-off-by: NÁlvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Paul Gortmaker 提交于
The Kconfig currently controlling compilation of this code is: drivers/leds/Kconfig:config LEDS_SYSCON drivers/leds/Kconfig: bool "LED support for LEDs on system controllers" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Paul Gortmaker 提交于
The Kconfig for this driver is currently: config LEDS_TRIGGER_IDE_DISK bool "LED IDE Disk Trigger" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Paul Gortmaker 提交于
The Kconfig for this driver is currently: config LEDS_TRIGGER_CPU bool "LED CPU Trigger" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Thierry Reding 提交于
These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Each break out of the for_each_available_child_of_node loop requires of_node_put(). This patch adds missing of_node_put() when loop breaks on conflicting values of led-sources DT property. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Rob Herring <robh@kernel.org> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
-
由 Jacek Anaszewski 提交于
The refcount of device_node increases after of_get_next_available_child() is called. Make sure it is decremented also in case of DT parsing error. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Rob Herring <robh@kernel.org> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
-
由 Jacek Anaszewski 提交于
Since brightness setting can sleep for this driver, implement brightness_set_blocking op, instead of brightness_set. It makes this driver compatible with LED triggers. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-
由 Jacek Anaszewski 提交于
Since brightness setting can sleep for this driver, implement brightness_set_blocking op, instead of brightness_set. It makes this driver compatible with LED triggers. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Saurabh Sengar 提交于
No need to explicitly check for pointer to be null, of_prop_next_string anyways returns NULL, if passed pointer is NULL and hence loop will continue. Signed-off-by: NSaurabh Sengar <saurabh.truth@gmail.com> Acked-by: NVasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Simon Arlott 提交于
The values of BCM6328_LED_MODE_ON and BCM6328_LED_MODE_OFF were named for active low LEDs. These should be swapped so that they are named for the default case of active high LEDs. Signed-off-by: NSimon Arlott <simon@fire.lp0.eu> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Simon Arlott 提交于
When ensuring a consistent initial LED state in bcm6328_led (as they may be blinking instead of on/off), the LED register is set using an inverted copy of bcm6328_led_set(). To avoid further errors relating to active low handling, call this function directly instead. As bcm6328_led_set() acquires the same spinlock again when updating the register, it is called after unlocking. Signed-off-by: NSimon Arlott <simon@fire.lp0.eu> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Tested-by: NSimon Guinot <simon.guinot@sequanux.org>
-
由 Uwe Kleine-König 提交于
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Milo Kim 提交于
Workqueue, 'set_brightness_work' is used for scheduling brightness control. This workqueue is canceled when the LED class device is unregistered. Currently, LED subsystem handles like below. cancel_work_sync(&led_cdev->set_brightness_work) led_set_brightness(led_cdev, LED_OFF) However, this could be a problem. Workqueue is going to be canceled but LED device needs to be off. The worst case is null pointer access due to scheduling a workqueue. LED module is loaded. LED driver private data is allocated by using devm_zalloc(). LED module is unloaded. led_classdev_unregister() is called. cancel_work_sync() led_set_brightness(led_cdev, LED_OFF) schedule_work() if LED driver uses brightness_set_blocking() In the meantime, driver private data will be freed. ..scheduling.. brightness_set_blocking() callback is invoked. For the brightness control, LED driver tries to access private data but resource is removed! To avoid this problem, LED subsystem should turn off the brightness first and wait for completion. led_set_brightness(led_cdev, LED_OFF) flush_work(&led_cdev->set_brightness_work) It guarantees that LED driver turns off the brightness prior to resource management. Cc: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: NMilo Kim <milo.kim@ti.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Strobe state variable is declared as unsigned long, remove the check for values less than zero then. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Reported-by: NDavid Binderman <dcb314@hotmail.com>
-
由 Ingi Kim 提交于
The refcount of device_node increases after of_node_get() is called. So, a break out of the loop requires of_node_put(). This patch adds missing of_node_put() when loop breaks. Signed-off-by: NIngi Kim <ingi2.kim@samsung.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Markus Hofstaetter 提交于
Some PWMs are disabled by default or the default pin setting does not match the LED_OFF state (e.g., active-low leds). Hence, the driver may end up reporting 0 brightness, but the leds are actually on using full brightness, because it never enforces its default configuration. So enforce it by calling led_pwm_set() after successfully registering the device. Tested on a Phytec phyFLEX i.MX6Q board based on kernel v3.19.5. Signed-off-by: NMarkus Hofstaetter <markus.hofstaetter@ait.ac.at> Tested-by: NMarkus Hofstaetter <markus.hofstaetter@ait.ac.at> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Uwe Kleine-König 提交于
The header of this file fixes the license to GPL 2 only without the option to use later version. So use the string "GPL v2" that is to be used in this case. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NFabio Baltieri <fabio.baltieri@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Rob Herring 提交于
The transient trigger duration is documented to be in msec units, but is actually in jiffies units. Other time based triggers are in msec units as well. Fix the timer setup to convert from msec. This could break an existing userspace that worked around this problem, but exposing jiffies to userspace is just wrong and would break anyway if HZ is changed. Signed-off-by: NRob Herring <robh@kernel.org> Cc: Shuah Khan <shuahkhan@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: G.Shark Jeong <gshark.jeong@gmail.com>
-