LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to change trigger in BSP for LED device (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-change-trigger-in-bsp-for-led-device-944847/)

swmail 05-14-2012 04:30 AM

How to change trigger in BSP for LED device
 
Hi!
I have register in BSP's driver a LED
Code:

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);
}

How can I change the trigger in run time?

swmail 05-30-2012 02:40 AM

I know that it's possible with sysfs, but maybe exist another way?


All times are GMT -5. The time now is 09:10 PM.