diff options
author | Ryan Harkin <ryan.harkin@linaro.org> | 2014-04-16 18:08:01 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-17 19:04:50 +0100 |
commit | 6846e7822c4cab5a84672baace3b768c2d0db142 (patch) | |
tree | df88f11bb8e0d1cfd7eb2fd5d192d66e4538039d /drivers | |
parent | 936b996b71a6f0985e0c5474bf20174197d445d0 (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>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-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 94a1998338d..dba653f6bad 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -45,6 +45,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 @@ -763,10 +765,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; |