1 #include <linux/init.h>
2 #include <linux/module.h>
3 #include <linux/types.h>
4 #include <linux/string.h>
5 #include <linux/mtd/physmap.h>
6 #include <linux/kernel.h>
7 #include <linux/reboot.h>
8 #include <linux/platform_device.h>
9 #include <linux/leds.h>
10 #include <linux/etherdevice.h>
11 #include <linux/reboot.h>
12 #include <linux/time.h>
14 #include <linux/gpio.h>
15 #include <linux/leds.h>
17 #include <asm/bootinfo.h>
21 #include <ifxmips_irq.h>
24 #ifdef CONFIG_LEDS_GPIO
25 static struct gpio_led_platform_data ifxmips_gpio_led_data
;
27 static struct platform_device ifxmips_gpio_leds
=
31 .platform_data
= (void *) &ifxmips_gpio_led_data
,
36 ifxmips_register_gpio_leds(struct gpio_led
*leds
, int cnt
)
38 ifxmips_gpio_led_data
.leds
= leds
;
39 ifxmips_gpio_led_data
.num_leds
= cnt
;
40 platform_device_register(&ifxmips_gpio_leds
);
45 static struct gpio_led_platform_data ifxmips_led_data
;
47 static struct platform_device ifxmips_led
=
49 .name
= "ifxmips_led",
51 .platform_data
= (void *) &ifxmips_led_data
,
56 ifxmips_register_leds(struct gpio_led
*leds
, int cnt
)
58 ifxmips_led_data
.leds
= leds
;
59 ifxmips_led_data
.num_leds
= cnt
;
60 platform_device_register(&ifxmips_led
);
64 static struct resource ifxmips_mtd_resource
=
66 .start
= IFXMIPS_FLASH_START
,
67 .end
= IFXMIPS_FLASH_START
+ IFXMIPS_FLASH_MAX
- 1,
68 .flags
= IORESOURCE_MEM
,
71 static struct platform_device ifxmips_mtd
=
73 .name
= "ifxmips_mtd",
74 .resource
= &ifxmips_mtd_resource
,
79 ifxmips_register_mtd(struct physmap_flash_data
*pdata
)
81 ifxmips_mtd
.dev
.platform_data
= pdata
;
82 platform_device_register(&ifxmips_mtd
);
86 static struct resource ifxmips_wdt_resource
=
88 .start
= IFXMIPS_WDT_BASE_ADDR
,
89 .end
= IFXMIPS_WDT_BASE_ADDR
+ IFXMIPS_WDT_SIZE
- 1,
90 .flags
= IORESOURCE_MEM
,
93 static struct platform_device ifxmips_wdt
=
95 .name
= "ifxmips_wdt",
96 .resource
= &ifxmips_wdt_resource
,
101 ifxmips_register_wdt(void)
103 platform_device_register(&ifxmips_wdt
);
107 static struct platform_device ifxmips_gpio0
=
109 .name
= "ifxmips_gpio",
112 static struct platform_device ifxmips_gpio1
=
114 .name
= "ifxmips_gpio1",
118 ifxmips_register_gpio(void)
120 platform_device_register(&ifxmips_gpio0
);
121 platform_device_register(&ifxmips_gpio1
);