diff options
Diffstat (limited to 'drivers/video/svgalib.c')
-rw-r--r-- | drivers/video/svgalib.c | 175 |
1 files changed, 88 insertions, 87 deletions
diff --git a/drivers/video/svgalib.c b/drivers/video/svgalib.c index fdb45674e2f6..33df9ec91795 100644 --- a/drivers/video/svgalib.c +++ b/drivers/video/svgalib.c | |||
@@ -20,12 +20,12 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | /* Write a CRT register value spread across multiple registers */ | 22 | /* Write a CRT register value spread across multiple registers */ |
23 | void svga_wcrt_multi(const struct vga_regset *regset, u32 value) { | 23 | void svga_wcrt_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value) |
24 | 24 | { | |
25 | u8 regval, bitval, bitnum; | 25 | u8 regval, bitval, bitnum; |
26 | 26 | ||
27 | while (regset->regnum != VGA_REGSET_END_VAL) { | 27 | while (regset->regnum != VGA_REGSET_END_VAL) { |
28 | regval = vga_rcrt(NULL, regset->regnum); | 28 | regval = vga_rcrt(regbase, regset->regnum); |
29 | bitnum = regset->lowbit; | 29 | bitnum = regset->lowbit; |
30 | while (bitnum <= regset->highbit) { | 30 | while (bitnum <= regset->highbit) { |
31 | bitval = 1 << bitnum; | 31 | bitval = 1 << bitnum; |
@@ -34,18 +34,18 @@ void svga_wcrt_multi(const struct vga_regset *regset, u32 value) { | |||
34 | bitnum ++; | 34 | bitnum ++; |
35 | value = value >> 1; | 35 | value = value >> 1; |
36 | } | 36 | } |
37 | vga_wcrt(NULL, regset->regnum, regval); | 37 | vga_wcrt(regbase, regset->regnum, regval); |
38 | regset ++; | 38 | regset ++; |
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||
42 | /* Write a sequencer register value spread across multiple registers */ | 42 | /* Write a sequencer register value spread across multiple registers */ |
43 | void svga_wseq_multi(const struct vga_regset *regset, u32 value) { | 43 | void svga_wseq_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value) |
44 | 44 | { | |
45 | u8 regval, bitval, bitnum; | 45 | u8 regval, bitval, bitnum; |
46 | 46 | ||
47 | while (regset->regnum != VGA_REGSET_END_VAL) { | 47 | while (regset->regnum != VGA_REGSET_END_VAL) { |
48 | regval = vga_rseq(NULL, regset->regnum); | 48 | regval = vga_rseq(regbase, regset->regnum); |
49 | bitnum = regset->lowbit; | 49 | bitnum = regset->lowbit; |
50 | while (bitnum <= regset->highbit) { | 50 | while (bitnum <= regset->highbit) { |
51 | bitval = 1 << bitnum; | 51 | bitval = 1 << bitnum; |
@@ -54,7 +54,7 @@ void svga_wseq_multi(const struct vga_regset *regset, u32 value) { | |||
54 | bitnum ++; | 54 | bitnum ++; |
55 | value = value >> 1; | 55 | value = value >> 1; |
56 | } | 56 | } |
57 | vga_wseq(NULL, regset->regnum, regval); | 57 | vga_wseq(regbase, regset->regnum, regval); |
58 | regset ++; | 58 | regset ++; |
59 | } | 59 | } |
60 | } | 60 | } |
@@ -75,95 +75,95 @@ static unsigned int svga_regset_size(const struct vga_regset *regset) | |||
75 | 75 | ||
76 | 76 | ||
77 | /* Set graphics controller registers to sane values */ | 77 | /* Set graphics controller registers to sane values */ |
78 | void svga_set_default_gfx_regs(void) | 78 | void svga_set_default_gfx_regs(void __iomem *regbase) |
79 | { | 79 | { |
80 | /* All standard GFX registers (GR00 - GR08) */ | 80 | /* All standard GFX registers (GR00 - GR08) */ |
81 | vga_wgfx(NULL, VGA_GFX_SR_VALUE, 0x00); | 81 | vga_wgfx(regbase, VGA_GFX_SR_VALUE, 0x00); |
82 | vga_wgfx(NULL, VGA_GFX_SR_ENABLE, 0x00); | 82 | vga_wgfx(regbase, VGA_GFX_SR_ENABLE, 0x00); |
83 | vga_wgfx(NULL, VGA_GFX_COMPARE_VALUE, 0x00); | 83 | vga_wgfx(regbase, VGA_GFX_COMPARE_VALUE, 0x00); |
84 | vga_wgfx(NULL, VGA_GFX_DATA_ROTATE, 0x00); | 84 | vga_wgfx(regbase, VGA_GFX_DATA_ROTATE, 0x00); |
85 | vga_wgfx(NULL, VGA_GFX_PLANE_READ, 0x00); | 85 | vga_wgfx(regbase, VGA_GFX_PLANE_READ, 0x00); |
86 | vga_wgfx(NULL, VGA_GFX_MODE, 0x00); | 86 | vga_wgfx(regbase, VGA_GFX_MODE, 0x00); |
87 | /* vga_wgfx(NULL, VGA_GFX_MODE, 0x20); */ | 87 | /* vga_wgfx(regbase, VGA_GFX_MODE, 0x20); */ |
88 | /* vga_wgfx(NULL, VGA_GFX_MODE, 0x40); */ | 88 | /* vga_wgfx(regbase, VGA_GFX_MODE, 0x40); */ |
89 | vga_wgfx(NULL, VGA_GFX_MISC, 0x05); | 89 | vga_wgfx(regbase, VGA_GFX_MISC, 0x05); |
90 | /* vga_wgfx(NULL, VGA_GFX_MISC, 0x01); */ | 90 | /* vga_wgfx(regbase, VGA_GFX_MISC, 0x01); */ |
91 | vga_wgfx(NULL, VGA_GFX_COMPARE_MASK, 0x0F); | 91 | vga_wgfx(regbase, VGA_GFX_COMPARE_MASK, 0x0F); |
92 | vga_wgfx(NULL, VGA_GFX_BIT_MASK, 0xFF); | 92 | vga_wgfx(regbase, VGA_GFX_BIT_MASK, 0xFF); |
93 | } | 93 | } |
94 | 94 | ||
95 | /* Set attribute controller registers to sane values */ | 95 | /* Set attribute controller registers to sane values */ |
96 | void svga_set_default_atc_regs(void) | 96 | void svga_set_default_atc_regs(void __iomem *regbase) |
97 | { | 97 | { |
98 | u8 count; | 98 | u8 count; |
99 | 99 | ||
100 | vga_r(NULL, 0x3DA); | 100 | vga_r(regbase, 0x3DA); |
101 | vga_w(NULL, VGA_ATT_W, 0x00); | 101 | vga_w(regbase, VGA_ATT_W, 0x00); |
102 | 102 | ||
103 | /* All standard ATC registers (AR00 - AR14) */ | 103 | /* All standard ATC registers (AR00 - AR14) */ |
104 | for (count = 0; count <= 0xF; count ++) | 104 | for (count = 0; count <= 0xF; count ++) |
105 | svga_wattr(count, count); | 105 | svga_wattr(regbase, count, count); |
106 | 106 | ||
107 | svga_wattr(VGA_ATC_MODE, 0x01); | 107 | svga_wattr(regbase, VGA_ATC_MODE, 0x01); |
108 | /* svga_wattr(VGA_ATC_MODE, 0x41); */ | 108 | /* svga_wattr(regbase, VGA_ATC_MODE, 0x41); */ |
109 | svga_wattr(VGA_ATC_OVERSCAN, 0x00); | 109 | svga_wattr(regbase, VGA_ATC_OVERSCAN, 0x00); |
110 | svga_wattr(VGA_ATC_PLANE_ENABLE, 0x0F); | 110 | svga_wattr(regbase, VGA_ATC_PLANE_ENABLE, 0x0F); |
111 | svga_wattr(VGA_ATC_PEL, 0x00); | 111 | svga_wattr(regbase, VGA_ATC_PEL, 0x00); |
112 | svga_wattr(VGA_ATC_COLOR_PAGE, 0x00); | 112 | svga_wattr(regbase, VGA_ATC_COLOR_PAGE, 0x00); |
113 | 113 | ||
114 | vga_r(NULL, 0x3DA); | 114 | vga_r(regbase, 0x3DA); |
115 | vga_w(NULL, VGA_ATT_W, 0x20); | 115 | vga_w(regbase, VGA_ATT_W, 0x20); |
116 | } | 116 | } |
117 | 117 | ||
118 | /* Set sequencer registers to sane values */ | 118 | /* Set sequencer registers to sane values */ |
119 | void svga_set_default_seq_regs(void) | 119 | void svga_set_default_seq_regs(void __iomem *regbase) |
120 | { | 120 | { |
121 | /* Standard sequencer registers (SR01 - SR04), SR00 is not set */ | 121 | /* Standard sequencer registers (SR01 - SR04), SR00 is not set */ |
122 | vga_wseq(NULL, VGA_SEQ_CLOCK_MODE, VGA_SR01_CHAR_CLK_8DOTS); | 122 | vga_wseq(regbase, VGA_SEQ_CLOCK_MODE, VGA_SR01_CHAR_CLK_8DOTS); |
123 | vga_wseq(NULL, VGA_SEQ_PLANE_WRITE, VGA_SR02_ALL_PLANES); | 123 | vga_wseq(regbase, VGA_SEQ_PLANE_WRITE, VGA_SR02_ALL_PLANES); |
124 | vga_wseq(NULL, VGA_SEQ_CHARACTER_MAP, 0x00); | 124 | vga_wseq(regbase, VGA_SEQ_CHARACTER_MAP, 0x00); |
125 | /* vga_wseq(NULL, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM | VGA_SR04_SEQ_MODE | VGA_SR04_CHN_4M); */ | 125 | /* vga_wseq(regbase, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM | VGA_SR04_SEQ_MODE | VGA_SR04_CHN_4M); */ |
126 | vga_wseq(NULL, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM | VGA_SR04_SEQ_MODE); | 126 | vga_wseq(regbase, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM | VGA_SR04_SEQ_MODE); |
127 | } | 127 | } |
128 | 128 | ||
129 | /* Set CRTC registers to sane values */ | 129 | /* Set CRTC registers to sane values */ |
130 | void svga_set_default_crt_regs(void) | 130 | void svga_set_default_crt_regs(void __iomem *regbase) |
131 | { | 131 | { |
132 | /* Standard CRT registers CR03 CR08 CR09 CR14 CR17 */ | 132 | /* Standard CRT registers CR03 CR08 CR09 CR14 CR17 */ |
133 | svga_wcrt_mask(0x03, 0x80, 0x80); /* Enable vertical retrace EVRA */ | 133 | svga_wcrt_mask(regbase, 0x03, 0x80, 0x80); /* Enable vertical retrace EVRA */ |
134 | vga_wcrt(NULL, VGA_CRTC_PRESET_ROW, 0); | 134 | vga_wcrt(regbase, VGA_CRTC_PRESET_ROW, 0); |
135 | svga_wcrt_mask(VGA_CRTC_MAX_SCAN, 0, 0x1F); | 135 | svga_wcrt_mask(regbase, VGA_CRTC_MAX_SCAN, 0, 0x1F); |
136 | vga_wcrt(NULL, VGA_CRTC_UNDERLINE, 0); | 136 | vga_wcrt(regbase, VGA_CRTC_UNDERLINE, 0); |
137 | vga_wcrt(NULL, VGA_CRTC_MODE, 0xE3); | 137 | vga_wcrt(regbase, VGA_CRTC_MODE, 0xE3); |
138 | } | 138 | } |
139 | 139 | ||
140 | void svga_set_textmode_vga_regs(void) | 140 | void svga_set_textmode_vga_regs(void __iomem *regbase) |
141 | { | 141 | { |
142 | /* svga_wseq_mask(0x1, 0x00, 0x01); */ /* Switch 8/9 pixel per char */ | 142 | /* svga_wseq_mask(regbase, 0x1, 0x00, 0x01); */ /* Switch 8/9 pixel per char */ |
143 | vga_wseq(NULL, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM); | 143 | vga_wseq(regbase, VGA_SEQ_MEMORY_MODE, VGA_SR04_EXT_MEM); |
144 | vga_wseq(NULL, VGA_SEQ_PLANE_WRITE, 0x03); | 144 | vga_wseq(regbase, VGA_SEQ_PLANE_WRITE, 0x03); |
145 | 145 | ||
146 | vga_wcrt(NULL, VGA_CRTC_MAX_SCAN, 0x0f); /* 0x4f */ | 146 | vga_wcrt(regbase, VGA_CRTC_MAX_SCAN, 0x0f); /* 0x4f */ |
147 | vga_wcrt(NULL, VGA_CRTC_UNDERLINE, 0x1f); | 147 | vga_wcrt(regbase, VGA_CRTC_UNDERLINE, 0x1f); |
148 | svga_wcrt_mask(VGA_CRTC_MODE, 0x23, 0x7f); | 148 | svga_wcrt_mask(regbase, VGA_CRTC_MODE, 0x23, 0x7f); |
149 | 149 | ||
150 | vga_wcrt(NULL, VGA_CRTC_CURSOR_START, 0x0d); | 150 | vga_wcrt(regbase, VGA_CRTC_CURSOR_START, 0x0d); |
151 | vga_wcrt(NULL, VGA_CRTC_CURSOR_END, 0x0e); | 151 | vga_wcrt(regbase, VGA_CRTC_CURSOR_END, 0x0e); |
152 | vga_wcrt(NULL, VGA_CRTC_CURSOR_HI, 0x00); | 152 | vga_wcrt(regbase, VGA_CRTC_CURSOR_HI, 0x00); |
153 | vga_wcrt(NULL, VGA_CRTC_CURSOR_LO, 0x00); | 153 | vga_wcrt(regbase, VGA_CRTC_CURSOR_LO, 0x00); |
154 | 154 | ||
155 | vga_wgfx(NULL, VGA_GFX_MODE, 0x10); /* Odd/even memory mode */ | 155 | vga_wgfx(regbase, VGA_GFX_MODE, 0x10); /* Odd/even memory mode */ |
156 | vga_wgfx(NULL, VGA_GFX_MISC, 0x0E); /* Misc graphics register - text mode enable */ | 156 | vga_wgfx(regbase, VGA_GFX_MISC, 0x0E); /* Misc graphics register - text mode enable */ |
157 | vga_wgfx(NULL, VGA_GFX_COMPARE_MASK, 0x00); | 157 | vga_wgfx(regbase, VGA_GFX_COMPARE_MASK, 0x00); |
158 | 158 | ||
159 | vga_r(NULL, 0x3DA); | 159 | vga_r(regbase, 0x3DA); |
160 | vga_w(NULL, VGA_ATT_W, 0x00); | 160 | vga_w(regbase, VGA_ATT_W, 0x00); |
161 | 161 | ||
162 | svga_wattr(0x10, 0x0C); /* Attribute Mode Control Register - text mode, blinking and line graphics */ | 162 | svga_wattr(regbase, 0x10, 0x0C); /* Attribute Mode Control Register - text mode, blinking and line graphics */ |
163 | svga_wattr(0x13, 0x08); /* Horizontal Pixel Panning Register */ | 163 | svga_wattr(regbase, 0x13, 0x08); /* Horizontal Pixel Panning Register */ |
164 | 164 | ||
165 | vga_r(NULL, 0x3DA); | 165 | vga_r(regbase, 0x3DA); |
166 | vga_w(NULL, VGA_ATT_W, 0x20); | 166 | vga_w(regbase, VGA_ATT_W, 0x20); |
167 | } | 167 | } |
168 | 168 | ||
169 | #if 0 | 169 | #if 0 |
@@ -299,7 +299,7 @@ void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit) | |||
299 | } | 299 | } |
300 | 300 | ||
301 | /* Set cursor in text (tileblit) mode */ | 301 | /* Set cursor in text (tileblit) mode */ |
302 | void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor) | 302 | void svga_tilecursor(void __iomem *regbase, struct fb_info *info, struct fb_tilecursor *cursor) |
303 | { | 303 | { |
304 | u8 cs = 0x0d; | 304 | u8 cs = 0x0d; |
305 | u8 ce = 0x0e; | 305 | u8 ce = 0x0e; |
@@ -310,7 +310,7 @@ void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor) | |||
310 | if (! cursor -> mode) | 310 | if (! cursor -> mode) |
311 | return; | 311 | return; |
312 | 312 | ||
313 | svga_wcrt_mask(0x0A, 0x20, 0x20); /* disable cursor */ | 313 | svga_wcrt_mask(regbase, 0x0A, 0x20, 0x20); /* disable cursor */ |
314 | 314 | ||
315 | if (cursor -> shape == FB_TILE_CURSOR_NONE) | 315 | if (cursor -> shape == FB_TILE_CURSOR_NONE) |
316 | return; | 316 | return; |
@@ -334,11 +334,11 @@ void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor) | |||
334 | } | 334 | } |
335 | 335 | ||
336 | /* set cursor position */ | 336 | /* set cursor position */ |
337 | vga_wcrt(NULL, 0x0E, pos >> 8); | 337 | vga_wcrt(regbase, 0x0E, pos >> 8); |
338 | vga_wcrt(NULL, 0x0F, pos & 0xFF); | 338 | vga_wcrt(regbase, 0x0F, pos & 0xFF); |
339 | 339 | ||
340 | vga_wcrt(NULL, 0x0B, ce); /* set cursor end */ | 340 | vga_wcrt(regbase, 0x0B, ce); /* set cursor end */ |
341 | vga_wcrt(NULL, 0x0A, cs); /* set cursor start and enable it */ | 341 | vga_wcrt(regbase, 0x0A, cs); /* set cursor start and enable it */ |
342 | } | 342 | } |
343 | 343 | ||
344 | int svga_get_tilemax(struct fb_info *info) | 344 | int svga_get_tilemax(struct fb_info *info) |
@@ -507,8 +507,9 @@ int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screenin | |||
507 | } | 507 | } |
508 | 508 | ||
509 | /* Set CRT timing registers */ | 509 | /* Set CRT timing registers */ |
510 | void svga_set_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, | 510 | void svga_set_timings(void __iomem *regbase, const struct svga_timing_regs *tm, |
511 | u32 hmul, u32 hdiv, u32 vmul, u32 vdiv, u32 hborder, int node) | 511 | struct fb_var_screeninfo *var, |
512 | u32 hmul, u32 hdiv, u32 vmul, u32 vdiv, u32 hborder, int node) | ||
512 | { | 513 | { |
513 | u8 regval; | 514 | u8 regval; |
514 | u32 value; | 515 | u32 value; |
@@ -516,66 +517,66 @@ void svga_set_timings(const struct svga_timing_regs *tm, struct fb_var_screeninf | |||
516 | value = var->xres + var->left_margin + var->right_margin + var->hsync_len; | 517 | value = var->xres + var->left_margin + var->right_margin + var->hsync_len; |
517 | value = (value * hmul) / hdiv; | 518 | value = (value * hmul) / hdiv; |
518 | pr_debug("fb%d: horizontal total : %d\n", node, value); | 519 | pr_debug("fb%d: horizontal total : %d\n", node, value); |
519 | svga_wcrt_multi(tm->h_total_regs, (value / 8) - 5); | 520 | svga_wcrt_multi(regbase, tm->h_total_regs, (value / 8) - 5); |
520 | 521 | ||
521 | value = var->xres; | 522 | value = var->xres; |
522 | value = (value * hmul) / hdiv; | 523 | value = (value * hmul) / hdiv; |
523 | pr_debug("fb%d: horizontal display : %d\n", node, value); | 524 | pr_debug("fb%d: horizontal display : %d\n", node, value); |
524 | svga_wcrt_multi(tm->h_display_regs, (value / 8) - 1); | 525 | svga_wcrt_multi(regbase, tm->h_display_regs, (value / 8) - 1); |
525 | 526 | ||
526 | value = var->xres; | 527 | value = var->xres; |
527 | value = (value * hmul) / hdiv; | 528 | value = (value * hmul) / hdiv; |
528 | pr_debug("fb%d: horizontal blank start: %d\n", node, value); | 529 | pr_debug("fb%d: horizontal blank start: %d\n", node, value); |
529 | svga_wcrt_multi(tm->h_blank_start_regs, (value / 8) - 1 + hborder); | 530 | svga_wcrt_multi(regbase, tm->h_blank_start_regs, (value / 8) - 1 + hborder); |
530 | 531 | ||
531 | value = var->xres + var->left_margin + var->right_margin + var->hsync_len; | 532 | value = var->xres + var->left_margin + var->right_margin + var->hsync_len; |
532 | value = (value * hmul) / hdiv; | 533 | value = (value * hmul) / hdiv; |
533 | pr_debug("fb%d: horizontal blank end : %d\n", node, value); | 534 | pr_debug("fb%d: horizontal blank end : %d\n", node, value); |
534 | svga_wcrt_multi(tm->h_blank_end_regs, (value / 8) - 1 - hborder); | 535 | svga_wcrt_multi(regbase, tm->h_blank_end_regs, (value / 8) - 1 - hborder); |
535 | 536 | ||
536 | value = var->xres + var->right_margin; | 537 | value = var->xres + var->right_margin; |
537 | value = (value * hmul) / hdiv; | 538 | value = (value * hmul) / hdiv; |
538 | pr_debug("fb%d: horizontal sync start : %d\n", node, value); | 539 | pr_debug("fb%d: horizontal sync start : %d\n", node, value); |
539 | svga_wcrt_multi(tm->h_sync_start_regs, (value / 8)); | 540 | svga_wcrt_multi(regbase, tm->h_sync_start_regs, (value / 8)); |
540 | 541 | ||
541 | value = var->xres + var->right_margin + var->hsync_len; | 542 | value = var->xres + var->right_margin + var->hsync_len; |
542 | value = (value * hmul) / hdiv; | 543 | value = (value * hmul) / hdiv; |
543 | pr_debug("fb%d: horizontal sync end : %d\n", node, value); | 544 | pr_debug("fb%d: horizontal sync end : %d\n", node, value); |
544 | svga_wcrt_multi(tm->h_sync_end_regs, (value / 8)); | 545 | svga_wcrt_multi(regbase, tm->h_sync_end_regs, (value / 8)); |
545 | 546 | ||
546 | value = var->yres + var->upper_margin + var->lower_margin + var->vsync_len; | 547 | value = var->yres + var->upper_margin + var->lower_margin + var->vsync_len; |
547 | value = (value * vmul) / vdiv; | 548 | value = (value * vmul) / vdiv; |
548 | pr_debug("fb%d: vertical total : %d\n", node, value); | 549 | pr_debug("fb%d: vertical total : %d\n", node, value); |
549 | svga_wcrt_multi(tm->v_total_regs, value - 2); | 550 | svga_wcrt_multi(regbase, tm->v_total_regs, value - 2); |
550 | 551 | ||
551 | value = var->yres; | 552 | value = var->yres; |
552 | value = (value * vmul) / vdiv; | 553 | value = (value * vmul) / vdiv; |
553 | pr_debug("fb%d: vertical display : %d\n", node, value); | 554 | pr_debug("fb%d: vertical display : %d\n", node, value); |
554 | svga_wcrt_multi(tm->v_display_regs, value - 1); | 555 | svga_wcrt_multi(regbase, tm->v_display_regs, value - 1); |
555 | 556 | ||
556 | value = var->yres; | 557 | value = var->yres; |
557 | value = (value * vmul) / vdiv; | 558 | value = (value * vmul) / vdiv; |
558 | pr_debug("fb%d: vertical blank start : %d\n", node, value); | 559 | pr_debug("fb%d: vertical blank start : %d\n", node, value); |
559 | svga_wcrt_multi(tm->v_blank_start_regs, value); | 560 | svga_wcrt_multi(regbase, tm->v_blank_start_regs, value); |
560 | 561 | ||
561 | value = var->yres + var->upper_margin + var->lower_margin + var->vsync_len; | 562 | value = var->yres + var->upper_margin + var->lower_margin + var->vsync_len; |
562 | value = (value * vmul) / vdiv; | 563 | value = (value * vmul) / vdiv; |
563 | pr_debug("fb%d: vertical blank end : %d\n", node, value); | 564 | pr_debug("fb%d: vertical blank end : %d\n", node, value); |
564 | svga_wcrt_multi(tm->v_blank_end_regs, value - 2); | 565 | svga_wcrt_multi(regbase, tm->v_blank_end_regs, value - 2); |
565 | 566 | ||
566 | value = var->yres + var->lower_margin; | 567 | value = var->yres + var->lower_margin; |
567 | value = (value * vmul) / vdiv; | 568 | value = (value * vmul) / vdiv; |
568 | pr_debug("fb%d: vertical sync start : %d\n", node, value); | 569 | pr_debug("fb%d: vertical sync start : %d\n", node, value); |
569 | svga_wcrt_multi(tm->v_sync_start_regs, value); | 570 | svga_wcrt_multi(regbase, tm->v_sync_start_regs, value); |
570 | 571 | ||
571 | value = var->yres + var->lower_margin + var->vsync_len; | 572 | value = var->yres + var->lower_margin + var->vsync_len; |
572 | value = (value * vmul) / vdiv; | 573 | value = (value * vmul) / vdiv; |
573 | pr_debug("fb%d: vertical sync end : %d\n", node, value); | 574 | pr_debug("fb%d: vertical sync end : %d\n", node, value); |
574 | svga_wcrt_multi(tm->v_sync_end_regs, value); | 575 | svga_wcrt_multi(regbase, tm->v_sync_end_regs, value); |
575 | 576 | ||
576 | /* Set horizontal and vertical sync pulse polarity in misc register */ | 577 | /* Set horizontal and vertical sync pulse polarity in misc register */ |
577 | 578 | ||
578 | regval = vga_r(NULL, VGA_MIS_R); | 579 | regval = vga_r(regbase, VGA_MIS_R); |
579 | if (var->sync & FB_SYNC_HOR_HIGH_ACT) { | 580 | if (var->sync & FB_SYNC_HOR_HIGH_ACT) { |
580 | pr_debug("fb%d: positive horizontal sync\n", node); | 581 | pr_debug("fb%d: positive horizontal sync\n", node); |
581 | regval = regval & ~0x80; | 582 | regval = regval & ~0x80; |
@@ -590,7 +591,7 @@ void svga_set_timings(const struct svga_timing_regs *tm, struct fb_var_screeninf | |||
590 | pr_debug("fb%d: negative vertical sync\n\n", node); | 591 | pr_debug("fb%d: negative vertical sync\n\n", node); |
591 | regval = regval | 0x40; | 592 | regval = regval | 0x40; |
592 | } | 593 | } |
593 | vga_w(NULL, VGA_MIS_W, regval); | 594 | vga_w(regbase, VGA_MIS_W, regval); |
594 | } | 595 | } |
595 | 596 | ||
596 | 597 | ||