Commit 5fd284e6 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 5ae0cf82
...@@ -1198,6 +1198,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1198,6 +1198,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
const struct fb_videomode *mode = cfg->lcd_cfg; const struct fb_videomode *mode = cfg->lcd_cfg;
unsigned long max_size = 0; unsigned long max_size = 0;
int k; int k;
int num_cfg;
ch->info = framebuffer_alloc(0, &pdev->dev); ch->info = framebuffer_alloc(0, &pdev->dev);
if (!ch->info) { if (!ch->info) {
...@@ -1233,8 +1234,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1233,8 +1234,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
info->fix = sh_mobile_lcdc_fix; info->fix = sh_mobile_lcdc_fix;
info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; info->fix.smem_len = max_size * (cfg->bpp / 8) * 2;
if (!mode) if (!mode) {
mode = &default_720p; mode = &default_720p;
num_cfg = 1;
} else {
num_cfg = ch->cfg.num_cfg;
}
fb_videomode_to_modelist(mode, num_cfg, &info->modelist);
fb_videomode_to_var(var, mode); fb_videomode_to_var(var, mode);
/* Default Y virtual resolution is 2x panel size */ /* Default Y virtual resolution is 2x panel size */
...@@ -1282,10 +1289,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1282,10 +1289,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
for (i = 0; i < j; i++) { for (i = 0; i < j; i++) {
struct sh_mobile_lcdc_chan *ch = priv->ch + i; struct sh_mobile_lcdc_chan *ch = priv->ch + i;
const struct fb_videomode *mode = ch->cfg.lcd_cfg;
if (!mode)
mode = &default_720p;
info = ch->info; info = ch->info;
...@@ -1298,7 +1301,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) ...@@ -1298,7 +1301,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
} }
} }
fb_videomode_to_modelist(mode, ch->cfg.num_cfg, &info->modelist);
error = register_framebuffer(info); error = register_framebuffer(info);
if (error < 0) if (error < 0)
goto err1; goto err1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment