[PATCH] pxafb: Add option to enable/disable the cursor

From: Rodolfo Giometti
Date: Tue Feb 13 2007 - 12:38:14 EST


Add cursor enable/disable, very useful if you wish a full screen boot
logo.

Cursor can be disabled from kernel command line:

video=pxafb:nocursor

or from sysfs interface:

echo 1 > /sys/module/pxafb/parameters/nocursor

Signed-off-by: Rodolfo Giometti <giometti@xxxxxxxx>
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index b4947c8..5d33501 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -9,6 +9,8 @@
* which in turn is
* Based on acornfb.c Copyright (C) Russell King.
*
+ * Cursor enable/disable by Rodolfo Giometti <giometti@xxxxxxxx>
+ *
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
@@ -54,6 +56,10 @@

#include "pxafb.h"

+static int nocursor = 0;
+module_param(nocursor, int, 0644);
+MODULE_PARM_DESC(nocursor, "cursor enable/disable");
+
/* Bits which should not be set in machine configuration structures */
#define LCCR0_INVALID_CONFIG_MASK (LCCR0_OUM|LCCR0_BM|LCCR0_QDM|LCCR0_DIS|LCCR0_EFM|LCCR0_IUM|LCCR0_SFM|LCCR0_LDM|LCCR0_ENB)
#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP|LCCR3_VSP|LCCR3_PCD|LCCR3_BPP)
@@ -464,6 +470,17 @@ static int pxafb_mmap(struct fb_info *info,
return -EINVAL;
}

+/* fb_cursor
+ * Used to disable cursor drawing...
+ */
+int pxafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
+{
+ if (nocursor)
+ return 0;
+ else
+ return -EINVAL; /* just to force soft_cursor() call */
+}
+
static struct fb_ops pxafb_ops = {
.owner = THIS_MODULE,
.fb_check_var = pxafb_check_var,
@@ -474,6 +491,7 @@ static struct fb_ops pxafb_ops = {
.fb_imageblit = cfb_imageblit,
.fb_blank = pxafb_blank,
.fb_mmap = pxafb_mmap,
+ .fb_cursor = pxafb_cursor,
};

/*
@@ -1308,6 +1326,9 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_4PixMono;
} else if (!strncmp(this_opt, "8pix", 4)) {
inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_8PixMono;
+ } else if (!strncmp(this_opt, "nocursor", 8)) {
+ nocursor = 1;
+ dev_info(dev, "cursor disabled");
} else {
dev_err(dev, "unknown option: %s\n", this_opt);
return -EINVAL;