summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fbtft
AgeCommit message (Collapse)Author
2017-02-05staging: fbtft: fix unaligned parenthesesUmang Raghuvanshi
Fix the following formatting issues: CHECK: Alignment should match open parenthesis Signed-off-by: Umang Raghuvanshi <u@umangis.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03staging: fbtft: change 'gamma' array to u32Arnd Bergmann
Having a local variable of 1024 bytes on 64-bit architectures is a bit too much, and I ran into this warning while trying to see what functions use the largest stack: drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve': drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] As there is no need for 64-bit gamma values (on 32-bit architectures, we don't use those either), I'm changing the type from 'unsigned long' to 'u32' here, which cuts the required space in half everywhere. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-27staging: fbtft: fix unaligned parenthesesUmang Raghuvanshi
Fix the following formatting issues: CHECK: Alignment should match open parenthesis Signed-off-by: Umang Raghuvanshi <u@umangis.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25staging: fbtft: fix checkpatch decimal permissions errorAbdul Rauf
Fix the following errors: Use 4 digit octal (0777) not decimal permissions Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25staging: fbtft: remove duplicate entries of ili9225Amitesh Singh
There are multiple entries for ili9225 display defined in flexfb_chip_table array. remove duplicate entries and keep single entry. Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: fb_ssd1306: Refactor write_vmem()Andy Shevchenko
Refactor write_vmem() for sake of readability. While here, fix indentation in one comment. Acked-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: fb_ssd1306: Support smaller screen sizesAndy Shevchenko
There is 64x48 display exists. In order to support that set multiplexer to 48 pixels and window address to proper position in the graphic display data RAM. Acked-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: propagate error code from kstrto*()Andy Shevchenko
kstrto*() functions return proper error code. Do propogate it to the user. Acked-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: remove custom DMA mapped bufferAndy Shevchenko
There is no need to duplicate what SPI core already does, i.e. mapping buffers for DMA capable transfers. Remove all related pices of code. Note, that code, besides its redundancy, was buggy: DMA address potentially can be 0, SPI slave device has nothing to do with DMA capable device properties and DMA mask in particular. Suggested-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: convert fbtft_reset() to be non-atomicAndy Shevchenko
First of all, fbtft in current state doesn't allow to override GPIOs to be optional, like "reset" one. It might be a bug somewhere, but rather out of scope of this fix. Second, not all GPIOs available on the board would be SoC based, some of them might sit on I2C GPIO expanders, for example, on Intel Edison/Arduino, and thus any communication with them might sleep. Besides that using udelay() and mdelay() is kinda resource wasteful. Summarize all of the above, convert fbtft_reset() function to non-atomic variant by using gpio_set_value_cansleep(), usleep_range(), and msleep(). Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19staging: fbtft: replace decimal with 4-digit octal permissionsStefano Manni
Following error detected by checkpatch.pl: ERROR: Use 4 digit octal (0777) not decimal permissions Signed-off-by: Stefano Manni <stefano.manni@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: fbtft: fix code alignment with open parenthesisScott Matheina
These changes where identified by checkpatch.pl as needed changes to align the code with the linux development coding style. The several lines of text where aligned with the precending parenthesis. Signed-off-by: Scott Matheina <scott@matheina.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: fbtft: Fix 'line over 80 characters'Maninder Singh
This patch fixes the following checkpatch.pl warning WARNING: line over 80 characters Signed-off-by: Maninder Singh <maninder.s2@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25Staging:fbtft: Replace decimal permissions with 4 digit octalNadim Almas
ERROR: Use 4 digit octal (0777) not decimal permissions This error was detected by checkpatch.pl Signed-off-by: Nadim Almas <nadim.902@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25staging: fbtft: Fix module autoloadJavier Martinez Canillas
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/staging/fbtft/flexfb.ko | grep alias $ After this patch: $ modinfo drivers/staging/fbtft/flexfb.ko | grep alias alias: platform:flexpfb Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16Staging: fbtft: Fix too many leading tabs warningGustavo A. R. Silva
This is a patch to the fb_agm1264k-fl.c file that fixes up the following issue: WARNING: Too many leading tabs - consider code refactoring Add new function iterate_diffusion_matrix() to refactor a piece of code inside write_vmem(). Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: fbtft: Convert int arrays to s16Joe Perches
These arrays use -1, -2, and -3 as initiators for various types of writes to initialize hardware. No values are used that conflict with using these arrays as s16 instead of int and reducing overall data is good. $ size drivers/staging/fbtft/built-in.o* text data bss dec hex filename 116120 32872 4152 153144 25638 drivers/staging/fbtft/built-in.o.new 116104 36344 6200 158648 26bb8 drivers/staging/fbtft/built-in.o.old Miscellaneous: o Realign some of the arrays to make reading a bit easier Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16Staging: fbtft: Fixed open parenthesis alignment checkHarman Kalra
This patch resolves all the following CHECKs caught by checkpatch.pl CHECK: Alignment should match open parenthesis Signed-off-by: Harman Kalra <harman4linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02Staging: fbtft: Fix bug in fbtft-coreKsenija Stanojevic
Commit 367e8560e8d7a62d96e9b1d644028a3816e04206 introduced a bug in fbtft-core where fps is always 0, this is because variable update_time is not assigned correctly. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Fixes: 367e8560e8d7 ("Staging: fbtbt: Replace timespec with ktime_t") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02staging: fbtft: fix NULL comparison checkpatch warningCarlos Palminha
Fixed the following checkpatch warnings (task #10 of eudyptula challenge): - NULL comparison rewritten to use '!' operator Signed-off-by: Carlos Palminha <palminha@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18Staging: fbtft: Use !x instead of x == NULL.Sandhya Bankar
Use !x instead of x == NULL. This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: fbtft: add spaces around <<Gargi Sharma
add spaces around << to fix the checkpatch issue, spaces preferred around that '<<'. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: fbtft: move && operator for logical continuationGargi Sharma
Move && up to the previous line, to fix the checkpatch issue Logical continuations should be on the previous line. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_tls8204: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fbtft_device: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fbtft-bus: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_st7735r: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_ssd1331: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_ssd1306: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_ssd1289: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_s6d1121.c: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: fbtft: fb_s6d02a1.c: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: fbtft: This patch fixes the checkpatch.pl warningPrit Raj
WARNING: Statements should start on a tabstop Signed-off-by: Prit Raj <prit.adra@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21Staging: fbtft: fixed unsigned type warningsMing Yang
Replace unsigned by unsigned int in fbtft driver. Issue found by checkpatch. Signed-off-by: Ming Yang <minos.future@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: fbtft: do not allocate huge txbufMichal Suchanek
txbuflen can be set to arbitrary value by user and it is also set automagically to the maximum transfer size of the SPI master controller. Do not allocate the buffer when larger than vmem. When my SPI master controller reports maximum transfer size 16M the probe of fbtft fails. Signed-off-by: Michal Suchanek <hramrach@gmail.com> Acked-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: fbtft: fb_agm1264k-fl: No space is necessary after cast.Sandhya Bankar
No space is necessary after cast.This problem is found by checkpatch.pl script. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: fbtft: fbtft-io: No space is necessary after cast.Sandhya Bankar
No space is necessary after cast.This patch is found by checkpatch.pl script. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: fbtft: fbtft_device: No space is necessary after cast.Sandhya Bankar
No space is necessary after cast. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: fb_uc1611.c: Drop void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: fb_ra8875.c: Remove unneeded void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: fbtft-bus.c: Drop unneeded void pointer castJanani Ravichandran
Remove unneeded cast on the void pointer par->txbuf.buf . Semantic patch used: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: Use devm_kcalloc instead of devm_kzallocAmitoj Kaur Chawla
Replace devm_kzalloc with devm_kcalloc to ensure there are no integer overflows from the multiplication of a number * sizeof The following Coccinelle semantic patch was used to make this change: //<smpl> @@ expression dev,E1,E2,E3,E4; @@ - devm_kzalloc(dev,E1*E2*sizeof(E3),E4) + devm_kcalloc(dev,E1*E2,sizeof(E3),E4) //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: Remove unnecessary spi_set_drvdata()Amitoj Kaur Chawla
Unnecessary spi_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: @@ struct spi_device *spi; @@ - spi_set_drvdata(spi, NULL); // </smpl> Due to this removal, variable `spi` was unused so dropped `spi` Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: replace ternary operator with min macroAlison Schofield
Use macro min() to get the minimum of two values for brevity and readability. Found using Coccinelle: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fbtft: Use kmalloc_arrayBhaktipriya Shridhar
Use kmalloc_array instead of kmalloc for arrays to prevent integer overflows. This was done using Coccinelle: @@ expression e1, e2; constant C; type t; @@ ( - kmalloc( + kmalloc_array( e2 - * + , sizeof(e1), C) | - kmalloc( + kmalloc_array( e1 - * + , sizeof(t), C) | - kmalloc( + kmalloc_array( - sizeof(e1) - * e2 + , + sizeof(e1) , C) | - kmalloc( + kmalloc_array( - sizeof(t) - * e1 + , + sizeof(t) , C) ) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: fbtft: Fix block comment coding styleAnchal Jain
Add the required leading * on subsequent lines as well as move the */ on a separate line. Checkpatch found this issue. Signed-off-by: Anchal Jain <anchalj109@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: fbtft: Remove the use of CamelCaseEva Rachel Retuya
Rename the macro defining constant ROWxCOL into ROW_X_COL to remove checkpatch check concerning use of CamelCase and to achieve better readability. CHECK: Avoid CamelCase: <ROWxCOL> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: fbtft: Delete blank line after '{' braceEva Rachel Retuya
Omit the whitespace after '{' brace as suggested by checkpatch. CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: fbtft: Insert blank line after function declarationEva Rachel Retuya
Insert the required whitespace after the function declaration as suggested by checkpatch. CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: fbtft: Fix alignment to match open parenthesisEva Rachel Retuya
Fix alignment issues by properly indenting function parameters in accordance to the kernel coding style. Checkpatch pointed out this issue. CHECK: Alignment should match open parenthesis Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>