X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=target%2Flinux%2Far7%2Ffiles%2Farch%2Fmips%2Far7%2Fplatform.c;h=c2629861e13478137dc718a4600a9afd3480a960;hb=1aaf14ee09dc8242ee644d0320505e0f1bcbfba7;hp=1671be1ba0452c55237a08bcb72ffebce64ee2c3;hpb=1346f7147a28e24f391aeda85ebfa5a425e6afae;p=openwrt-10.03%2F.git diff --git a/target/linux/ar7/files/arch/mips/ar7/platform.c b/target/linux/ar7/files/arch/mips/ar7/platform.c index 1671be1ba..c2629861e 100644 --- a/target/linux/ar7/files/arch/mips/ar7/platform.c +++ b/target/linux/ar7/files/arch/mips/ar7/platform.c @@ -29,15 +29,13 @@ #include #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) +#include #include -#endif #include #include #include #include -#include struct plat_vlynq_data { struct plat_vlynq_ops ops; @@ -180,6 +178,27 @@ static struct resource vlynq_high_res[] = { }, }; +static struct resource usb_res[] = { + { + .name = "regs", + .flags = IORESOURCE_MEM, + .start = AR7_REGS_USB, + .end = AR7_REGS_USB + 0xff, + }, + { + .name = "irq", + .flags = IORESOURCE_IRQ, + .start = 32, + .end = 32, + }, + { + .name = "mem", + .flags = IORESOURCE_MEM, + .start = 0x03400000, + .end = 0x034001fff, + }, +}; + static struct physmap_flash_data physmap_flash_data = { .width = 2, }; @@ -299,7 +318,6 @@ static struct platform_device uart = { }; #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) static struct gpio_led default_leds[] = { { .name = "status", .gpio = 8, .active_low = 1, }, }; @@ -329,7 +347,13 @@ static struct platform_device ar7_gpio_leds = { .platform_data = &ar7_led_data, } }; -#endif + +static struct platform_device ar7_udc = { + .id = -1, + .name = "ar7_udc", + .resource = usb_res, + .num_resources = ARRAY_SIZE(usb_res), +}; static inline unsigned char char2hex(char h) { @@ -448,12 +472,15 @@ static int __init ar7_register_devices(void) if (res) return res; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) #warning FIXME: add model detection ar7_led_data.num_leds = ARRAY_SIZE(default_leds); ar7_led_data.leds = default_leds; res = platform_device_register(&ar7_gpio_leds); -#endif + if (res) + return res; + + res = platform_device_register(&ar7_udc); + return res; }