Commit 227dc115 authored by Peter Huewe's avatar Peter Huewe Committed by Greg Kroah-Hartman

staging/xgifb: Replace XGI340_CR6B table with simple if/else

The XGI340_CR6B lookup table consists of the entries
{0xaa, 0xaa, 0xaa, 0xaa} for an index <= 2 and
{0x00, 0x00, 0x00, 0x00} for all other indices.

The only user XGINew_SetDRAMDefaultRegister340 loops over these 4 values
of a line with a for loop and since all entries are the same for each line
we can simply replace the whole lookup table with a simple if/else assignment.
Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5056d87a
...@@ -429,7 +429,7 @@ static void XGINew_SetDRAMDefaultRegister340( ...@@ -429,7 +429,7 @@ static void XGINew_SetDRAMDefaultRegister340(
temp2 = 0; temp2 = 0;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
/* CR6B DQS fine tune delay */ /* CR6B DQS fine tune delay */
temp = XGI340_CR6B[pVBInfo->ram_type][i]; temp = (pVBInfo->ram_type <= 2) ? 0xaa : 0x00;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
temp1 = ((temp >> (2 * j)) & 0x03) << 2; temp1 = ((temp >> (2 * j)) & 0x03) << 2;
temp2 |= temp1; temp2 |= temp1;
......
...@@ -103,17 +103,6 @@ static const unsigned char XGI27_cr41[24][8] = { ...@@ -103,17 +103,6 @@ static const unsigned char XGI27_cr41[24][8] = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 23 CRC5 */ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} /* 23 CRC5 */
}; };
const unsigned char XGI340_CR6B[8][4] = {
{0xaa, 0xaa, 0xaa, 0xaa},
{0xaa, 0xaa, 0xaa, 0xaa},
{0xaa, 0xaa, 0xaa, 0xaa},
{0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00}
};
/* CR47,CR48,CR49,CR4A,CR4B,CR4C,CR70,CR71,CR74,CR75,CR76,CR77 */ /* CR47,CR48,CR49,CR4A,CR4B,CR4C,CR70,CR71,CR74,CR75,CR76,CR77 */
const unsigned char XGI340_AGPReg[12] = { const unsigned char XGI340_AGPReg[12] = {
0x28, 0x23, 0x00, 0x20, 0x00, 0x20, 0x28, 0x23, 0x00, 0x20, 0x00, 0x20,
......
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