Commit 384c3041 authored by Florian Tobias Schandinat's avatar Florian Tobias Schandinat Committed by Jonathan Corbet

viafb: replace inb/outb

viafb: replace inb/outb

This patch replaces occurences of inb/outb with via_write_reg and
via_write_reg_mask where this is possible to improve code
readability.
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 100e74a1
...@@ -1008,16 +1008,12 @@ void viafb_load_reg(int timing_value, int viafb_load_reg_num, ...@@ -1008,16 +1008,12 @@ void viafb_load_reg(int timing_value, int viafb_load_reg_num,
void viafb_write_regx(struct io_reg RegTable[], int ItemNum) void viafb_write_regx(struct io_reg RegTable[], int ItemNum)
{ {
int i; int i;
unsigned char RegTemp;
/*DEBUG_MSG(KERN_INFO "Table Size : %x!!\n",ItemNum ); */ /*DEBUG_MSG(KERN_INFO "Table Size : %x!!\n",ItemNum ); */
for (i = 0; i < ItemNum; i++) { for (i = 0; i < ItemNum; i++)
outb(RegTable[i].index, RegTable[i].port); via_write_reg_mask(RegTable[i].port, RegTable[i].index,
RegTemp = inb(RegTable[i].port + 1); RegTable[i].value, RegTable[i].mask);
RegTemp = (RegTemp & (~RegTable[i].mask)) | RegTable[i].value;
outb(RegTemp, RegTable[i].port + 1);
}
} }
void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga) void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga)
...@@ -2130,10 +2126,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, ...@@ -2130,10 +2126,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
outb(VPIT.Misc, VIAWMisc); outb(VPIT.Misc, VIAWMisc);
/* Write Sequencer */ /* Write Sequencer */
for (i = 1; i <= StdSR; i++) { for (i = 1; i <= StdSR; i++)
outb(i, VIASR); via_write_reg(VIASR, i, VPIT.SR[i - 1]);
outb(VPIT.SR[i - 1], VIASR + 1);
}
viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2); viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2);
viafb_set_iga_path(); viafb_set_iga_path();
...@@ -2142,10 +2136,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, ...@@ -2142,10 +2136,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1); viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1);
/* Write Graphic Controller */ /* Write Graphic Controller */
for (i = 0; i < StdGR; i++) { for (i = 0; i < StdGR; i++)
outb(i, VIAGR); via_write_reg(VIAGR, i, VPIT.GR[i]);
outb(VPIT.GR[i], VIAGR + 1);
}
/* Write Attribute Controller */ /* Write Attribute Controller */
for (i = 0; i < StdAR; i++) { for (i = 0; i < StdAR; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment