From 77ac7552be3b024a5a93cd8c3b1422f44eb39fc3 Mon Sep 17 00:00:00 2001 From: Shashank Mittal Date: Thu, 12 May 2011 19:56:48 -0700 Subject: [PATCH] vfb: Support vfb configuration from kernel cmdline Add support to configure mode_option, framebuffer size and bpp from kernel command line. Signed-off-by: Shashank Mittal Signed-off-by: David Brown --- drivers/video/vfb.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 501a922aa9dc..2428997c3a0e 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -35,6 +35,13 @@ static void *videomemory; static u_long videomemorysize = VIDEOMEMSIZE; module_param(videomemorysize, ulong, 0); +static char *mode_option __devinitdata; +static int bpp __devinitdata = 8; + +module_param(mode_option, charp, 0); +MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'"); +module_param(bpp, int, 0); + /********************************************************************** * @@ -469,6 +476,14 @@ static int __init vfb_setup(char *options) /* Test disable for backwards compatibility */ if (!strcmp(this_opt, "disable")) vfb_enable = 0; + else if (!strncmp(this_opt, "bpp=", 4)) { + if (kstrtoint(this_opt + 4, 0, &bpp) < 0) + bpp = 8; + } else if (!strncmp(this_opt, "memsize=", 8)) { + if (kstrtoul(this_opt + 8, 0, &videomemorysize) < 0) + videomemorysize = VIDEOMEMSIZE; + } else + mode_option = this_opt; } return 1; } @@ -504,8 +519,8 @@ static int __devinit vfb_probe(struct platform_device *dev) info->screen_base = (char __iomem *)videomemory; info->fbops = &vfb_ops; - retval = fb_find_mode(&info->var, info, NULL, - NULL, 0, NULL, 8); + retval = fb_find_mode(&info->var, info, mode_option, + NULL, 0, NULL, bpp); if (!retval || (retval == 4)) info->var = vfb_default;