* [PATCH 1/5] MIPS: dts: rzx50.dts: add LCD backlight
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
@ 2014-07-30 17:34 ` Antony Pavlov
2014-07-30 17:34 ` [PATCH 2/5] MIPS: ritmix-rzx50_defconfig: enable LED-related stuff Antony Pavlov
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-07-30 17:34 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/dts/rzx50.dts | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/mips/dts/rzx50.dts b/arch/mips/dts/rzx50.dts
index 360c1bf..7ec3352 100644
--- a/arch/mips/dts/rzx50.dts
+++ b/arch/mips/dts/rzx50.dts
@@ -9,6 +9,16 @@
memory {
reg = <0x00000000 0x4000000>;
};
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ lcd-backlight-enable {
+ label = "lcd backlight";
+ gpios = <&gpio4 22 0>;
+ linux,default-trigger = "default-on";
+ };
+ };
};
&serial1 {
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/5] MIPS: ritmix-rzx50_defconfig: enable LED-related stuff
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
2014-07-30 17:34 ` [PATCH 1/5] MIPS: dts: rzx50.dts: add LCD backlight Antony Pavlov
@ 2014-07-30 17:34 ` Antony Pavlov
2014-07-30 17:34 ` [PATCH 3/5] led: triggers: fix crash on disabling "default-on" trigger Antony Pavlov
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-07-30 17:34 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/configs/ritmix-rzx50_defconfig | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/mips/configs/ritmix-rzx50_defconfig b/arch/mips/configs/ritmix-rzx50_defconfig
index e6f10fb..232faa2 100644
--- a/arch/mips/configs/ritmix-rzx50_defconfig
+++ b/arch/mips/configs/ritmix-rzx50_defconfig
@@ -29,12 +29,18 @@ CONFIG_CMD_GETOPT=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_EDIT=y
CONFIG_CMD_GPIO=y
+CONFIG_CMD_LED=y
CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_LED_TRIGGER=y
CONFIG_CMD_OF_NODE=y
CONFIG_CMD_OF_PROPERTY=y
CONFIG_CMD_OFTREE=y
CONFIG_OFDEVICE=y
# CONFIG_SPI is not set
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_GPIO_OF=y
+CONFIG_LED_TRIGGERS=y
CONFIG_GPIO_JZ4740=y
CONFIG_SHA1=y
CONFIG_SHA224=y
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/5] led: triggers: fix crash on disabling "default-on" trigger
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
2014-07-30 17:34 ` [PATCH 1/5] MIPS: dts: rzx50.dts: add LCD backlight Antony Pavlov
2014-07-30 17:34 ` [PATCH 2/5] MIPS: ritmix-rzx50_defconfig: enable LED-related stuff Antony Pavlov
@ 2014-07-30 17:34 ` Antony Pavlov
2014-07-30 17:34 ` [PATCH 4/5] commands: trigger: check trigger disable return code too Antony Pavlov
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-07-30 17:34 UTC (permalink / raw)
To: barebox
Here is a sample crash log on Ritmix RZX-50:
barebox:/ trigger
0: panic
1: heartbeat
2: net rx
3: net tx
4: net
5: default on (led 0)
barebox:/ trigger -d 5
...
Ooops, TLB miss on store!
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
drivers/led/led-triggers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/led/led-triggers.c b/drivers/led/led-triggers.c
index 5eaf732..1a5a09f 100644
--- a/drivers/led/led-triggers.c
+++ b/drivers/led/led-triggers.c
@@ -124,7 +124,7 @@ int led_set_trigger(enum led_trigger trigger, struct led *led)
triggers[trigger].led = led;
- if (trigger == LED_TRIGGER_DEFAULT_ON)
+ if (led && trigger == LED_TRIGGER_DEFAULT_ON)
led_set(triggers[trigger].led, triggers[trigger].led->max_value);
return 0;
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/5] commands: trigger: check trigger disable return code too
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
` (2 preceding siblings ...)
2014-07-30 17:34 ` [PATCH 3/5] led: triggers: fix crash on disabling "default-on" trigger Antony Pavlov
@ 2014-07-30 17:34 ` Antony Pavlov
2014-07-30 17:34 ` [PATCH 5/5] led: triggers: fix "no previous prototype for 'trigger_init'" warning Antony Pavlov
2014-07-31 6:05 ` [PATCH 0/5] led-related series Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-07-30 17:34 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
commands/trigger.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/commands/trigger.c b/commands/trigger.c
index 17c8411..b605448 100644
--- a/commands/trigger.c
+++ b/commands/trigger.c
@@ -68,8 +68,9 @@ static int do_trigger(int argc, char *argv[])
break;
case LED_COMMAND_DISABLE_TRIGGER:
- led_set_trigger(trigger, NULL);
- return 0;
+ ret = led_set_trigger(trigger, NULL);
+ break;
+
case LED_COMMAND_SET_TRIGGER:
if (argc - optind != 1)
return COMMAND_ERROR_USAGE;
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/5] led: triggers: fix "no previous prototype for 'trigger_init'" warning
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
` (3 preceding siblings ...)
2014-07-30 17:34 ` [PATCH 4/5] commands: trigger: check trigger disable return code too Antony Pavlov
@ 2014-07-30 17:34 ` Antony Pavlov
2014-07-31 6:05 ` [PATCH 0/5] led-related series Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Antony Pavlov @ 2014-07-30 17:34 UTC (permalink / raw)
To: barebox
Here is compiler's message:
drivers/led/led-triggers.c:148:5: warning: no previous prototype for 'trigger_init' [-Wmissing-prototypes]
int trigger_init(void)
^
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
drivers/led/led-triggers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/led/led-triggers.c b/drivers/led/led-triggers.c
index 1a5a09f..c5484d5 100644
--- a/drivers/led/led-triggers.c
+++ b/drivers/led/led-triggers.c
@@ -145,7 +145,7 @@ int led_get_trigger(enum led_trigger trigger)
return led_get_number(triggers[trigger].led);
}
-int trigger_init(void)
+static int trigger_init(void)
{
return poller_register(&trigger_poller);
}
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] led-related series
2014-07-30 17:34 [PATCH 0/5] led-related series Antony Pavlov
` (4 preceding siblings ...)
2014-07-30 17:34 ` [PATCH 5/5] led: triggers: fix "no previous prototype for 'trigger_init'" warning Antony Pavlov
@ 2014-07-31 6:05 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2014-07-31 6:05 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Wed, Jul 30, 2014 at 09:34:31PM +0400, Antony Pavlov wrote:
> Antony Pavlov (5):
> MIPS: dts: rzx50.dts: add LCD backlight
> MIPS: ritmix-rzx50_defconfig: enable LED-related stuff
> led: triggers: fix crash on disabling "default-on" trigger
> commands: trigger: check trigger disable return code too
> led: triggers: fix "no previous prototype for 'trigger_init'" warning
Applied all, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread