mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED updates from Bryan Wu: "This cycle we got: - new driver for leds-mc13783 - bug fixes - code cleanup" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: leds: make sure we unregister a trigger only once leds: leds-pwm: properly clean up after probe failure leds: clevo-mail: Make probe function __init leds-ot200: Fix dependencies leds-gpio: of: introduce MODULE_DEVICE_TABLE for module autoloading leds: clevo-mail: remove __initdata marker leds: leds-ss4200: remove __initdata marker leds: blinkm: remove unnecessary spaces leds: lp5562: remove unnecessary parentheses leds: leds-ss4200: remove DEFINE_PCI_DEVICE_TABLE macro leds: leds-s3c24xx: Trivial cleanup in header file drivers/leds: delete non-required instances of include <linux/init.h> leds: leds-gpio: add retain-state-suspended property leds: leds-mc13783: Add devicetree support leds: leds-mc13783: Remove unnecessary cleaning of registers on exit leds: leds-mc13783: Use proper "max_brightness" value fo LEDs leds: leds-mc13783: Use LED core PM functions leds: leds-mc13783: Add MC34708 LED support leds: Turn off led if blinking is disabled ledtrig-cpu: Handle CPU hot(un)plugging
This commit is contained in:
@@ -21,6 +21,8 @@ LED sub-node properties:
|
||||
on). The "keep" setting will keep the LED at whatever its current
|
||||
state is, without producing a glitch. The default is off if this
|
||||
property is not present.
|
||||
- retain-state-suspended: (optional) The suspend state can be retained.Such
|
||||
as charge-led gpio.
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -50,3 +52,13 @@ run-control {
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
charger-led {
|
||||
gpios = <&gpio1 2 0>;
|
||||
linux,default-trigger = "max8903-charger-charging";
|
||||
retain-state-suspended;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,9 +10,44 @@ Optional properties:
|
||||
- fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used
|
||||
|
||||
Sub-nodes:
|
||||
- leds : Contain the led nodes and initial register values in property
|
||||
"led-control". Number of register depends of used IC, for MC13783 is 6,
|
||||
for MC13892 is 4, for MC34708 is 1. See datasheet for bits definitions of
|
||||
these registers.
|
||||
- #address-cells: Must be 1.
|
||||
- #size-cells: Must be 0.
|
||||
Each led node should contain "reg", which used as LED ID (described below).
|
||||
Optional properties "label" and "linux,default-trigger" is described in
|
||||
Documentation/devicetree/bindings/leds/common.txt.
|
||||
- regulators : Contain the regulator nodes. The regulators are bound using
|
||||
their names as listed below with their registers and bits for enabling.
|
||||
|
||||
MC13783 LED IDs:
|
||||
0 : Main display
|
||||
1 : AUX display
|
||||
2 : Keypad
|
||||
3 : Red 1
|
||||
4 : Green 1
|
||||
5 : Blue 1
|
||||
6 : Red 2
|
||||
7 : Green 2
|
||||
8 : Blue 2
|
||||
9 : Red 3
|
||||
10 : Green 3
|
||||
11 : Blue 3
|
||||
|
||||
MC13892 LED IDs:
|
||||
0 : Main display
|
||||
1 : AUX display
|
||||
2 : Keypad
|
||||
3 : Red
|
||||
4 : Green
|
||||
5 : Blue
|
||||
|
||||
MC34708 LED IDs:
|
||||
0 : Charger Red
|
||||
1 : Charger Green
|
||||
|
||||
MC13783 regulators:
|
||||
sw1a : regulator SW1A (register 24, bit 0)
|
||||
sw1b : regulator SW1B (register 25, bit 0)
|
||||
@@ -89,6 +124,18 @@ ecspi@70010000 { /* ECSPI1 */
|
||||
interrupt-parent = <&gpio0>;
|
||||
interrupts = <8>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
led-control = <0x000 0x000 0x0e0 0x000>;
|
||||
|
||||
sysled {
|
||||
reg = <3>;
|
||||
label = "system:red:live";
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
};
|
||||
|
||||
regulators {
|
||||
sw1_reg: mc13892__sw1 {
|
||||
regulator-min-microvolt = <600000>;
|
||||
|
||||
@@ -416,7 +416,7 @@ config LEDS_MC13783
|
||||
depends on MFD_MC13XXX
|
||||
help
|
||||
This option enable support for on-chip LED drivers found
|
||||
on Freescale Semiconductor MC13783/MC13892 PMIC.
|
||||
on Freescale Semiconductor MC13783/MC13892/MC34708 PMIC.
|
||||
|
||||
config LEDS_NS2
|
||||
tristate "LED support for Network Space v2 GPIO LEDs"
|
||||
@@ -474,7 +474,7 @@ config LEDS_LM355x
|
||||
|
||||
config LEDS_OT200
|
||||
tristate "LED support for the Bachmann OT200"
|
||||
depends on LEDS_CLASS && HAS_IOMEM
|
||||
depends on LEDS_CLASS && HAS_IOMEM && (X86_32 || COMPILE_TEST)
|
||||
help
|
||||
This option enables support for the LEDs on the Bachmann OT200.
|
||||
Say Y to enable LEDs on the Bachmann OT200.
|
||||
|
||||
@@ -39,9 +39,11 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
|
||||
led_cdev->blink_delay_on = delay_on;
|
||||
led_cdev->blink_delay_off = delay_off;
|
||||
|
||||
/* never on - don't blink */
|
||||
if (!delay_on)
|
||||
/* never on - just set to off */
|
||||
if (!delay_on) {
|
||||
__led_set_brightness(led_cdev, LED_OFF);
|
||||
return;
|
||||
}
|
||||
|
||||
/* never off - just set to brightness */
|
||||
if (!delay_off) {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/device.h>
|
||||
@@ -220,9 +219,12 @@ void led_trigger_unregister(struct led_trigger *trig)
|
||||
{
|
||||
struct led_classdev *led_cdev;
|
||||
|
||||
if (list_empty_careful(&trig->next_trig))
|
||||
return;
|
||||
|
||||
/* Remove from the list of led triggers */
|
||||
down_write(&triggers_list_lock);
|
||||
list_del(&trig->next_trig);
|
||||
list_del_init(&trig->next_trig);
|
||||
up_write(&triggers_list_lock);
|
||||
|
||||
/* Remove anyone actively using this trigger */
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/i2c.h>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
@@ -444,7 +443,7 @@ static void led_work(struct work_struct *work)
|
||||
{
|
||||
int ret;
|
||||
struct blinkm_led *led;
|
||||
struct blinkm_data *data ;
|
||||
struct blinkm_data *data;
|
||||
struct blinkm_work *blm_work = work_to_blmwork(work);
|
||||
|
||||
led = blm_work->blinkm_led;
|
||||
|
||||
@@ -19,7 +19,7 @@ MODULE_AUTHOR("Márton Németh <nm127@freemail.hu>");
|
||||
MODULE_DESCRIPTION("Clevo mail LED driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static bool __initdata nodetect;
|
||||
static bool nodetect;
|
||||
module_param_named(nodetect, nodetect, bool, 0);
|
||||
MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");
|
||||
|
||||
@@ -153,7 +153,7 @@ static struct led_classdev clevo_mail_led = {
|
||||
.flags = LED_CORE_SUSPENDRESUME,
|
||||
};
|
||||
|
||||
static int clevo_mail_led_probe(struct platform_device *pdev)
|
||||
static int __init clevo_mail_led_probe(struct platform_device *pdev)
|
||||
{
|
||||
return led_classdev_register(&pdev->dev, &clevo_mail_led);
|
||||
}
|
||||
@@ -165,7 +165,6 @@ static int clevo_mail_led_remove(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
static struct platform_driver clevo_mail_led_driver = {
|
||||
.probe = clevo_mail_led_probe,
|
||||
.remove = clevo_mail_led_remove,
|
||||
.driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Control the Cobalt Qube/RaQ front LED
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/leds.h>
|
||||
@@ -204,6 +203,9 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
|
||||
led.default_state = LEDS_GPIO_DEFSTATE_OFF;
|
||||
}
|
||||
|
||||
if (of_get_property(child, "retain-state-suspended", NULL))
|
||||
led.retain_state_suspended = 1;
|
||||
|
||||
ret = create_gpio_led(&led, &priv->leds[priv->num_leds++],
|
||||
&pdev->dev, NULL);
|
||||
if (ret < 0) {
|
||||
@@ -224,6 +226,8 @@ static const struct of_device_id of_gpio_leds_match[] = {
|
||||
{ .compatible = "gpio-leds", },
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, of_gpio_leds_match);
|
||||
#else /* CONFIG_OF_GPIO */
|
||||
static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/leds.h>
|
||||
#include <asm/hd64461.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
@@ -347,9 +346,9 @@ static void lp5562_write_program_memory(struct lp55xx_chip *chip,
|
||||
/* check the size of program count */
|
||||
static inline bool _is_pc_overflow(struct lp55xx_predef_pattern *ptn)
|
||||
{
|
||||
return (ptn->size_r >= LP5562_PROGRAM_LENGTH ||
|
||||
ptn->size_g >= LP5562_PROGRAM_LENGTH ||
|
||||
ptn->size_b >= LP5562_PROGRAM_LENGTH);
|
||||
return ptn->size_r >= LP5562_PROGRAM_LENGTH ||
|
||||
ptn->size_g >= LP5562_PROGRAM_LENGTH ||
|
||||
ptn->size_b >= LP5562_PROGRAM_LENGTH;
|
||||
}
|
||||
|
||||
static int lp5562_run_predef_led_pattern(struct lp55xx_chip *chip, int mode)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user