diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/ct-ca9x4.c | 58 |
2 files changed, 10 insertions, 49 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7ee15c2933f8..4f0e83e07989 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -274,6 +274,7 @@ config ARCH_VEXPRESS | |||
274 | select HAVE_PATA_PLATFORM | 274 | select HAVE_PATA_PLATFORM |
275 | select ICST | 275 | select ICST |
276 | select PLAT_VERSATILE | 276 | select PLAT_VERSATILE |
277 | select PLAT_VERSATILE_CLCD | ||
277 | help | 278 | help |
278 | This enables support for the ARM Ltd Versatile Express boards. | 279 | This enables support for the ARM Ltd Versatile Express boards. |
279 | 280 | ||
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index e628402b754c..27baed18a256 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -30,6 +30,8 @@ | |||
30 | 30 | ||
31 | #include <mach/motherboard.h> | 31 | #include <mach/motherboard.h> |
32 | 32 | ||
33 | #include <plat/clcd.h> | ||
34 | |||
33 | #define V2M_PA_CS7 0x10000000 | 35 | #define V2M_PA_CS7 0x10000000 |
34 | 36 | ||
35 | static struct map_desc ct_ca9x4_io_desc[] __initdata = { | 37 | static struct map_desc ct_ca9x4_io_desc[] __initdata = { |
@@ -80,29 +82,6 @@ static struct sys_timer ct_ca9x4_timer = { | |||
80 | }; | 82 | }; |
81 | #endif | 83 | #endif |
82 | 84 | ||
83 | static struct clcd_panel xvga_panel = { | ||
84 | .mode = { | ||
85 | .name = "XVGA", | ||
86 | .refresh = 60, | ||
87 | .xres = 1024, | ||
88 | .yres = 768, | ||
89 | .pixclock = 15384, | ||
90 | .left_margin = 168, | ||
91 | .right_margin = 8, | ||
92 | .upper_margin = 29, | ||
93 | .lower_margin = 3, | ||
94 | .hsync_len = 144, | ||
95 | .vsync_len = 6, | ||
96 | .sync = 0, | ||
97 | .vmode = FB_VMODE_NONINTERLACED, | ||
98 | }, | ||
99 | .width = -1, | ||
100 | .height = -1, | ||
101 | .tim2 = TIM2_BCD | TIM2_IPC, | ||
102 | .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1), | ||
103 | .bpp = 16, | ||
104 | }; | ||
105 | |||
106 | static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) | 85 | static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) |
107 | { | 86 | { |
108 | v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); | 87 | v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); |
@@ -112,42 +91,23 @@ static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) | |||
112 | static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) | 91 | static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) |
113 | { | 92 | { |
114 | unsigned long framesize = 1024 * 768 * 2; | 93 | unsigned long framesize = 1024 * 768 * 2; |
115 | dma_addr_t dma; | ||
116 | |||
117 | fb->panel = &xvga_panel; | ||
118 | 94 | ||
119 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, | 95 | fb->panel = versatile_clcd_get_panel("XVGA"); |
120 | &dma, GFP_KERNEL); | 96 | if (!fb->panel) |
121 | if (!fb->fb.screen_base) { | 97 | return -EINVAL; |
122 | printk(KERN_ERR "CLCD: unable to map frame buffer\n"); | ||
123 | return -ENOMEM; | ||
124 | } | ||
125 | fb->fb.fix.smem_start = dma; | ||
126 | fb->fb.fix.smem_len = framesize; | ||
127 | 98 | ||
128 | return 0; | 99 | return versatile_clcd_setup_dma(fb, framesize); |
129 | } | ||
130 | |||
131 | static int ct_ca9x4_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) | ||
132 | { | ||
133 | return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base, | ||
134 | fb->fb.fix.smem_start, fb->fb.fix.smem_len); | ||
135 | } | ||
136 | |||
137 | static void ct_ca9x4_clcd_remove(struct clcd_fb *fb) | ||
138 | { | ||
139 | dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, | ||
140 | fb->fb.screen_base, fb->fb.fix.smem_start); | ||
141 | } | 100 | } |
142 | 101 | ||
143 | static struct clcd_board ct_ca9x4_clcd_data = { | 102 | static struct clcd_board ct_ca9x4_clcd_data = { |
144 | .name = "CT-CA9X4", | 103 | .name = "CT-CA9X4", |
104 | .caps = CLCD_CAP_5551 | CLCD_CAP_565, | ||
145 | .check = clcdfb_check, | 105 | .check = clcdfb_check, |
146 | .decode = clcdfb_decode, | 106 | .decode = clcdfb_decode, |
147 | .enable = ct_ca9x4_clcd_enable, | 107 | .enable = ct_ca9x4_clcd_enable, |
148 | .setup = ct_ca9x4_clcd_setup, | 108 | .setup = ct_ca9x4_clcd_setup, |
149 | .mmap = ct_ca9x4_clcd_mmap, | 109 | .mmap = versatile_clcd_mmap_dma, |
150 | .remove = ct_ca9x4_clcd_remove, | 110 | .remove = versatile_clcd_remove_dma, |
151 | }; | 111 | }; |
152 | 112 | ||
153 | static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); | 113 | static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); |