01 Oct, 2020
1 commit
-
In one of the error paths of the for_each_child_of_node loop in
tlc591xx_probe, add missing call to of_node_put.Fixes: 1ab4531ad132 ("leds: tlc591xx: simplify driver by using the managed led API")
Signed-off-by: Tobias Jordan
Reviewed-by: Marek Behún
Reviewed-by: Tomi Valkeinen
Signed-off-by: Pavel Machek
27 Sep, 2020
4 commits
-
Do the parsing of `linux,default-trigger` DT property to LED core.
Currently it is done in many different drivers and the code is repeated.This patch removes the parsing from 23 drivers:
an30259a, aw2013, bcm6328, bcm6358, cr0014114, el15203000, gpio,
is31fl32xx, lm3532, lm36274, lm3692x, lm3697, lp50xx, lp8860, lt3593,
max77650, mt6323, ns2, pm8058, pwm, syscon, tlc591xx and turris-omnia.There is one driver in drivers/input which parses this property on it's
own. I shall send a separate patch there after this is applied.There are still 8 drivers that parse this property on their own because
they do not pass the led_init_data structure to the registering
function. I will try to refactor those in the future.Signed-off-by: Marek Behún
Signed-off-by: Pavel Machek -
Various drivers count and iterate over OF children nodes via
of_get_child_count and for_each_child_of_node. Instead they should use
of_get_available_child_count and for_each_available_child_of_node, so
that if a given node has the `status` property set to `disabled`, the
child will be ignored.Signed-off-by: Marek Behún
Cc: Andrew Lunn
Cc: Andrey Utkin
Cc: Baolin Wang
Cc: Baolin Wang
Cc: Benjamin Herrenschmidt
Cc: Christian Mauderer
Cc: Chunyan Zhang
Cc: Dan Murphy
Cc: David Rivshin
Cc: Haojian Zhuang
Cc: H. Nikolaus Schaller
Cc: Michael Ellerman
Cc: Milo Kim
Cc: NeilBrown
Cc: Nikita Travkin
Cc: Orson Zhai
Cc: Paul Mackerras
Cc: Philippe Retornaz
Cc: Riku Voipio
Cc: Simon Guinot
Cc: Simon Shields
Cc: Vasant Hegde
Cc: Xiaotong Lu
Signed-off-by: Pavel Machek -
The dev_of_node function should be preferred.
Signed-off-by: Marek Behún
Cc: Orson Zhai
Cc: Baolin Wang
Cc: Chunyan Zhang
Cc: Sean Wang
Cc: Matthias Brugger
Cc: Riku Voipio
Signed-off-by: Pavel Machek -
Simply use device_get_match_data instead of matching against the match
table again.Signed-off-by: Marek Behún
Cc: H. Nikolaus Schaller
Cc: David Rivshin
Cc: Sebastian Reichel
Cc: Christian Mauderer
Cc: Andrew Lunn
Signed-off-by: Pavel Machek
09 Sep, 2020
1 commit
-
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Pavel Machek
17 Apr, 2020
1 commit
-
If devm_led_classdev_register_ext() fails with EPROBE_DEFER, we get:
tlc591xx 0-0040: couldn't register LED (null)
Only print the error if the error is something else than EPROBE_DEFER.
Signed-off-by: Tomi Valkeinen
Reviewed-by: Dan Murphy
Signed-off-by: Pavel Machek
04 Nov, 2019
4 commits
-
The TLC chips actually offer 257 levels:
- 0: led OFF
- 1-255: Led dimmed is using a PWM. The duty cycle range from 0.4% to 99.6%
- 256: led fully ONFixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c LED driver")
Signed-off-by: Jean-Jacques Hiblot
Signed-off-by: Pavel Machek -
Use devm_led_classdev_register_ext() to pass the fwnode to the LED core.
The fwnode can then be used by the firmware core to create meaningful
names.Signed-off-by: Jean-Jacques Hiblot
Signed-off-by: Pavel Machek -
Use the managed API of the LED class (devm_led_classdev_register()
instead of led_classdev_register()).
This allows us to remove the code used to track-and-destroy the LED devices.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Tomi Valkeinen
Signed-off-by: Pavel Machek -
The driver currently ignores errors from register writes at probe time.
It will hence register an LED class device no matter whether the
pyhsical device is present or not.To fix this, make the device probe fail in case regmap operations
return an error.Signed-off-by: Daniel Mack
Signed-off-by: Pavel Machek
05 Jun, 2019
1 commit
-
Based on 1 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 as published by
the free software foundation version 2 of the licenseextracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 315 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Allison Randal
Reviewed-by: Armijn Hemel
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de
Signed-off-by: Greg Kroah-Hartman
17 Jul, 2017
2 commits
-
for_each_child_of_node performs an of_node_get on each iteration, so a
return from the loop requires an of_node_put.The semantic patch that fixes this problem is as follows
(http://coccinelle.lip6.fr)://
@@
local idexpression n;
expression e,e1;
iterator name for_each_child_of_node;
@@for_each_child_of_node(e1,n) {
...
(
of_node_put(n);
|
e = n
|
return n;
|
+ of_node_put(n);
? return ...;
)
...
}
//Signed-off-by: Julia Lawall
Acked-by: Pavel Machek
Signed-off-by: Jacek Anaszewski -
Merge conditionals that have the same then branch, to prepare for extending
that branch with of_node_put.Signed-off-by: Julia Lawall
Acked-by: Pavel Machek
Signed-off-by: Jacek Anaszewski
04 Jan, 2016
1 commit
-
Now the core implements the work queue, remove it from the driver,
and switch to using brightness_set_blocking op.Signed-off-by: Andrew Lunn
Signed-off-by: Jacek Anaszewski
28 Aug, 2015
1 commit
-
This checking is done by regmap_get_i2c_bus() which is called in
devm_regmap_init_i2c().Signed-off-by: Axel Lin
Reviewed-by: Andrew Lunn
Signed-off-by: Jacek Anaszewski
05 May, 2015
1 commit
-
The TLC59116 is an I2C bus controlled 16-channel LED driver. The
TLC59108 is an I2C bus controlled 8-channel LED driver, which is very
similar to the TLC59116. Each LED output has its own 8-bit
fixed-frequency PWM controller to control the brightness of the LED.
The LEDs can also be fixed off and on, making them suitable for use as
GPOs.This is based on a driver from Belkin, but has been extensively
rewritten and extended to support both 08 and 16 versions.Signed-off-by: Andrew Lunn
Tested-by: Imre Kaloz
Cc: Matthew.Fatheree@belkin.com
Acked-by: Jacek Anaszewski
Signed-off-by: Bryan Wu