aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-11-04 07:06:11 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-11-10 02:53:21 -0500
commit5fd284e6cd39f731db86dfd2440553365d5fad4d (patch)
treed72bc54c2f0ffd77abbb2fd014328be250e1b6b1
parent5ae0cf82df212253857326a6706018eccb658683 (diff)
fbdev: sh_mobile_lcdc: use correct number of modes, when using the default
Fix zero mode number, when using the default 720p mode. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index a87dace49cb7..9b1364723c65 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1198,6 +1198,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
1198 const struct fb_videomode *mode = cfg->lcd_cfg; 1198 const struct fb_videomode *mode = cfg->lcd_cfg;
1199 unsigned long max_size = 0; 1199 unsigned long max_size = 0;
1200 int k; 1200 int k;
1201 int num_cfg;
1201 1202
1202 ch->info = framebuffer_alloc(0, &pdev->dev); 1203 ch->info = framebuffer_alloc(0, &pdev->dev);
1203 if (!ch->info) { 1204 if (!ch->info) {
@@ -1233,8 +1234,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
1233 info->fix = sh_mobile_lcdc_fix; 1234 info->fix = sh_mobile_lcdc_fix;
1234 info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; 1235 info->fix.smem_len = max_size * (cfg->bpp / 8) * 2;
1235 1236
1236 if (!mode) 1237 if (!mode) {
1237 mode = &default_720p; 1238 mode = &default_720p;
1239 num_cfg = 1;
1240 } else {
1241 num_cfg = ch->cfg.num_cfg;
1242 }
1243
1244 fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
1238 1245
1239 fb_videomode_to_var(var, mode); 1246 fb_videomode_to_var(var, mode);
1240 /* Default Y virtual resolution is 2x panel size */ 1247 /* Default Y virtual resolution is 2x panel size */
@@ -1282,10 +1289,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
1282 1289
1283 for (i = 0; i < j; i++) { 1290 for (i = 0; i < j; i++) {
1284 struct sh_mobile_lcdc_chan *ch = priv->ch + i; 1291 struct sh_mobile_lcdc_chan *ch = priv->ch + i;
1285 const struct fb_videomode *mode = ch->cfg.lcd_cfg;
1286
1287 if (!mode)
1288 mode = &default_720p;
1289 1292
1290 info = ch->info; 1293 info = ch->info;
1291 1294
@@ -1298,7 +1301,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
1298 } 1301 }
1299 } 1302 }
1300 1303
1301 fb_videomode_to_modelist(mode, ch->cfg.num_cfg, &info->modelist);
1302 error = register_framebuffer(info); 1304 error = register_framebuffer(info);
1303 if (error < 0) 1305 if (error < 0)
1304 goto err1; 1306 goto err1;