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 static struct platform_device ifxmips_gpio_dev
=
31 ifxmips_register_gpio_dev(void)
33 platform_device_register(&ifxmips_gpio_dev
);
37 #ifdef CONFIG_LEDS_GPIO
38 static struct gpio_led_platform_data ifxmips_gpio_led_data
;
40 static struct platform_device ifxmips_gpio_leds
=
44 .platform_data
= (void *) &ifxmips_gpio_led_data
,
49 ifxmips_register_gpio_leds(struct gpio_led
*leds
, int cnt
)
51 ifxmips_gpio_led_data
.leds
= leds
;
52 ifxmips_gpio_led_data
.num_leds
= cnt
;
53 platform_device_register(&ifxmips_gpio_leds
);
58 static struct gpio_led_platform_data ifxmips_led_data
;
60 static struct platform_device ifxmips_led
=
62 .name
= "ifxmips_led",
64 .platform_data
= (void *) &ifxmips_led_data
,
69 ifxmips_register_leds(struct gpio_led
*leds
, int cnt
)
71 ifxmips_led_data
.leds
= leds
;
72 ifxmips_led_data
.num_leds
= cnt
;
73 platform_device_register(&ifxmips_led
);
77 static struct resource ifxmips_mtd_resource
=
79 .start
= IFXMIPS_FLASH_START
,
80 .end
= IFXMIPS_FLASH_START
+ IFXMIPS_FLASH_MAX
- 1,
81 .flags
= IORESOURCE_MEM
,
84 static struct platform_device ifxmips_mtd
=
86 .name
= "ifxmips_mtd",
87 .resource
= &ifxmips_mtd_resource
,
92 ifxmips_register_mtd(struct physmap_flash_data
*pdata
)
94 ifxmips_mtd
.dev
.platform_data
= pdata
;
95 platform_device_register(&ifxmips_mtd
);
99 static struct resource ifxmips_wdt_resource
=
101 .start
= IFXMIPS_WDT_BASE_ADDR
,
102 .end
= IFXMIPS_WDT_BASE_ADDR
+ IFXMIPS_WDT_SIZE
- 1,
103 .flags
= IORESOURCE_MEM
,
106 static struct platform_device ifxmips_wdt
=
108 .name
= "ifxmips_wdt",
109 .resource
= &ifxmips_wdt_resource
,
114 ifxmips_register_wdt(void)
116 platform_device_register(&ifxmips_wdt
);
120 static struct platform_device ifxmips_gpio0
=
122 .name
= "ifxmips_gpio",
125 static struct platform_device ifxmips_gpio1
=
127 .name
= "ifxmips_gpio1",
131 ifxmips_register_gpio(void)
133 platform_device_register(&ifxmips_gpio0
);
134 platform_device_register(&ifxmips_gpio1
);