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

staging: xgifb: use a real pointer for TV DATAPTR

Replace DATAPTR numbers with a real pointer to make code simpler.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 24572545
...@@ -1791,53 +1791,7 @@ static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo, ...@@ -1791,53 +1791,7 @@ static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo,
i++; i++;
} }
switch (XGI_TVDataTable[i].DATAPTR) { return &XGI_TVDataTable[i].DATAPTR[tempal];
case 0:
return &XGI_ExtPALData[tempal];
break;
case 1:
return &XGI_ExtNTSCData[tempal];
break;
case 2:
return &XGI_StPALData[tempal];
break;
case 3:
return &XGI_StNTSCData[tempal];
break;
case 4:
return &XGI_ExtHiTVData[tempal];
break;
case 5:
return &XGI_St2HiTVData[tempal];
break;
case 6:
return &XGI_ExtYPbPr525iData[tempal];
break;
case 7:
return &XGI_ExtYPbPr525pData[tempal];
break;
case 8:
return &XGI_ExtYPbPr750pData[tempal];
break;
case 9:
return &XGI_StYPbPr525iData[tempal];
break;
case 10:
return &XGI_StYPbPr525pData[tempal];
break;
case 11:
return &XGI_StYPbPr750pData[tempal];
break;
case 12: /* avoid system hang */
return &XGI_ExtNTSCData[tempal];
break;
case 13:
return &XGI_St1HiTVData[tempal];
break;
default:
break;
}
return NULL;
} }
static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
......
...@@ -69,7 +69,7 @@ struct XGI330_LCDDataTablStruct { ...@@ -69,7 +69,7 @@ struct XGI330_LCDDataTablStruct {
struct XGI330_TVDataTablStruct { struct XGI330_TVDataTablStruct {
unsigned short MASK; unsigned short MASK;
unsigned short CAP; unsigned short CAP;
unsigned short DATAPTR; struct SiS_TVData const *DATAPTR;
}; };
......
...@@ -1872,21 +1872,21 @@ static struct XGI330_LCDDataTablStruct XGI_EPLCHLCDRegPtr[] = { ...@@ -1872,21 +1872,21 @@ static struct XGI330_LCDDataTablStruct XGI_EPLCHLCDRegPtr[] = {
{0xFF, 0x0000, 0x0000, 0} {0xFF, 0x0000, 0x0000, 0}
}; };
static struct XGI330_TVDataTablStruct XGI_TVDataTable[] = { static const struct XGI330_TVDataTablStruct XGI_TVDataTable[] = {
{0x09E1, 0x0001, 0}, /* XGI_ExtPALData */ {0x09E1, 0x0001, XGI_ExtPALData},
{0x09E1, 0x0000, 1}, /* XGI_ExtNTSCData */ {0x09E1, 0x0000, XGI_ExtNTSCData},
{0x09E1, 0x0801, 2}, /* XGI_StPALData */ {0x09E1, 0x0801, XGI_StPALData},
{0x09E1, 0x0800, 3}, /* XGI_StNTSCData */ {0x09E1, 0x0800, XGI_StNTSCData},
{0x49E0, 0x0100, 4}, /* XGI_ExtHiTVData */ {0x49E0, 0x0100, XGI_ExtHiTVData},
{0x49E0, 0x4100, 5}, /* XGI_St2HiTVData */ {0x49E0, 0x4100, XGI_St2HiTVData},
{0x49E0, 0x4900, 13}, /* XGI_St1HiTVData */ {0x49E0, 0x4900, XGI_St1HiTVData},
{0x09E0, 0x0020, 6}, /* XGI_ExtYPbPr525iData */ {0x09E0, 0x0020, XGI_ExtYPbPr525iData},
{0x09E0, 0x0040, 7}, /* XGI_ExtYPbPr525pData */ {0x09E0, 0x0040, XGI_ExtYPbPr525pData},
{0x09E0, 0x0080, 8}, /* XGI_ExtYPbPr750pData */ {0x09E0, 0x0080, XGI_ExtYPbPr750pData},
{0x09E0, 0x0820, 9}, /* XGI_StYPbPr525iData */ {0x09E0, 0x0820, XGI_StYPbPr525iData},
{0x09E0, 0x0840, 10}, /* XGI_StYPbPr525pData */ {0x09E0, 0x0840, XGI_StYPbPr525pData},
{0x09E0, 0x0880, 11}, /* XGI_StYPbPr750pData */ {0x09E0, 0x0880, XGI_StYPbPr750pData},
{0xffff, 0x0000, 12} /* END */ {0xffff, 0x0000, XGI_ExtNTSCData},
}; };
static unsigned short LCDLenList[] = { static unsigned short LCDLenList[] = {
......
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