diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-10-16 01:03:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:40 -0400 |
commit | 93a22f8b95756c53e80308820892119c910d2739 (patch) | |
tree | 01539a24fc517e84e35c951699fc0939336b55a6 /drivers/video/omap/lcd_sx1.c | |
parent | 0f6d504e73b49374c6093efe6aa60ab55058248a (diff) |
omap drivers: switch to standard GPIO calls
This updates most of the OMAP drivers which are in mainline to switch to
using the cross-platform GPIO calls instead of the older OMAP-specific
ones.
This is all fairly brainless/obvious stuff. Probably the most interesting
bit is to observe that the omap-keypad code seems to now have a portable
core that could work with non-OMAP matrix keypads. (That would improve
with hardware IRQ debouncing enabled, of course...)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/omap/lcd_sx1.c')
-rw-r--r-- | drivers/video/omap/lcd_sx1.c | 99 |
1 files changed, 46 insertions, 53 deletions
diff --git a/drivers/video/omap/lcd_sx1.c b/drivers/video/omap/lcd_sx1.c index caa6a896cb8b..e55de201b8ff 100644 --- a/drivers/video/omap/lcd_sx1.c +++ b/drivers/video/omap/lcd_sx1.c | |||
@@ -81,21 +81,21 @@ static void epson_sendbyte(int flag, unsigned char byte) | |||
81 | int i, shifter = 0x80; | 81 | int i, shifter = 0x80; |
82 | 82 | ||
83 | if (!flag) | 83 | if (!flag) |
84 | omap_set_gpio_dataout(_A_LCD_SSC_A0, 0); | 84 | gpio_set_value(_A_LCD_SSC_A0, 0); |
85 | mdelay(2); | 85 | mdelay(2); |
86 | omap_set_gpio_dataout(A_LCD_SSC_RD, 1); | 86 | gpio_set_value(A_LCD_SSC_RD, 1); |
87 | 87 | ||
88 | omap_set_gpio_dataout(A_LCD_SSC_SD, flag); | 88 | gpio_set_value(A_LCD_SSC_SD, flag); |
89 | 89 | ||
90 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); | 90 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); |
91 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); | 91 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); |
92 | for (i = 0; i < 8; i++) { | 92 | for (i = 0; i < 8; i++) { |
93 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); | 93 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2200); |
94 | omap_set_gpio_dataout(A_LCD_SSC_SD, shifter & byte); | 94 | gpio_set_value(A_LCD_SSC_SD, shifter & byte); |
95 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); | 95 | OMAP_MCBSP_WRITE(OMAP1510_MCBSP3_BASE, PCR0, 0x2202); |
96 | shifter >>= 1; | 96 | shifter >>= 1; |
97 | } | 97 | } |
98 | omap_set_gpio_dataout(_A_LCD_SSC_A0, 1); | 98 | gpio_set_value(_A_LCD_SSC_A0, 1); |
99 | } | 99 | } |
100 | 100 | ||
101 | static void init_system(void) | 101 | static void init_system(void) |
@@ -107,25 +107,18 @@ static void init_system(void) | |||
107 | static void setup_GPIO(void) | 107 | static void setup_GPIO(void) |
108 | { | 108 | { |
109 | /* new wave */ | 109 | /* new wave */ |
110 | omap_request_gpio(A_LCD_SSC_RD); | 110 | gpio_request(A_LCD_SSC_RD, "lcd_ssc_rd"); |
111 | omap_request_gpio(A_LCD_SSC_SD); | 111 | gpio_request(A_LCD_SSC_SD, "lcd_ssc_sd"); |
112 | omap_request_gpio(_A_LCD_RESET); | 112 | gpio_request(_A_LCD_RESET, "lcd_reset"); |
113 | omap_request_gpio(_A_LCD_SSC_CS); | 113 | gpio_request(_A_LCD_SSC_CS, "lcd_ssc_cs"); |
114 | omap_request_gpio(_A_LCD_SSC_A0); | 114 | gpio_request(_A_LCD_SSC_A0, "lcd_ssc_a0"); |
115 | 115 | ||
116 | /* set all GPIOs to output */ | 116 | /* set GPIOs to output, with initial data */ |
117 | omap_set_gpio_direction(A_LCD_SSC_RD, 0); | 117 | gpio_direction_output(A_LCD_SSC_RD, 1); |
118 | omap_set_gpio_direction(A_LCD_SSC_SD, 0); | 118 | gpio_direction_output(A_LCD_SSC_SD, 0); |
119 | omap_set_gpio_direction(_A_LCD_RESET, 0); | 119 | gpio_direction_output(_A_LCD_RESET, 0); |
120 | omap_set_gpio_direction(_A_LCD_SSC_CS, 0); | 120 | gpio_direction_output(_A_LCD_SSC_CS, 1); |
121 | omap_set_gpio_direction(_A_LCD_SSC_A0, 0); | 121 | gpio_direction_output(_A_LCD_SSC_A0, 1); |
122 | |||
123 | /* set GPIO data */ | ||
124 | omap_set_gpio_dataout(A_LCD_SSC_RD, 1); | ||
125 | omap_set_gpio_dataout(A_LCD_SSC_SD, 0); | ||
126 | omap_set_gpio_dataout(_A_LCD_RESET, 0); | ||
127 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | ||
128 | omap_set_gpio_dataout(_A_LCD_SSC_A0, 1); | ||
129 | } | 122 | } |
130 | 123 | ||
131 | static void display_init(void) | 124 | static void display_init(void) |
@@ -139,61 +132,61 @@ static void display_init(void) | |||
139 | mdelay(2); | 132 | mdelay(2); |
140 | 133 | ||
141 | /* reset LCD */ | 134 | /* reset LCD */ |
142 | omap_set_gpio_dataout(A_LCD_SSC_SD, 1); | 135 | gpio_set_value(A_LCD_SSC_SD, 1); |
143 | epson_sendbyte(0, 0x25); | 136 | epson_sendbyte(0, 0x25); |
144 | 137 | ||
145 | omap_set_gpio_dataout(_A_LCD_RESET, 0); | 138 | gpio_set_value(_A_LCD_RESET, 0); |
146 | mdelay(10); | 139 | mdelay(10); |
147 | omap_set_gpio_dataout(_A_LCD_RESET, 1); | 140 | gpio_set_value(_A_LCD_RESET, 1); |
148 | 141 | ||
149 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 142 | gpio_set_value(_A_LCD_SSC_CS, 1); |
150 | mdelay(2); | 143 | mdelay(2); |
151 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 144 | gpio_set_value(_A_LCD_SSC_CS, 0); |
152 | 145 | ||
153 | /* init LCD, phase 1 */ | 146 | /* init LCD, phase 1 */ |
154 | epson_sendbyte(0, 0xCA); | 147 | epson_sendbyte(0, 0xCA); |
155 | for (i = 0; i < 10; i++) | 148 | for (i = 0; i < 10; i++) |
156 | epson_sendbyte(1, INIT_1[i]); | 149 | epson_sendbyte(1, INIT_1[i]); |
157 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 150 | gpio_set_value(_A_LCD_SSC_CS, 1); |
158 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 151 | gpio_set_value(_A_LCD_SSC_CS, 0); |
159 | 152 | ||
160 | /* init LCD phase 2 */ | 153 | /* init LCD phase 2 */ |
161 | epson_sendbyte(0, 0xCB); | 154 | epson_sendbyte(0, 0xCB); |
162 | for (i = 0; i < 125; i++) | 155 | for (i = 0; i < 125; i++) |
163 | epson_sendbyte(1, INIT_2[i]); | 156 | epson_sendbyte(1, INIT_2[i]); |
164 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 157 | gpio_set_value(_A_LCD_SSC_CS, 1); |
165 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 158 | gpio_set_value(_A_LCD_SSC_CS, 0); |
166 | 159 | ||
167 | /* init LCD phase 2a */ | 160 | /* init LCD phase 2a */ |
168 | epson_sendbyte(0, 0xCC); | 161 | epson_sendbyte(0, 0xCC); |
169 | for (i = 0; i < 14; i++) | 162 | for (i = 0; i < 14; i++) |
170 | epson_sendbyte(1, INIT_3[i]); | 163 | epson_sendbyte(1, INIT_3[i]); |
171 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 164 | gpio_set_value(_A_LCD_SSC_CS, 1); |
172 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 165 | gpio_set_value(_A_LCD_SSC_CS, 0); |
173 | 166 | ||
174 | /* init LCD phase 3 */ | 167 | /* init LCD phase 3 */ |
175 | epson_sendbyte(0, 0xBC); | 168 | epson_sendbyte(0, 0xBC); |
176 | epson_sendbyte(1, 0x08); | 169 | epson_sendbyte(1, 0x08); |
177 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 170 | gpio_set_value(_A_LCD_SSC_CS, 1); |
178 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 171 | gpio_set_value(_A_LCD_SSC_CS, 0); |
179 | 172 | ||
180 | /* init LCD phase 4 */ | 173 | /* init LCD phase 4 */ |
181 | epson_sendbyte(0, 0x07); | 174 | epson_sendbyte(0, 0x07); |
182 | epson_sendbyte(1, 0x05); | 175 | epson_sendbyte(1, 0x05); |
183 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 176 | gpio_set_value(_A_LCD_SSC_CS, 1); |
184 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 177 | gpio_set_value(_A_LCD_SSC_CS, 0); |
185 | 178 | ||
186 | /* init LCD phase 5 */ | 179 | /* init LCD phase 5 */ |
187 | epson_sendbyte(0, 0x94); | 180 | epson_sendbyte(0, 0x94); |
188 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 181 | gpio_set_value(_A_LCD_SSC_CS, 1); |
189 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 182 | gpio_set_value(_A_LCD_SSC_CS, 0); |
190 | 183 | ||
191 | /* init LCD phase 6 */ | 184 | /* init LCD phase 6 */ |
192 | epson_sendbyte(0, 0xC6); | 185 | epson_sendbyte(0, 0xC6); |
193 | epson_sendbyte(1, 0x80); | 186 | epson_sendbyte(1, 0x80); |
194 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 187 | gpio_set_value(_A_LCD_SSC_CS, 1); |
195 | mdelay(100); /* used to be 1000 */ | 188 | mdelay(100); /* used to be 1000 */ |
196 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 189 | gpio_set_value(_A_LCD_SSC_CS, 0); |
197 | 190 | ||
198 | /* init LCD phase 7 */ | 191 | /* init LCD phase 7 */ |
199 | epson_sendbyte(0, 0x16); | 192 | epson_sendbyte(0, 0x16); |
@@ -201,8 +194,8 @@ static void display_init(void) | |||
201 | epson_sendbyte(1, 0x00); | 194 | epson_sendbyte(1, 0x00); |
202 | epson_sendbyte(1, 0xB1); | 195 | epson_sendbyte(1, 0xB1); |
203 | epson_sendbyte(1, 0x00); | 196 | epson_sendbyte(1, 0x00); |
204 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 197 | gpio_set_value(_A_LCD_SSC_CS, 1); |
205 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 198 | gpio_set_value(_A_LCD_SSC_CS, 0); |
206 | 199 | ||
207 | /* init LCD phase 8 */ | 200 | /* init LCD phase 8 */ |
208 | epson_sendbyte(0, 0x76); | 201 | epson_sendbyte(0, 0x76); |
@@ -210,12 +203,12 @@ static void display_init(void) | |||
210 | epson_sendbyte(1, 0x00); | 203 | epson_sendbyte(1, 0x00); |
211 | epson_sendbyte(1, 0xDB); | 204 | epson_sendbyte(1, 0xDB); |
212 | epson_sendbyte(1, 0x00); | 205 | epson_sendbyte(1, 0x00); |
213 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 206 | gpio_set_value(_A_LCD_SSC_CS, 1); |
214 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 207 | gpio_set_value(_A_LCD_SSC_CS, 0); |
215 | 208 | ||
216 | /* init LCD phase 9 */ | 209 | /* init LCD phase 9 */ |
217 | epson_sendbyte(0, 0xAF); | 210 | epson_sendbyte(0, 0xAF); |
218 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 211 | gpio_set_value(_A_LCD_SSC_CS, 1); |
219 | } | 212 | } |
220 | 213 | ||
221 | static int sx1_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) | 214 | static int sx1_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) |
@@ -231,18 +224,18 @@ static void sx1_panel_disable(struct lcd_panel *panel) | |||
231 | { | 224 | { |
232 | printk(KERN_INFO "SX1: LCD panel disable\n"); | 225 | printk(KERN_INFO "SX1: LCD panel disable\n"); |
233 | sx1_setmmipower(0); | 226 | sx1_setmmipower(0); |
234 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 227 | gpio_set_value(_A_LCD_SSC_CS, 1); |
235 | 228 | ||
236 | epson_sendbyte(0, 0x25); | 229 | epson_sendbyte(0, 0x25); |
237 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 230 | gpio_set_value(_A_LCD_SSC_CS, 0); |
238 | 231 | ||
239 | epson_sendbyte(0, 0xAE); | 232 | epson_sendbyte(0, 0xAE); |
240 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 233 | gpio_set_value(_A_LCD_SSC_CS, 1); |
241 | mdelay(100); | 234 | mdelay(100); |
242 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 0); | 235 | gpio_set_value(_A_LCD_SSC_CS, 0); |
243 | 236 | ||
244 | epson_sendbyte(0, 0x95); | 237 | epson_sendbyte(0, 0x95); |
245 | omap_set_gpio_dataout(_A_LCD_SSC_CS, 1); | 238 | gpio_set_value(_A_LCD_SSC_CS, 1); |
246 | } | 239 | } |
247 | 240 | ||
248 | static int sx1_panel_enable(struct lcd_panel *panel) | 241 | static int sx1_panel_enable(struct lcd_panel *panel) |