]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] xilinxfb: Parameterize xilinxfb platform device registration
authorGrant Likely <grant.likely@secretlab.ca>
Mon, 9 Jul 2007 23:51:05 +0000 (09:51 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 11 Jul 2007 03:24:40 +0000 (13:24 +1000)
This allows multiple xilinxfb devices to be registered and used.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
cc: Andrei Konovalov <akonovalov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/syslib/virtex_devices.c

index 16546788e23b59faea05d1769da6eca2e49c53fa..ace4ec08de5118f5e68fc4286f19ec8f5b27d094 100644 (file)
        }, \
 }
 
+/*
+ * ML300/ML403 Video Device: shortcut macro for single instance
+ */
+#define XPAR_TFT(num) { \
+       .name = "xilinxfb", \
+       .id = num, \
+       .num_resources = 1, \
+       .resource = (struct resource[]) { \
+               { \
+                       .start = XPAR_TFT_##num##_BASEADDR, \
+                       .end = XPAR_TFT_##num##_BASEADDR+7, \
+                       .flags = IORESOURCE_IO, \
+               }, \
+       }, \
+}
 
 /* UART 8250 driver platform data table */
 struct plat_serial8250_port virtex_serial_platform_data[] = {
@@ -146,20 +161,17 @@ struct platform_device virtex_platform_devices[] = {
        XPAR_SYSACE(1),
 #endif
 
-       /* ML300/403 reference design framebuffer */
 #if defined(XPAR_TFT_0_BASEADDR)
-       {
-               .name           = "xilinxfb",
-               .id             = 0,
-               .num_resources  = 1,
-               .resource = (struct resource[]) {
-                       {
-                               .start  = XPAR_TFT_0_BASEADDR,
-                               .end    = XPAR_TFT_0_BASEADDR+7,
-                               .flags  = IORESOURCE_IO,
-                       },
-               },
-       },
+       XPAR_TFT(0),
+#endif
+#if defined(XPAR_TFT_1_BASEADDR)
+       XPAR_TFT(1),
+#endif
+#if defined(XPAR_TFT_2_BASEADDR)
+       XPAR_TFT(2),
+#endif
+#if defined(XPAR_TFT_3_BASEADDR)
+       XPAR_TFT(3),
 #endif
 };