Skip to contentSkip to conversation

led-related series

PATCH Applied Antony Pavlov 2 participants 7 messages Jul 30, 2014 – Jul 31, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

cover led-related series

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

 arch/mips/configs/ritmix-rzx50_defconfig |  6 ++++++
 arch/mips/dts/rzx50.dts                  | 10 ++++++++++
 commands/trigger.c                       |  5 +++--
 drivers/led/led-triggers.c               |  4 ++--
 4 files changed, 21 insertions(+), 4 deletions(-)
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/5 MIPS: dts: rzx50.dts: add LCD backlight

---
 arch/mips/dts/rzx50.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/dts/rzx50.dts +10 -0
index 360c1bf..7ec3352 100644
@@ -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 {
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/5 MIPS: ritmix-rzx50_defconfig: enable LED-related stuff

In reply to Antony Pavlov
---
 arch/mips/configs/ritmix-rzx50_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/configs/ritmix-rzx50_defconfig +6 -0
index e6f10fb..232faa2 100644
@@ -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
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/5 led: triggers: fix crash on disabling "default-on" trigger

In reply to Antony Pavlov

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!

---
 drivers/led/led-triggers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/led/led-triggers.c +1 -1
index 5eaf732..1a5a09f 100644
@@ -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;
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/5 commands: trigger: check trigger disable return code too

In reply to Antony Pavlov
---
 commands/trigger.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
commands/trigger.c +3 -2
index 17c8411..b605448 100644
@@ -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;
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/5 led: triggers: fix "no previous prototype for 'trigger_init'" warning

In reply to Antony Pavlov

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)
^

---
 drivers/led/led-triggers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/led/led-triggers.c +1 -1
index 1a5a09f..c5484d5 100644
@@ -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);
 }
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#6 lore raw
In reply to Antony Pavlov
Quoted 6 lines · Antony Pavlov

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox