aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-11-28 21:21:43 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-11-28 23:05:21 -0500
commit11fee467a119afac02d336bf41dcd9c4db2b6106 (patch)
tree8936825019754e882f747bf1444018d328150c65
parent2264c151efa632fa8aab7377d13d9aa1476547bf (diff)
ARM: mach-shmobile: mackerel: Add LCDC support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index e2def7e27711..21443fef28e6 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -34,6 +34,8 @@
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35#include <linux/smsc911x.h> 35#include <linux/smsc911x.h>
36 36
37#include <video/sh_mobile_lcdc.h>
38
37#include <mach/common.h> 39#include <mach/common.h>
38#include <mach/sh7372.h> 40#include <mach/sh7372.h>
39 41
@@ -138,9 +140,64 @@ static struct platform_device smc911x_device = {
138 }, 140 },
139}; 141};
140 142
143/* LCDC */
144static struct fb_videomode mackerel_lcdc_modes[] = {
145 {
146 .name = "WVGA Panel",
147 .xres = 800,
148 .yres = 480,
149 .left_margin = 220,
150 .right_margin = 110,
151 .hsync_len = 70,
152 .upper_margin = 20,
153 .lower_margin = 5,
154 .vsync_len = 5,
155 .sync = 0,
156 },
157};
158
159static struct sh_mobile_lcdc_info lcdc_info = {
160 .clock_source = LCDC_CLK_BUS,
161 .ch[0] = {
162 .chan = LCDC_CHAN_MAINLCD,
163 .bpp = 16,
164 .lcd_cfg = mackerel_lcdc_modes,
165 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
166 .interface_type = RGB24,
167 .clock_divider = 2,
168 .flags = 0,
169 .lcd_size_cfg.width = 152,
170 .lcd_size_cfg.height = 91,
171 }
172};
173
174static struct resource lcdc_resources[] = {
175 [0] = {
176 .name = "LCDC",
177 .start = 0xfe940000,
178 .end = 0xfe943fff,
179 .flags = IORESOURCE_MEM,
180 },
181 [1] = {
182 .start = intcs_evt2irq(0x580),
183 .flags = IORESOURCE_IRQ,
184 },
185};
186
187static struct platform_device lcdc_device = {
188 .name = "sh_mobile_lcdc_fb",
189 .num_resources = ARRAY_SIZE(lcdc_resources),
190 .resource = lcdc_resources,
191 .dev = {
192 .platform_data = &lcdc_info,
193 .coherent_dma_mask = ~0,
194 },
195};
196
141static struct platform_device *mackerel_devices[] __initdata = { 197static struct platform_device *mackerel_devices[] __initdata = {
142 &nor_flash_device, 198 &nor_flash_device,
143 &smc911x_device, 199 &smc911x_device,
200 &lcdc_device,
144}; 201};
145 202
146static struct map_desc mackerel_io_desc[] __initdata = { 203static struct map_desc mackerel_io_desc[] __initdata = {
@@ -176,6 +233,35 @@ static void __init mackerel_init(void)
176 gpio_request(GPIO_FN_CS5A, NULL); 233 gpio_request(GPIO_FN_CS5A, NULL);
177 gpio_request(GPIO_FN_IRQ6_39, NULL); 234 gpio_request(GPIO_FN_IRQ6_39, NULL);
178 235
236 /* LCDC */
237 gpio_request(GPIO_FN_LCDD17, NULL);
238 gpio_request(GPIO_FN_LCDD16, NULL);
239 gpio_request(GPIO_FN_LCDD15, NULL);
240 gpio_request(GPIO_FN_LCDD14, NULL);
241 gpio_request(GPIO_FN_LCDD13, NULL);
242 gpio_request(GPIO_FN_LCDD12, NULL);
243 gpio_request(GPIO_FN_LCDD11, NULL);
244 gpio_request(GPIO_FN_LCDD10, NULL);
245 gpio_request(GPIO_FN_LCDD9, NULL);
246 gpio_request(GPIO_FN_LCDD8, NULL);
247 gpio_request(GPIO_FN_LCDD7, NULL);
248 gpio_request(GPIO_FN_LCDD6, NULL);
249 gpio_request(GPIO_FN_LCDD5, NULL);
250 gpio_request(GPIO_FN_LCDD4, NULL);
251 gpio_request(GPIO_FN_LCDD3, NULL);
252 gpio_request(GPIO_FN_LCDD2, NULL);
253 gpio_request(GPIO_FN_LCDD1, NULL);
254 gpio_request(GPIO_FN_LCDD0, NULL);
255 gpio_request(GPIO_FN_LCDDISP, NULL);
256 gpio_request(GPIO_FN_LCDDCK, NULL);
257
258 gpio_request(GPIO_PORT31, NULL); /* backlight */
259 gpio_direction_output(GPIO_PORT31, 1);
260
261 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
262 gpio_direction_output(GPIO_PORT151, 1);
263
264
179 sh7372_add_standard_devices(); 265 sh7372_add_standard_devices();
180 266
181 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); 267 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));