diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-04-17 15:44:54 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2010-05-07 19:17:39 -0400 |
commit | 384c3041aeaf77d299b0d4a62481850fed86e53b (patch) | |
tree | 9be5fb948e7d4aa6c35d874ede023b64a582cbe8 /drivers/video/via | |
parent | 100e74a150d3a31d4c12658c926429ceb880d2f7 (diff) |
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: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via')
-rw-r--r-- | drivers/video/via/hw.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index d474fbee3350..b2bb24e23f33 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -1008,16 +1008,12 @@ void viafb_load_reg(int timing_value, int viafb_load_reg_num, | |||
1008 | void viafb_write_regx(struct io_reg RegTable[], int ItemNum) | 1008 | void viafb_write_regx(struct io_reg RegTable[], int ItemNum) |
1009 | { | 1009 | { |
1010 | int i; | 1010 | int i; |
1011 | unsigned char RegTemp; | ||
1012 | 1011 | ||
1013 | /*DEBUG_MSG(KERN_INFO "Table Size : %x!!\n",ItemNum ); */ | 1012 | /*DEBUG_MSG(KERN_INFO "Table Size : %x!!\n",ItemNum ); */ |
1014 | 1013 | ||
1015 | for (i = 0; i < ItemNum; i++) { | 1014 | for (i = 0; i < ItemNum; i++) |
1016 | outb(RegTable[i].index, RegTable[i].port); | 1015 | via_write_reg_mask(RegTable[i].port, RegTable[i].index, |
1017 | RegTemp = inb(RegTable[i].port + 1); | 1016 | RegTable[i].value, RegTable[i].mask); |
1018 | RegTemp = (RegTemp & (~RegTable[i].mask)) | RegTable[i].value; | ||
1019 | outb(RegTemp, RegTable[i].port + 1); | ||
1020 | } | ||
1021 | } | 1017 | } |
1022 | 1018 | ||
1023 | void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga) | 1019 | 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 | outb(VPIT.Misc, VIAWMisc); | 2126 | outb(VPIT.Misc, VIAWMisc); |
2131 | 2127 | ||
2132 | /* Write Sequencer */ | 2128 | /* Write Sequencer */ |
2133 | for (i = 1; i <= StdSR; i++) { | 2129 | for (i = 1; i <= StdSR; i++) |
2134 | outb(i, VIASR); | 2130 | via_write_reg(VIASR, i, VPIT.SR[i - 1]); |
2135 | outb(VPIT.SR[i - 1], VIASR + 1); | ||
2136 | } | ||
2137 | 2131 | ||
2138 | viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2); | 2132 | viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2); |
2139 | viafb_set_iga_path(); | 2133 | viafb_set_iga_path(); |
@@ -2142,10 +2136,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, | |||
2142 | viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1); | 2136 | viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1); |
2143 | 2137 | ||
2144 | /* Write Graphic Controller */ | 2138 | /* Write Graphic Controller */ |
2145 | for (i = 0; i < StdGR; i++) { | 2139 | for (i = 0; i < StdGR; i++) |
2146 | outb(i, VIAGR); | 2140 | via_write_reg(VIAGR, i, VPIT.GR[i]); |
2147 | outb(VPIT.GR[i], VIAGR + 1); | ||
2148 | } | ||
2149 | 2141 | ||
2150 | /* Write Attribute Controller */ | 2142 | /* Write Attribute Controller */ |
2151 | for (i = 0; i < StdAR; i++) { | 2143 | for (i = 0; i < StdAR; i++) { |