小编swm*_*ail的帖子

如何更改 LED 触发器?

我已经在 BSP 的 LED 中注册:

static struct gpio_led ic_leds[] = {
        {
                .name                   = "led1:green",
                .gpio                   = USER_LED,
                .default_trigger        = "heartbeat",
                .active_low             = 1,
        },
};

static struct gpio_led_platform_data ic_led_info = {
        .num_leds       = ARRAY_SIZE(ic_leds),
        .leds           = ic_leds,
};

static struct platform_device ic_leds_device = {
        .name   = "leds-gpio",
        .id     = -1,
        .dev    = {
                .platform_data = &ic_led_info,
        },
};

static void __init ic_add_device_leds(void)
{
        platform_device_register(&ic_leds_device);
}
Run Code Online (Sandbox Code Playgroud)

如何在运行时更改触发器?我知道 sysfs 是可能的,但也许存在另一种方式?

linux kernel linux-device-driver led

4
推荐指数
1
解决办法
3374
查看次数

标签 统计

kernel ×1

led ×1

linux ×1

linux-device-driver ×1