Merge branch 'for-next/led'
This commit is contained in:
commit
c138893990
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue