static void Ti3026_restore(struct matrox_fb_info *minfo)
{
	int i;
	unsigned char progdac[6];
	struct matrox_hw_state *hw = &minfo->hw;
	CRITFLAGS

	DBG(__func__)

#ifdef DEBUG
;
	for (i = 0; i < 6; i++)
;
;
#endif

	CRITBEGIN

	pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, hw->MXoptionReg);

	CRITEND

	matroxfb_vgaHWrestore(minfo);

	CRITBEGIN

	minfo->crtc1.panpos = -1;
	for (i = 0; i < 6; i++)
		mga_setr(M_EXTVGA_INDEX, i, hw->CRTCEXT[i]);

	for (i = 0; i < 21; i++) {
		outTi3026(minfo, DACseq[i], hw->DACreg[i]);
	}

	outTi3026(minfo, TVP3026_XPLLADDR, 0x00);
	progdac[0] = inTi3026(minfo, TVP3026_XPIXPLLDATA);
	progdac[3] = inTi3026(minfo, TVP3026_XLOOPPLLDATA);
	outTi3026(minfo, TVP3026_XPLLADDR, 0x15);
	progdac[1] = inTi3026(minfo, TVP3026_XPIXPLLDATA);
	progdac[4] = inTi3026(minfo, TVP3026_XLOOPPLLDATA);
	outTi3026(minfo, TVP3026_XPLLADDR, 0x2A);
	progdac[2] = inTi3026(minfo, TVP3026_XPIXPLLDATA);
	progdac[5] = inTi3026(minfo, TVP3026_XLOOPPLLDATA);

	CRITEND
	if (memcmp(hw->DACclk, progdac, 6)) {
		/* agrhh... setting up PLL is very slow on Millennium... */
		/* Mystique PLL is locked in few ms, but Millennium PLL lock takes about 0.15 s... */
		/* Maybe even we should call schedule() ? */

		CRITBEGIN
		outTi3026(minfo, TVP3026_XCLKCTRL, hw->DACreg[POS3026_XCLKCTRL]);
		outTi3026(minfo, TVP3026_XPLLADDR, 0x2A);
		outTi3026(minfo, TVP3026_XLOOPPLLDATA, 0);
		outTi3026(minfo, TVP3026_XPIXPLLDATA, 0);

		outTi3026(minfo, TVP3026_XPLLADDR, 0x00);
		for (i = 0; i < 3; i++)
			outTi3026(minfo, TVP3026_XPIXPLLDATA, hw->DACclk[i]);
		/* wait for PLL only if PLL clock requested (always for PowerMode, never for VGA) */
		if (hw->MiscOutReg & 0x08) {
			int tmout;
			outTi3026(minfo, TVP3026_XPLLADDR, 0x3F);
			for (tmout = 500000; tmout; --tmout) {
				if (inTi3026(minfo, TVP3026_XPIXPLLDATA) & 0x40)
					break;
				udelay(10);
			}

			CRITEND

			if (!tmout)
;
			else
;
			CRITBEGIN
		}
Beispiel #2
0
static void Ti3026_restore(WPMINFO2) {
    int i;
    unsigned char progdac[6];
    struct matrox_hw_state* hw = &ACCESS_FBINFO(hw);
    CRITFLAGS

    DBG(__func__)

#ifdef DEBUG
    dprintk(KERN_INFO "EXTVGA regs: ");
    for (i = 0; i < 6; i++)
        dprintk("%02X:", hw->CRTCEXT[i]);
    dprintk("\n");
#endif

    CRITBEGIN

    pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg);

    CRITEND

    matroxfb_vgaHWrestore(PMINFO2);

    CRITBEGIN

    ACCESS_FBINFO(crtc1.panpos) = -1;
    for (i = 0; i < 6; i++)
        mga_setr(M_EXTVGA_INDEX, i, hw->CRTCEXT[i]);

    for (i = 0; i < 21; i++) {
        outTi3026(PMINFO DACseq[i], hw->DACreg[i]);
    }

    outTi3026(PMINFO TVP3026_XPLLADDR, 0x00);
    progdac[0] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
    progdac[3] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);
    outTi3026(PMINFO TVP3026_XPLLADDR, 0x15);
    progdac[1] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
    progdac[4] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);
    outTi3026(PMINFO TVP3026_XPLLADDR, 0x2A);
    progdac[2] = inTi3026(PMINFO TVP3026_XPIXPLLDATA);
    progdac[5] = inTi3026(PMINFO TVP3026_XLOOPPLLDATA);

    CRITEND
    if (memcmp(hw->DACclk, progdac, 6)) {
        /* agrhh... setting up PLL is very slow on Millennium... */
        /* Mystique PLL is locked in few ms, but Millennium PLL lock takes about 0.15 s... */
        /* Maybe even we should call schedule() ? */

        CRITBEGIN
        outTi3026(PMINFO TVP3026_XCLKCTRL, hw->DACreg[POS3026_XCLKCTRL]);
        outTi3026(PMINFO TVP3026_XPLLADDR, 0x2A);
        outTi3026(PMINFO TVP3026_XLOOPPLLDATA, 0);
        outTi3026(PMINFO TVP3026_XPIXPLLDATA, 0);

        outTi3026(PMINFO TVP3026_XPLLADDR, 0x00);
        for (i = 0; i < 3; i++)
            outTi3026(PMINFO TVP3026_XPIXPLLDATA, hw->DACclk[i]);
        /* wait for PLL only if PLL clock requested (always for PowerMode, never for VGA) */
        if (hw->MiscOutReg & 0x08) {
            int tmout;
            outTi3026(PMINFO TVP3026_XPLLADDR, 0x3F);
            for (tmout = 500000; tmout; --tmout) {
                if (inTi3026(PMINFO TVP3026_XPIXPLLDATA) & 0x40)
                    break;
                udelay(10);
            }

            CRITEND

            if (!tmout)
                printk(KERN_ERR "matroxfb: Pixel PLL not locked after 5 secs\n");
            else
                dprintk(KERN_INFO "PixelPLL: %d\n", 500000-tmout);
            CRITBEGIN
        }