alpine 3.7
obsolete weakness #21

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

xf86-video-openchrome/src/xf86-video-openchrome-0.6.0/src/via_ch7xxx.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.7 obsolete weakness.

 						 "CH7xxxLCDPower: CH7019 PLL lock ok!\n"));
				/* reset data path */
				W_Buffer[0] = 0x48;
				xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1);
				W_Buffer[1] = R_Buffer[0] & ~0x08;
				xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0);
				usleep(1);
				W_Buffer[1] = R_Buffer[0];
				xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0);
				break;
			}

            DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                             "CH7xxxLCDPower: [%d]CH7019 PLL lock fail!\n", i+1));
            DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                             "CH7xxxLCDPower: [%d]0x66 = %X!\n", i+1, R_Buffer[0]));
		}
	}else{
		DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CH7xxxLCDPower: Off\n"));
		/* Turn off VDD (Turn off backlignt only) */
		W_Buffer[0] = 0x66;
		xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1);
		W_Buffer[1] &= ~0x01;
		xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0);
		usleep(100);
		/* Turn off LVDS path */
		W_Buffer[0] = 0x63;
		xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,1, R_Buffer,1);
		W_Buffer[1] = (R_Buffer[0] | 0x40);
		xf86I2CWriteRead(pBIOSInfo->TVI2CDev, W_Buffer,2, NULL,0);
	}
}

/*
 *
 */
void
ViaCH7xxxInit(ScrnInfoPtr pScrn)
{
    VIABIOSInfoPtr pBIOSInfo = VIAPTR(pScrn)->pBIOSInfo;

    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaCH7xxxInit\n"));

    switch (pBIOSInfo->TVEncoder) {
        case VIA_CH7011:
            pBIOSInfo->TVSave = CH7xxxSave;
            pBIOSInfo->TVRestore = CH7xxxRestore;
            pBIOSInfo->TVDACSense = CH7xxxDACSense;
            pBIOSInfo->TVModeValid = CH7xxxModeValid;
            pBIOSInfo->TVModeI2C = CH7xxxModeI2C; 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.