aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions/leds.sh
Commit message (Collapse)AuthorAgeFilesLines
* treewide: drop shebang from non-executable lib filesAdrian Schmutzler2021-01-291-1/+0
| | | | | | | | | | | | This drops the shebang from another bunch of files in various /lib folders, as these are sourced and the shebang is useless. Fix execute bit in one case, too. This should cover almost all trivial cases now, i.e. where /lib is actually used for library files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* base-files: support label-property-less in get_dt_ledsChristian Lamparter2020-09-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | The LED's "label" property has been deprecated in upstream by: |commit c5d18dd6b64e09dd6984bda9bdd55160af537a8c |Author: Jacek Anaszewski <jacek.anaszewski@gmail.com> |Date: Sun Jun 9 20:19:04 2019 +0200 | | dt-bindings: leds: Add properties for LED name construction | | Introduce dedicated properties for conveying information about | LED function and color. Mark old "label" property as deprecated. | | Additionally function-enumerator property is being provided | for the cases when neither function nor color can be used | for LED differentiation. in order to be somewhat prepared, this patch adds a fallback as a last resort to make the current led code work by falling back to the node-name as the "label". Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* base-files: diag: restore default trigger for 'boot' LEDPiotr Dymacz2020-02-241-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For devices without a dedicated 'diag' LED, we use sometimes one of other LEDs for indicating at least 'boot', 'failsafe' and 'upgrade' stages. In some cases, at the same time these LEDs have defined default triggers in DTS using 'linux,default-trigger' property. Current 'diag' setup removes the trigger and turns off 'boot' LED after bootup. One of the examples of such device is TP-Link TL-WR841N v14 (ramips) which uses 'wlan' LED with defined 'linux,default-trigger' for 'diag': aliases { led-boot = &led_wlan; led-failsafe = &led_wlan; led-upgrade = &led_wlan; }; [...] led_wlan: wlan { label = "tl-wr841n-v14:green:wlan"; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; This patch extends 'diag.sh' and 'leds.sh' scripts to make sure default trigger defined in DTS is restored for 'diag' LED which isn't used for indicating 'running' stage. Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* base-files: get_dt_led: don't warn about missing ledMathias Kresin2018-04-041-2/+1
| | | | | | | | | It's intentional that some boards within a target don't have all LEDs which are tried to be setup in a common script. Don't show a warning in such cases. Fixes: 4f4fc993db4c ("base-files: add more name source to get_dt_led helper function") Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: add more name source to get_dt_led helper functionMathias Kresin2018-03-141-1/+4
| | | | | | | | Not all LED driver are using the label devicetree property for the led name. Add support for the TI/National Semiconductor LP55xx Led Drivers, which are using the chan-name property for the led name, as fallback. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: unify get_dt_led helper functionChristian Lamparter2017-12-141-0/+12
| | | | | | | | | | | | | | Lantiq and IPQ806X (which includes IPQ40XX) both define the same custom function {ipq806x|lantiq}_get_dt_led. This patch moves the function into the base-file package at lib/functions/leds.sh to make it more accessible for other targets as well. Cc: Mathias Kresin <dev@kresin.me> Cc: John Crispin <john@phrozen.org> Cc: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* kernel: remove unused morse led trigger driverFelix Fietkau2016-08-041-11/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: Use 200ms LED timing as before for the new phase preinit_regular.John Crispin2015-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores normal pre-r43715 200ms blink-period for the System LED we're all accustomed to see while our OpenWrt routers are booting. Failsafe possibility will now be signalled with a new 100ms blinking, which is easily recognizable from the normal 200ms booting. So no existing user will be scared by a new 500ms LED pattern, since such a slow pattern could easily be mistaken for something wrong... I was like "ok why my router is collapsing now, is this a bad flash, a kernel panic, or what else" when I've seen it for the first time ;) Sorry for not having explained myself better in v1 of this patch. Original: Preinit, failsafe is possible: 200ms Preinit, failsafe not possible anymore, booting normally: 200ms Failsafe entered: 50ms Now (after preinit_regular has been introduced): Preinit, failsafe is possible: 200ms Preinit, failsafe not possible anymore, booting normally: 500ms *here is the "offending" change* Failsafe entered: 50ms With my proposed patch: Preinit, failsafe is possible: 100ms *indicate this condition with a new timing, that prompts the user to press the key if they want to start failsafe* Preinit, failsafe not possible anymore, booting normally: 200ms *keep this as before* Failsafe entered: 50ms Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> SVN-Revision: 44056
* add "preinit_regular" diag.sh set_state argumentJohn Crispin2014-12-151-0/+4
| | | | | | | | | | | | This new argument is used right after starting regular preinit (which happens if failsafe wasn't triggered). The main purpose of "preinit" argument is to indicate that failsafe can be triggered, however we were missing a way to inform user that we don't wait for a trigger anymore. With this change it's clear when failsafe mode can be triggered. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 43715
* base-files: introduce commonly used helper functions for setting ledsGabor Juhos2013-02-181-0/+68
Currently, most platforms define such helpers in their own diag.sh implementation with almost identical code. By factoring out the common ground it's possible to simplify maintainability and homogenize the haptics over multiple platforms (so far as is reasonably practicable, in a next step). [juhosg: - fix led_set_attr parameters in led_timer - add led_morse and status_led_set_morse helpers - add status_led_blink_{preinit,failsafe} helpers] Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35648