2 * Driver for the LCD display on the Tensilica LX60 Board.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 2001, 2006 Tensilica Inc.
13 * FIXME: this code is from the examples from the LX60 user guide.
15 * The lcd_pause function does busy waiting, which is probably not
16 * great. Maybe the code could be changed to use kernel timers, or
17 * change the hardware to not need to wait.
20 #include <linux/init.h>
23 #include <platform/hardware.h>
24 #include <platform/lcd.h>
25 #include <linux/delay.h>
27 #define LCD_PAUSE_ITERATIONS 4000
29 #define LCD_DISPLAY_ON 0xc
31 /* 8bit and 2 lines display */
32 #define LCD_DISPLAY_MODE8BIT 0x38
33 #define LCD_DISPLAY_POS 0x80
34 #define LCD_SHIFT_LEFT 0x18
35 #define LCD_SHIFT_RIGHT 0x1c
37 static int __init
lcd_init(void)
39 *LCD_INSTR_ADDR
= LCD_DISPLAY_MODE8BIT
;
41 *LCD_INSTR_ADDR
= LCD_DISPLAY_MODE8BIT
;
43 *LCD_INSTR_ADDR
= LCD_DISPLAY_MODE8BIT
;
45 *LCD_INSTR_ADDR
= LCD_DISPLAY_ON
;
47 *LCD_INSTR_ADDR
= LCD_CLEAR
;
49 lcd_disp_at_pos("XTENSA LINUX", 0);
53 void lcd_disp_at_pos(char *str
, unsigned char pos
)
55 *LCD_INSTR_ADDR
= LCD_DISPLAY_POS
| pos
;
58 *LCD_DATA_ADDR
= *str
;
64 void lcd_shiftleft(void)
66 *LCD_INSTR_ADDR
= LCD_SHIFT_LEFT
;
70 void lcd_shiftright(void)
72 *LCD_INSTR_ADDR
= LCD_SHIFT_RIGHT
;
76 arch_initcall(lcd_init
);