summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2014-01-15 18:32:34 +0100
committerStefan Agner <stefan.agner@toradex.com>2014-01-22 18:56:40 +0100
commit6b16aabdbcd86db1cfc25f094a4321b1d8f94c41 (patch)
treeb6fb38437c92eb92c9f63ae2b8fb8ef287e6b2e8 /drivers
parent24b367fa9cf448c8b23dc7d0f2bc2a28801ed233 (diff)
mvf_dcu: use modedb to set video mode
Use modedb helper function to get video mode from kernel cmd line. Video mode can now be choosen at boot time using video=dcufb:...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mvf_dcu.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/video/mvf_dcu.c b/drivers/video/mvf_dcu.c
index 165b39a1e2dc..c388273a75ed 100644
--- a/drivers/video/mvf_dcu.c
+++ b/drivers/video/mvf_dcu.c
@@ -50,7 +50,7 @@ static struct fb_videomode __devinitdata mvf_dcu_default_mode = {
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED,
#else /* !CONFIG_COLIBRI_VF */
-// .refresh = 60,
+ .refresh = 60,
.xres = 640,
.yres = 480,
/* pixel clock period in picoseconds (25.18 MHz) */
@@ -63,7 +63,6 @@ static struct fb_videomode __devinitdata mvf_dcu_default_mode = {
.vsync_len = 2,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
#endif /* !CONFIG_COLIBRI_VF */
};
@@ -84,7 +83,7 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
{
/* 640x480p 60hz: EIA/CEA-861-B Format 1 */
.name = "640x480",
-// .refresh = 60,
+ .refresh = 60,
.xres = 640,
.yres = 480,
/* pixel clock period in picoseconds (25.18 MHz) */
@@ -97,12 +96,11 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
.vsync_len = 2,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
},
{
/* 800x480@60 (e.g. EDT ET070080DH6) */
.name = "800x480",
-// .refresh = 60,
+ .refresh = 60,
.xres = 800,
.yres = 480,
/* pixel clock period in picoseconds (33.26 MHz) */
@@ -115,12 +113,11 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
.vsync_len = 2,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
},
{
/* 800x600@60 */
.name = "800x600",
-// .refresh = 60,
+ .refresh = 60,
.xres = 800,
.yres = 600,
/* pixel clock period in picoseconds (40 MHz) */
@@ -133,13 +130,12 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
.vsync_len = 4,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
},
{
/* TouchRevolution Fusion 10 aka Chunghwa Picture Tubes
CLAA101NC05 10.1 inch 1024x600 single channel LVDS panel */
.name = "1024x600",
-// .refresh = 60,
+ .refresh = 60,
.xres = 1024,
.yres = 600,
/* pixel clock period in picoseconds (48 MHz) */
@@ -152,12 +148,11 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
.vsync_len = 5,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
},
{
/* 1024x768@60 */
.name = "1024x768",
-// .refresh = 60,
+ .refresh = 60,
.xres = 1024,
.yres = 768,
/* pixel clock period in picoseconds (65 MHz) */
@@ -170,7 +165,6 @@ static struct fb_videomode __devinitdata mvf_dcu_mode_db[] = {
.vsync_len = 6,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
-// .flag = 0,
},
};
@@ -974,11 +968,23 @@ static int __devinit install_fb(struct fb_info *info)
struct fb_videomode *db = mvf_dcu_mode_db;
unsigned int dbsize = ARRAY_SIZE(mvf_dcu_mode_db);
int rc;
+ char *param_option = NULL;
+ const char *option;
if (init_fbinfo(info))
return -EINVAL;
- rc = fb_find_mode(&info->var, info, mfbi->mode_str, db, dbsize,
+ fb_get_options("dcufb", &param_option);
+ if (param_option != NULL) {
+ option = param_option;
+ printk(KERN_INFO "dcufb: parse cmd options: %s\n", option);
+ } else {
+ option = mfbi->mode_str;
+ printk(KERN_INFO "dcufb: use default mode: %s\n", option);
+ }
+
+
+ rc = fb_find_mode(&info->var, info, option, db, dbsize,
&mvf_dcu_default_mode, mfbi->default_bpp);
if (mvf_dcu_check_var(&info->var, info)) {