Linux 2.6.21.1
[linux/fpc-iii.git] / drivers / char / lcd.h
blob290b3ff23b0353905d129d6848c60065cccf273a
1 /*
2 * LED, LCD and Button panel driver for Cobalt
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
6 * for more details.
8 * Copyright (C) 1996, 1997 by Andrew Bose
10 * Linux kernel version history:
11 * March 2001: Ported from 2.0.34 by Liam Davies
15 // function headers
17 #define LCD_CHARS_PER_LINE 40
18 #define MAX_IDLE_TIME 120
20 struct lcd_display {
21 unsigned buttons;
22 int size1;
23 int size2;
24 unsigned char line1[LCD_CHARS_PER_LINE];
25 unsigned char line2[LCD_CHARS_PER_LINE];
26 unsigned char cursor_address;
27 unsigned char character;
28 unsigned char leds;
29 unsigned char *RomImage;
34 #define LCD_DRIVER "Cobalt LCD Driver v2.10"
36 #define LCD "lcd: "
38 #define kLCD_IR 0x0F000000
39 #define kLCD_DR 0x0F000010
40 #define kGPI 0x0D000000
41 #define kLED 0x0C000000
43 #define kDD_R00 0x00
44 #define kDD_R01 0x27
45 #define kDD_R10 0x40
46 #define kDD_R11 0x67
48 #define kLCD_Addr 0x00000080
50 #define LCDTimeoutValue 0xfff
53 // Macros
55 #define LCDWriteData(x) outl((x << 24), kLCD_DR)
56 #define LCDWriteInst(x) outl((x << 24), kLCD_IR)
58 #define LCDReadData (inl(kLCD_DR) >> 24)
59 #define LCDReadInst (inl(kLCD_IR) >> 24)
61 #define GPIRead (inl(kGPI) >> 24)
63 #define LEDSet(x) outb((char)x, kLED)
65 #define WRITE_GAL(x,y) outl(y, 0x04000000 | (x))
66 #define BusyCheck() while ((LCDReadInst & 0x80) == 0x80)
71 * Function command codes for io_ctl.
73 #define LCD_On 1
74 #define LCD_Off 2
75 #define LCD_Clear 3
76 #define LCD_Reset 4
77 #define LCD_Cursor_Left 5
78 #define LCD_Cursor_Right 6
79 #define LCD_Disp_Left 7
80 #define LCD_Disp_Right 8
81 #define LCD_Get_Cursor 9
82 #define LCD_Set_Cursor 10
83 #define LCD_Home 11
84 #define LCD_Read 12
85 #define LCD_Write 13
86 #define LCD_Cursor_Off 14
87 #define LCD_Cursor_On 15
88 #define LCD_Get_Cursor_Pos 16
89 #define LCD_Set_Cursor_Pos 17
90 #define LCD_Blink_Off 18
92 #define LED_Set 40
93 #define LED_Bit_Set 41
94 #define LED_Bit_Clear 42
97 // Button defs
98 #define BUTTON_Read 50
101 // Ethernet LINK check hackaroo
102 #define LINK_Check 90
103 #define LINK_Check_2 91
105 // Button patterns _B - single layer lcd boards
107 #define BUTTON_NONE 0x3F
108 #define BUTTON_NONE_B 0xFE
110 #define BUTTON_Left 0x3B
111 #define BUTTON_Left_B 0xFA
113 #define BUTTON_Right 0x37
114 #define BUTTON_Right_B 0xDE
116 #define BUTTON_Up 0x2F
117 #define BUTTON_Up_B 0xF6
119 #define BUTTON_Down 0x1F
120 #define BUTTON_Down_B 0xEE
122 #define BUTTON_Next 0x3D
123 #define BUTTON_Next_B 0x7E
125 #define BUTTON_Enter 0x3E
126 #define BUTTON_Enter_B 0xBE
128 #define BUTTON_Reset_B 0xFC
131 // debounce constants
133 #define BUTTON_SENSE 160000
134 #define BUTTON_DEBOUNCE 5000
137 // Galileo register stuff
139 #define kGal_DevBank2Cfg 0x1466DB33
140 #define kGal_DevBank2PReg 0x464
141 #define kGal_DevBank3Cfg 0x146FDFFB
142 #define kGal_DevBank3PReg 0x468
144 // Network
146 #define kIPADDR 1
147 #define kNETMASK 2
148 #define kGATEWAY 3
149 #define kDNS 4
151 #define kClassA 5
152 #define kClassB 6
153 #define kClassC 7