summaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb/vb_init.c
AgeCommit message (Collapse)Author
2016-03-30staging: xgifb: fix block commentsClifton Barnes
fix checkpatch.pl warning about 'Block comments use a trailing */ on a separate line' and 'Block comments use * on subsequent lines' Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29staging: xgifb: fix 'line over 80 characters'Clifton Barnes
fix checkpatch.pl warning about 'line over 80 characters' Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: xgifb: Fix comment styleJanani Ravichandran
Fix comments to use trailing */ on separate lines. Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24Staging: xgifb: Remove space after castNavya Sri Nizamkari
This patch fixes the checkpatch check: CHECK: No space is necessary after a cast Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24Staging: xgifb: Fix comparison to NULL warningNavya Sri Nizamkari
Change comparison to NULL to a ! operation. Found using checkpatch. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24Staging: xgifb: Remove extra blank lines.Navya Sri Nizamkari
This patch fixes the checkpatch.pl check: CHECK: Please don't use multiple blank lines Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24Staging: xgifb: Remove blank line before } and after {Navya Sri Nizamkari
Remove blank line after { and before }. Problem found using checkpatch. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24Staging: xgifb: Replace udelay, mdelay functions with usleep_rangeNavya Sri Nizamkari
This patch fixes the checkpatch.pl check: CHECK: usleep_range is preferred over udelay. Replace mdelay with usleep_range function too. Add 1 millisecond to the delay time to get a reasonable upper limit which saves one wakeup call. Do same throughout the file. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: xgifb: remove unnecessary elseThomas Gummerer
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25staging: xgifb coding style cleanupVitor Braga
This fixes "missing a blank line after declaration" warnings from checkpatch.pl for driver xgifb. The driver has no remaining errors or warnings from checkpatch.pl Signed-off-by: Vitor Braga <vitorpybraga@gmail.com> Reviewed-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: xgifb: delete unused "pVBInfo" parametersAaro Koskinen
Delete unused "pVBInfo" parameters from internal functions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: xgifb: delete unused "HwDeviceExtension" parametersAaro Koskinen
Delete unused "HwDeviceExtension" parameters from internal functions. 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: 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: 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: 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 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-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 variablePeter Huewe
After the patch 'staging/xgifb: Don't write the same values x times' the local variable i is unused, which leads to the following warning: driverrs/staging/xgifb/vb_init.c: In function ‘XGINew_SetDRAMDefaultRegister340’: drivers/staging/xgifb/vb_init.c:433:43: warning: unused variable ‘i’ [-Wunused-variable] This patch fixes this Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Don't write the same values x timesPeter Huewe
With the previous patch 'Move duplicated code for dram to helper function' it becomes evident that the code is performing the same thing 4 or 8 times in a row without changing arguments to the function and thus writing the same values over and over again. It was tested that these repeats are unnecessary. -> we can safely remove them. Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Move duplicated code for dram to helper functionPeter Huewe
XGINew_SetDRAMDefaultRegister340 uses the same code fragment 4 times with only a slight variation each time. -> Move this code to a helper function - this saves some lines and ~450bytes in the .o / .ko Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05staging/xgifb: Replace XGI340_CR6B table with simple if/elsePeter Huewe
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: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21staging: xgifb: delete pVBInfo->BaseAddrAaro Koskinen
Delete redundant field. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21staging: xgifb: do not use pVBInfo->BaseAddrAaro Koskinen
Use pre-calculated register addresses instead of pVBInfo->BaseAddr. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21staging: xgifb: use XGIRegInit()Aaro Koskinen
Avoid copy-paste and use XGIRegInit() to initialize registers addresses. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->AGPRegAaro Koskinen
Access XGI340_AGPReg directly and make it const. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->SR16Aaro Koskinen
Inline constant values that are used only once. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->CR6BAaro Koskinen
Access XGI340_CR6B directly and make it const. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->SR21/22/25Aaro Koskinen
In-line constants that are used only once. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->ECLKDataAaro Koskinen
Access XGI340_ECLKData directly and make it const. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: xgifb: eliminate pVBInfo->CR6E/6F/89Aaro Koskinen
Eliminate dummy zero read-only global data. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-13staging: xgifb: delete bogus video RAM configurationAaro Koskinen
The driver reconfigures DRAM size register to 8M (regardless what the actual size was) once the init has been completed, overwriting the correct value written during the early init. As a result if the driver is unloaded and reloaded, the user will be limited to 8M video memory and may lose some of the available video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete ISXPDOSAaro Koskinen
Delete unneeded flag. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-14Staging: xgifb: fix bitwise vs logical bugDan Carpenter
This is a static checker fix and not something I can test. The intent of the code here is to set some bit flags. For a logical OR the ">> 1" shift wouldn't make a difference. So it should be using a bitwise OR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Fix coding style.Miguel Gómez
Fix small coding style warnings in several files. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove useless always true condition.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Improve debug strings.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Comment cleaning.Miguel Gómez
Remove commented code and useless comments. Leave only those with relevant hints to the code. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: Replace pr_* with dev_* when possible.Miguel Gómez
Replace pr_* calls with dev_* ones when the device structure is available. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: Fix sparse warnings.Miguel Gómez
Add include files with function definitions to avoid sparse warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: Remove printk usage.Miguel Gómez
Replace meaninful printks with pr_debug and remove useless ones. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>