aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/geode/lxfb_core.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2008-04-28 05:15:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:40 -0400
commit3553a2fa8cbfc9f85f1809366be5884054f52c6d (patch)
tree21d850599c9ce2b75d967927afa6b59adadfda74 /drivers/video/geode/lxfb_core.c
parentfd96795630428ceca775bd1effc5bf41a9fe5272 (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>
Diffstat (limited to 'drivers/video/geode/lxfb_core.c')
-rw-r--r--drivers/video/geode/lxfb_core.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 15150ed41ce..2cd9b74d222 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
39static const struct fb_videomode geode_modedb[] __initdata = { 39static 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
223static 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
230static 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
242static 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
220static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 249static 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