2 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
10 #include <linux/leds.h>
11 #include <linux/mtd/partitions.h>
12 #include <linux/sizes.h>
14 #include <loongson1.h>
19 struct plat_ls1x_dma ls1x_dma_pdata = {
23 static struct mtd_partition ls1x_nand_parts[] = {
31 .offset = MTDPART_OFS_APPEND,
32 .size = MTDPART_SIZ_FULL,
36 struct plat_ls1x_nand ls1x_nand_pdata = {
37 .parts = ls1x_nand_parts,
38 .nr_parts = ARRAY_SIZE(ls1x_nand_parts),
43 static const struct gpio_led ls1x_gpio_leds[] __initconst = {
46 .default_trigger = "heartbeat",
49 .default_state = LEDS_GPIO_DEFSTATE_OFF,
52 .default_trigger = "nand-disk",
55 .default_state = LEDS_GPIO_DEFSTATE_OFF,
59 static const struct gpio_led_platform_data ls1x_led_pdata __initconst = {
60 .num_leds = ARRAY_SIZE(ls1x_gpio_leds),
61 .leds = ls1x_gpio_leds,
64 static struct platform_device *ls1b_platform_devices[] __initdata = {
78 static int __init ls1b_platform_init(void)
80 ls1x_serial_set_uartclk(&ls1x_uart_pdev);
81 ls1x_dma_set_platdata(&ls1x_dma_pdata);
82 ls1x_nand_set_platdata(&ls1x_nand_pdata);
84 gpio_led_register_device(-1, &ls1x_led_pdata);
86 return platform_add_devices(ls1b_platform_devices,
87 ARRAY_SIZE(ls1b_platform_devices));
90 arch_initcall(ls1b_platform_init);