aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/geode/lxfb_core.c
diff options
context:
space:
mode:
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 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
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