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>
15 static const struct gpio_led ls1x_gpio_leds
[] __initconst
= {
18 .default_trigger
= "heartbeat",
21 .default_state
= LEDS_GPIO_DEFSTATE_OFF
,
24 .default_trigger
= "nand-disk",
27 .default_state
= LEDS_GPIO_DEFSTATE_OFF
,
31 static const struct gpio_led_platform_data ls1x_led_pdata __initconst
= {
32 .num_leds
= ARRAY_SIZE(ls1x_gpio_leds
),
33 .leds
= ls1x_gpio_leds
,
36 static struct platform_device
*ls1b_platform_devices
[] __initdata
= {
48 static int __init
ls1b_platform_init(void)
50 ls1x_serial_set_uartclk(&ls1x_uart_pdev
);
52 gpio_led_register_device(-1, &ls1x_led_pdata
);
54 return platform_add_devices(ls1b_platform_devices
,
55 ARRAY_SIZE(ls1b_platform_devices
));
58 arch_initcall(ls1b_platform_init
);