summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2017-06-14 11:40:55 -0400
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-06-14 11:40:55 -0400
commit08cfe9f08109ad7ebe2248d483c683adbb1c9448 (patch)
treea283a4eaeb2ba38cd88316d43c9b3f4b8eebe4ed
parent5b45fe6b39e1d01c45de7b8e6d3ff72585eee6cf (diff)
mdacon: align code in mda_detect properly
This is just a whitespace cleanup. The code was a mess having multiple commands on one line like: scr_writew(0xAA55, p); if (scr_readw(p) == 0xAA55) count++; Indent that properly and make it nicer for reading. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--drivers/video/console/mdacon.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index ec192a1bf297..424af6bdb408 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -208,10 +208,17 @@ static int mda_detect(void)
208 p = (u16 *) mda_vram_base; 208 p = (u16 *) mda_vram_base;
209 q = (u16 *) (mda_vram_base + 0x01000); 209 q = (u16 *) (mda_vram_base + 0x01000);
210 210
211 p_save = scr_readw(p); q_save = scr_readw(q); 211 p_save = scr_readw(p);
212 q_save = scr_readw(q);
213
214 scr_writew(0xAA55, p);
215 if (scr_readw(p) == 0xAA55)
216 count++;
217
218 scr_writew(0x55AA, p);
219 if (scr_readw(p) == 0x55AA)
220 count++;
212 221
213 scr_writew(0xAA55, p); if (scr_readw(p) == 0xAA55) count++;
214 scr_writew(0x55AA, p); if (scr_readw(p) == 0x55AA) count++;
215 scr_writew(p_save, p); 222 scr_writew(p_save, p);
216 223
217 if (count != 2) { 224 if (count != 2) {
@@ -220,13 +227,18 @@ static int mda_detect(void)
220 227
221 /* check if we have 4K or 8K */ 228 /* check if we have 4K or 8K */
222 229
223 scr_writew(0xA55A, q); scr_writew(0x0000, p); 230 scr_writew(0xA55A, q);
224 if (scr_readw(q) == 0xA55A) count++; 231 scr_writew(0x0000, p);
232 if (scr_readw(q) == 0xA55A)
233 count++;
225 234
226 scr_writew(0x5AA5, q); scr_writew(0x0000, p); 235 scr_writew(0x5AA5, q);
227 if (scr_readw(q) == 0x5AA5) count++; 236 scr_writew(0x0000, p);
237 if (scr_readw(q) == 0x5AA5)
238 count++;
228 239
229 scr_writew(p_save, p); scr_writew(q_save, q); 240 scr_writew(p_save, p);
241 scr_writew(q_save, q);
230 242
231 if (count == 4) { 243 if (count == 4) {
232 mda_vram_len = 0x02000; 244 mda_vram_len = 0x02000;
@@ -240,14 +252,12 @@ static int mda_detect(void)
240 /* Edward: These two mess `tests' mess up my cursor on bootup */ 252 /* Edward: These two mess `tests' mess up my cursor on bootup */
241 253
242 /* cursor low register */ 254 /* cursor low register */
243 if (! test_mda_b(0x66, 0x0f)) { 255 if (!test_mda_b(0x66, 0x0f))
244 return 0; 256 return 0;
245 }
246 257
247 /* cursor low register */ 258 /* cursor low register */
248 if (! test_mda_b(0x99, 0x0f)) { 259 if (!test_mda_b(0x99, 0x0f))
249 return 0; 260 return 0;
250 }
251#endif 261#endif
252 262
253 /* See if the card is a Hercules, by checking whether the vsync 263 /* See if the card is a Hercules, by checking whether the vsync
@@ -257,25 +267,25 @@ static int mda_detect(void)
257 267
258 p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC; 268 p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC;
259 269
260 for (count=0; count < 50000 && p_save == q_save; count++) { 270 for (count = 0; count < 50000 && p_save == q_save; count++) {
261 q_save = inb(mda_status_port) & MDA_STATUS_VSYNC; 271 q_save = inb(mda_status_port) & MDA_STATUS_VSYNC;
262 udelay(2); 272 udelay(2);
263 } 273 }
264 274
265 if (p_save != q_save) { 275 if (p_save != q_save) {
266 switch (inb_p(mda_status_port) & 0x70) { 276 switch (inb_p(mda_status_port) & 0x70) {
267 case 0x10: 277 case 0x10:
268 mda_type = TYPE_HERCPLUS; 278 mda_type = TYPE_HERCPLUS;
269 mda_type_name = "HerculesPlus"; 279 mda_type_name = "HerculesPlus";
270 break; 280 break;
271 case 0x50: 281 case 0x50:
272 mda_type = TYPE_HERCCOLOR; 282 mda_type = TYPE_HERCCOLOR;
273 mda_type_name = "HerculesColor"; 283 mda_type_name = "HerculesColor";
274 break; 284 break;
275 default: 285 default:
276 mda_type = TYPE_HERC; 286 mda_type = TYPE_HERC;
277 mda_type_name = "Hercules"; 287 mda_type_name = "Hercules";
278 break; 288 break;
279 } 289 }
280 } 290 }
281 291