Commit b3a45d8e authored by Joseph Chan's avatar Joseph Chan Committed by Linus Torvalds

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: default avatarJoseph Chan <josephchan@via.com.tw>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 29b619fa
...@@ -896,30 +896,32 @@ static void viafb_fillrect(struct fb_info *info, ...@@ -896,30 +896,32 @@ static void viafb_fillrect(struct fb_info *info,
} }
/* BitBlt Source Address */ /* BitBlt Source Address */
MMIO_OUT32(VIA_REG_SRCPOS, 0x0); writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS);
/* Source Base Address */ /* Source Base Address */
MMIO_OUT32(VIA_REG_SRCBASE, 0x0); writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE);
/* Destination Base Address */ /* Destination Base Address */
/*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ writel(((unsigned long) (info->screen_base) -
MMIO_OUT32(VIA_REG_DSTBASE, (unsigned long) viafb_FB_MM) >> 3,
((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); viaparinfo->io_virt + VIA_REG_DSTBASE);
/* Pitch */ /* Pitch */
pitch = (info->var.xres_virtual + 7) & ~7; pitch = (info->var.xres_virtual + 7) & ~7;
MMIO_OUT32(VIA_REG_PITCH, writel(VIA_PITCH_ENABLE |
VIA_PITCH_ENABLE |
(((pitch * (((pitch *
info->var.bits_per_pixel >> 3) >> 3) | info->var.bits_per_pixel >> 3) >> 3) |
(((pitch * info-> (((pitch * info->
var.bits_per_pixel >> 3) >> 3) << 16))); var.bits_per_pixel >> 3) >> 3) << 16)),
viaparinfo->io_virt + VIA_REG_PITCH);
/* BitBlt Destination Address */ /* BitBlt Destination Address */
MMIO_OUT32(VIA_REG_DSTPOS, ((rect->dy << 16) | rect->dx)); writel(((rect->dy << 16) | rect->dx),
viaparinfo->io_virt + VIA_REG_DSTPOS);
/* Dimension: width & height */ /* Dimension: width & height */
MMIO_OUT32(VIA_REG_DIMENSION, writel((((rect->height - 1) << 16) | (rect->width - 1)),
(((rect->height - 1) << 16) | (rect->width - 1))); viaparinfo->io_virt + VIA_REG_DIMENSION);
/* Forground color or Destination color */ /* Forground color or Destination color */
MMIO_OUT32(VIA_REG_FGCOLOR, col); writel(col, viaparinfo->io_virt + VIA_REG_FGCOLOR);
/* GE Command */ /* GE Command */
MMIO_OUT32(VIA_REG_GECMD, (0x01 | 0x2000 | (rop << 24))); writel((0x01 | 0x2000 | (rop << 24)),
viaparinfo->io_virt + VIA_REG_GECMD);
} }
...@@ -951,33 +953,34 @@ static void viafb_copyarea(struct fb_info *info, ...@@ -951,33 +953,34 @@ static void viafb_copyarea(struct fb_info *info,
} }
/* Source Base Address */ /* Source Base Address */
/*MMIO_OUT32(VIA_REG_SRCBASE, 0x0); */ writel(((unsigned long) (info->screen_base) -
MMIO_OUT32(VIA_REG_SRCBASE, (unsigned long) viafb_FB_MM) >> 3,
((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); viaparinfo->io_virt + VIA_REG_SRCBASE);
/* Destination Base Address */ /* Destination Base Address */
/*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ writel(((unsigned long) (info->screen_base) -
MMIO_OUT32(VIA_REG_DSTBASE, (unsigned long) viafb_FB_MM) >> 3,
((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); viaparinfo->io_virt + VIA_REG_DSTBASE);
/* Pitch */ /* Pitch */
pitch = (info->var.xres_virtual + 7) & ~7; pitch = (info->var.xres_virtual + 7) & ~7;
/* VIA_PITCH_ENABLE can be omitted now. */ /* VIA_PITCH_ENABLE can be omitted now. */
MMIO_OUT32(VIA_REG_PITCH, writel(VIA_PITCH_ENABLE |
VIA_PITCH_ENABLE |
(((pitch * (((pitch *
info->var.bits_per_pixel >> 3) >> 3) | (((pitch * info->var.bits_per_pixel >> 3) >> 3) | (((pitch *
info->var. info->var.
bits_per_pixel bits_per_pixel
>> 3) >> 3) >> 3) >> 3)
<< 16))); << 16)),
viaparinfo->io_virt + VIA_REG_PITCH);
/* BitBlt Source Address */ /* BitBlt Source Address */
MMIO_OUT32(VIA_REG_SRCPOS, ((sy << 16) | sx)); writel(((sy << 16) | sx), viaparinfo->io_virt + VIA_REG_SRCPOS);
/* BitBlt Destination Address */ /* BitBlt Destination Address */
MMIO_OUT32(VIA_REG_DSTPOS, ((dy << 16) | dx)); writel(((dy << 16) | dx), viaparinfo->io_virt + VIA_REG_DSTPOS);
/* Dimension: width & height */ /* Dimension: width & height */
MMIO_OUT32(VIA_REG_DIMENSION, writel((((area->height - 1) << 16) | (area->width - 1)),
(((area->height - 1) << 16) | (area->width - 1))); viaparinfo->io_virt + VIA_REG_DIMENSION);
/* GE Command */ /* GE Command */
MMIO_OUT32(VIA_REG_GECMD, (0x01 | direction | (0xCC << 24))); writel((0x01 | direction | (0xCC << 24)),
viaparinfo->io_virt + VIA_REG_GECMD);
} }
...@@ -1010,37 +1013,38 @@ static void viafb_imageblit(struct fb_info *info, ...@@ -1010,37 +1013,38 @@ static void viafb_imageblit(struct fb_info *info,
size = image->width * image->height; size = image->width * image->height;
/* Source Base Address */ /* Source Base Address */
MMIO_OUT32(VIA_REG_SRCBASE, 0x0); writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE);
/* Destination Base Address */ /* Destination Base Address */
/*MMIO_OUT32(VIA_REG_DSTBASE, 0x0); */ writel(((unsigned long) (info->screen_base) -
MMIO_OUT32(VIA_REG_DSTBASE, (unsigned long) viafb_FB_MM) >> 3,
((u32) (info->screen_base) - (u32) viafb_FB_MM) >> 3); viaparinfo->io_virt + VIA_REG_DSTBASE);
/* Pitch */ /* Pitch */
pitch = (info->var.xres_virtual + 7) & ~7; pitch = (info->var.xres_virtual + 7) & ~7;
MMIO_OUT32(VIA_REG_PITCH, writel(VIA_PITCH_ENABLE |
VIA_PITCH_ENABLE |
(((pitch * (((pitch *
info->var.bits_per_pixel >> 3) >> 3) | (((pitch * info->var.bits_per_pixel >> 3) >> 3) | (((pitch *
info->var. info->var.
bits_per_pixel bits_per_pixel
>> 3) >> 3) >> 3) >> 3)
<< 16))); << 16)),
viaparinfo->io_virt + VIA_REG_PITCH);
/* BitBlt Source Address */ /* BitBlt Source Address */
MMIO_OUT32(VIA_REG_SRCPOS, 0x0); writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS);
/* BitBlt Destination Address */ /* BitBlt Destination Address */
MMIO_OUT32(VIA_REG_DSTPOS, ((image->dy << 16) | image->dx)); writel(((image->dy << 16) | image->dx),
viaparinfo->io_virt + VIA_REG_DSTPOS);
/* Dimension: width & height */ /* Dimension: width & height */
MMIO_OUT32(VIA_REG_DIMENSION, writel((((image->height - 1) << 16) | (image->width - 1)),
(((image->height - 1) << 16) | (image->width - 1))); viaparinfo->io_virt + VIA_REG_DIMENSION);
/* fb color */ /* fb color */
MMIO_OUT32(VIA_REG_FGCOLOR, fg_col); writel(fg_col, viaparinfo->io_virt + VIA_REG_FGCOLOR);
/* bg color */ /* bg color */
MMIO_OUT32(VIA_REG_BGCOLOR, bg_col); writel(bg_col, viaparinfo->io_virt + VIA_REG_BGCOLOR);
/* GE Command */ /* GE Command */
MMIO_OUT32(VIA_REG_GECMD, 0xCC020142); writel(0xCC020142, viaparinfo->io_virt + VIA_REG_GECMD);
for (i = 0; i < size / 4; i++) { for (i = 0; i < size / 4; i++) {
MMIO_OUT32(VIA_MMIO_BLTBASE, *udata); writel(*udata, viaparinfo->io_virt + VIA_MMIO_BLTBASE);
udata++; udata++;
} }
...@@ -1080,7 +1084,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1080,7 +1084,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
if (cursor->set & FB_CUR_SETHOT) { if (cursor->set & FB_CUR_SETHOT) {
viacursor.hot = cursor->hot; viacursor.hot = cursor->hot;
temp = ((viacursor.hot.x) << 16) + viacursor.hot.y; temp = ((viacursor.hot.x) << 16) + viacursor.hot.y;
MMIO_OUT32(VIA_REG_CURSOR_ORG, temp); writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_ORG);
} }
if (cursor->set & FB_CUR_SETPOS) { if (cursor->set & FB_CUR_SETPOS) {
...@@ -1090,11 +1094,11 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1090,11 +1094,11 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
xx = cursor->image.dx - info->var.xoffset; xx = cursor->image.dx - info->var.xoffset;
temp = yy & 0xFFFF; temp = yy & 0xFFFF;
temp |= (xx << 16); temp |= (xx << 16);
MMIO_OUT32(VIA_REG_CURSOR_POS, temp); writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_POS);
} }
if (cursor->set & FB_CUR_SETSIZE) { if (cursor->set & FB_CUR_SETSIZE) {
temp = MMIO_IN32(VIA_REG_CURSOR_MODE); temp = readl(viaparinfo->io_virt + VIA_REG_CURSOR_MODE);
if ((cursor->image.width <= 32) if ((cursor->image.width <= 32)
&& (cursor->image.height <= 32)) { && (cursor->image.height <= 32)) {
...@@ -1109,7 +1113,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1109,7 +1113,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
"The cursor image is biger than 64x64 bits...\n"); "The cursor image is biger than 64x64 bits...\n");
return -ENXIO; return -ENXIO;
} }
MMIO_OUT32(VIA_REG_CURSOR_MODE, temp); writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_MODE);
viacursor.image.height = cursor->image.height; viacursor.image.height = cursor->image.height;
viacursor.image.width = cursor->image.width; viacursor.image.width = cursor->image.width;
...@@ -1169,8 +1173,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1169,8 +1173,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
0xFFC0) >> 6); 0xFFC0) >> 6);
} }
MMIO_OUT32(VIA_REG_CURSOR_BG, bg_col); writel(bg_col, viaparinfo->io_virt + VIA_REG_CURSOR_BG);
MMIO_OUT32(VIA_REG_CURSOR_FG, fg_col); writel(fg_col, viaparinfo->io_virt + VIA_REG_CURSOR_FG);
} }
if (cursor->set & FB_CUR_SETSHAPE) { if (cursor->set & FB_CUR_SETSHAPE) {
...@@ -2116,15 +2120,15 @@ static int __devinit via_pci_probe(void) ...@@ -2116,15 +2120,15 @@ static int __devinit via_pci_probe(void)
viaparinfo = (struct viafb_par *)viafbinfo->par; viaparinfo = (struct viafb_par *)viafbinfo->par;
viaparinfo->tmds_setting_info = (struct tmds_setting_information *) viaparinfo->tmds_setting_info = (struct tmds_setting_information *)
((u32)viaparinfo + viafb_par_length); ((unsigned long)viaparinfo + viafb_par_length);
viaparinfo->lvds_setting_info = (struct lvds_setting_information *) viaparinfo->lvds_setting_info = (struct lvds_setting_information *)
((u32)viaparinfo->tmds_setting_info + tmds_length); ((unsigned long)viaparinfo->tmds_setting_info + tmds_length);
viaparinfo->lvds_setting_info2 = (struct lvds_setting_information *) viaparinfo->lvds_setting_info2 = (struct lvds_setting_information *)
((u32)viaparinfo->lvds_setting_info + lvds_length); ((unsigned long)viaparinfo->lvds_setting_info + lvds_length);
viaparinfo->crt_setting_info = (struct crt_setting_information *) viaparinfo->crt_setting_info = (struct crt_setting_information *)
((u32)viaparinfo->lvds_setting_info2 + lvds_length); ((unsigned long)viaparinfo->lvds_setting_info2 + lvds_length);
viaparinfo->chip_info = (struct chip_information *) viaparinfo->chip_info = (struct chip_information *)
((u32)viaparinfo->crt_setting_info + crt_length); ((unsigned long)viaparinfo->crt_setting_info + crt_length);
if (viafb_dual_fb) if (viafb_dual_fb)
viafb_SAMM_ON = 1; viafb_SAMM_ON = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment