Код
static struct gpio_led xxx_leds[] = {
{
.name = "red",
.gpio = ,
},
{
.name = "yellow",
.gpio = ,
},
{
.name = "green",
.gpio = ,
.default_trigger= "heartbeat",
},
{
.name = "onboard",
.gpio = ,
.default_trigger= "default-off",
},
};
static struct gpio_led_platform_data xxx_led_data = {
.num_leds = ARRAY_SIZE(xxx_leds),
.leds = xxx_leds,
};
static struct platform_device xxx_leds_device = {
.name = "leds-gpio",
.id = -1,
.dev.platform_data = &xxx_led_data,
};
...
platform_add_devices(&xxx_leds_device,1);
Только вот появится он там же: /sys/class/leds/ . Не вижу проблем дергать ножками через /sys .
Кнопки