summaryrefslogtreecommitdiff
path: root/drivers/staging/xgifb
AgeCommit message (Collapse)Author
2013-05-30staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checksAaro Koskinen
Code checking for IF_DEF_CRT2Monitor is only executed for chips < XG20, and there IF_DEF_CRT2Monitor is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: vb_setmode: delete IF_DEF_HiVision checksAaro Koskinen
Code checking for IF_DEF_HiVision is only executed for chips < XG20, and there IF_DEF_HiVision is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: vb_setmode: delete IF_DEF_YPbPr checksAaro Koskinen
Code checking for IF_DEF_YPbPr is only executed for chips < XG20, and there IF_DEF_YPbPr is always true, so the flag is redundant. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: delete redundant return statementsAaro Koskinen
Delete redundant return statements at the end of void functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_DisableBridge(): delete redundant checksAaro Koskinen
Delete some redudant checks. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_EnableChISLCD(): delete trivial functionAaro Koskinen
The function returns always false, delete it. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: SetFlag: delete EnableChAAaro Koskinen
This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: SetFlag: delete DisableChAAaro Koskinen
This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: SetFlag: delete EnableChBAaro Koskinen
This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: SetFlag: delete DisableChBAaro Koskinen
This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: SetFlag: delete GatingCRTAaro Koskinen
This flag is never set, so checks can be removed and code behind it deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_SetCRT1VCLK(): avoid copy-pasteAaro Koskinen
Avoid copy-pasted code in if branches by rearranging the checks. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_GetRatePtrCRT2(): delete IF_DEF_LVDS checkAaro Koskinen
IF_DEF_LVDS cannot be set if ProgrammingCRT2 flag is set, so remove the check to simplify the code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_AjustCRT2Rate(): delete IF_DEF_LVDS checkAaro Koskinen
IF_DEF_LVDS cannot be set when XGI_AjustCRT2Rate() is called, so we can remove the check and dead code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: call XGI_GetVBType from InitTo330PointerAaro Koskinen
Move XGI_GetVBType call inside InitTo330Pointer to avoid code duplication. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: XGI_GetVBType(): delete IF_DEF_LVDS checkAaro Koskinen
XGI_GetVBType() is called only for chips < XG20 so IF_DEF_LVDS cannot be set. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30staging: xgifb: refactor XGI_BridgeIsOn()Aaro Koskinen
Refactor XGI_BridgeIsOn(). IF_DEF_LVDS bit is not valid for < XG20 chips. Also we can make the function static by moving it to vb_init. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17staging/xgifb: Remove dead assignments/incrementsPeter Huewe
The code now contains several dead assignments which are shadowed by another assignment a few lines later. -> This patch removes them (and possibly associated code). Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging/xgifb: Fix always false condition in vb_setmode.c (smatch)Peter Huewe
Smatch complains: drivers/staging/xgifb/vb_setmode.c:3181 XGI_SetLockRegs() warn: bitwise AND condition is false here Since SetNTSCTV is defined as 0 in drivers/video/sis/initdef.h this is correct. -> Change the condition to == to fix this. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBitsPeter Huewe
If temp <= 2 no other bits than the lowest two (0x03) can be set anyway -> this operation can be removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging/xgifb: Consolidate function almost identical calls in ↵Peter Huewe
XGINew_GetXG21Sense Instead of calling xgifb_reg_and_or with almost identical parameters in a simple if/else scenario, we assign the changing parameter to a temp variable and call xgifb_reg_and_or only from one location. -> Easier to read, easier to understand (especially wrt the line breaks) (For the if condition we don't need the Temp variable, so we can use the value directly). Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging/xgifb: Remove unnecessary cases in XGINew_SenseLCDPeter Huewe
The switch statement sets the temp value to zero for certain cases and leaves it untouched for other cases -> all these other cases can be combined in the default case. Since an empty case containing only a break, it can be removed. The patch also removes the if statement, as it uses the same value as the switch for comparison, and includes the code into the switch. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging/xgifb: Remove uneccessary/simply if in XGINew_GetXG20DRAMTypePeter Huewe
Instead of storing the value in a temp variable, anding it with 1 and assign data conditionally we can assign the value directly. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: rename SR15/SR13 arrays to SR18Aaro Koskinen
Since we are programming SR register 18, better name structs/arrays accordingly to avoid confusion. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: make SR15/SR13 arrays single dimensionalAaro Koskinen
Since we only access the third row, we can delete the others. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: XGINew_SetDRAMDefaultRegister340: inline the value of SR1BAaro Koskinen
SR1B register value is always 3 regardless of video card or RAM type. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete pXGINew_DRAMTypeDefinitionAaro Koskinen
Delete unused struct field. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete XGI330_LCDCapStruct.PWD_2xAaro Koskinen
Delete unused XGI330_LCDCapStruct fields. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete XGI330_LCDCapStruct.PSC_SxAaro Koskinen
Delete unused XGI330_LCDCapStruct fields. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete LCD_SetFlagAaro Koskinen
Delete redundant XGI330_LCDCapStruct field. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete IF_DEF_TRUMPION and IF_DEF_DSTNAaro Koskinen
Delete some unused flags. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: eliminate IF_DEF_LVDS checks from vb_initAaro Koskinen
Inside vb_init, IF_DEF_LVDS tells only if the vbios was succesfully read on XG21. Rearrange the code so that we don't need to set or care about this flag. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28staging: xgifb: delete redundant IF_DEF_LVDS checkAaro Koskinen
IF_DEF_LVDS can be set only on XG21. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/xgifb: Remove duplicated code in loops.Peter Huewe
Instead of calling the same function three times in a loop, multiply the loop counter by three. And since the value in DAC_TEST_PARMS is always the same we can use the value directly. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/xgifb: Consolidate return pathsPeter Huewe
Both branches of this if statement end in the same return statement. -> move the return to the bottom and get rid of the else statement. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/xgifb: Remove code without effectPeter Huewe
The tempal variable is assigned and then immediately overwritten. -> remove everything without effect. The inb is kept for possible side effects. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/xgifb: Remove unnecessary castsPeter Huewe
Both functions xgifb_reg_get and inb return an u8 value, so we don't need to cast their return value to unsigned char. -> remove the cast Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/xgifb: Consolidate if/else if with identical code branchesPeter Huewe
Both branches of this if statement execute the same code. Thus we can || them together and remove code duplication Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08staging: xgifb: XGI_SetDelayComp(): delete IF_DEF_LVDS checkAaro Koskinen
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>
2013-02-08staging: xgifb: XGI_GetCRT2ResInfo(): delete IF_DEF_LVDS checkAaro Koskinen
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>
2013-02-08staging: xgifb: XGI_GetLCDInfo(): delete IF_DEF_LVDS checkAaro Koskinen
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>
2013-02-08staging: xgifb: XGI_GetTVInfo(): delete IF_DEF_LVDS checksAaro Koskinen
This function is never called when pVBInfo->IF_DEF_LVDS is true, so we can remove checks and reduce complexity. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08staging: xgifb: XGI_GetVBInfo(): delete IF_DEF_LVDS checkAaro Koskinen
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>
2013-02-08staging: xgifb: XGI_GetVCLK2Ptr(): delete IF_DEF_LVDS checkAaro Koskinen
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>
2013-02-07staging: xgifb: initialize register 3cc addressAaro Koskinen
Commit 56810a92c689c64d586a51a1078c5d307b24e8eb (staging: xgifb: use XGIRegInit()) left 3cc uninitialized, and it may trigger a panic during probe. Fix this. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Remove always false if statementPeter Huewe
MCLKData does not contain any 0x1C value for its field SR28 nor does XGI340_ECLKData contain any 0x1C or 0x22 value for its field SR2E. -> the statement always evaluates to false. -> remove Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Remove unneeded conditional assignmentPeter Huewe
pVBInfo->ram_type is assigned the return value of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 -> The conditional assignment is not needed here as it always evaluates to true. -> remove Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Remove unused values in XGI340_ECLKDataPeter Huewe
In the lookup table XGI340_ECLKData only the first three 'lines' are used, thus the remaining entries can be removed. Rationale: - vb_init.c uses pVBInfo->ram_type as the index for XGI340_ECLKData. - pVBInfo->ram_type is assigned the return value of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 -> only the first three values are used. -> remove the remeining entries. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Remove unused entries in XGI340New_MCLKData and XGI27New_MCLKDataPeter Huewe
In the lookup tables XGI340New_MCLKData and XGI27New_MCLKData only the first three 'lines' are used, thus the remaining fields can be removed. Rationale: - vb_init.c uses pVBInfo->ram_type as the index for pVBInfo->MCLKData - pVBInfo->ram_type is assigned the return value of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 - pVBInfo->MCLKData is assigned to either XGI340New_MCLKData or XGI27New_MCLKData in vb_setmode.c -> only the first three values are used, the rest can be removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Remove unused values in XG27_SR13 and XGI340_SR13Peter Huewe
In the lookup tables XG27_SR13 and XGI340_SR13 only the first three values are used of each 'line', thus the remaining fields can be removed. Rationale: - vb_init.c uses pVBInfo->ram_type for the 'column' index for pVBInfo->SR15. - pVBInfo->ram_type is assigned the return value of XGINew_GetXG20DRAMType which can only be 0, 1 or 2 - pVBInfo->SR15 is assigned to either XG27_SR13 or XGI340_SR13 in vb_setmode.c -> only the first three values are used. This becomes also evident as values 3-7 are all 0. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>