Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08cfe9f0 authored by Jiri Slaby's avatar Jiri Slaby Committed by Bartlomiej Zolnierkiewicz
Browse files

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: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 5b45fe6b
Loading
Loading
Loading
Loading
+35 −25
Original line number Original line Diff line number Diff line
@@ -208,10 +208,17 @@ static int mda_detect(void)
	p = (u16 *) mda_vram_base;
	p = (u16 *) mda_vram_base;
	q = (u16 *) (mda_vram_base + 0x01000);
	q = (u16 *) (mda_vram_base + 0x01000);


	p_save = scr_readw(p); q_save = scr_readw(q);
	p_save = scr_readw(p);
	q_save = scr_readw(q);

	scr_writew(0xAA55, p);
	if (scr_readw(p) == 0xAA55)
		count++;

	scr_writew(0x55AA, p);
	if (scr_readw(p) == 0x55AA)
		count++;


	scr_writew(0xAA55, p); if (scr_readw(p) == 0xAA55) count++;
	scr_writew(0x55AA, p); if (scr_readw(p) == 0x55AA) count++;
	scr_writew(p_save, p);
	scr_writew(p_save, p);


	if (count != 2) {
	if (count != 2) {
@@ -220,13 +227,18 @@ static int mda_detect(void)


	/* check if we have 4K or 8K */
	/* check if we have 4K or 8K */


	scr_writew(0xA55A, q); scr_writew(0x0000, p);
	scr_writew(0xA55A, q);
	if (scr_readw(q) == 0xA55A) count++;
	scr_writew(0x0000, p);
	if (scr_readw(q) == 0xA55A)
		count++;
	
	
	scr_writew(0x5AA5, q); scr_writew(0x0000, p);
	scr_writew(0x5AA5, q);
	if (scr_readw(q) == 0x5AA5) count++;
	scr_writew(0x0000, p);
	if (scr_readw(q) == 0x5AA5)
		count++;


	scr_writew(p_save, p); scr_writew(q_save, q);
	scr_writew(p_save, p);
	scr_writew(q_save, q);
	
	
	if (count == 4) {
	if (count == 4) {
		mda_vram_len = 0x02000;
		mda_vram_len = 0x02000;
@@ -240,14 +252,12 @@ static int mda_detect(void)
	/* Edward: These two mess `tests' mess up my cursor on bootup */
	/* Edward: These two mess `tests' mess up my cursor on bootup */


	/* cursor low register */
	/* cursor low register */
	if (! test_mda_b(0x66, 0x0f)) {
	if (!test_mda_b(0x66, 0x0f))
		return 0;
		return 0;
	}


	/* cursor low register */
	/* cursor low register */
	if (! test_mda_b(0x99, 0x0f)) {
	if (!test_mda_b(0x99, 0x0f))
		return 0;
		return 0;
	}
#endif
#endif


	/* See if the card is a Hercules, by checking whether the vsync
	/* See if the card is a Hercules, by checking whether the vsync