ath79: led-resets: add default-trigger property

Add support for the common led property "linux,default-trigger". It
allows to set a default led trigger via devicetree.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[add commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
Johann Neuhauser 2018-06-11 21:15:40 +02:00 committed by Mathias Kresin
parent f7a220b2f6
commit 10f8823254

View File

@ -33,7 +33,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
--- /dev/null
+++ b/drivers/leds/leds-reset.c
@@ -0,0 +1,137 @@
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2018 John Crispin <john@phrozen.org>
+ *
@ -112,6 +112,9 @@ Signed-off-by: John Crispin <john@phrozen.org>
+ if (IS_ERR(led->rst))
+ return ERR_PTR(-EINVAL);
+
+ fwnode_property_read_string(child, "linux,default-trigger",
+ &led->cdev.default_trigger);
+
+ led->cdev.brightness_set = reset_led_set;
+ ret = devm_of_led_classdev_register(&pdev->dev, np, &led->cdev);
+ if (ret < 0)