aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3fb.c
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2011-01-11 18:51:26 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-03-22 02:47:07 -0400
commitea770789dce2d27afab39c3891a475624acbd82f (patch)
tree352ed0f19b74bff7dc6b80f7e05e7bf35b1f5d3f /drivers/video/s3fb.c
parentd907ec04cc498e11e039e0fff8eb58cf01e885da (diff)
svga: Make svga_wcrt_mask() take an iomem regbase pointer.
Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/s3fb.c')
-rw-r--r--drivers/video/s3fb.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index efe77b683bfa..ece99f2044f4 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -507,11 +507,11 @@ static int s3fb_set_par(struct fb_info *info)
507 vga_wcrt(NULL, 0x38, 0x48); 507 vga_wcrt(NULL, 0x38, 0x48);
508 vga_wcrt(NULL, 0x39, 0xA5); 508 vga_wcrt(NULL, 0x39, 0xA5);
509 vga_wseq(NULL, 0x08, 0x06); 509 vga_wseq(NULL, 0x08, 0x06);
510 svga_wcrt_mask(0x11, 0x00, 0x80); 510 svga_wcrt_mask(par->state.vgabase, 0x11, 0x00, 0x80);
511 511
512 /* Blank screen and turn off sync */ 512 /* Blank screen and turn off sync */
513 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); 513 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
514 svga_wcrt_mask(0x17, 0x00, 0x80); 514 svga_wcrt_mask(par->state.vgabase, 0x17, 0x00, 0x80);
515 515
516 /* Set default values */ 516 /* Set default values */
517 svga_set_default_gfx_regs(par->state.vgabase); 517 svga_set_default_gfx_regs(par->state.vgabase);
@@ -522,20 +522,20 @@ static int s3fb_set_par(struct fb_info *info)
522 svga_wcrt_multi(par->state.vgabase, s3_start_address_regs, 0); 522 svga_wcrt_multi(par->state.vgabase, s3_start_address_regs, 0);
523 523
524 /* S3 specific initialization */ 524 /* S3 specific initialization */
525 svga_wcrt_mask(0x58, 0x10, 0x10); /* enable linear framebuffer */ 525 svga_wcrt_mask(par->state.vgabase, 0x58, 0x10, 0x10); /* enable linear framebuffer */
526 svga_wcrt_mask(0x31, 0x08, 0x08); /* enable sequencer access to framebuffer above 256 kB */ 526 svga_wcrt_mask(par->state.vgabase, 0x31, 0x08, 0x08); /* enable sequencer access to framebuffer above 256 kB */
527 527
528/* svga_wcrt_mask(0x33, 0x08, 0x08); */ /* DDR ? */ 528/* svga_wcrt_mask(par->state.vgabase, 0x33, 0x08, 0x08); */ /* DDR ? */
529/* svga_wcrt_mask(0x43, 0x01, 0x01); */ /* DDR ? */ 529/* svga_wcrt_mask(par->state.vgabase, 0x43, 0x01, 0x01); */ /* DDR ? */
530 svga_wcrt_mask(0x33, 0x00, 0x08); /* no DDR ? */ 530 svga_wcrt_mask(par->state.vgabase, 0x33, 0x00, 0x08); /* no DDR ? */
531 svga_wcrt_mask(0x43, 0x00, 0x01); /* no DDR ? */ 531 svga_wcrt_mask(par->state.vgabase, 0x43, 0x00, 0x01); /* no DDR ? */
532 532
533 svga_wcrt_mask(0x5D, 0x00, 0x28); /* Clear strange HSlen bits */ 533 svga_wcrt_mask(par->state.vgabase, 0x5D, 0x00, 0x28); /* Clear strange HSlen bits */
534 534
535/* svga_wcrt_mask(0x58, 0x03, 0x03); */ 535/* svga_wcrt_mask(par->state.vgabase, 0x58, 0x03, 0x03); */
536 536
537/* svga_wcrt_mask(0x53, 0x12, 0x13); */ /* enable MMIO */ 537/* svga_wcrt_mask(par->state.vgabase, 0x53, 0x12, 0x13); */ /* enable MMIO */
538/* svga_wcrt_mask(0x40, 0x08, 0x08); */ /* enable write buffer */ 538/* svga_wcrt_mask(par->state.vgabase, 0x40, 0x08, 0x08); */ /* enable write buffer */
539 539
540 540
541 /* Set the offset register */ 541 /* Set the offset register */
@@ -555,19 +555,19 @@ static int s3fb_set_par(struct fb_info *info)
555 svga_wattr(par->state.vgabase, 0x33, 0x00); 555 svga_wattr(par->state.vgabase, 0x33, 0x00);
556 556
557 if (info->var.vmode & FB_VMODE_DOUBLE) 557 if (info->var.vmode & FB_VMODE_DOUBLE)
558 svga_wcrt_mask(0x09, 0x80, 0x80); 558 svga_wcrt_mask(par->state.vgabase, 0x09, 0x80, 0x80);
559 else 559 else
560 svga_wcrt_mask(0x09, 0x00, 0x80); 560 svga_wcrt_mask(par->state.vgabase, 0x09, 0x00, 0x80);
561 561
562 if (info->var.vmode & FB_VMODE_INTERLACED) 562 if (info->var.vmode & FB_VMODE_INTERLACED)
563 svga_wcrt_mask(0x42, 0x20, 0x20); 563 svga_wcrt_mask(par->state.vgabase, 0x42, 0x20, 0x20);
564 else 564 else
565 svga_wcrt_mask(0x42, 0x00, 0x20); 565 svga_wcrt_mask(par->state.vgabase, 0x42, 0x00, 0x20);
566 566
567 /* Disable hardware graphics cursor */ 567 /* Disable hardware graphics cursor */
568 svga_wcrt_mask(0x45, 0x00, 0x01); 568 svga_wcrt_mask(par->state.vgabase, 0x45, 0x00, 0x01);
569 /* Disable Streams engine */ 569 /* Disable Streams engine */
570 svga_wcrt_mask(0x67, 0x00, 0x0C); 570 svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0x0C);
571 571
572 mode = svga_match_format(s3fb_formats, &(info->var), &(info->fix)); 572 mode = svga_match_format(s3fb_formats, &(info->var), &(info->fix));
573 573
@@ -596,7 +596,7 @@ static int s3fb_set_par(struct fb_info *info)
596 vga_wcrt(NULL, 0x66, 0x81); 596 vga_wcrt(NULL, 0x66, 0x81);
597 } 597 }
598 598
599 svga_wcrt_mask(0x31, 0x00, 0x40); 599 svga_wcrt_mask(par->state.vgabase, 0x31, 0x00, 0x40);
600 multiplex = 0; 600 multiplex = 0;
601 hmul = 1; 601 hmul = 1;
602 602
@@ -607,15 +607,15 @@ static int s3fb_set_par(struct fb_info *info)
607 svga_set_textmode_vga_regs(); 607 svga_set_textmode_vga_regs();
608 608
609 /* Set additional registers like in 8-bit mode */ 609 /* Set additional registers like in 8-bit mode */
610 svga_wcrt_mask(0x50, 0x00, 0x30); 610 svga_wcrt_mask(par->state.vgabase, 0x50, 0x00, 0x30);
611 svga_wcrt_mask(0x67, 0x00, 0xF0); 611 svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
612 612
613 /* Disable enhanced mode */ 613 /* Disable enhanced mode */
614 svga_wcrt_mask(0x3A, 0x00, 0x30); 614 svga_wcrt_mask(par->state.vgabase, 0x3A, 0x00, 0x30);
615 615
616 if (fasttext) { 616 if (fasttext) {
617 pr_debug("fb%d: high speed text mode set\n", info->node); 617 pr_debug("fb%d: high speed text mode set\n", info->node);
618 svga_wcrt_mask(0x31, 0x40, 0x40); 618 svga_wcrt_mask(par->state.vgabase, 0x31, 0x40, 0x40);
619 } 619 }
620 break; 620 break;
621 case 1: 621 case 1:
@@ -623,32 +623,32 @@ static int s3fb_set_par(struct fb_info *info)
623 vga_wgfx(NULL, VGA_GFX_MODE, 0x40); 623 vga_wgfx(NULL, VGA_GFX_MODE, 0x40);
624 624
625 /* Set additional registers like in 8-bit mode */ 625 /* Set additional registers like in 8-bit mode */
626 svga_wcrt_mask(0x50, 0x00, 0x30); 626 svga_wcrt_mask(par->state.vgabase, 0x50, 0x00, 0x30);
627 svga_wcrt_mask(0x67, 0x00, 0xF0); 627 svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
628 628
629 /* disable enhanced mode */ 629 /* disable enhanced mode */
630 svga_wcrt_mask(0x3A, 0x00, 0x30); 630 svga_wcrt_mask(par->state.vgabase, 0x3A, 0x00, 0x30);
631 break; 631 break;
632 case 2: 632 case 2:
633 pr_debug("fb%d: 4 bit pseudocolor, planar\n", info->node); 633 pr_debug("fb%d: 4 bit pseudocolor, planar\n", info->node);
634 634
635 /* Set additional registers like in 8-bit mode */ 635 /* Set additional registers like in 8-bit mode */
636 svga_wcrt_mask(0x50, 0x00, 0x30); 636 svga_wcrt_mask(par->state.vgabase, 0x50, 0x00, 0x30);
637 svga_wcrt_mask(0x67, 0x00, 0xF0); 637 svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
638 638
639 /* disable enhanced mode */ 639 /* disable enhanced mode */
640 svga_wcrt_mask(0x3A, 0x00, 0x30); 640 svga_wcrt_mask(par->state.vgabase, 0x3A, 0x00, 0x30);
641 break; 641 break;
642 case 3: 642 case 3:
643 pr_debug("fb%d: 8 bit pseudocolor\n", info->node); 643 pr_debug("fb%d: 8 bit pseudocolor\n", info->node);
644 svga_wcrt_mask(0x50, 0x00, 0x30); 644 svga_wcrt_mask(par->state.vgabase, 0x50, 0x00, 0x30);
645 if (info->var.pixclock > 20000 || 645 if (info->var.pixclock > 20000 ||
646 par->chip == CHIP_360_TRIO3D_1X || 646 par->chip == CHIP_360_TRIO3D_1X ||
647 par->chip == CHIP_362_TRIO3D_2X || 647 par->chip == CHIP_362_TRIO3D_2X ||
648 par->chip == CHIP_368_TRIO3D_2X) 648 par->chip == CHIP_368_TRIO3D_2X)
649 svga_wcrt_mask(0x67, 0x00, 0xF0); 649 svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
650 else { 650 else {
651 svga_wcrt_mask(0x67, 0x10, 0xF0); 651 svga_wcrt_mask(par->state.vgabase, 0x67, 0x10, 0xF0);
652 multiplex = 1; 652 multiplex = 1;
653 } 653 }
654 break; 654 break;
@@ -656,12 +656,12 @@ static int s3fb_set_par(struct fb_info *info)
656 pr_debug("fb%d: 5/5/5 truecolor\n", info->node); 656 pr_debug("fb%d: 5/5/5 truecolor\n", info->node);
657 if (par->chip == CHIP_988_VIRGE_VX) { 657 if (par->chip == CHIP_988_VIRGE_VX) {
658 if (info->var.pixclock > 20000) 658 if (info->var.pixclock > 20000)
659 svga_wcrt_mask(0x67, 0x20, 0xF0); 659 svga_wcrt_mask(par->state.vgabase, 0x67, 0x20, 0xF0);
660 else 660 else
661 svga_wcrt_mask(0x67, 0x30, 0xF0); 661 svga_wcrt_mask(par->state.vgabase, 0x67, 0x30, 0xF0);
662 } else { 662 } else {
663 svga_wcrt_mask(0x50, 0x10, 0x30); 663 svga_wcrt_mask(par->state.vgabase, 0x50, 0x10, 0x30);
664 svga_wcrt_mask(0x67, 0x30, 0xF0); 664 svga_wcrt_mask(par->state.vgabase, 0x67, 0x30, 0xF0);
665 if (par->chip != CHIP_360_TRIO3D_1X && 665 if (par->chip != CHIP_360_TRIO3D_1X &&
666 par->chip != CHIP_362_TRIO3D_2X && 666 par->chip != CHIP_362_TRIO3D_2X &&
667 par->chip != CHIP_368_TRIO3D_2X) 667 par->chip != CHIP_368_TRIO3D_2X)
@@ -672,12 +672,12 @@ static int s3fb_set_par(struct fb_info *info)
672 pr_debug("fb%d: 5/6/5 truecolor\n", info->node); 672 pr_debug("fb%d: 5/6/5 truecolor\n", info->node);
673 if (par->chip == CHIP_988_VIRGE_VX) { 673 if (par->chip == CHIP_988_VIRGE_VX) {
674 if (info->var.pixclock > 20000) 674 if (info->var.pixclock > 20000)
675 svga_wcrt_mask(0x67, 0x40, 0xF0); 675 svga_wcrt_mask(par->state.vgabase, 0x67, 0x40, 0xF0);
676 else 676 else
677 svga_wcrt_mask(0x67, 0x50, 0xF0); 677 svga_wcrt_mask(par->state.vgabase, 0x67, 0x50, 0xF0);
678 } else { 678 } else {
679 svga_wcrt_mask(0x50, 0x10, 0x30); 679 svga_wcrt_mask(par->state.vgabase, 0x50, 0x10, 0x30);
680 svga_wcrt_mask(0x67, 0x50, 0xF0); 680 svga_wcrt_mask(par->state.vgabase, 0x67, 0x50, 0xF0);
681 if (par->chip != CHIP_360_TRIO3D_1X && 681 if (par->chip != CHIP_360_TRIO3D_1X &&
682 par->chip != CHIP_362_TRIO3D_2X && 682 par->chip != CHIP_362_TRIO3D_2X &&
683 par->chip != CHIP_368_TRIO3D_2X) 683 par->chip != CHIP_368_TRIO3D_2X)
@@ -687,12 +687,12 @@ static int s3fb_set_par(struct fb_info *info)
687 case 6: 687 case 6:
688 /* VIRGE VX case */ 688 /* VIRGE VX case */
689 pr_debug("fb%d: 8/8/8 truecolor\n", info->node); 689 pr_debug("fb%d: 8/8/8 truecolor\n", info->node);
690 svga_wcrt_mask(0x67, 0xD0, 0xF0); 690 svga_wcrt_mask(par->state.vgabase, 0x67, 0xD0, 0xF0);
691 break; 691 break;
692 case 7: 692 case 7:
693 pr_debug("fb%d: 8/8/8/8 truecolor\n", info->node); 693 pr_debug("fb%d: 8/8/8/8 truecolor\n", info->node);
694 svga_wcrt_mask(0x50, 0x30, 0x30); 694 svga_wcrt_mask(par->state.vgabase, 0x50, 0x30, 0x30);
695 svga_wcrt_mask(0x67, 0xD0, 0xF0); 695 svga_wcrt_mask(par->state.vgabase, 0x67, 0xD0, 0xF0);
696 break; 696 break;
697 default: 697 default:
698 printk(KERN_ERR "fb%d: unsupported mode - bug\n", info->node); 698 printk(KERN_ERR "fb%d: unsupported mode - bug\n", info->node);
@@ -717,7 +717,7 @@ static int s3fb_set_par(struct fb_info *info)
717 717
718 memset_io(info->screen_base, 0x00, screen_size); 718 memset_io(info->screen_base, 0x00, screen_size);
719 /* Device and screen back on */ 719 /* Device and screen back on */
720 svga_wcrt_mask(0x17, 0x80, 0x80); 720 svga_wcrt_mask(par->state.vgabase, 0x17, 0x80, 0x80);
721 svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20); 721 svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20);
722 722
723 return 0; 723 return 0;
@@ -793,27 +793,27 @@ static int s3fb_blank(int blank_mode, struct fb_info *info)
793 switch (blank_mode) { 793 switch (blank_mode) {
794 case FB_BLANK_UNBLANK: 794 case FB_BLANK_UNBLANK:
795 pr_debug("fb%d: unblank\n", info->node); 795 pr_debug("fb%d: unblank\n", info->node);
796 svga_wcrt_mask(0x56, 0x00, 0x06); 796 svga_wcrt_mask(par->state.vgabase, 0x56, 0x00, 0x06);
797 svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20); 797 svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20);
798 break; 798 break;
799 case FB_BLANK_NORMAL: 799 case FB_BLANK_NORMAL:
800 pr_debug("fb%d: blank\n", info->node); 800 pr_debug("fb%d: blank\n", info->node);
801 svga_wcrt_mask(0x56, 0x00, 0x06); 801 svga_wcrt_mask(par->state.vgabase, 0x56, 0x00, 0x06);
802 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); 802 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
803 break; 803 break;
804 case FB_BLANK_HSYNC_SUSPEND: 804 case FB_BLANK_HSYNC_SUSPEND:
805 pr_debug("fb%d: hsync\n", info->node); 805 pr_debug("fb%d: hsync\n", info->node);
806 svga_wcrt_mask(0x56, 0x02, 0x06); 806 svga_wcrt_mask(par->state.vgabase, 0x56, 0x02, 0x06);
807 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); 807 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
808 break; 808 break;
809 case FB_BLANK_VSYNC_SUSPEND: 809 case FB_BLANK_VSYNC_SUSPEND:
810 pr_debug("fb%d: vsync\n", info->node); 810 pr_debug("fb%d: vsync\n", info->node);
811 svga_wcrt_mask(0x56, 0x04, 0x06); 811 svga_wcrt_mask(par->state.vgabase, 0x56, 0x04, 0x06);
812 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); 812 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
813 break; 813 break;
814 case FB_BLANK_POWERDOWN: 814 case FB_BLANK_POWERDOWN:
815 pr_debug("fb%d: sync down\n", info->node); 815 pr_debug("fb%d: sync down\n", info->node);
816 svga_wcrt_mask(0x56, 0x06, 0x06); 816 svga_wcrt_mask(par->state.vgabase, 0x56, 0x06, 0x06);
817 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); 817 svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20);
818 break; 818 break;
819 } 819 }