linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jordan Crouse" <jordan.crouse@amd.com>
To: linux-fbdev-devel@lists.sourceforge.net, info-linux@ldcmail.amd.com
Cc: akpm@osdl.org
Subject: [PATCH 4/6] [PATCH] gxfb: Support command line options
Date: Tue, 28 Nov 2006 16:15:07 -0700	[thread overview]
Message-ID: <20061128231507.25769.75366.stgit@cosmic.amd.com> (raw)
In-Reply-To: <20061128230639.25769.43.stgit@cosmic.amd.com>

From: Jordan Crouse <jordan.crouse@amd.com>

Add support for command line options for setting the mode and various
settings.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
---

 drivers/video/geode/gxfb_core.c |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index ccc50fc..d404f56 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -35,10 +35,10 @@ #include "geodefb.h"
 #include "display_gx.h"
 #include "video_gx.h"
 
-static char mode_option[32] = "640x480-16@60";
+static char *mode_option;
 
 /* Modes relevant to the GX (taken from modedb.c) */
-static const struct fb_videomode __initdata gx_modedb[] = {
+static const struct fb_videomode gx_modedb[] __initdata = {
 	/* 640x480-60 VESA */
 	{ NULL, 60, 640, 480, 39682,  48, 16, 33, 10, 96, 2,
 	  0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
@@ -341,7 +341,8 @@ static int __init gxfb_probe(struct pci_
 		goto err;
 	}
 
-        /* Clear the frame buffer of garbage. */
+       
+	/* Clear the frame buffer of garbage. */
         memset_io(info->screen_base, 0, info->fix.smem_len);
 
 	gxfb_check_var(&info->var, info);
@@ -411,11 +412,34 @@ static struct pci_driver gxfb_driver = {
 	.remove		= gxfb_remove,
 };
 
+#ifndef MODULE
+static int __init gxfb_setup(char *options) {
+
+	char *opt;
+
+	if (!options || !*options)
+		return 0;
+
+	while((opt = strsep(&options, ",")) != NULL) {
+		if (!*opt)
+			continue;
+
+		mode_option = opt;
+	}
+
+	return 0;
+}
+#endif
+
 static int __init gxfb_init(void)
 {
 #ifndef MODULE
-	if (fb_get_options("gxfb", NULL))
+	char *option = NULL;
+
+	if (fb_get_options("gxfb", &option))
 		return -ENODEV;
+
+	gxfb_setup(option);
 #endif
 	return pci_register_driver(&gxfb_driver);
 }
@@ -428,8 +452,8 @@ static void __exit gxfb_cleanup(void)
 module_init(gxfb_init);
 module_exit(gxfb_cleanup);
 
-module_param_string(mode, mode_option, sizeof(mode_option), 0444);
-MODULE_PARM_DESC(mode, "video mode (<x>x<y>[-<bpp>][@<refr>])");
+module_param(mode_option, charp, 0);
+MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
 
 MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX");
 MODULE_LICENSE("GPL");



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  parent reply	other threads:[~2006-11-28 23:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-28 23:06 [PATCH 0/6] Geode GX framebuffer patches Jordan Crouse
2006-11-28 23:14 ` [PATCH 1/6] FB: Get the Geode GX frambuffer size from the BIOS Jordan Crouse
2006-11-29 14:21   ` James Simmons
2006-11-28 23:14 ` [PATCH 2/6] [PATCH] gxfb: Fixups for the AMD Geode GX framebuffer driver Jordan Crouse
2006-11-29 14:21   ` James Simmons
2006-11-28 23:15 ` [PATCH 3/6] [PATCH] gxfb: Support flat panel timings Jordan Crouse
2006-11-29 14:21   ` James Simmons
2006-11-28 23:15 ` Jordan Crouse [this message]
2006-11-29 14:21   ` [PATCH 4/6] [PATCH] gxfb: Support command line options James Simmons
2006-11-28 23:15 ` [PATCH 5/6] [PATCH] gxfb: Fixup flatpanel detection Jordan Crouse
2006-11-29 14:22   ` James Simmons
2006-11-28 23:15 ` [PATCH 6/6] [PATCH] gxfb: Turn on the flatpanel power and data Jordan Crouse
2006-11-29 14:22   ` James Simmons
2006-11-29  0:10 ` [PATCH 0/6] Geode GX framebuffer patches Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061128231507.25769.75366.stgit@cosmic.amd.com \
    --to=jordan.crouse@amd.com \
    --cc=akpm@osdl.org \
    --cc=info-linux@ldcmail.amd.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).