aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/geode
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2006-12-08 05:40:54 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:08 -0500
commit16ef9870959621fa437d25ead28a7199acc6ce49 (patch)
treee58bfb79c1a37db85af6187438a667de9384a793 /drivers/video/geode
parentab1db0cfcf69f94a5c6831db230982cd6bbeb2e1 (diff)
[PATCH] gxfb: Support command line options
Add support for command line options for setting the mode and various settings. [akpm@osdl.org: cleanups] Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Acked-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/geode')
-rw-r--r--drivers/video/geode/gxfb_core.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index 1e0d47ea0e43..47a68802e94f 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -35,10 +35,10 @@
35#include "display_gx.h" 35#include "display_gx.h"
36#include "video_gx.h" 36#include "video_gx.h"
37 37
38static char mode_option[32] = "640x480-16@60"; 38static char *mode_option;
39 39
40/* Modes relevant to the GX (taken from modedb.c) */ 40/* Modes relevant to the GX (taken from modedb.c) */
41static const struct fb_videomode __initdata gx_modedb[] = { 41static const struct fb_videomode gx_modedb[] __initdata = {
42 /* 640x480-60 VESA */ 42 /* 640x480-60 VESA */
43 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, 43 { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
44 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, 44 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
@@ -341,7 +341,8 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
341 goto err; 341 goto err;
342 } 342 }
343 343
344 /* Clear the frame buffer of garbage. */ 344
345 /* Clear the frame buffer of garbage. */
345 memset_io(info->screen_base, 0, info->fix.smem_len); 346 memset_io(info->screen_base, 0, info->fix.smem_len);
346 347
347 gxfb_check_var(&info->var, info); 348 gxfb_check_var(&info->var, info);
@@ -411,11 +412,35 @@ static struct pci_driver gxfb_driver = {
411 .remove = gxfb_remove, 412 .remove = gxfb_remove,
412}; 413};
413 414
415#ifndef MODULE
416static int __init gxfb_setup(char *options)
417{
418
419 char *opt;
420
421 if (!options || !*options)
422 return 0;
423
424 while ((opt = strsep(&options, ",")) != NULL) {
425 if (!*opt)
426 continue;
427
428 mode_option = opt;
429 }
430
431 return 0;
432}
433#endif
434
414static int __init gxfb_init(void) 435static int __init gxfb_init(void)
415{ 436{
416#ifndef MODULE 437#ifndef MODULE
417 if (fb_get_options("gxfb", NULL)) 438 char *option = NULL;
439
440 if (fb_get_options("gxfb", &option))
418 return -ENODEV; 441 return -ENODEV;
442
443 gxfb_setup(option);
419#endif 444#endif
420 return pci_register_driver(&gxfb_driver); 445 return pci_register_driver(&gxfb_driver);
421} 446}
@@ -428,8 +453,8 @@ static void __exit gxfb_cleanup(void)
428module_init(gxfb_init); 453module_init(gxfb_init);
429module_exit(gxfb_cleanup); 454module_exit(gxfb_cleanup);
430 455
431module_param_string(mode, mode_option, sizeof(mode_option), 0444); 456module_param(mode_option, charp, 0);
432MODULE_PARM_DESC(mode, "video mode (<x>x<y>[-<bpp>][@<refr>])"); 457MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
433 458
434MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX"); 459MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX");
435MODULE_LICENSE("GPL"); 460MODULE_LICENSE("GPL");