mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-25 12:24:35 +02:00
Use the dmz led as diagnostic led
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8380 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
8ec76b7a55
commit
ab0edce43a
19
target/linux/rdc-2.6/base-files/default/etc/diag.sh
Normal file
19
target/linux/rdc-2.6/base-files/default/etc/diag.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (C) 2007 OpenWrt.org
|
||||||
|
|
||||||
|
set_led() {
|
||||||
|
local led="$1"
|
||||||
|
local state="$2"
|
||||||
|
[ -d "/sys/class/leds/rdc321x:$led" ] && echo "$state" > "/sys/class/leds/rdc321x:$led/brightness"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_state() {
|
||||||
|
case "$1" in
|
||||||
|
preinit)
|
||||||
|
set_led dmz 1
|
||||||
|
;;
|
||||||
|
done)
|
||||||
|
set_led dmz 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
@ -104,7 +104,7 @@ CONFIG_KEXEC=y
|
|||||||
CONFIG_KTIME_SCALAR=y
|
CONFIG_KTIME_SCALAR=y
|
||||||
# CONFIG_KVM is not set
|
# CONFIG_KVM is not set
|
||||||
CONFIG_LBD=y
|
CONFIG_LBD=y
|
||||||
CONFIG_LEDS_RDC3211=m
|
CONFIG_LEDS_RDC3211=y
|
||||||
CONFIG_LSF=y
|
CONFIG_LSF=y
|
||||||
# CONFIG_M386 is not set
|
# CONFIG_M386 is not set
|
||||||
CONFIG_M486=y
|
CONFIG_M486=y
|
||||||
|
@ -18,14 +18,9 @@
|
|||||||
|
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
|
|
||||||
/* This is just for testing purpose */
|
|
||||||
int gpio=-1;
|
|
||||||
module_param(gpio, int, 0444);
|
|
||||||
MODULE_PARM_DESC(gpio, " GPIO line");
|
|
||||||
|
|
||||||
static void rdc321x_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
|
static void rdc321x_led_set(struct led_classdev *led_cdev, enum led_brightness brightness)
|
||||||
{
|
{
|
||||||
gpio_set_value(gpio, brightness ? 1 : 0);
|
gpio_set_value(1, brightness ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The DMZ led is at GPIO line 1 */
|
/* The DMZ led is at GPIO line 1 */
|
||||||
@ -58,7 +53,7 @@ static int __init rdc321x_leds_init(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = gpio+1?platform_driver_register(&rdc321x_leds_driver):-EINVAL;
|
ret = platform_driver_register(&rdc321x_leds_driver);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user