#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+#include <linux/vlynq.h>
#include <linux/leds.h>
-#endif
#include <asm/addrspace.h>
#include <asm/ar7/ar7.h>
#include <asm/ar7/gpio.h>
#include <asm/ar7/prom.h>
-#include <asm/ar7/vlynq.h>
struct plat_vlynq_data {
struct plat_vlynq_ops ops;
},
};
+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,
};
};
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
static struct gpio_led default_leds[] = {
{ .name = "status", .gpio = 8, .active_low = 1, },
};
.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)
{
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;
}