]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - arch/mips/loongson32/ls1b/board.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
[mirror_ubuntu-eoan-kernel.git] / arch / mips / loongson32 / ls1b / board.c
CommitLineData
2874c5fd 1// SPDX-License-Identifier: GPL-2.0-or-later
ca585cf9 2/*
9ec88b60 3 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
ca585cf9
KC
4 */
5
9ec88b60
KC
6#include <linux/leds.h>
7#include <linux/mtd/partitions.h>
8#include <linux/sizes.h>
9
10#include <loongson1.h>
11#include <dma.h>
12#include <nand.h>
ca585cf9
KC
13#include <platform.h>
14
9ec88b60
KC
15static const struct gpio_led ls1x_gpio_leds[] __initconst = {
16 {
17 .name = "LED9",
18 .default_trigger = "heartbeat",
19 .gpio = 38,
20 .active_low = 1,
21 .default_state = LEDS_GPIO_DEFSTATE_OFF,
22 }, {
23 .name = "LED6",
24 .default_trigger = "nand-disk",
25 .gpio = 39,
26 .active_low = 1,
27 .default_state = LEDS_GPIO_DEFSTATE_OFF,
28 },
29};
30
31static const struct gpio_led_platform_data ls1x_led_pdata __initconst = {
32 .num_leds = ARRAY_SIZE(ls1x_gpio_leds),
33 .leds = ls1x_gpio_leds,
34};
35
ca585cf9 36static struct platform_device *ls1b_platform_devices[] __initdata = {
f29ad10d
KC
37 &ls1x_uart_pdev,
38 &ls1x_cpufreq_pdev,
39 &ls1x_eth0_pdev,
40 &ls1x_eth1_pdev,
41 &ls1x_ehci_pdev,
9ec88b60
KC
42 &ls1x_gpio0_pdev,
43 &ls1x_gpio1_pdev,
f29ad10d 44 &ls1x_rtc_pdev,
5e73ad3f 45 &ls1x_wdt_pdev,
ca585cf9
KC
46};
47
48static int __init ls1b_platform_init(void)
49{
9ec88b60 50 ls1x_serial_set_uartclk(&ls1x_uart_pdev);
ca585cf9 51
9ec88b60 52 gpio_led_register_device(-1, &ls1x_led_pdata);
ca585cf9 53
9ec88b60 54 return platform_add_devices(ls1b_platform_devices,
ca585cf9 55 ARRAY_SIZE(ls1b_platform_devices));
ca585cf9
KC
56}
57
58arch_initcall(ls1b_platform_init);