1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
6 #include <linux/leds.h>
7 #include <linux/mtd/partitions.h>
8 #include <linux/sizes.h>
10 #include <loongson1.h>
13 static const struct gpio_led ls1x_gpio_leds
[] __initconst
= {
16 .default_trigger
= "heartbeat",
19 .default_state
= LEDS_GPIO_DEFSTATE_OFF
,
22 .default_trigger
= "nand-disk",
25 .default_state
= LEDS_GPIO_DEFSTATE_OFF
,
29 static const struct gpio_led_platform_data ls1x_led_pdata __initconst
= {
30 .num_leds
= ARRAY_SIZE(ls1x_gpio_leds
),
31 .leds
= ls1x_gpio_leds
,
34 static struct platform_device
*ls1b_platform_devices
[] __initdata
= {
45 static int __init
ls1b_platform_init(void)
47 ls1x_serial_set_uartclk(&ls1x_uart_pdev
);
49 gpio_led_register_device(-1, &ls1x_led_pdata
);
51 return platform_add_devices(ls1b_platform_devices
,
52 ARRAY_SIZE(ls1b_platform_devices
));
55 arch_initcall(ls1b_platform_init
);