aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorJoseph Chan <JosephChan@via.com.tw>2008-10-16 01:03:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:42 -0400
commitb3a45d8e5d9049c3a47b3f97405b4123bef5155b (patch)
tree88c6d13863c581dd833fecf1919afe91d9d5676a /drivers/video/via
parent29b619fae69a0638ce10d5d6bb3c53f5d3ca0390 (diff)
viafb: viafbdev.c (update)
Remove the macro MMIO_OUT32, and replace it with writel() function. And replace "u32" with "unsigned long" in writel() function (original MMIO_OUT32 marco) for avoiding warning message in 64bit OS. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/viafbdev.c110
1 files changed, 57 insertions, 53 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index ba8ce61140c9..0132eae06f55 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -896,30 +896,32 @@ static void viafb_fillrect(struct fb_info *info,
896 } 896 }
897 897
898 /* BitBlt Source Address */ 898 /* BitBlt Source Address */
899 MMIO_OUT32(VIA_REG_SRCPOS, 0x0); 899 writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS);
900 /* Source Base Address */ 900 /* Source Base Address */
901 MMIO_OUT32(VIA_REG_SRCBASE, 0x0); 901 writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE);
902 /* Destination Base Address */ 902 /* Destination Base Address */
903 /*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ 903 writel(((unsigned long) (info->screen_base) -
904 MMIO_OUT32(VIA_REG_DSTBASE, 904 (unsigned long) viafb_FB_MM) >> 3,
905 ((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); 905 viaparinfo->io_virt + VIA_REG_DSTBASE);
906 /* Pitch */ 906 /* Pitch */
907 pitch = (info->var.xres_virtual + 7) & ~7; 907 pitch = (info->var.xres_virtual + 7) & ~7;
908 MMIO_OUT32(VIA_REG_PITCH, 908 writel(VIA_PITCH_ENABLE |
909 VIA_PITCH_ENABLE |
910 (((pitch * 909 (((pitch *
911 info->var.bits_per_pixel >> 3) >> 3) | 910 info->var.bits_per_pixel >> 3) >> 3) |
912 (((pitch * info-> 911 (((pitch * info->
913 var.bits_per_pixel >> 3) >> 3) << 16))); 912 var.bits_per_pixel >> 3) >> 3) << 16)),
913 viaparinfo->io_virt + VIA_REG_PITCH);
914 /* BitBlt Destination Address */ 914 /* BitBlt Destination Address */
915 MMIO_OUT32(VIA_REG_DSTPOS, ((rect->dy << 16) | rect->dx)); 915 writel(((rect->dy << 16) | rect->dx),
916 viaparinfo->io_virt + VIA_REG_DSTPOS);
916 /* Dimension: width & height */ 917 /* Dimension: width & height */
917 MMIO_OUT32(VIA_REG_DIMENSION, 918 writel((((rect->height - 1) << 16) | (rect->width - 1)),
918 (((rect->height - 1) << 16) | (rect->width - 1))); 919 viaparinfo->io_virt + VIA_REG_DIMENSION);
919 /* Forground color or Destination color */ 920 /* Forground color or Destination color */
920 MMIO_OUT32(VIA_REG_FGCOLOR, col); 921 writel(col, viaparinfo->io_virt + VIA_REG_FGCOLOR);
921 /* GE Command */ 922 /* GE Command */
922 MMIO_OUT32(VIA_REG_GECMD, (0x01 | 0x2000 | (rop << 24))); 923 writel((0x01 | 0x2000 | (rop << 24)),
924 viaparinfo->io_virt + VIA_REG_GECMD);
923 925
924} 926}
925 927
@@ -951,33 +953,34 @@ static void viafb_copyarea(struct fb_info *info,
951 } 953 }
952 954
953 /* Source Base Address */ 955 /* Source Base Address */
954 /*MMIO_OUT32(VIA_REG_SRCBASE, 0x0); */ 956 writel(((unsigned long) (info->screen_base) -
955 MMIO_OUT32(VIA_REG_SRCBASE, 957 (unsigned long) viafb_FB_MM) >> 3,
956 ((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); 958 viaparinfo->io_virt + VIA_REG_SRCBASE);
957 /* Destination Base Address */ 959 /* Destination Base Address */
958 /*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ 960 writel(((unsigned long) (info->screen_base) -
959 MMIO_OUT32(VIA_REG_DSTBASE, 961 (unsigned long) viafb_FB_MM) >> 3,
960 ((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); 962 viaparinfo->io_virt + VIA_REG_DSTBASE);
961 /* Pitch */ 963 /* Pitch */
962 pitch = (info->var.xres_virtual + 7) & ~7; 964 pitch = (info->var.xres_virtual + 7) & ~7;
963 /* VIA_PITCH_ENABLE can be omitted now. */ 965 /* VIA_PITCH_ENABLE can be omitted now. */
964 MMIO_OUT32(VIA_REG_PITCH, 966 writel(VIA_PITCH_ENABLE |
965 VIA_PITCH_ENABLE |
966 (((pitch * 967 (((pitch *
967 info->var.bits_per_pixel >> 3) >> 3) | (((pitch * 968 info->var.bits_per_pixel >> 3) >> 3) | (((pitch *
968 info->var. 969 info->var.
969 bits_per_pixel 970 bits_per_pixel
970 >> 3) >> 3) 971 >> 3) >> 3)
971 << 16))); 972 << 16)),
973 viaparinfo->io_virt + VIA_REG_PITCH);
972 /* BitBlt Source Address */ 974 /* BitBlt Source Address */
973 MMIO_OUT32(VIA_REG_SRCPOS, ((sy << 16) | sx)); 975 writel(((sy << 16) | sx), viaparinfo->io_virt + VIA_REG_SRCPOS);
974 /* BitBlt Destination Address */ 976 /* BitBlt Destination Address */
975 MMIO_OUT32(VIA_REG_DSTPOS, ((dy << 16) | dx)); 977 writel(((dy << 16) | dx), viaparinfo->io_virt + VIA_REG_DSTPOS);
976 /* Dimension: width & height */ 978 /* Dimension: width & height */
977 MMIO_OUT32(VIA_REG_DIMENSION, 979 writel((((area->height - 1) << 16) | (area->width - 1)),
978 (((area->height - 1) << 16) | (area->width - 1))); 980 viaparinfo->io_virt + VIA_REG_DIMENSION);
979 /* GE Command */ 981 /* GE Command */
980 MMIO_OUT32(VIA_REG_GECMD, (0x01 | direction | (0xCC << 24))); 982 writel((0x01 | direction | (0xCC << 24)),
983 viaparinfo->io_virt + VIA_REG_GECMD);
981 984
982} 985}
983 986
@@ -1010,37 +1013,38 @@ static void viafb_imageblit(struct fb_info *info,
1010 size = image->width * image->height; 1013 size = image->width * image->height;
1011 1014
1012 /* Source Base Address */ 1015 /* Source Base Address */
1013 MMIO_OUT32(VIA_REG_SRCBASE, 0x0); 1016 writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE);
1014 /* Destination Base Address */ 1017 /* Destination Base Address */
1015 /*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ 1018 writel(((unsigned long) (info->screen_base) -
1016 MMIO_OUT32(VIA_REG_DSTBASE, 1019 (unsigned long) viafb_FB_MM) >> 3,
1017 ((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); 1020 viaparinfo->io_virt + VIA_REG_DSTBASE);
1018 /* Pitch */ 1021 /* Pitch */
1019 pitch = (info->var.xres_virtual + 7) & ~7; 1022 pitch = (info->var.xres_virtual + 7) & ~7;
1020 MMIO_OUT32(VIA_REG_PITCH, 1023 writel(VIA_PITCH_ENABLE |
1021 VIA_PITCH_ENABLE |
1022 (((pitch * 1024 (((pitch *
1023 info->var.bits_per_pixel >> 3) >> 3) | (((pitch * 1025 info->var.bits_per_pixel >> 3) >> 3) | (((pitch *
1024 info->var. 1026 info->var.
1025 bits_per_pixel 1027 bits_per_pixel
1026 >> 3) >> 3) 1028 >> 3) >> 3)
1027 << 16))); 1029 << 16)),
1030 viaparinfo->io_virt + VIA_REG_PITCH);
1028 /* BitBlt Source Address */ 1031 /* BitBlt Source Address */
1029 MMIO_OUT32(VIA_REG_SRCPOS, 0x0); 1032 writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS);
1030 /* BitBlt Destination Address */ 1033 /* BitBlt Destination Address */
1031 MMIO_OUT32(VIA_REG_DSTPOS, ((image->dy << 16) | image->dx)); 1034 writel(((image->dy << 16) | image->dx),
1035 viaparinfo->io_virt + VIA_REG_DSTPOS);
1032 /* Dimension: width & height */ 1036 /* Dimension: width & height */
1033 MMIO_OUT32(VIA_REG_DIMENSION, 1037 writel((((image->height - 1) << 16) | (image->width - 1)),
1034 (((image->height - 1) << 16) | (image->width - 1))); 1038 viaparinfo->io_virt + VIA_REG_DIMENSION);
1035 /* fb color */ 1039 /* fb color */
1036 MMIO_OUT32(VIA_REG_FGCOLOR, fg_col); 1040 writel(fg_col, viaparinfo->io_virt + VIA_REG_FGCOLOR);
1037 /* bg color */ 1041 /* bg color */
1038 MMIO_OUT32(VIA_REG_BGCOLOR, bg_col); 1042 writel(bg_col, viaparinfo->io_virt + VIA_REG_BGCOLOR);
1039 /* GE Command */ 1043 /* GE Command */
1040 MMIO_OUT32(VIA_REG_GECMD, 0xCC020142); 1044 writel(0xCC020142, viaparinfo->io_virt + VIA_REG_GECMD);
1041 1045
1042 for (i = 0; i < size / 4; i++) { 1046 for (i = 0; i < size / 4; i++) {
1043 MMIO_OUT32(VIA_MMIO_BLTBASE, *udata); 1047 writel(*udata, viaparinfo->io_virt + VIA_MMIO_BLTBASE);
1044 udata++; 1048 udata++;
1045 } 1049 }
1046 1050
@@ -1080,7 +1084,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1080 if (cursor->set & FB_CUR_SETHOT) { 1084 if (cursor->set & FB_CUR_SETHOT) {
1081 viacursor.hot = cursor->hot; 1085 viacursor.hot = cursor->hot;
1082 temp = ((viacursor.hot.x) << 16) + viacursor.hot.y; 1086 temp = ((viacursor.hot.x) << 16) + viacursor.hot.y;
1083 MMIO_OUT32(VIA_REG_CURSOR_ORG, temp); 1087 writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_ORG);
1084 } 1088 }
1085 1089
1086 if (cursor->set & FB_CUR_SETPOS) { 1090 if (cursor->set & FB_CUR_SETPOS) {
@@ -1090,11 +1094,11 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1090 xx = cursor->image.dx - info->var.xoffset; 1094 xx = cursor->image.dx - info->var.xoffset;
1091 temp = yy & 0xFFFF; 1095 temp = yy & 0xFFFF;
1092 temp |= (xx << 16); 1096 temp |= (xx << 16);
1093 MMIO_OUT32(VIA_REG_CURSOR_POS, temp); 1097 writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_POS);
1094 } 1098 }
1095 1099
1096 if (cursor->set & FB_CUR_SETSIZE) { 1100 if (cursor->set & FB_CUR_SETSIZE) {
1097 temp = MMIO_IN32(VIA_REG_CURSOR_MODE); 1101 temp = readl(viaparinfo->io_virt + VIA_REG_CURSOR_MODE);
1098 1102
1099 if ((cursor->image.width <= 32) 1103 if ((cursor->image.width <= 32)
1100 && (cursor->image.height <= 32)) { 1104 && (cursor->image.height <= 32)) {
@@ -1109,7 +1113,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1109 "The cursor image is biger than 64x64 bits...\n"); 1113 "The cursor image is biger than 64x64 bits...\n");
1110 return -ENXIO; 1114 return -ENXIO;
1111 } 1115 }
1112 MMIO_OUT32(VIA_REG_CURSOR_MODE, temp); 1116 writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_MODE);
1113 1117
1114 viacursor.image.height = cursor->image.height; 1118 viacursor.image.height = cursor->image.height;
1115 viacursor.image.width = cursor->image.width; 1119 viacursor.image.width = cursor->image.width;
@@ -1169,8 +1173,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1169 0xFFC0) >> 6); 1173 0xFFC0) >> 6);
1170 } 1174 }
1171 1175
1172 MMIO_OUT32(VIA_REG_CURSOR_BG, bg_col); 1176 writel(bg_col, viaparinfo->io_virt + VIA_REG_CURSOR_BG);
1173 MMIO_OUT32(VIA_REG_CURSOR_FG, fg_col); 1177 writel(fg_col, viaparinfo->io_virt + VIA_REG_CURSOR_FG);
1174 } 1178 }
1175 1179
1176 if (cursor->set & FB_CUR_SETSHAPE) { 1180 if (cursor->set & FB_CUR_SETSHAPE) {
@@ -2116,15 +2120,15 @@ static int __devinit via_pci_probe(void)
2116 2120
2117 viaparinfo = (struct viafb_par *)viafbinfo->par; 2121 viaparinfo = (struct viafb_par *)viafbinfo->par;
2118 viaparinfo->tmds_setting_info = (struct tmds_setting_information *) 2122 viaparinfo->tmds_setting_info = (struct tmds_setting_information *)
2119 ((u32)viaparinfo + viafb_par_length); 2123 ((unsigned long)viaparinfo + viafb_par_length);
2120 viaparinfo->lvds_setting_info = (struct lvds_setting_information *) 2124 viaparinfo->lvds_setting_info = (struct lvds_setting_information *)
2121 ((u32)viaparinfo->tmds_setting_info + tmds_length); 2125 ((unsigned long)viaparinfo->tmds_setting_info + tmds_length);
2122 viaparinfo->lvds_setting_info2 = (struct lvds_setting_information *) 2126 viaparinfo->lvds_setting_info2 = (struct lvds_setting_information *)
2123 ((u32)viaparinfo->lvds_setting_info + lvds_length); 2127 ((unsigned long)viaparinfo->lvds_setting_info + lvds_length);
2124 viaparinfo->crt_setting_info = (struct crt_setting_information *) 2128 viaparinfo->crt_setting_info = (struct crt_setting_information *)
2125 ((u32)viaparinfo->lvds_setting_info2 + lvds_length); 2129 ((unsigned long)viaparinfo->lvds_setting_info2 + lvds_length);
2126 viaparinfo->chip_info = (struct chip_information *) 2130 viaparinfo->chip_info = (struct chip_information *)
2127 ((u32)viaparinfo->crt_setting_info + crt_length); 2131 ((unsigned long)viaparinfo->crt_setting_info + crt_length);
2128 2132
2129 if (viafb_dual_fb) 2133 if (viafb_dual_fb)
2130 viafb_SAMM_ON = 1; 2134 viafb_SAMM_ON = 1;