aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAsaf Vertz <asaf.vertz@tandemg.com>2014-12-11 04:04:41 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-01-13 05:53:25 -0500
commit96699b4004f40cc0006794ff0f63ba841a4427fe (patch)
tree48c740e46e07c829cf4cd6437ee473fa21a5d2fc /drivers/video
parent77989ee83c7c634a642383ec01f43dd471637558 (diff)
fbdev: vgastate: remove trailing whitespaces
Fixed a coding style error, trailing whitespace. Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/vgastate.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c
index b91c466225b9..548c751d2415 100644
--- a/drivers/video/vgastate.c
+++ b/drivers/video/vgastate.c
@@ -2,7 +2,7 @@
2 * linux/drivers/video/vgastate.c -- VGA state save/restore 2 * linux/drivers/video/vgastate.c -- VGA state save/restore
3 * 3 *
4 * Copyright 2002 James Simmons 4 * Copyright 2002 James Simmons
5 * 5 *
6 * Copyright history from vga16fb.c: 6 * Copyright history from vga16fb.c:
7 * Copyright 1999 Ben Pfaff and Petr Vandrovec 7 * Copyright 1999 Ben Pfaff and Petr Vandrovec
8 * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm 8 * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
@@ -10,7 +10,7 @@
10 * 10 *
11 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
12 * Public License. See the file COPYING in the main directory of this 12 * Public License. See the file COPYING in the main directory of this
13 * archive for more details. 13 * archive for more details.
14 * 14 *
15 */ 15 */
16#include <linux/module.h> 16#include <linux/module.h>
@@ -29,16 +29,16 @@ struct regstate {
29 __u8 *gfx; 29 __u8 *gfx;
30 __u8 *seq; 30 __u8 *seq;
31 __u8 misc; 31 __u8 misc;
32}; 32};
33 33
34static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short iobase, 34static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short iobase,
35 unsigned char reg) 35 unsigned char reg)
36{ 36{
37 vga_w(regbase, iobase + 0x4, reg); 37 vga_w(regbase, iobase + 0x4, reg);
38 return vga_r(regbase, iobase + 0x5); 38 return vga_r(regbase, iobase + 0x5);
39} 39}
40 40
41static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase, 41static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
42 unsigned char reg, unsigned char val) 42 unsigned char reg, unsigned char val)
43{ 43{
44 vga_w(regbase, iobase + 0x4, reg); 44 vga_w(regbase, iobase + 0x4, reg);
@@ -71,7 +71,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
71 gr6 = vga_rgfx(state->vgabase, VGA_GFX_MISC); 71 gr6 = vga_rgfx(state->vgabase, VGA_GFX_MISC);
72 seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE); 72 seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
73 seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE); 73 seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
74 74
75 /* blank screen */ 75 /* blank screen */
76 seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE); 76 seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
77 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1); 77 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -85,7 +85,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
85 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2); 85 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2);
86 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 86 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
87 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 87 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
88 for (i = 0; i < 4 * 8192; i++) 88 for (i = 0; i < 4 * 8192; i++)
89 saved->vga_font0[i] = vga_r(fbbase, i); 89 saved->vga_font0[i] = vga_r(fbbase, i);
90 } 90 }
91 91
@@ -96,10 +96,10 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
96 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3); 96 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
97 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 97 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
98 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 98 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
99 for (i = 0; i < state->memsize; i++) 99 for (i = 0; i < state->memsize; i++)
100 saved->vga_font1[i] = vga_r(fbbase, i); 100 saved->vga_font1[i] = vga_r(fbbase, i);
101 } 101 }
102 102
103 /* save font at plane 0/1 */ 103 /* save font at plane 0/1 */
104 if (state->flags & VGA_SAVE_TEXT) { 104 if (state->flags & VGA_SAVE_TEXT) {
105 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1); 105 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -107,7 +107,7 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
107 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0); 107 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0);
108 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 108 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
109 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 109 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
110 for (i = 0; i < 8192; i++) 110 for (i = 0; i < 8192; i++)
111 saved->vga_text[i] = vga_r(fbbase, i); 111 saved->vga_text[i] = vga_r(fbbase, i);
112 112
113 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2); 113 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
@@ -115,8 +115,8 @@ static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
115 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1); 115 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1);
116 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 116 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
117 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 117 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
118 for (i = 0; i < 8192; i++) 118 for (i = 0; i < 8192; i++)
119 saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i); 119 saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i);
120 } 120 }
121 121
122 /* restore regs */ 122 /* restore regs */
@@ -151,7 +151,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
151 gr8 = vga_rgfx(state->vgabase, VGA_GFX_BIT_MASK); 151 gr8 = vga_rgfx(state->vgabase, VGA_GFX_BIT_MASK);
152 seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE); 152 seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
153 seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE); 153 seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
154 154
155 /* blank screen */ 155 /* blank screen */
156 seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE); 156 seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
157 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1); 157 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -163,7 +163,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
163 vga_wgfx(state->vgabase, VGA_GFX_BIT_MASK, 0xff); 163 vga_wgfx(state->vgabase, VGA_GFX_BIT_MASK, 0xff);
164 vga_wgfx(state->vgabase, VGA_GFX_SR_ENABLE, 0x00); 164 vga_wgfx(state->vgabase, VGA_GFX_SR_ENABLE, 0x00);
165 } 165 }
166 166
167 /* restore font at plane 2 */ 167 /* restore font at plane 2 */
168 if (state->flags & VGA_SAVE_FONT0) { 168 if (state->flags & VGA_SAVE_FONT0) {
169 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x4); 169 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x4);
@@ -171,7 +171,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
171 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2); 171 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2);
172 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 172 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
173 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 173 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
174 for (i = 0; i < 4 * 8192; i++) 174 for (i = 0; i < 4 * 8192; i++)
175 vga_w(fbbase, i, saved->vga_font0[i]); 175 vga_w(fbbase, i, saved->vga_font0[i]);
176 } 176 }
177 177
@@ -182,10 +182,10 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
182 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3); 182 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
183 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 183 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
184 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 184 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
185 for (i = 0; i < state->memsize; i++) 185 for (i = 0; i < state->memsize; i++)
186 vga_w(fbbase, i, saved->vga_font1[i]); 186 vga_w(fbbase, i, saved->vga_font1[i]);
187 } 187 }
188 188
189 /* restore font at plane 0/1 */ 189 /* restore font at plane 0/1 */
190 if (state->flags & VGA_SAVE_TEXT) { 190 if (state->flags & VGA_SAVE_TEXT) {
191 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1); 191 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -193,16 +193,16 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
193 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0); 193 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0);
194 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 194 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
195 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 195 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
196 for (i = 0; i < 8192; i++) 196 for (i = 0; i < 8192; i++)
197 vga_w(fbbase, i, saved->vga_text[i]); 197 vga_w(fbbase, i, saved->vga_text[i]);
198 198
199 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2); 199 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
200 vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, 0x6); 200 vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, 0x6);
201 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1); 201 vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1);
202 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0); 202 vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
203 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5); 203 vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
204 for (i = 0; i < 8192; i++) 204 for (i = 0; i < 8192; i++)
205 vga_w(fbbase, i, saved->vga_text[8192+i]); 205 vga_w(fbbase, i, saved->vga_text[8192+i]);
206 } 206 }
207 207
208 /* unblank screen */ 208 /* unblank screen */
@@ -222,7 +222,7 @@ static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
222 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, seq2); 222 vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, seq2);
223 vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, seq4); 223 vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, seq4);
224} 224}
225 225
226static void save_vga_mode(struct vgastate *state) 226static void save_vga_mode(struct vgastate *state)
227{ 227{
228 struct regstate *saved = (struct regstate *) state->vidstate; 228 struct regstate *saved = (struct regstate *) state->vidstate;
@@ -235,10 +235,10 @@ static void save_vga_mode(struct vgastate *state)
235 else 235 else
236 iobase = 0x3b0; 236 iobase = 0x3b0;
237 237
238 for (i = 0; i < state->num_crtc; i++) 238 for (i = 0; i < state->num_crtc; i++)
239 saved->crtc[i] = vga_rcrtcs(state->vgabase, iobase, i); 239 saved->crtc[i] = vga_rcrtcs(state->vgabase, iobase, i);
240 240
241 vga_r(state->vgabase, iobase + 0xa); 241 vga_r(state->vgabase, iobase + 0xa);
242 vga_w(state->vgabase, VGA_ATT_W, 0x00); 242 vga_w(state->vgabase, VGA_ATT_W, 0x00);
243 for (i = 0; i < state->num_attr; i++) { 243 for (i = 0; i < state->num_attr; i++) {
244 vga_r(state->vgabase, iobase + 0xa); 244 vga_r(state->vgabase, iobase + 0xa);
@@ -247,10 +247,10 @@ static void save_vga_mode(struct vgastate *state)
247 vga_r(state->vgabase, iobase + 0xa); 247 vga_r(state->vgabase, iobase + 0xa);
248 vga_w(state->vgabase, VGA_ATT_W, 0x20); 248 vga_w(state->vgabase, VGA_ATT_W, 0x20);
249 249
250 for (i = 0; i < state->num_gfx; i++) 250 for (i = 0; i < state->num_gfx; i++)
251 saved->gfx[i] = vga_rgfx(state->vgabase, i); 251 saved->gfx[i] = vga_rgfx(state->vgabase, i);
252 252
253 for (i = 0; i < state->num_seq; i++) 253 for (i = 0; i < state->num_seq; i++)
254 saved->seq[i] = vga_rseq(state->vgabase, i); 254 saved->seq[i] = vga_rseq(state->vgabase, i);
255} 255}
256 256
@@ -268,26 +268,26 @@ static void restore_vga_mode(struct vgastate *state)
268 iobase = 0x3b0; 268 iobase = 0x3b0;
269 269
270 /* turn off display */ 270 /* turn off display */
271 vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, 271 vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
272 saved->seq[VGA_SEQ_CLOCK_MODE] | 0x20); 272 saved->seq[VGA_SEQ_CLOCK_MODE] | 0x20);
273 273
274 /* disable sequencer */ 274 /* disable sequencer */
275 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01); 275 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01);
276 276
277 /* enable palette addressing */ 277 /* enable palette addressing */
278 vga_r(state->vgabase, iobase + 0xa); 278 vga_r(state->vgabase, iobase + 0xa);
279 vga_w(state->vgabase, VGA_ATT_W, 0x00); 279 vga_w(state->vgabase, VGA_ATT_W, 0x00);
280 280
281 for (i = 2; i < state->num_seq; i++) 281 for (i = 2; i < state->num_seq; i++)
282 vga_wseq(state->vgabase, i, saved->seq[i]); 282 vga_wseq(state->vgabase, i, saved->seq[i]);
283 283
284 284
285 /* unprotect vga regs */ 285 /* unprotect vga regs */
286 vga_wcrtcs(state->vgabase, iobase, 17, saved->crtc[17] & ~0x80); 286 vga_wcrtcs(state->vgabase, iobase, 17, saved->crtc[17] & ~0x80);
287 for (i = 0; i < state->num_crtc; i++) 287 for (i = 0; i < state->num_crtc; i++)
288 vga_wcrtcs(state->vgabase, iobase, i, saved->crtc[i]); 288 vga_wcrtcs(state->vgabase, iobase, i, saved->crtc[i]);
289 289
290 for (i = 0; i < state->num_gfx; i++) 290 for (i = 0; i < state->num_gfx; i++)
291 vga_wgfx(state->vgabase, i, saved->gfx[i]); 291 vga_wgfx(state->vgabase, i, saved->gfx[i]);
292 292
293 for (i = 0; i < state->num_attr; i++) { 293 for (i = 0; i < state->num_attr; i++) {
@@ -298,7 +298,7 @@ static void restore_vga_mode(struct vgastate *state)
298 /* reenable sequencer */ 298 /* reenable sequencer */
299 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x03); 299 vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x03);
300 /* turn display on */ 300 /* turn display on */
301 vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, 301 vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE,
302 saved->seq[VGA_SEQ_CLOCK_MODE] & ~(1 << 5)); 302 saved->seq[VGA_SEQ_CLOCK_MODE] & ~(1 << 5));
303 303
304 /* disable video/palette source */ 304 /* disable video/palette source */
@@ -312,7 +312,7 @@ static void save_vga_cmap(struct vgastate *state)
312 int i; 312 int i;
313 313
314 vga_w(state->vgabase, VGA_PEL_MSK, 0xff); 314 vga_w(state->vgabase, VGA_PEL_MSK, 0xff);
315 315
316 /* assumes DAC is readable and writable */ 316 /* assumes DAC is readable and writable */
317 vga_w(state->vgabase, VGA_PEL_IR, 0x00); 317 vga_w(state->vgabase, VGA_PEL_IR, 0x00);
318 for (i = 0; i < 768; i++) 318 for (i = 0; i < 768; i++)
@@ -346,7 +346,7 @@ static void vga_cleanup(struct vgastate *state)
346 state->vidstate = NULL; 346 state->vidstate = NULL;
347 } 347 }
348} 348}
349 349
350int save_vga(struct vgastate *state) 350int save_vga(struct vgastate *state)
351{ 351{
352 struct regstate *saved; 352 struct regstate *saved;
@@ -357,7 +357,7 @@ int save_vga(struct vgastate *state)
357 return 1; 357 return 1;
358 358
359 state->vidstate = (void *)saved; 359 state->vidstate = (void *)saved;
360 360
361 if (state->flags & VGA_SAVE_CMAP) { 361 if (state->flags & VGA_SAVE_CMAP) {
362 saved->vga_cmap = vmalloc(768); 362 saved->vga_cmap = vmalloc(768);
363 if (!saved->vga_cmap) { 363 if (!saved->vga_cmap) {
@@ -403,7 +403,7 @@ int save_vga(struct vgastate *state)
403 } 403 }
404 if (!state->memsize) 404 if (!state->memsize)
405 state->memsize = 8 * 8192; 405 state->memsize = 8 * 8192;
406 406
407 if (!state->membase) 407 if (!state->membase)
408 state->membase = 0xA0000; 408 state->membase = 0xA0000;
409 409
@@ -414,7 +414,7 @@ int save_vga(struct vgastate *state)
414 return 1; 414 return 1;
415 } 415 }
416 416
417 /* 417 /*
418 * save only first 32K used by vgacon 418 * save only first 32K used by vgacon
419 */ 419 */
420 if (state->flags & VGA_SAVE_FONT0) { 420 if (state->flags & VGA_SAVE_FONT0) {
@@ -425,7 +425,7 @@ int save_vga(struct vgastate *state)
425 return 1; 425 return 1;
426 } 426 }
427 } 427 }
428 /* 428 /*
429 * largely unused, but if required by the caller 429 * largely unused, but if required by the caller
430 * we'll just save everything. 430 * we'll just save everything.
431 */ 431 */
@@ -448,7 +448,7 @@ int save_vga(struct vgastate *state)
448 return 1; 448 return 1;
449 } 449 }
450 } 450 }
451 451
452 save_vga_text(state, fbbase); 452 save_vga_text(state, fbbase);
453 iounmap(fbbase); 453 iounmap(fbbase);
454 } 454 }