summaryrefslogtreecommitdiff
path: root/drivers/staging/sm750fb/sm750.c
AgeCommit message (Collapse)AuthorFilesLines
2016-02-08staging: sm750fb: introduce sm750fb_frambuffer_allocMike Rapoport1-57/+41
Split framebuffer allocation and registration into a dedicated function to simplify lynxfb_pci_probe Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: sm750fb: introduce sm750fb_frambuffer_releaseMike Rapoport1-12/+13
Use a function to unregister framebuffer info and release its resources. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: sm750fb: replace dual member of sm750_dev with fb_countMike Rapoport1-11/+13
Will be used in futher refactoring of driver _probe and _remove methods. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: sm750fb: lynxfb_pci_remove: remove unused variableMike Rapoport1-2/+0
The par variable in lynxfb_pci_remove is only assigned a value and never used afterwards. Remove it. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: sm750fb: lynxfb_pci_probe: return actual errorsMike Rapoport1-20/+17
The lynxfb_pci_probe always returned -ENODEV in case of error. Modify it so that actual error code will be propogated to the caller. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: sm750fb: disable PCI device if lynxfb_pci_probe failsMike Rapoport1-0/+1
In case of error during lynxfb_pci_probe, the function returned without calling pci_disable_device. Fix it by adding pci_disable_device on the error cleanup path. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-16Staging: sm750fb: Remove unused modedb.h fileShraddha Barke1-2/+0
The header file modedb.h is only included in sm750.c but the things defined by modedb.h are not used anywhere in sm750.c. Thus, drop the include in sm750.c and modedb.h can be dropped completely. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: remove '#ifdef CAP_EXP*' conditionalsMike Rapoport1-18/+0
There are several occurencies of '#ifdef CAP_EXP<something>', spelled differently each time. None of these is ever defined and therefore they enclose dead code that can be removed. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: merge lynx_share into sm750_devMike Rapoport1-115/+94
Both struct lynx_share and struct sm750_dev reprsent some parts of the SM750 graphics adapter. There is no point to keep these parts in different structures. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: remove unused field in lynx_cursorMike Rapoport1-1/+0
The lynx_share field in lynx_cursor structure is never used and can be removed. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: fix wrong indentationMike Rapoport1-1/+1
Fix wrong indentation of a line in lynxfb_set_fbinfo Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: use sm750_dev with pci_{get, set}_drvdataMike Rapoport1-6/+8
Use sm750_dev as private driver data for the PCI device Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: use 'struct sm750_dev *' instead of 'void *'Mike Rapoport1-1/+1
Use proper 'struct sm750_dev *' type instead of 'void *' Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: replace lynx_share with sm750_dev in function callsMike Rapoport1-7/+8
Use sm750_dev rather than lynx_share as parameter for hw_sm750_map, hw_sm750_inithw and hw_sm750_initAccel functions. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: replace lynx_share with sm750_dev in lynxfb_parMike Rapoport1-9/+9
Use sm750_dev instead of lynx_share in the private data of the frambuffer device. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: remove unused PROC_SPEC_* typedefsMike Rapoport1-4/+0
The PROC_SPEC* typedefs are not used and can be removed Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: merge struct sm750_state into struct sm750_devMike Rapoport1-20/+20
The struct sm750_state is never used on its own. Merge it into the struct sm750_dev. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: rename 'struct sm750_dev' variables to sm750_devMike Rapoport1-33/+33
Use consistent naming for 'struct sm750_dev' variables Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: rename struct sm750_share to sm750_devMike Rapoport1-8/+8
The struct sm750_share represents the device state and name sm750_dev seems more appropriate. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: merge sm750_hw.h into sm750.hMike Rapoport1-1/+0
There is no actual need to split type definitions and global function declarations between lots of small headers. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: remove unused smi_indent variableMike Rapoport1-2/+0
The smi_indent variable is only declared, but never used. Remove it. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: replace PADDING macro with ALIGNMike Rapoport1-4/+4
The custom macro PADDING differs from standard kernel ALIGN only in parameters order. Replace PADDING with ALIGN and remove it's definition. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: sm750fb: replace lynx_cursor methods with function callsMike Rapoport1-20/+14
The methods in lynx_cursor always use the same implementation and there is no point to use redirection rather than direct function call. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-25staging: sm750fb: use direct call to hw_sm750_output_setModeMike Rapoport1-3/+1
The proc_setMode method in lynx_output always uses the same implementation and there is no point to use redirection rather than direct function call. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-25staging: sm750fb: replace lynx_crtc methods with function callsMike Rapoport1-8/+4
The methods in lynx_crtc always use the same implementation and there is no point to use redirection rather than direct function call. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-25staging: sm750fb: remove unused methods from lynx_shareMike Rapoport1-6/+0
The suspend and resume methods in lynx_share are not implemented and never set. Remove them. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17Staging: sm750fb: sm750: Remove irrelevant codeShivani Bhardwaj1-2/+0
The variable ret is only declared and initialized to 0, but never referenced, so remove it. Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: sm750fb: Fix the power state error in resumeBinbin Zhou1-0/+1
The PM_EVENT_RESUME state is needed when SM750 resume, otherwise it will be failed in the second time of continuous suspend/resume. Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Binbin Zhou <zhoubb@lemote.com> Reviewed-by: Huacai Chen <chenhc@lemote.com> Reviewed-by: Teddy Wang <teddy.wang@siliconmotion.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02staging: sm750fb: remove clear method from lynxfb_{crtc,output}Mike Rapoport1-5/+0
The clear methods of lynxfb_crtc and lynxfb_output are empty and therefore they can be removed. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02staging: sm750fb: remove proc_checkMode method from lynxfb_outputMike Rapoport1-5/+1
The proc_checkMode of lynxfb_output is set to function that always returns 0. Calling that function and checking for its return value is meaningless. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02staging: sm750fb: remove unneeded switch statementMike Rapoport1-15/+2
The lynxfb_ops_check_var function has two switch statements, the first one checks for validity of var->bits_per_pixel and it is is immediatly followed by another one that sets parameters according to var->bits_per_pixel value. These switch statements can be merged into one. Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: sm750fb: tidy up #include directivesMike Rapoport1-17/+17
Add space between '#include' keyword and the header name Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08staging: sm750fb: simplify returnSudip Mukherjee1-5/+1
Lets return the return value directly instead of using a variable to store the result. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08staging: sm750fb: rearrange codeSudip Mukherjee1-14/+13
Rearrange the code to remove one exit label which also makes the code less indented and more readable. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08staging: sm750fb: fix multiline commentSudip Mukherjee1-24/+39
Multiline comments are edited to be in the kernel coding style. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08staging: sm750fb: space around operatorSudip Mukherjee1-13/+17
Kernel coding style says to have a space around the operators. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08staging: sm750fb: remove multiple blank lineSudip Mukherjee1-26/+0
Multiple blank lines are not kernel coding style and so checkpatch complains. Remove them. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-15staging: sm750fb: remove unnecessary whitespaceJuston Li1-1/+1
Fixes checkpatch.pl warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Juston Li <juston.h.li@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-15staging: sm750fb: coding style global ERROR fixesVinay Simha BN1-3/+3
kernel coding style fixes for below messages from scripts/checkpatch.pl ERROR: do not initialise globals to 0 or NULL Signed-off-by: Vinay Simha BN <simhavcs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-19drivers: staging: sm750fb: Fix "'foo * bar' should be 'foo *bar'" errorsGreg Donald1-1/+1
Fix checkpatch.pl "'foo * bar' should be 'foo *bar'" errors Signed-off-by: Greg Donald <gdonald@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-19staging: sm750fb: convert pr_err to pr_infoHari Prasath Gujulan Elango1-3/+3
This patch modifies few debug prints from pr_err() to pr_info() as they fall under that category. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: sm750fb: Fix typo in sm750.cMasanari Iida1-1/+1
This patch fix a spelling typo in printk within sm750.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: sm750fb: remove duplicate from fb_videomodeMichel von Czettritz1-3/+0
As suggested by Sudip this patch removes the redundant 1360x768@60 option from the fb_videomode struct array. The removed option and the option one it differ in a typo and a flag. Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: sm750: Fix lynxfb_ops_imageblit() if image->depth != 1Huacai Chen1-0/+3
If image->depth != 1, lynxfb_ops_imageblit() should fallback to call cfb_imageblit(), not return directly. Otherwise it can't display the boot logo. Cc: Teddy Wang <teddy.wang@siliconmotion.com> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: sm750fb: use arch_phys_wc_add() and ioremap_wc()Luis R. Rodriguez1-32/+4
The same area used for ioremap() is used for the MTRR area. Convert the driver from using the x86 specific MTRR code to the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add() will avoid MTRR if write-combining is available, in order to take advantage of that also ensure the ioremap'd area is requested as write-combining. There are a few motivations for this: a) Take advantage of PAT when available b) Help bury MTRR code away, MTRR is architecture specific and on x86 its replaced by PAT c) Help with the goal of eventually using _PAGE_CACHE_UC over _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit de33c442e titled "x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range()") The conversion done is expressed by the following Coccinelle SmPL patch, it additionally required manual intervention to address all the #ifdery and removal of redundant things which arch_phys_wc_add() already addresses such as verbose message about when MTRR fails and doing nothing when we didn't get an MTRR. @ mtrr_found @ expression index, base, size; @@ -index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); +index = arch_phys_wc_add(base, size); @ mtrr_rm depends on mtrr_found @ expression mtrr_found.index, mtrr_found.base, mtrr_found.size; @@ -mtrr_del(index, base, size); +arch_phys_wc_del(index); @ mtrr_rm_zero_arg depends on mtrr_found @ expression mtrr_found.index; @@ -mtrr_del(index, 0, 0); +arch_phys_wc_del(index); @ mtrr_rm_fb_info depends on mtrr_found @ struct fb_info *info; expression mtrr_found.index; @@ -mtrr_del(index, info->fix.smem_start, info->fix.smem_len); +arch_phys_wc_del(index); @ ioremap_replace_nocache depends on mtrr_found @ struct fb_info *info; expression base, size; @@ -info->screen_base = ioremap_nocache(base, size); +info->screen_base = ioremap_wc(base, size); @ ioremap_replace_default depends on mtrr_found @ struct fb_info *info; expression base, size; @@ -info->screen_base = ioremap(base, size); +info->screen_base = ioremap_wc(base, size); Generated-by: Coccinelle SmPL Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Cc: Teddy Wang <teddy.wang@siliconmotion.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Suresh Siddha <sbsiddha@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Juergen Gross <jgross@suse.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Airlie <airlied@redhat.com> Cc: Antonino Daplas <adaplas@gmail.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: devel@driverdev.osuosl.org Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-18Merge 4.1-rc4 into staging-nextGreg Kroah-Hartman1-1/+1
We want the fixes in here for testing and merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08Staging: fixed multiple spelling errors.Carlos E. Garcia1-6/+6
Fixed multiple spelling errors. Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: sm750: remove incorrect __exit annotationArnd Bergmann1-1/+1
The lynxfb_pci_remove function is used as the 'remove' callback of the driver, and must not be discarded: lynxfb_pci_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o This removes the extraneous annotation. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03staging: sm750: move assignment out of if condMichel von Czettritz1-3/+6
This patch moves the assignments from the if conditions to the line before the condition. The 3 occurrence are return values and the checks for errors. Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03staging: sm750: fix whitspace for cast to pointerMichel von Czettritz1-3/+3
This patch fixes the checkpatch.pl warning: 'ERROR: "(foo*)" should be "(foo *)"' Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>