diff options
author | Andres Salomon <dilinger@queued.net> | 2008-04-28 05:15:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:40 -0400 |
commit | 3553a2fa8cbfc9f85f1809366be5884054f52c6d (patch) | |
tree | 21d850599c9ce2b75d967927afa6b59adadfda74 | |
parent | fd96795630428ceca775bd1effc5bf41a9fe5272 (diff) |
OLPC: gxfb/lxfb: add DCON panel modes to framebuffer drivers
Since there's no way to autodetect panel modes, we're forced to hardcode them
in the driver and add a big fat #ifdef. The OLPC DCON needs a specific mode
line (at 1200x900). This adds it to both gxfb and lxfb.
(Jordan said: We could probably detect the panel mode, but there isn't any
reason to since the panel timings are well known and won't change. While OFW
detection would be good computer science fu, it would be a wasted effort since
its so easy to hard code them into the table.)
Signed-off-by: Andres Salomon <dilinger@debian.org>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/geode/gxfb_core.c | 37 | ||||
-rw-r--r-- | drivers/video/geode/lxfb_core.c | 37 |
2 files changed, 67 insertions, 7 deletions
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index f16c21d5bc21..de2b8f9876a5 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c | |||
@@ -41,7 +41,7 @@ static int vram; | |||
41 | static int vt_switch; | 41 | static int vt_switch; |
42 | 42 | ||
43 | /* Modes relevant to the GX (taken from modedb.c) */ | 43 | /* Modes relevant to the GX (taken from modedb.c) */ |
44 | static const struct fb_videomode gx_modedb[] __initdata = { | 44 | static struct fb_videomode gx_modedb[] __initdata = { |
45 | /* 640x480-60 VESA */ | 45 | /* 640x480-60 VESA */ |
46 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, | 46 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, |
47 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, | 47 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, |
@@ -108,6 +108,35 @@ static const struct fb_videomode gx_modedb[] __initdata = { | |||
108 | FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, | 108 | FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | #ifdef CONFIG_OLPC | ||
112 | #include <asm/olpc.h> | ||
113 | |||
114 | static struct fb_videomode gx_dcon_modedb[] __initdata = { | ||
115 | /* The only mode the DCON has is 1200x900 */ | ||
116 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, | ||
117 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
118 | FB_VMODE_NONINTERLACED, 0 } | ||
119 | }; | ||
120 | |||
121 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | ||
122 | { | ||
123 | if (olpc_has_dcon()) { | ||
124 | *modedb = (struct fb_videomode *) gx_dcon_modedb; | ||
125 | *size = ARRAY_SIZE(gx_dcon_modedb); | ||
126 | } else { | ||
127 | *modedb = (struct fb_videomode *) gx_modedb; | ||
128 | *size = ARRAY_SIZE(gx_modedb); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | #else | ||
133 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | ||
134 | { | ||
135 | *modedb = (struct fb_videomode *) gx_modedb; | ||
136 | *size = ARRAY_SIZE(gx_modedb); | ||
137 | } | ||
138 | #endif | ||
139 | |||
111 | static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 140 | static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
112 | { | 141 | { |
113 | if (var->xres > 1600 || var->yres > 1200) | 142 | if (var->xres > 1600 || var->yres > 1200) |
@@ -350,6 +379,9 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i | |||
350 | int ret; | 379 | int ret; |
351 | unsigned long val; | 380 | unsigned long val; |
352 | 381 | ||
382 | struct fb_videomode *modedb_ptr; | ||
383 | unsigned int modedb_size; | ||
384 | |||
353 | info = gxfb_init_fbinfo(&pdev->dev); | 385 | info = gxfb_init_fbinfo(&pdev->dev); |
354 | if (!info) | 386 | if (!info) |
355 | return -ENOMEM; | 387 | return -ENOMEM; |
@@ -369,8 +401,9 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i | |||
369 | else | 401 | else |
370 | par->enable_crt = 1; | 402 | par->enable_crt = 1; |
371 | 403 | ||
404 | get_modedb(&modedb_ptr, &modedb_size); | ||
372 | ret = fb_find_mode(&info->var, info, mode_option, | 405 | ret = fb_find_mode(&info->var, info, mode_option, |
373 | gx_modedb, ARRAY_SIZE(gx_modedb), NULL, 16); | 406 | modedb_ptr, modedb_size, NULL, 16); |
374 | if (ret == 0 || ret == 4) { | 407 | if (ret == 0 || ret == 4) { |
375 | dev_err(&pdev->dev, "could not find valid video mode\n"); | 408 | dev_err(&pdev->dev, "could not find valid video mode\n"); |
376 | ret = -EINVAL; | 409 | ret = -EINVAL; |
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 15150ed41cec..2cd9b74d2225 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c | |||
@@ -36,7 +36,7 @@ static int vt_switch; | |||
36 | * we try to make it something sane - 640x480-60 is sane | 36 | * we try to make it something sane - 640x480-60 is sane |
37 | */ | 37 | */ |
38 | 38 | ||
39 | static const struct fb_videomode geode_modedb[] __initdata = { | 39 | static struct fb_videomode geode_modedb[] __initdata = { |
40 | /* 640x480-60 */ | 40 | /* 640x480-60 */ |
41 | { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2, | 41 | { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2, |
42 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 42 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
@@ -217,6 +217,35 @@ static const struct fb_videomode geode_modedb[] __initdata = { | |||
217 | 0, FB_VMODE_NONINTERLACED, 0 }, | 217 | 0, FB_VMODE_NONINTERLACED, 0 }, |
218 | }; | 218 | }; |
219 | 219 | ||
220 | #ifdef CONFIG_OLPC | ||
221 | #include <asm/olpc.h> | ||
222 | |||
223 | static struct fb_videomode olpc_dcon_modedb[] __initdata = { | ||
224 | /* The only mode the DCON has is 1200x900 */ | ||
225 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, | ||
226 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
227 | FB_VMODE_NONINTERLACED, 0 } | ||
228 | }; | ||
229 | |||
230 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | ||
231 | { | ||
232 | if (olpc_has_dcon()) { | ||
233 | *modedb = (struct fb_videomode *) olpc_dcon_modedb; | ||
234 | *size = ARRAY_SIZE(olpc_dcon_modedb); | ||
235 | } else { | ||
236 | *modedb = (struct fb_videomode *) geode_modedb; | ||
237 | *size = ARRAY_SIZE(geode_modedb); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | #else | ||
242 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | ||
243 | { | ||
244 | *modedb = (struct fb_videomode *) geode_modedb; | ||
245 | *size = ARRAY_SIZE(geode_modedb); | ||
246 | } | ||
247 | #endif | ||
248 | |||
220 | static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 249 | static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
221 | { | 250 | { |
222 | if (var->xres > 1920 || var->yres > 1440) | 251 | if (var->xres > 1920 || var->yres > 1440) |
@@ -477,7 +506,7 @@ static int __init lxfb_probe(struct pci_dev *pdev, | |||
477 | int ret; | 506 | int ret; |
478 | 507 | ||
479 | struct fb_videomode *modedb_ptr; | 508 | struct fb_videomode *modedb_ptr; |
480 | int modedb_size; | 509 | unsigned int modedb_size; |
481 | 510 | ||
482 | info = lxfb_init_fbinfo(&pdev->dev); | 511 | info = lxfb_init_fbinfo(&pdev->dev); |
483 | 512 | ||
@@ -502,9 +531,7 @@ static int __init lxfb_probe(struct pci_dev *pdev, | |||
502 | 531 | ||
503 | /* Set up the mode database */ | 532 | /* Set up the mode database */ |
504 | 533 | ||
505 | modedb_ptr = (struct fb_videomode *) geode_modedb; | 534 | get_modedb(&modedb_ptr, &modedb_size); |
506 | modedb_size = ARRAY_SIZE(geode_modedb); | ||
507 | |||
508 | ret = fb_find_mode(&info->var, info, mode_option, | 535 | ret = fb_find_mode(&info->var, info, mode_option, |
509 | modedb_ptr, modedb_size, NULL, 16); | 536 | modedb_ptr, modedb_size, NULL, 16); |
510 | 537 | ||