summaryrefslogtreecommitdiff
path: root/drivers/staging/xgifb
AgeCommit message (Collapse)Author
2012-07-11Staging: xgifb: Remove useless condition.Miguel Gómez
Remove last if branch in XGIfb_do_set_var(), as it has no action assigned. Signed-off-by: Miguel Gómez <magomez@igalia.com> 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: Rework some conditions in XGI_SetCRT2ModeRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_EnableBridge().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_SetLockRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_GetCRT2ResInfo().Miguel Gómez
Use a goto to remove one level of indentation, fixing style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_GetVBInfo().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_GetVBType().Miguel Gómez
Refactor XGI_GetVBType() to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_AjustCRT2Rate().Miguel Gómez
Refactor some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_SetATTRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. 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: Remove unneeded var and condition in XGIfb_search_vesamode().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: Simplify XGIfb_GetXG21DefaultLVDSModeIdx().Miguel Gómez
Simplify the code and make it more readable. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove useless switch in XGIfb_detect_VB().Miguel Gómez
The switch performs no action so it can be removed. 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: Remove unused struct _chswtable.Miguel Gómez
Struct _chswtable and the variable mychswtable are not used anywhere, so remove them. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove LCDA detection in xgifb_probe().Miguel Gómez
The piece of code that checks for LCDA in xgifb_probe() just checks for some register values but doesn't really do anything in response to them (the actions that should be executed are commented). As nothing is really being done, the code can be safely removed. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove unneeded XGI_LCD_TYPE enumeration.Miguel Gómez
LCD_TYPEs are taken from drivers/video/sis/sis.h, so this enumeration is not needed. 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>
2012-06-18Staging: xgifb: Remove XGIFAIL() macro and its calls.Miguel Gómez
XGIFAIL() prints a message and returns a value, but it's used only in one place. Better remove it and replace the call with the macro content. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: define real dumpVGAReg() content only in DEBUG mode.Miguel Gómez
Define real content of dumpVGAReg() only in debug mode. Remove old condition. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: remove DPRINTK() macro and replace it with pr_debug.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: remove DEBUGPRN() macro and its uses.Miguel Gómez
Remove DEBUGPRN() macro which is defined as empty. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18Staging: xgifb: reformat module parameter descriptions.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Cleanup vb_device_info structPeter Huewe
This patch cleans up the vb_device_info struct and the related functions. The cleanup decreases the size of the compiled module by about 10kB. == Remove fields in vb_device_info that are never read: == pOutputSelect pRGBSenseData pRGBSenseData2 pVideoSenseData pVideoSenseData2 pYCSenseData pYCSenseData2 CR49 pXGINew_I2CDefinition pCR2E pCR2F pCR46 pCR47 pCRD0 pCRDE pSR40 pSR41 pCR47 === Remove the corresponding 'constants' === XGI330_RGBSenseData XGI330_RGBSenseData2 XGI330_VideoSenseData XGI330_VideoSenseData2 XGI330_YCSenseData XGI330_YCSenseData2 XGI330_CR49 XG40_I2CDefinition XG21_CR2E XG21_CR2F XG21_CR46 XG21_CR47 XG27_CRD0 XG27_CRDE XGI330_OutputSelect == Remove 'constant fields' and replace constant value with #define == pSR07 = XGI330_SR07 -> 0x18 pSR1F = XGI330_SR1F -> 0 pSR23 = XGI330_SR23 -> 0xf6 pSR24 = XGI330_SR24 -> 0x0d pSR33 = XGI330_SR33 ->0 pCRT2Data_1_2 = XGI330_CRT2Data_1_2 -> 0 pCRT2Data_4_D = XGI330_CRT2Data_4_D -> 0 pCRT2Data_4_E = XGI330_CRT2Data_4_E -> 0 pCRT2Data_4_10 = XGI330_CRT2Data_4_10 -> 0x80 pSR36 = XG27_SR36 -> 0x30 pCR8F = &XG27_CR8F -> 0x0C pSR40 = XG27_SR40 -> 0x04 pSR41 = XG27_SR41 ->0x00 pSR31 = XGI330_SR31 -> 0xc0 pSR32 = XGI330_SR32 -> 0xc0 SR25 = XGI330_sr25 -> 0 (we only use XGI330_sr25[0]) == Constant fields with 'dead' code: == pSoftSetting is set to XGI330_SoftSetting = 0x30 -> if (*pVBInfo->pSoftSetting & SoftDRAMType) is never true since SoftDRAMType = 0x80 -> if (*pVBInfo->pSoftSetting & ModeSoftSetting) is never true since ModeSoftSetting = 0x04 --> remove the code, remove pSoftSetting, remove XGI330_SoftSetting pDVOSetting is set to XG21_DVOSetting = 0 -> if (((*pVBInfo->pDVOSetting) & 0xC0) == 0xC0) is never true --> remove the code, remove pDVOSetting, remove XG21_DVOSetting pXGINew_DRAMTypeDefinition is set to &XG40_DRAMTypeDefinition 0xFF -> if (*pVBInfo->pXGINew_DRAMTypeDefinition != 0x0C) is always true --> remove the if and remove pXGINew_DRAMTypeDefinition remove XG40_DRAMTypeDefinition == Replace pointer to unsigned char with unsigned char variable and assign value of referenced pointer: == pSR21 -> SR21, remove XGI330_SR21 pSR22 -> SR22, remove XGI330_SR22 pXGINew_CR97 -> XGINew_CR97, remove XG20_CR97, XG27_CR97 and Z11m_CR97 Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Use SiS structsPeter Huewe
This patch replaces some of the XGI internal structs by their counterparts in the SiS driver. XGI330_LVDSDataStruct -> SiS_LVDSData XGI330_LCDDataStruct -> SiS_LCDData XGI330_CHTVDataStruct -> SiS_LVDSData Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Replace delay lookup tables with constant valuesPeter Huewe
For TV Devices: The values taken from XGI_TVDelayList are always overwritten with the values from XGI_TVDelayList2 since the if condition for using the values from XGI_TVDelayList2 is identical with the check to enter this scope and thus always true. The delay values in XGI_TVDelayList2 is always 0x22 so we can simply replace it with this constant value. For LCD Devices: The LCD_DelayCompensation field is always set to 0x12 so we can simply replace this field with a constant value. This saves about 500 bytes in compiled size. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Remove useless function XGI_CloseCRTCPeter Huewe
Since XGI_CloseCRTC does not perform anything useful we can simply remove it. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Simplyfy XGI_GetVCLK2Ptr a bitPeter Huewe
This patch simplyfies the XGI_GetVCLK2Ptr a bit by moving the +=25 to a define and removing statements without effect. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Replace constant arrays with constant valuesPeter Huewe
This patch removes the arrays in XGI_GetVCLK2Ptr which each contain only one value four times and replaces them with their constant value. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Remove unnecessary fields of XGINew_DDRDRAM_TYPE{340, 20}Peter Huewe
Since the first three entries in XGINew_DDRDRAM_TYPE{340,20} are never used, we can simply remove them; and instead of passing XGINew_DDRDRAM_TYPE with an index we can simply pass the value directly to XGINew_SetDRAMSize20Reg. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Inline XGINew_SetDRAMSizingTypePeter Huewe
Since the function XGINew_SetDRAMSizingType is only called from one location and consist only of 2 valuable lines we can simply inline it here. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Remove duplicated code from XGINew_DDRSizing340Peter Huewe
Since XGINew_SetDRAMSize20Reg now handles both cases we can remove the code duplication in XGINew_DDRSizing340. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Consolidate XGINew_SetDRAMSize{,20}RegPeter Huewe
This patch consolidates the almost identical functions XGINew_SetDRAMSizeReg and XGINew_SetDRAMSize20Reg as they are implemented identically except one division factor. The changed factor is now reflected in the input data. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Remove superfluous header includesPeter Huewe
This patch removes all unnecessary, redundant and superfluous header includes from xgifb. Tested on hp t5325 (XGI Z11) Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Add header #include guards to vb_table.hPeter Huewe
This patch adds a simple #include guard to vb_table.h Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Add mutext for fb_mmap lockingPeter Huewe
This adds a mutex for fb_mmap around smem_start and smem_len so the mutex inside the fb_mmap() is actually used. Changing of these fields before calling the framebuffer_register() are not mutexed. We check whether framebuffer_register has been called by reading fbinfo->count. See 537a1bf0 - "fbdev: add mutex for fb_mmap locking" by Krzysztof Helt for details. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging/xgifb: Remove assignments without effectPeter Huewe
This patch removes assignments to the fb_fix_screeninfo struct which are overwritten by the memset in XGIfb_get_fix() a few lines later. Since the name/id might be useful this was moved to XGIfb_get_fix(). Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11Staging: xgifb: disable pci device on pci remove function.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11Staging: xgifb: disable pci device if there's an error after enabling it.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11Staging: xgifb: reorder the code a bit to be more module friendlyMiguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11Staging: xgifb: Remove #ifdef MODULEMiguel Gómez
Check for MODULE is not needed. In a static compilation the parameters definition is valid and module_exit() does nothing. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02Merge 3.4-rc5 into staging-nextGreg Kroah-Hartman
This resolves the conflict in: drivers/staging/vt6656/ioctl.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: xgifb: inline XGI_GetResInfo()Aaro Koskinen
Inline a trivial function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: xgifb: eliminate redundant struct definitionAaro Koskinen
Replace XGI330_LCDDataDesStruct with identical XGI_LCDDesStruct. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: xgifb: delete VB_ExtTVEdgeIndexAaro Koskinen
Delete VB_ExtTVEdgeIndex. It's 0 for all video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: xgifb: delete VB_ExtTVFlickerIndexAaro Koskinen
Delete VB_ExtTVFlickerIndex. It's 0 for all video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>