diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-04-17 15:44:52 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2010-05-07 19:17:38 -0400 |
commit | 2749413db17723cf894036c0eaf339f289bcc841 (patch) | |
tree | 8bfff7a881bf7fa54e93a8a11665c6e51c736859 /drivers/video/via/hw.c | |
parent | c2b12cd496bbe5eff6a48bc669fe6b0c56f2b3d9 (diff) |
viafb: unify modesetting functions
viafb: unify modesetting functions
This patch unifies some cleaned up modesetting functions to prepare for
moving them to an extra file. This includes make them use via_io and
changing there names to reflect that they do not depend on anything
framebuffer specific.
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 | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 805151f48ea9..1628a5f93dc2 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -624,50 +624,50 @@ void viafb_set_iga_path(void) | |||
624 | } | 624 | } |
625 | } | 625 | } |
626 | 626 | ||
627 | void viafb_set_primary_address(u32 addr) | 627 | void via_set_primary_address(u32 addr) |
628 | { | 628 | { |
629 | DEBUG_MSG(KERN_DEBUG "viafb_set_primary_address(0x%08X)\n", addr); | 629 | DEBUG_MSG(KERN_DEBUG "via_set_primary_address(0x%08X)\n", addr); |
630 | viafb_write_reg(CR0D, VIACR, addr & 0xFF); | 630 | via_write_reg(VIACR, 0x0D, addr & 0xFF); |
631 | viafb_write_reg(CR0C, VIACR, (addr >> 8) & 0xFF); | 631 | via_write_reg(VIACR, 0x0C, (addr >> 8) & 0xFF); |
632 | viafb_write_reg(CR34, VIACR, (addr >> 16) & 0xFF); | 632 | via_write_reg(VIACR, 0x34, (addr >> 16) & 0xFF); |
633 | viafb_write_reg_mask(CR48, VIACR, (addr >> 24) & 0x1F, 0x1F); | 633 | via_write_reg_mask(VIACR, 0x48, (addr >> 24) & 0x1F, 0x1F); |
634 | } | 634 | } |
635 | 635 | ||
636 | void viafb_set_secondary_address(u32 addr) | 636 | void via_set_secondary_address(u32 addr) |
637 | { | 637 | { |
638 | DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_address(0x%08X)\n", addr); | 638 | DEBUG_MSG(KERN_DEBUG "via_set_secondary_address(0x%08X)\n", addr); |
639 | /* secondary display supports only quadword aligned memory */ | 639 | /* secondary display supports only quadword aligned memory */ |
640 | viafb_write_reg_mask(CR62, VIACR, (addr >> 2) & 0xFE, 0xFE); | 640 | via_write_reg_mask(VIACR, 0x62, (addr >> 2) & 0xFE, 0xFE); |
641 | viafb_write_reg(CR63, VIACR, (addr >> 10) & 0xFF); | 641 | via_write_reg(VIACR, 0x63, (addr >> 10) & 0xFF); |
642 | viafb_write_reg(CR64, VIACR, (addr >> 18) & 0xFF); | 642 | via_write_reg(VIACR, 0x64, (addr >> 18) & 0xFF); |
643 | viafb_write_reg_mask(CRA3, VIACR, (addr >> 26) & 0x07, 0x07); | 643 | via_write_reg_mask(VIACR, 0xA3, (addr >> 26) & 0x07, 0x07); |
644 | } | 644 | } |
645 | 645 | ||
646 | void viafb_set_primary_pitch(u32 pitch) | 646 | void via_set_primary_pitch(u32 pitch) |
647 | { | 647 | { |
648 | DEBUG_MSG(KERN_DEBUG "viafb_set_primary_pitch(0x%08X)\n", pitch); | 648 | DEBUG_MSG(KERN_DEBUG "via_set_primary_pitch(0x%08X)\n", pitch); |
649 | /* spec does not say that first adapter skips 3 bits but old | 649 | /* spec does not say that first adapter skips 3 bits but old |
650 | * code did it and seems to be reasonable in analogy to 2nd adapter | 650 | * code did it and seems to be reasonable in analogy to 2nd adapter |
651 | */ | 651 | */ |
652 | pitch = pitch >> 3; | 652 | pitch = pitch >> 3; |
653 | viafb_write_reg(0x13, VIACR, pitch & 0xFF); | 653 | via_write_reg(VIACR, 0x13, pitch & 0xFF); |
654 | viafb_write_reg_mask(0x35, VIACR, (pitch >> (8 - 5)) & 0xE0, 0xE0); | 654 | via_write_reg_mask(VIACR, 0x35, (pitch >> (8 - 5)) & 0xE0, 0xE0); |
655 | } | 655 | } |
656 | 656 | ||
657 | void viafb_set_secondary_pitch(u32 pitch) | 657 | void via_set_secondary_pitch(u32 pitch) |
658 | { | 658 | { |
659 | DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_pitch(0x%08X)\n", pitch); | 659 | DEBUG_MSG(KERN_DEBUG "via_set_secondary_pitch(0x%08X)\n", pitch); |
660 | pitch = pitch >> 3; | 660 | pitch = pitch >> 3; |
661 | viafb_write_reg(0x66, VIACR, pitch & 0xFF); | 661 | via_write_reg(VIACR, 0x66, pitch & 0xFF); |
662 | viafb_write_reg_mask(0x67, VIACR, (pitch >> 8) & 0x03, 0x03); | 662 | via_write_reg_mask(VIACR, 0x67, (pitch >> 8) & 0x03, 0x03); |
663 | viafb_write_reg_mask(0x71, VIACR, (pitch >> (10 - 7)) & 0x80, 0x80); | 663 | via_write_reg_mask(VIACR, 0x71, (pitch >> (10 - 7)) & 0x80, 0x80); |
664 | } | 664 | } |
665 | 665 | ||
666 | void viafb_set_primary_color_depth(u8 depth) | 666 | void via_set_primary_color_depth(u8 depth) |
667 | { | 667 | { |
668 | u8 value; | 668 | u8 value; |
669 | 669 | ||
670 | DEBUG_MSG(KERN_DEBUG "viafb_set_primary_color_depth(%d)\n", depth); | 670 | DEBUG_MSG(KERN_DEBUG "via_set_primary_color_depth(%d)\n", depth); |
671 | switch (depth) { | 671 | switch (depth) { |
672 | case 8: | 672 | case 8: |
673 | value = 0x00; | 673 | value = 0x00; |
@@ -685,19 +685,19 @@ void viafb_set_primary_color_depth(u8 depth) | |||
685 | value = 0x08; | 685 | value = 0x08; |
686 | break; | 686 | break; |
687 | default: | 687 | default: |
688 | printk(KERN_WARNING "viafb_set_primary_color_depth: " | 688 | printk(KERN_WARNING "via_set_primary_color_depth: " |
689 | "Unsupported depth: %d\n", depth); | 689 | "Unsupported depth: %d\n", depth); |
690 | return; | 690 | return; |
691 | } | 691 | } |
692 | 692 | ||
693 | viafb_write_reg_mask(0x15, VIASR, value, 0x1C); | 693 | via_write_reg_mask(VIASR, 0x15, value, 0x1C); |
694 | } | 694 | } |
695 | 695 | ||
696 | void viafb_set_secondary_color_depth(u8 depth) | 696 | void via_set_secondary_color_depth(u8 depth) |
697 | { | 697 | { |
698 | u8 value; | 698 | u8 value; |
699 | 699 | ||
700 | DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_color_depth(%d)\n", depth); | 700 | DEBUG_MSG(KERN_DEBUG "via_set_secondary_color_depth(%d)\n", depth); |
701 | switch (depth) { | 701 | switch (depth) { |
702 | case 8: | 702 | case 8: |
703 | value = 0x00; | 703 | value = 0x00; |
@@ -712,12 +712,12 @@ void viafb_set_secondary_color_depth(u8 depth) | |||
712 | value = 0x80; | 712 | value = 0x80; |
713 | break; | 713 | break; |
714 | default: | 714 | default: |
715 | printk(KERN_WARNING "viafb_set_secondary_color_depth: " | 715 | printk(KERN_WARNING "via_set_secondary_color_depth: " |
716 | "Unsupported depth: %d\n", depth); | 716 | "Unsupported depth: %d\n", depth); |
717 | return; | 717 | return; |
718 | } | 718 | } |
719 | 719 | ||
720 | viafb_write_reg_mask(0x67, VIACR, value, 0xC0); | 720 | via_write_reg_mask(VIACR, 0x67, value, 0xC0); |
721 | } | 721 | } |
722 | 722 | ||
723 | static void set_color_register(u8 index, u8 red, u8 green, u8 blue) | 723 | static void set_color_register(u8 index, u8 red, u8 green, u8 blue) |
@@ -2268,11 +2268,11 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, | |||
2268 | } | 2268 | } |
2269 | } | 2269 | } |
2270 | 2270 | ||
2271 | viafb_set_primary_pitch(viafbinfo->fix.line_length); | 2271 | via_set_primary_pitch(viafbinfo->fix.line_length); |
2272 | viafb_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length | 2272 | via_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length |
2273 | : viafbinfo->fix.line_length); | 2273 | : viafbinfo->fix.line_length); |
2274 | viafb_set_primary_color_depth(viaparinfo->depth); | 2274 | via_set_primary_color_depth(viaparinfo->depth); |
2275 | viafb_set_secondary_color_depth(viafb_dual_fb ? viaparinfo1->depth | 2275 | via_set_secondary_color_depth(viafb_dual_fb ? viaparinfo1->depth |
2276 | : viaparinfo->depth); | 2276 | : viaparinfo->depth); |
2277 | /* Update Refresh Rate Setting */ | 2277 | /* Update Refresh Rate Setting */ |
2278 | 2278 | ||