Commit Graph

506 Commits

Author SHA1 Message Date
Thomas Gummerer
9c8c831514 staging: xgifb: remove unnecessary else
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:48:19 -07:00
Chaitanya Hazarey
0292bd466a Staging: xgifb: Fixed a code-style warning
Added a blank line after declarations to fix the following warning issued by checkpatch.pl:

drivers/staging/xgifb/vb_init.c:800: WARNING: Missing a blank line after declarations

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 04:42:20 +09:00
Lubomir Rintel
5a0ba45727 staging: xgifb: Update TODO
There's no more printk abuse, it's been sorted out in
448810662a ("Staging: xgifb: Remove printk usage.")

Extra ifdefs have been fixed too, mostly in
800d67cf9f ("staging: xgifb: eliminate #ifdef Tap4"),
c39aada692 ("staging: xgifb: eliminate #ifdef XGIFB_PAN"),
fa4c212f2b ("staging: xgifb: delete unused definitions"),
5c167b30c1 ("staging: xgifb: eliminate #ifdef NewScratch"),
f059077388 ("Staging: xgifb: Remove #ifdef MODULE") and more.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:32 -07:00
Lubomir Rintel
51c4491457 staging: xgifb: Drop some more useless defines
SetLCDStdMode is not supported as of 34c13ee2b6 ("staging: xgifb: drop
code for legacy VGA modes").

DisableLCD24bpp defined to zero was never realy useful and went away with
aa56b2790a ("staging: xgifb: vb_table: delete XGI21_LCDCapList").

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Lubomir Rintel
a5c79d610f staging: xgifb: Initialize Part0Port
It was left uninitialized, likely overseen, in this commit:
56810a92c6 ("staging: xgifb: use XGIRegInit()
Avoid copy-paste and use XGIRegInit() to initialize registers addresses.")

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Lubomir Rintel
bb7e5ed497 staging: xgifb: Eliminate useless ifndefs
XGI_VB_CHIP_TYPE, PCI_DEVICE_ID_XGI_42 and PCI_DEVICE_ID_XGI_27
are never defined.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 10:03:31 -07:00
Vitor Braga
694683f631 staging: xgifb coding style cleanup
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>
2014-04-25 16:20:02 -07:00
Tomi Valkeinen
f7018c2135 video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.

Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.

No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-17 08:10:19 +03:00
Monam Agarwal
e508b52a45 Staging: xgifb: Fix quoted string split across lines in XGI_main_26.c
This patch fixes the following checkpatch.pl issues in XGI_main_26.c:
WARNING: Quoted string split across lines

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:29:38 -08:00
Jingoo Han
41e043fcfa staging: remove DEFINE_PCI_DEVICE_TABLE macro
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02 22:32:35 -08:00
Ebru Akagunduz
4759e82481 Staging: xgifb: fix braces {} are not necessary for any arm of this statement
Fix checkpatch.pl issues with braces {} are not necessary
for any arm of this statement in vb_setmode.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30 09:22:05 -07:00
Ashvini Varatharaj
1d2a01eb40 Staging: xgifb: remove space before semicolon
Fix checkpatch warning: WARNING:space prohibited before semicolon

Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-14 09:15:27 -07:00
Ebru Akagunduz
f88d818717 Staging: xgifb: braces {} are not necessary for single statement in vb_setmode
Fix checkpatch.pl issues with braces {} are not necessary
for single statement blocks in vb_setmode.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-07 18:39:32 -07:00
Sachin Kamat
477c81f025 staging: xgifb: Remove redundant pci_set_drvdata
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:45:19 -07:00
Kumar Gaurav
2acb6111d7 Staging: xgifb: Fixed a warning of Space before semicolon
Fixed issue by removing Space before semicolon

Signed-off-by: Kumar Gaurav <kumargauravgupta3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12 14:08:27 -07:00
Aaro Koskinen
334ab0728d staging: xgifb: delete unused "pVBInfo" parameters
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-23 15:01:09 -07:00
Aaro Koskinen
88a3dfdd93 staging: xgifb: delete unused "RefreshRateTableIndex" parameters
Delete unused "RefreshRateTableIndex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 15:01:09 -07:00
Aaro Koskinen
b053af1688 staging: xgifb: delete unused "HwDeviceExtension" parameters
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-07-23 15:01:09 -07:00
Aaro Koskinen
6b6e6a3995 staging: xgifb: delete unused "ModeIdIndex" parameters
Delete unused "ModeIdIndex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 15:01:09 -07:00
Aaro Koskinen
3d05f66f76 staging: xgifb: delete unused "ModeNo" parameters
Delete unused "ModeNo" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 15:01:09 -07:00
Aaro Koskinen
f3ac47cf79 staging: xgifb: delete unused "rateindex" parameters
Delete unused "rateindex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 15:01:09 -07:00
Aaro Koskinen
ee76875ea5 staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checks
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-30 20:55:53 +09:00
Aaro Koskinen
aee0ac92f4 staging: xgifb: vb_setmode: delete IF_DEF_HiVision checks
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-30 20:55:52 +09:00
Aaro Koskinen
a4ce0e7e6e staging: xgifb: vb_setmode: delete IF_DEF_YPbPr checks
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-30 20:55:52 +09:00
Aaro Koskinen
2351d1fd97 staging: xgifb: delete redundant return statements
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-30 20:55:52 +09:00
Aaro Koskinen
41fc5f031c staging: xgifb: XGI_DisableBridge(): delete redundant checks
Delete some redudant checks.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 20:55:51 +09:00
Aaro Koskinen
056b5405fa staging: xgifb: XGI_EnableChISLCD(): delete trivial function
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-30 20:55:51 +09:00
Aaro Koskinen
a2526d1f32 staging: xgifb: SetFlag: delete EnableChA
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-30 20:55:51 +09:00
Aaro Koskinen
d1724637e1 staging: xgifb: SetFlag: delete DisableChA
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-30 20:55:51 +09:00
Aaro Koskinen
b8e34b3ffa staging: xgifb: SetFlag: delete EnableChB
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-30 20:55:51 +09:00
Aaro Koskinen
c4f9c31ebe staging: xgifb: SetFlag: delete DisableChB
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-30 20:55:50 +09:00
Aaro Koskinen
ae424a3d6e staging: xgifb: SetFlag: delete GatingCRT
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-30 20:55:49 +09:00
Aaro Koskinen
b750f51661 staging: xgifb: XGI_SetCRT1VCLK(): avoid copy-paste
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-30 20:55:49 +09:00
Aaro Koskinen
b0b4a8a126 staging: xgifb: XGI_GetRatePtrCRT2(): delete IF_DEF_LVDS check
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-30 20:55:49 +09:00
Aaro Koskinen
0903b0dbd2 staging: xgifb: XGI_AjustCRT2Rate(): delete IF_DEF_LVDS check
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-30 20:55:48 +09:00
Aaro Koskinen
ce76de5abe staging: xgifb: call XGI_GetVBType from InitTo330Pointer
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-30 20:55:47 +09:00
Aaro Koskinen
4b8071121d staging: xgifb: XGI_GetVBType(): delete IF_DEF_LVDS check
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-30 20:55:47 +09:00
Aaro Koskinen
c976c7819b staging: xgifb: refactor XGI_BridgeIsOn()
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-30 20:55:47 +09:00
Peter Huewe
7580d7feb4 staging/xgifb: Remove dead assignments/increments
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-17 15:47:18 -07:00
Peter Huewe
85b38476fd staging/xgifb: Fix always false condition in vb_setmode.c (smatch)
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-16 16:02:35 -07:00
Peter Huewe
986eb9fad5 staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBits
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-16 16:02:34 -07:00
Peter Huewe
9195ba095d staging/xgifb: Consolidate function almost identical calls in 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-16 16:02:34 -07:00
Peter Huewe
bcd1f16573 staging/xgifb: Remove unnecessary cases in XGINew_SenseLCD
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-16 16:02:34 -07:00
Peter Huewe
fb70b191ee staging/xgifb: Remove uneccessary/simply if in XGINew_GetXG20DRAMType
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-05-16 16:02:33 -07:00
Aaro Koskinen
597d96b63b staging: xgifb: rename SR15/SR13 arrays to SR18
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-28 16:10:16 -07:00
Aaro Koskinen
d8e7567e53 staging: xgifb: make SR15/SR13 arrays single dimensional
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-28 16:10:16 -07:00
Aaro Koskinen
d7ab4a4f5b staging: xgifb: XGINew_SetDRAMDefaultRegister340: inline the value of SR1B
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-28 16:10:15 -07:00
Aaro Koskinen
99c66181b8 staging: xgifb: delete pXGINew_DRAMTypeDefinition
Delete unused struct field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Aaro Koskinen
abe0a2e05d staging: xgifb: delete XGI330_LCDCapStruct.PWD_2x
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-28 16:10:15 -07:00
Aaro Koskinen
d5a1b52b72 staging: xgifb: delete XGI330_LCDCapStruct.PSC_Sx
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-28 16:10:15 -07:00