aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-06-23 17:51:13 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-06-23 18:25:37 +0200
commit8870dee7fab9745b2877734c915f153c8aa1409c (patch)
treed106d6b918fb19fe086b6a9b98feee38014503c3 /drivers
parent1e55d72c2ef6fc043d4044de46da6404a5747835 (diff)
glamo-fb: Drop unused exports
glamo_cmd_mode is only used in glamofb.c and glamo_cmd_write is not used at all.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/glamo-fb.c142
1 files changed, 60 insertions, 82 deletions
diff --git a/drivers/video/glamo-fb.c b/drivers/video/glamo-fb.c
index 74fdbf691ad..517cc5c711e 100644
--- a/drivers/video/glamo-fb.c
+++ b/drivers/video/glamo-fb.c
@@ -261,6 +261,66 @@ static void __rotate_lcd(struct glamofb_handle *glamo, uint32_t rotation)
GLAMO_LCD_MODE1_ROTATE_EN : 0);
}
+static inline int glamofb_cmdq_empty(struct glamofb_handle *gfb)
+{
+ /* DGCMdQempty -- 1 == command queue is empty */
+ return reg_read(gfb, GLAMO_REG_LCD_STATUS1) & (1 << 15);
+}
+
+/* call holding gfb->lock_cmd when locking, until you unlock */
+static int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
+{
+ int timeout = 2000000;
+
+ dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on);
+ if (on) {
+ dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ",
+ __func__);
+ while (!glamofb_cmdq_empty(gfb) && (timeout--))
+ cpu_relax();
+ if (timeout < 0) {
+ printk(KERN_ERR "glamofb cmd_queue never got empty\n");
+ return -EIO;
+ }
+ dev_dbg(gfb->dev, "empty!\n");
+
+ /* display the entire frame then switch to command */
+ reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
+ GLAMO_LCD_CMD_TYPE_DISP |
+ GLAMO_LCD_CMD_DATA_FIRE_VSYNC);
+
+ /* wait until lcd idle */
+ dev_dbg(gfb->dev, "waiting for lcd idle: ");
+ timeout = 2000000;
+ while (!(reg_read(gfb, GLAMO_REG_LCD_STATUS2) & (1 << 12)) &&
+ (timeout--))
+ cpu_relax();
+ if (timeout < 0) {
+ printk(KERN_ERR"*************"
+ "glamofb lcd never idle"
+ "*************\n");
+ return -EIO;
+ }
+
+ mdelay(100);
+
+ dev_dbg(gfb->dev, "cmd mode entered\n");
+
+ } else {
+ /* RGB interface needs vsync/hsync */
+ if (reg_read(gfb, GLAMO_REG_LCD_MODE3) & GLAMO_LCD_MODE3_RGB)
+ reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
+ GLAMO_LCD_CMD_TYPE_DISP |
+ GLAMO_LCD_CMD_DATA_DISP_SYNC);
+
+ reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
+ GLAMO_LCD_CMD_TYPE_DISP |
+ GLAMO_LCD_CMD_DATA_DISP_FIRE);
+ }
+
+ return 0;
+}
+
static void glamofb_program_mode(struct glamofb_handle *gfb)
{
unsigned int sync, bp, disp, fp, total;
@@ -612,88 +672,6 @@ static int glamofb_cursor(struct fb_info *info, struct fb_cursor *cursor)
}
#endif
-static inline int glamofb_cmdq_empty(struct glamofb_handle *gfb)
-{
- /* DGCMdQempty -- 1 == command queue is empty */
- return reg_read(gfb, GLAMO_REG_LCD_STATUS1) & (1 << 15);
-}
-
-/* call holding gfb->lock_cmd when locking, until you unlock */
-int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
-{
- int timeout = 2000000;
-
- dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on);
- if (on) {
- dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ",
- __func__);
- while (!glamofb_cmdq_empty(gfb) && (timeout--))
- cpu_relax();
- if (timeout < 0) {
- printk(KERN_ERR "glamofb cmd_queue never got empty\n");
- return -EIO;
- }
- dev_dbg(gfb->dev, "empty!\n");
-
- /* display the entire frame then switch to command */
- reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
- GLAMO_LCD_CMD_TYPE_DISP |
- GLAMO_LCD_CMD_DATA_FIRE_VSYNC);
-
- /* wait until lcd idle */
- dev_dbg(gfb->dev, "waiting for lcd idle: ");
- timeout = 2000000;
- while (!(reg_read(gfb, GLAMO_REG_LCD_STATUS2) & (1 << 12)) &&
- (timeout--))
- cpu_relax();
- if (timeout < 0) {
- printk(KERN_ERR"*************"
- "glamofb lcd never idle"
- "*************\n");
- return -EIO;
- }
-
- mdelay(100);
-
- dev_dbg(gfb->dev, "cmd mode entered\n");
-
- } else {
- /* RGB interface needs vsync/hsync */
- if (reg_read(gfb, GLAMO_REG_LCD_MODE3) & GLAMO_LCD_MODE3_RGB)
- reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
- GLAMO_LCD_CMD_TYPE_DISP |
- GLAMO_LCD_CMD_DATA_DISP_SYNC);
-
- reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
- GLAMO_LCD_CMD_TYPE_DISP |
- GLAMO_LCD_CMD_DATA_DISP_FIRE);
- }
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(glamofb_cmd_mode);
-
-int glamofb_cmd_write(struct glamofb_handle *gfb, uint16_t val)
-{
- int timeout = 200000;
-
- dev_dbg(gfb->dev, "%s: waiting for cmdq empty\n", __func__);
- while ((!glamofb_cmdq_empty(gfb)) && (timeout--))
- yield();
- if (timeout < 0) {
- printk(KERN_ERR"*************"
- "glamofb cmd_queue never got empty"
- "*************\n");
- return 1;
- }
- dev_dbg(gfb->dev, "idle, writing 0x%04x\n", val);
-
- reg_write(gfb, GLAMO_REG_LCD_COMMAND1, val);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(glamofb_cmd_write);
-
static struct fb_ops glamofb_ops = {
.owner = THIS_MODULE,
.fb_check_var = glamofb_check_var,