Commit ec9e5d3e authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: rename XGINew_SetRegANDOR() to xgifb_reg_and_or()

Rename XGINew_SetRegANDOR() to xgifb_reg_and_or().
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b9bf6e4e
......@@ -34,7 +34,7 @@ static unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx,
xgifb_reg_set(pVBInfo->Part4Port, 0x11, temp);
temp = (tempbx & 0xFF00) >> 8;
temp |= (tempcx & 0x00FF);
XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
xgifb_reg_and_or(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
for (i = 0; i < 10; i++)
XGI_LongWait(pVBInfo);
......@@ -87,7 +87,7 @@ static unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExt
default:
break;
}
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x36, 0xF0, temp);
xgifb_reg_and_or(pVBInfo->P3d4, 0x36, 0xF0, temp);
return 1;
}
}
......@@ -148,7 +148,7 @@ static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
tempbx = PanelTypeTable[tempbx];
temp = (tempbx & 0xFF00) >> 8;
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~(LCDSyncBit
xgifb_reg_and_or(pVBInfo->P3d4, 0x37, ~(LCDSyncBit
| LCDRGB18Bit), temp);
return 1;
}
......@@ -182,7 +182,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi
xgifb_reg_set(pVBInfo->Part4Port, 0x11, temp);
temp = (tempbx & 0xFF00) >> 8;
temp |= (tempcx & 0x00FF);
XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
xgifb_reg_and_or(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
for (i = 0; i < 10; i++)
XGI_LongWait(pVBInfo);
......@@ -202,7 +202,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi
xgifb_reg_set(pVBInfo->Part4Port, 0x11, temp);
temp = (tempbx & 0xFF00) >> 8;
temp |= (tempcx & 0x00FF);
XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
xgifb_reg_and_or(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
for (i = 0; i < 10; i++)
XGI_LongWait(pVBInfo);
......@@ -221,7 +221,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi
xgifb_reg_set(pVBInfo->Part4Port, 0x11, temp);
temp = (tempbx & 0xFF00) >> 8;
temp |= (tempcx & 0x00FF);
XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
xgifb_reg_and_or(pVBInfo->Part4Port, 0x10, ~0x1F, temp);
for (i = 0; i < 10; i++)
XGI_LongWait(pVBInfo);
......@@ -251,8 +251,8 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
if (tempax == 0x00) { /* Get Panel id from DDC */
temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo);
if (temp == 1) { /* LCD connect */
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x39, 0xFF, 0x01); /* set CR39 bit0="1" */
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, 0xEF, 0x00); /* clean CR37 bit4="0" */
xgifb_reg_and_or(pVBInfo->P3d4, 0x39, 0xFF, 0x01); /* set CR39 bit0="1" */
xgifb_reg_and_or(pVBInfo->P3d4, 0x37, 0xEF, 0x00); /* clean CR37 bit4="0" */
temp = LCDSense;
} else { /* LCD don't connect */
temp = 0;
......@@ -263,14 +263,14 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
}
tempbx = ~(LCDSense | AVIDEOSense | SVIDEOSense);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, tempbx, temp);
xgifb_reg_and_or(pVBInfo->P3d4, 0x32, tempbx, temp);
} else { /* for 301 */
if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) { /* for HiVision */
tempax = xgifb_reg_get(pVBInfo->P3c4, 0x38);
temp = tempax & 0x01;
tempax = xgifb_reg_get(pVBInfo->P3c4, 0x3A);
temp = temp | (tempax & 0x02);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xA0, temp);
xgifb_reg_and_or(pVBInfo->P3d4, 0x32, 0xA0, temp);
} else {
if (XGI_BridgeIsOn(pVBInfo)) {
P2reg0 = xgifb_reg_get(pVBInfo->Part2Port, 0x00);
......@@ -291,7 +291,7 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
XGI_SetCRT2Group301(SenseModeNo, HwDeviceExtension, pVBInfo);
XGI_SetCRT2ModeRegs(0x2e, HwDeviceExtension, pVBInfo);
/* XGI_DisableBridge( HwDeviceExtension, pVBInfo ) ; */
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x20); /* Display Off 0212 */
xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x20); /* Display Off 0212 */
for (i = 0; i < 20; i++)
XGI_LongWait(pVBInfo);
}
......@@ -365,7 +365,7 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
tempcx = 0;
XGINew_Sense(tempbx, tempcx, pVBInfo);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~0xDF, tempax);
xgifb_reg_and_or(pVBInfo->P3d4, 0x32, ~0xDF, tempax);
xgifb_reg_set(pVBInfo->Part2Port, 0x00, P2reg0);
if (!(P2reg0 & 0x20)) {
......
......@@ -421,7 +421,7 @@ static void XGINew_SetDRAMDefaultRegister340(
temp3 = 0;
for (k = 0; k < 4; k++) {
XGINew_SetRegANDOR(P3d4, 0x6E, 0xFC, temp3); /* CR6E_D[1:0] select channel */
xgifb_reg_and_or(P3d4, 0x6E, 0xFC, temp3); /* CR6E_D[1:0] select channel */
temp2 = 0;
for (i = 0; i < 8; i++) {
temp = pVBInfo->CR6F[XGINew_RAMType][8 * k + i]; /* CR6F DQ fine tune delay */
......@@ -516,7 +516,7 @@ static void XGINew_SetDRAMSizingType(int index,
unsigned short data;
data = DRAMTYPE_TABLE[index][4];
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x13, 0x80, data);
xgifb_reg_and_or(pVBInfo->P3c4, 0x13, 0x80, data);
udelay(15);
/* should delay 50 ns */
}
......@@ -1197,20 +1197,20 @@ static void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension,
if ((pVideoMemory[0x65] & 0x01)) { /* For XG21 LVDS */
pVBInfo->IF_DEF_LVDS = 1;
xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); /* LVDS on chip */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); /* LVDS on chip */
} else {
#endif
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* Enable GPIOA/B read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* Enable GPIOA/B read */
Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0xC0;
if (Temp == 0xC0) { /* DVI & DVO GPIOA/B pull high */
XGINew_SenseLCD(HwDeviceExtension, pVBInfo);
xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x20, 0x20); /* Enable read GPIOF */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x20, 0x20); /* Enable read GPIOF */
Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x04;
if (!Temp)
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0x80); /* TMDS on chip */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0x80); /* TMDS on chip */
else
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); /* Only DVO on chip */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); /* Only DVO on chip */
XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Disable read GPIOF */
}
#if 1
......@@ -1225,16 +1225,16 @@ static void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension,
pVBInfo->IF_DEF_LVDS = 0;
bCR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x07, 0x07); /* Enable GPIOA/B/C read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x07, 0x07); /* Enable GPIOA/B/C read */
Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x07;
xgifb_reg_set(pVBInfo->P3d4, 0x4A, bCR4A);
if (Temp <= 0x02) {
pVBInfo->IF_DEF_LVDS = 1;
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); /* LVDS setting */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); /* LVDS setting */
xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x21);
} else {
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); /* TMDS/DVO setting */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); /* TMDS/DVO setting */
}
xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense);
......@@ -1245,7 +1245,7 @@ static unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo)
unsigned char CR38, CR4A, temp;
CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x10, 0x10); /* enable GPIOE read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x10, 0x10); /* enable GPIOE read */
CR38 = xgifb_reg_get(pVBInfo->P3d4, 0x38);
temp = 0;
if ((CR38 & 0xE0) > 0x80) {
......@@ -1264,7 +1264,7 @@ static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo)
unsigned char CR4A, temp;
CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* enable GPIOA/B/C read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* enable GPIOA/B/C read */
temp = xgifb_reg_get(pVBInfo->P3d4, 0x48);
if (temp <= 2)
temp &= 0x03;
......@@ -1490,7 +1490,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)
if (HwDeviceExtension->jChipType < XG20) { /* kuku 2004/06/25 */
/* Set VB */
XGI_UnLockCRT2(HwDeviceExtension, pVBInfo);
XGINew_SetRegANDOR(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00); /* alan, disable VideoCapture */
xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00); /* alan, disable VideoCapture */
xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00);
temp1 = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x7B); /* chk if BCLK>=100MHz */
temp = (unsigned char) ((temp1 >> 4) & 0x0F);
......@@ -1551,16 +1551,16 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)
if (HwDeviceExtension->jChipType == XG21) {
printk("186");
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
xgifb_reg_and_or(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
temp = GetXG21FPBits(pVBInfo);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x01, temp);
xgifb_reg_and_or(pVBInfo->P3d4, 0x37, ~0x01, temp);
printk("187");
}
if (HwDeviceExtension->jChipType == XG27) {
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
xgifb_reg_and_or(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
temp = GetXG27FPBits(pVBInfo);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x03, temp);
xgifb_reg_and_or(pVBInfo->P3d4, 0x37, ~0x03, temp);
}
printk("19");
......
This diff is collapsed.
......@@ -24,7 +24,7 @@ unsigned char xgifb_reg_get(unsigned long port, unsigned short index)
return data;
}
void XGINew_SetRegANDOR(unsigned long Port, unsigned short Index,
void xgifb_reg_and_or(unsigned long Port, unsigned short Index,
unsigned short DataAND, unsigned short DataOR)
{
unsigned short temp;
......
......@@ -4,6 +4,6 @@ extern void xgifb_reg_set(unsigned long, unsigned short, unsigned short);
extern unsigned char xgifb_reg_get(unsigned long, unsigned short);
extern void xgifb_reg_or(unsigned long, unsigned short, unsigned short);
extern void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND);
extern void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index,unsigned short DataAND,unsigned short DataOR);
extern void xgifb_reg_and_or(unsigned long, unsigned short, unsigned short, unsigned short);
#endif
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