diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-04-17 15:44:51 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2010-05-07 19:16:03 -0400 |
commit | c389874805a6849e3e347fc0e13fa170d80840c1 (patch) | |
tree | 11508f50085603a0a9f9f14b10046f9940775f55 /drivers/video/via/hw.c | |
parent | 7e0de022680f7899d33141f3ab5724a704f5669a (diff) |
viafb: package often used basic io functions
This patch puts redesigned versions of the basic io functions that
are used overall the driver in an extra header. It is prefixed with
via_ as no framebuffer dependend stuff is in there. They were inlined
as they are really simple which reduced the module size about 2.5%.
The parameter order of read and write was fixed as it really doesn't
make sense to change the order as they are parts of the same address
and not source and destination.
Wrapper which use the new functions were added to hw.h to replicate
the old interface and avoid changing all old code.
[jc: added one comment]
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via/hw.c')
-rw-r--r-- | drivers/video/via/hw.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index f2425ae228ae..805151f48ea9 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -537,18 +537,6 @@ static void device_on(void); | |||
537 | static void enable_second_display_channel(void); | 537 | static void enable_second_display_channel(void); |
538 | static void disable_second_display_channel(void); | 538 | static void disable_second_display_channel(void); |
539 | 539 | ||
540 | void viafb_write_reg(u8 index, u16 io_port, u8 data) | ||
541 | { | ||
542 | outb(index, io_port); | ||
543 | outb(data, io_port + 1); | ||
544 | /*DEBUG_MSG(KERN_INFO "\nIndex=%2d Value=%2d", index, data); */ | ||
545 | } | ||
546 | u8 viafb_read_reg(int io_port, u8 index) | ||
547 | { | ||
548 | outb(index, io_port); | ||
549 | return inb(io_port + 1); | ||
550 | } | ||
551 | |||
552 | void viafb_lock_crt(void) | 540 | void viafb_lock_crt(void) |
553 | { | 541 | { |
554 | viafb_write_reg_mask(CR11, VIACR, BIT7, BIT7); | 542 | viafb_write_reg_mask(CR11, VIACR, BIT7, BIT7); |
@@ -560,16 +548,6 @@ void viafb_unlock_crt(void) | |||
560 | viafb_write_reg_mask(CR47, VIACR, 0, BIT0); | 548 | viafb_write_reg_mask(CR47, VIACR, 0, BIT0); |
561 | } | 549 | } |
562 | 550 | ||
563 | void viafb_write_reg_mask(u8 index, int io_port, u8 data, u8 mask) | ||
564 | { | ||
565 | u8 tmp; | ||
566 | |||
567 | outb(index, io_port); | ||
568 | tmp = inb(io_port + 1); | ||
569 | outb((data & mask) | (tmp & (~mask)), io_port + 1); | ||
570 | /*DEBUG_MSG(KERN_INFO "\nIndex=%2d Value=%2d", index, tmp); */ | ||
571 | } | ||
572 | |||
573 | void write_dac_reg(u8 index, u8 r, u8 g, u8 b) | 551 | void write_dac_reg(u8 index, u8 r, u8 g, u8 b) |
574 | { | 552 | { |
575 | outb(index, LUT_INDEX_WRITE); | 553 | outb(index, LUT_INDEX_WRITE); |