diff options
author | Ryan Harkin <ryan.harkin@linaro.org> | 2014-02-17 13:22:51 +0000 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-07-16 09:58:07 +0800 |
commit | af3b44ad16f779e0b9cffe8b8f77be75fa162fd3 (patch) | |
tree | 7c4f6460513b0d56d7878b8e0f3e65b51ba13715 /drivers/video | |
parent | 4337dd55269520f4869e3a76d5cae56fa8ceb822 (diff) |
amba-clcd: set video mode via module parameter on kernel commandline
Specifying the module parameter "amba-clcd.mode=<mode>" will over-ride
the default mode used when the driver is initialised.
Where <mode> can either be VGA or XVGA (the default).
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
(cherry picked from commit 78268af2fcd6441fde8994ca204bfaf55e38d618)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/amba-clcd.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index a0044a8e4e43..c6c393f4f201 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -46,6 +46,8 @@ /* This is limited to 16 characters when displayed by X startup */ static const char *clcd_name = "CLCD FB"; +static char *def_mode; +module_param_named(mode, def_mode, charp, 0); /* * Unfortunately, the enable/disable functions may be called either from @@ -764,10 +766,18 @@ static int clcdfb_dt_init(struct clcd_fb *fb) na = of_n_addr_cells(node); ns = of_n_size_cells(node); - if (WARN_ON(of_property_read_string(node, "mode", &mode))) - return -ENODEV; + if (def_mode && strlen(def_mode) > 0) { + fb->panel = clcdfb_get_panel(def_mode); + if (!fb->panel) + printk(KERN_ERR "CLCD: invalid mode specified on the command line (%s)\n", def_mode); + } + + if (!fb->panel) { + if (WARN_ON(of_property_read_string(node, "mode", &mode))) + return -ENODEV; + fb->panel = clcdfb_get_panel(mode); + } - fb->panel = clcdfb_get_panel(mode); if (!fb->panel) return -EINVAL; fb->fb.fix.smem_len = fb->panel->mode.xres * fb->panel->mode.yres * 2; |