ath79: led-resets: add default-trigger property
authorJohann Neuhauser <johann@it-neuhauser.de>
Mon, 11 Jun 2018 19:15:40 +0000 (21:15 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 16 Jun 2018 08:08:51 +0000 (10:08 +0200)
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>
target/linux/ath79/patches-4.14/0003-leds-add-reset-controller-based-driver.patch

index 495d792..d15c77a 100644 (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)