xilinxfb: Parameterize xilinxfb platform device registration
PATCH 1/1 xilinxfb: Parameterize xilinxfb platform device registration
From: Grant Likely <[email protected]>
This patch allows multiple xilinxfb devices to be registered and used
Signed-off-by Grant Likely <[email protected]>
cc Andrei Konovalov <[email protected]>
---
arch/ppc/syslib/virtex_devices.c | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-)
arch/ppc/syslib/virtex_devices.c +25 -13
@@ -152,6 +152,21 @@ }, \ } +/* +* 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[] = {
@@ -274,20 +289,17 @@ struct platform_device virtex_platform_devices[] = {#endif #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 };
Quoted 7 lines · Grant Likely
From: Grant Likely <[email protected]>
This patch allows multiple xilinxfb devices to be registered and used
Signed-off-by Grant Likely <[email protected]>cc Andrei Konovalov <[email protected]>---
Looks OK for me.
Thanks,
Andrei
Quoted 60 lines
arch/ppc/syslib/virtex_devices.c | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-)arch/ppc/syslib/virtex_devices.c +25
-13@@ -152,6 +152,21 @@ }, \ } +/* +* 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[] = {@@ -274,20 +289,17 @@ struct platform_device virtex_platform_devices[] = {#endif #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 };
Quoted 10 lines · Andrei Konovalov
Quoted 7 lines · Grant Likely
From: Grant Likely <[email protected]>
This patch allows multiple xilinxfb devices to be registered and used
Signed-off-by Grant Likely <[email protected]>cc Andrei Konovalov <[email protected]>---
Looks OK for me.
Paulus, can you please pick this one up?
Thanks,
g.
Signature · 4 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195