#include "matroxfb_misc.h"
#include <linux/interrupt.h>
#include <linux/matroxfb.h>
void matroxfb_DAC_out(const struct matrox_fb_info *minfo, int reg, int val)
{ … }
int matroxfb_DAC_in(const struct matrox_fb_info *minfo, int reg)
{ … }
void matroxfb_var2my(struct fb_var_screeninfo* var, struct my_timming* mt) { … }
int matroxfb_PLL_calcclock(const struct matrox_pll_features* pll, unsigned int freq, unsigned int fmax,
unsigned int* in, unsigned int* feed, unsigned int* post) { … }
int matroxfb_vgaHWinit(struct matrox_fb_info *minfo, struct my_timming *m)
{
unsigned int hd, hs, he, hbe, ht;
unsigned int vd, vs, ve, vt, lc;
unsigned int wd;
unsigned int divider;
int i;
struct matrox_hw_state * const hw = &minfo->hw;
DBG(__func__)
hw->SEQ[0] = 0x00;
hw->SEQ[1] = 0x01;
hw->SEQ[2] = 0x0F;
hw->SEQ[3] = 0x00;
hw->SEQ[4] = 0x0E;
if (m->dblscan) {
m->VTotal <<= 1;
m->VDisplay <<= 1;
m->VSyncStart <<= 1;
m->VSyncEnd <<= 1;
}
if (m->interlaced) {
m->VTotal >>= 1;
m->VDisplay >>= 1;
m->VSyncStart >>= 1;
m->VSyncEnd >>= 1;
}
hw->GCTL[0] = 0x00;
hw->GCTL[1] = 0x00;
hw->GCTL[2] = 0x00;
hw->GCTL[3] = 0x00;
hw->GCTL[4] = 0x00;
hw->GCTL[5] = 0x40;
hw->GCTL[6] = 0x05;
hw->GCTL[7] = 0x0F;
hw->GCTL[8] = 0xFF;
for (i = 0; i < 16; i++)
hw->ATTR[i] = i;
hw->ATTR[16] = 0x41;
hw->ATTR[17] = 0xFF;
hw->ATTR[18] = 0x0F;
hw->ATTR[19] = 0x00;
hw->ATTR[20] = 0x00;
hd = m->HDisplay >> 3;
hs = m->HSyncStart >> 3;
he = m->HSyncEnd >> 3;
ht = m->HTotal >> 3;
divider = minfo->curr.final_bppShift;
while (divider & 3) {
hd >>= 1;
hs >>= 1;
he >>= 1;
ht >>= 1;
divider <<= 1;
}
divider = divider / 4;
while (divider > 8) {
hd <<= 1;
hs <<= 1;
he <<= 1;
ht <<= 1;
divider >>= 1;
}
hd = hd - 1;
hs = hs - 1;
he = he - 1;
ht = ht - 1;
vd = m->VDisplay - 1;
vs = m->VSyncStart - 1;
ve = m->VSyncEnd - 1;
vt = m->VTotal - 2;
lc = vd;
if (((ht & 0x07) == 0x06) || ((ht & 0x0F) == 0x04))
ht++;
hbe = ht;
wd = minfo->fbcon.var.xres_virtual * minfo->curr.final_bppShift / 64;
hw->CRTCEXT[0] = 0;
hw->CRTCEXT[5] = 0;
if (m->interlaced) {
hw->CRTCEXT[0] = 0x80;
hw->CRTCEXT[5] = (hs + he - ht) >> 1;
if (!m->dblscan)
wd <<= 1;
vt &= ~1;
}
hw->CRTCEXT[0] |= (wd & 0x300) >> 4;
hw->CRTCEXT[1] = (((ht - 4) & 0x100) >> 8) |
((hd & 0x100) >> 7) |
((hs & 0x100) >> 6) |
(hbe & 0x040);
if (minfo->outputs[1].src == MATROXFB_SRC_CRTC1)
hw->CRTCEXT[1] |= 0x88;
hw->CRTCEXT[2] = ((vt & 0xC00) >> 10) |
((vd & 0x400) >> 8) |
((vd & 0xC00) >> 7) |
((vs & 0xC00) >> 5) |
((lc & 0x400) >> 3);
hw->CRTCEXT[3] = (divider - 1) | 0x80;
hw->CRTCEXT[4] = 0;
hw->CRTC[0] = ht-4;
hw->CRTC[1] = hd;
hw->CRTC[2] = hd;
hw->CRTC[3] = (hbe & 0x1F) | 0x80;
hw->CRTC[4] = hs;
hw->CRTC[5] = ((hbe & 0x20) << 2) | (he & 0x1F);
hw->CRTC[6] = vt & 0xFF;
hw->CRTC[7] = ((vt & 0x100) >> 8) |
((vd & 0x100) >> 7) |
((vs & 0x100) >> 6) |
((vd & 0x100) >> 5) |
((lc & 0x100) >> 4) |
((vt & 0x200) >> 4) |
((vd & 0x200) >> 3) |
((vs & 0x200) >> 2);
hw->CRTC[8] = 0x00;
hw->CRTC[9] = ((vd & 0x200) >> 4) |
((lc & 0x200) >> 3);
if (m->dblscan && !m->interlaced)
hw->CRTC[9] |= 0x80;
for (i = 10; i < 16; i++)
hw->CRTC[i] = 0x00;
hw->CRTC[16] = vs ;
hw->CRTC[17] = (ve & 0x0F) | 0x20;
hw->CRTC[18] = vd ;
hw->CRTC[19] = wd ;
hw->CRTC[20] = 0x00;
hw->CRTC[21] = vd ;
hw->CRTC[22] = (vt + 1) ;
hw->CRTC[23] = 0xC3;
hw->CRTC[24] = lc;
return 0;
};
void matroxfb_vgaHWrestore(struct matrox_fb_info *minfo)
{ … }
static void get_pins(unsigned char __iomem* pins, struct matrox_bios* bd) { … }
static void get_bios_version(unsigned char __iomem * vbios, struct matrox_bios* bd) { … }
static void get_bios_output(unsigned char __iomem* vbios, struct matrox_bios* bd) { … }
static void get_bios_tvout(unsigned char __iomem* vbios, struct matrox_bios* bd) { … }
static void parse_bios(unsigned char __iomem* vbios, struct matrox_bios* bd) { … }
static int parse_pins1(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
static void default_pins1(struct matrox_fb_info *minfo)
{ … }
static int parse_pins2(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
static void default_pins2(struct matrox_fb_info *minfo)
{ … }
static int parse_pins3(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
static void default_pins3(struct matrox_fb_info *minfo)
{ … }
static int parse_pins4(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
static void default_pins4(struct matrox_fb_info *minfo)
{ … }
static int parse_pins5(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
static void default_pins5(struct matrox_fb_info *minfo)
{ … }
static int matroxfb_set_limits(struct matrox_fb_info *minfo,
const struct matrox_bios *bd)
{ … }
void matroxfb_read_pins(struct matrox_fb_info *minfo)
{ … }
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;