diff options
| author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2013-02-08 17:03:44 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-08 18:39:57 -0500 |
| commit | 1b149edfa3496914d6b73a949dc03777ba172c88 (patch) | |
| tree | 7b6c038e15042c09ef1a092260180d6f41e9b14c | |
| parent | 7ac54d03920b3a100fa2f089a352367c906a867d (diff) | |
staging: xgifb: XGI_GetVBInfo(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 104 |
1 files changed, 35 insertions, 69 deletions
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index ee737377869b..9d7ec1832944 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
| @@ -1994,40 +1994,28 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 1994 | 1994 | ||
| 1995 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); | 1995 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); |
| 1996 | 1996 | ||
| 1997 | if (pVBInfo->IF_DEF_LVDS == 0) { | 1997 | if (pVBInfo->VBType & (VB_SIS302B | VB_SIS301LV | VB_SIS302LV | |
| 1998 | if (pVBInfo->VBType & | 1998 | VB_XGI301C)) { |
| 1999 | (VB_SIS302B | | 1999 | if (temp & EnableDualEdge) { |
| 2000 | VB_SIS301LV | | 2000 | tempbx |= SetCRT2ToDualEdge; |
| 2001 | VB_SIS302LV | | 2001 | if (temp & SetToLCDA) |
| 2002 | VB_XGI301C)) { | 2002 | tempbx |= XGI_SetCRT2ToLCDA; |
| 2003 | if (temp & EnableDualEdge) { | ||
| 2004 | tempbx |= SetCRT2ToDualEdge; | ||
| 2005 | if (temp & SetToLCDA) | ||
| 2006 | tempbx |= XGI_SetCRT2ToLCDA; | ||
| 2007 | } | ||
| 2008 | } | 2003 | } |
| 2009 | } | 2004 | } |
| 2010 | 2005 | ||
| 2011 | if (pVBInfo->IF_DEF_YPbPr == 1) { | 2006 | if (pVBInfo->IF_DEF_YPbPr == 1) { |
| 2012 | if (((pVBInfo->IF_DEF_LVDS == 0) && | 2007 | if (pVBInfo->VBType & (VB_SIS301LV|VB_SIS302LV|VB_XGI301C)) { |
| 2013 | ((pVBInfo->VBType & VB_SIS301LV) || | ||
| 2014 | (pVBInfo->VBType & VB_SIS302LV) || | ||
| 2015 | (pVBInfo->VBType & VB_XGI301C)))) { | ||
| 2016 | if (temp & SetYPbPr) { | 2008 | if (temp & SetYPbPr) { |
| 2017 | if (pVBInfo->IF_DEF_HiVision == 1) { | 2009 | if (pVBInfo->IF_DEF_HiVision == 1) { |
| 2018 | /* shampoo add for new | 2010 | /* shampoo add for new scratch */ |
| 2019 | * scratch */ | 2011 | temp = xgifb_reg_get(pVBInfo->P3d4, |
| 2020 | temp = xgifb_reg_get( | 2012 | 0x35); |
| 2021 | pVBInfo->P3d4, | ||
| 2022 | 0x35); | ||
| 2023 | temp &= YPbPrMode; | 2013 | temp &= YPbPrMode; |
| 2024 | tempbx |= SetCRT2ToHiVision; | 2014 | tempbx |= SetCRT2ToHiVision; |
| 2025 | 2015 | ||
| 2026 | if (temp != YPbPrMode1080i) { | 2016 | if (temp != YPbPrMode1080i) { |
| 2027 | tempbx &= | 2017 | tempbx &= (~SetCRT2ToHiVision); |
| 2028 | (~SetCRT2ToHiVision); | 2018 | tempbx |= SetCRT2ToYPbPr525750; |
| 2029 | tempbx |= | ||
| 2030 | SetCRT2ToYPbPr525750; | ||
| 2031 | } | 2019 | } |
| 2032 | } | 2020 | } |
| 2033 | } | 2021 | } |
| @@ -2036,19 +2024,15 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 2036 | 2024 | ||
| 2037 | tempax = push; /* restore CR31 */ | 2025 | tempax = push; /* restore CR31 */ |
| 2038 | 2026 | ||
| 2039 | if (pVBInfo->IF_DEF_LVDS == 0) { | 2027 | if (pVBInfo->IF_DEF_YPbPr == 1) { |
| 2040 | if (pVBInfo->IF_DEF_YPbPr == 1) { | 2028 | if (pVBInfo->IF_DEF_HiVision == 1) |
| 2041 | if (pVBInfo->IF_DEF_HiVision == 1) | 2029 | temp = 0x09FC; |
| 2042 | temp = 0x09FC; | 2030 | else |
| 2043 | else | 2031 | temp = 0x097C; |
| 2044 | temp = 0x097C; | 2032 | } else if (pVBInfo->IF_DEF_HiVision == 1) { |
| 2045 | } else if (pVBInfo->IF_DEF_HiVision == 1) { | 2033 | temp = 0x01FC; |
| 2046 | temp = 0x01FC; | 2034 | } else { |
| 2047 | } else { | 2035 | temp = 0x017C; |
| 2048 | temp = 0x017C; | ||
| 2049 | } | ||
| 2050 | } else { /* 3rd party chip */ | ||
| 2051 | temp = SetCRT2ToLCD; | ||
| 2052 | } | 2036 | } |
| 2053 | 2037 | ||
| 2054 | if (!(tempbx & temp)) { | 2038 | if (!(tempbx & temp)) { |
| @@ -2059,14 +2043,11 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 2059 | if (!(pVBInfo->VBType & VB_NoLCD)) { | 2043 | if (!(pVBInfo->VBType & VB_NoLCD)) { |
| 2060 | if (tempbx & XGI_SetCRT2ToLCDA) { | 2044 | if (tempbx & XGI_SetCRT2ToLCDA) { |
| 2061 | if (tempbx & SetSimuScanMode) | 2045 | if (tempbx & SetSimuScanMode) |
| 2062 | tempbx &= (~(SetCRT2ToLCD | | 2046 | tempbx &= (~(SetCRT2ToLCD | SetCRT2ToRAMDAC | |
| 2063 | SetCRT2ToRAMDAC | | ||
| 2064 | SwitchCRT2)); | 2047 | SwitchCRT2)); |
| 2065 | else | 2048 | else |
| 2066 | tempbx &= (~(SetCRT2ToLCD | | 2049 | tempbx &= (~(SetCRT2ToLCD | SetCRT2ToRAMDAC | |
| 2067 | SetCRT2ToRAMDAC | | 2050 | SetCRT2ToTV | SwitchCRT2)); |
| 2068 | SetCRT2ToTV | | ||
| 2069 | SwitchCRT2)); | ||
| 2070 | } | 2051 | } |
| 2071 | } | 2052 | } |
| 2072 | 2053 | ||
| @@ -2075,49 +2056,38 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 2075 | if (!(tempbx & (SwitchCRT2 | SetSimuScanMode))) { | 2056 | if (!(tempbx & (SwitchCRT2 | SetSimuScanMode))) { |
| 2076 | if (pVBInfo->IF_DEF_CRT2Monitor == 1) { | 2057 | if (pVBInfo->IF_DEF_CRT2Monitor == 1) { |
| 2077 | if (tempbx & SetCRT2ToRAMDAC) { | 2058 | if (tempbx & SetCRT2ToRAMDAC) { |
| 2078 | tempbx &= (0xFF00 | | 2059 | tempbx &= (0xFF00 | SetCRT2ToRAMDAC | |
| 2079 | SetCRT2ToRAMDAC | | 2060 | SwitchCRT2 | SetSimuScanMode); |
| 2080 | SwitchCRT2 | | ||
| 2081 | SetSimuScanMode); | ||
| 2082 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); | 2061 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); |
| 2083 | } | 2062 | } |
| 2084 | } else { | 2063 | } else { |
| 2085 | tempbx &= (~(SetCRT2ToRAMDAC | | 2064 | tempbx &= (~(SetCRT2ToRAMDAC | SetCRT2ToLCD | |
| 2086 | SetCRT2ToLCD | | ||
| 2087 | SetCRT2ToTV)); | 2065 | SetCRT2ToTV)); |
| 2088 | } | 2066 | } |
| 2089 | } | 2067 | } |
| 2090 | 2068 | ||
| 2091 | if (!(pVBInfo->VBType & VB_NoLCD)) { | 2069 | if (!(pVBInfo->VBType & VB_NoLCD)) { |
| 2092 | if (tempbx & SetCRT2ToLCD) { | 2070 | if (tempbx & SetCRT2ToLCD) { |
| 2093 | tempbx &= (0xFF00 | | 2071 | tempbx &= (0xFF00 | SetCRT2ToLCD | SwitchCRT2 | |
| 2094 | SetCRT2ToLCD | | ||
| 2095 | SwitchCRT2 | | ||
| 2096 | SetSimuScanMode); | 2072 | SetSimuScanMode); |
| 2097 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); | 2073 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); |
| 2098 | } | 2074 | } |
| 2099 | } | 2075 | } |
| 2100 | 2076 | ||
| 2101 | if (tempbx & SetCRT2ToSCART) { | 2077 | if (tempbx & SetCRT2ToSCART) { |
| 2102 | tempbx &= (0xFF00 | | 2078 | tempbx &= (0xFF00 | SetCRT2ToSCART | SwitchCRT2 | |
| 2103 | SetCRT2ToSCART | | ||
| 2104 | SwitchCRT2 | | ||
| 2105 | SetSimuScanMode); | 2079 | SetSimuScanMode); |
| 2106 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); | 2080 | tempbx &= (0x00FF | (~SetCRT2ToYPbPr525750)); |
| 2107 | } | 2081 | } |
| 2108 | 2082 | ||
| 2109 | if (pVBInfo->IF_DEF_YPbPr == 1) { | 2083 | if (pVBInfo->IF_DEF_YPbPr == 1) { |
| 2110 | if (tempbx & SetCRT2ToYPbPr525750) | 2084 | if (tempbx & SetCRT2ToYPbPr525750) |
| 2111 | tempbx &= (0xFF00 | | 2085 | tempbx &= (0xFF00 | SwitchCRT2 | SetSimuScanMode); |
| 2112 | SwitchCRT2 | | ||
| 2113 | SetSimuScanMode); | ||
| 2114 | } | 2086 | } |
| 2115 | 2087 | ||
| 2116 | if (pVBInfo->IF_DEF_HiVision == 1) { | 2088 | if (pVBInfo->IF_DEF_HiVision == 1) { |
| 2117 | if (tempbx & SetCRT2ToHiVision) | 2089 | if (tempbx & SetCRT2ToHiVision) |
| 2118 | tempbx &= (0xFF00 | | 2090 | tempbx &= (0xFF00 | SetCRT2ToHiVision | SwitchCRT2 | |
| 2119 | SetCRT2ToHiVision | | ||
| 2120 | SwitchCRT2 | | ||
| 2121 | SetSimuScanMode); | 2091 | SetSimuScanMode); |
| 2122 | } | 2092 | } |
| 2123 | 2093 | ||
| @@ -2127,19 +2097,15 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
| 2127 | } | 2097 | } |
| 2128 | 2098 | ||
| 2129 | if (!(tempbx & DisableCRT2Display)) { | 2099 | if (!(tempbx & DisableCRT2Display)) { |
| 2130 | if ((!(tempbx & DriverMode)) || | 2100 | if ((!(tempbx & DriverMode)) || (!(modeflag & CRT2Mode))) { |
| 2131 | (!(modeflag & CRT2Mode))) { | ||
| 2132 | if (!(tempbx & XGI_SetCRT2ToLCDA)) | 2101 | if (!(tempbx & XGI_SetCRT2ToLCDA)) |
| 2133 | tempbx |= (SetInSlaveMode | | 2102 | tempbx |= (SetInSlaveMode | SetSimuScanMode); |
| 2134 | SetSimuScanMode); | ||
| 2135 | } | 2103 | } |
| 2136 | 2104 | ||
| 2137 | /* LCD+TV can't support in slave mode | 2105 | /* LCD+TV can't support in slave mode |
| 2138 | * (Force LCDA+TV->LCDB) */ | 2106 | * (Force LCDA+TV->LCDB) */ |
| 2139 | if ((tempbx & SetInSlaveMode) && | 2107 | if ((tempbx & SetInSlaveMode) && (tempbx & XGI_SetCRT2ToLCDA)) { |
| 2140 | (tempbx & XGI_SetCRT2ToLCDA)) { | 2108 | tempbx ^= (SetCRT2ToLCD | XGI_SetCRT2ToLCDA | |
| 2141 | tempbx ^= (SetCRT2ToLCD | | ||
| 2142 | XGI_SetCRT2ToLCDA | | ||
| 2143 | SetCRT2ToDualEdge); | 2109 | SetCRT2ToDualEdge); |
| 2144 | pVBInfo->SetFlag |= ReserveTVOption; | 2110 | pVBInfo->SetFlag |= ReserveTVOption; |
| 2145 | } | 2111 | } |
