aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/fbtft (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-04-28staging: fbtft: fix open parentheses alignmentChristophe Colin1-7/+7
Modify the code indentations to fix the checkpatch issues. Signed-off-by: Christophe Colin <popscolin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: fbtft: fix type assignment warningAlex Wilson1-1/+1
Sparse spits out a warning that a __be16 was being assigned to a u16. Change the type of txbuf16 to __be16 b/c it's a restricted type and prevents mixing endianness. Signed-off-by: Alex Wilson <alex.david.wilson@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: fbtft: Replace a bit shift by a use of BIT.Arushi Singhal4-4/+4
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuationsAlexander Kapshuk1-4/+4
Use a single string literal as the fmt argument passed to dev_err() instead of multiple string literals split with an embedded backslash character. Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: fbtft: fb_sh1106: use new helper helper fbtft_write_buf_dcHeiner Kallweit1-13/+4
Make use of new helper fbtft_write_buf_dc. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: fbtft: use helper fbtft_write_buf_dc in fbtft-bus.cHeiner Kallweit1-23/+8
Make use of new helper fbtft_write_buf_dc. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: fbtft: add helper fbtft_write_buf_dcHeiner Kallweit2-0/+16
Factor out setting DC GPIO and writing buffer content to helper fbtft_write_buf_dc. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: fbtft: fb_sh1106: use own implementation of write_registerHeiner Kallweit1-32/+33
The default implementation of write_register keeps DC low for the first byte only. SH1106 requires DC to be low for all bytes of a multi-byte command. To deal with this limitation we currently use a separate call to write_reg for each single command byte what is not really efficient. Therefore override the default implementation of write_register with an own one which keeps DC low for all bytes. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: fbtft: improve a syslog message in fbtft_register_framebufferHeiner Kallweit1-1/+1
There are drivers like fb_sh1106 which allocate a txbuf less than 1 KiB. In this case the message would include "0 KiB buffer memory" what doesn't make sense and in general I doubt that there is any benefit in informing the user about allocation of a very small buffer. Therefore omit this message part if the buffer has less than 1 KiB. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: add adriver for SH1106Heiner Kallweit3-0/+210
This patch adds support for the SH1106 OLED controller chip. It's similar to the SSD1306, however it supports only a subset of commands and the internal video memory has a different width. Major differences: - Internal video memory has a width of 132 pixels - Only a subset of commands is supported - Only page addressing mode is supported, no support for vertical and horizontal addressing - SPI frequency limited to 2 MHz according to the datasheet Successfully tested with a 1.3" OLED display with this chip and SPI interface. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Merged two identical conditionals into one.Narcisa Ana Maria Vasile1-3/+2
Merged two if conditionals into a single one, since they had exactly the same condition. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: fix unnecessary line continuationsCezary Gapinski1-1/+1
Fix the following formatting issues: WARNING: Avoid unnecessary line continuations Signed-off-by: Cezary Gapinski <gapalinux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Make some s16 arrays constJoe Perches6-16/+16
Using const reduces data size. $ size drivers/staging/fbtft/built-in.o* text data bss dec hex filename 89909 41584 2928 134421 20d15 drivers/staging/fbtft/built-in.o.new 88053 43392 2928 134373 20ce5 drivers/staging/fbtft/built-in.o.old Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Make the pointers to s16 init arrays constJoe Perches3-5/+5
This allows making some of the actual arrays const. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging:fbtft: Fix some warnings regarding types.Anthony Brandon1-1/+1
Running make C=1 M=drivers/staging/fbtft reports warnings about conversion from __be16 to unsigned short. Change the type of the variables being assigned into __be16 to remove those warnings. Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06Staging: fbtft: fb_watterott: fix incorrect type in assignmentsJulián de Gortari1-3/+3
__be16 type variables should be used with return value of macro cpu_to_be16() Signed-off-by: Julián de Gortari <kiototeko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Remove blank lineGargi Sharma1-1/+0
Remove blank line before closing brace to fix the checkpatch issue blank lines aren't necessary before a close brace '}'. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Match alignment with open parenthesesGargi Sharma1-27/+27
Indent code to match alignment with open parentheses, to fix the checkpatch issue alignment should match open parenthesis. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Add check on strlcpy() return valueTobin C. Harding1-1/+7
Return value of strlcpy() is not checked. Name string is silently truncated if longer that SPI_NAME_SIZE, whilst not detrimental to the program logic it would be nice to notify the user. Module is currently quite verbose, adding extra pr_warn() calls will not overly impact this verbosity. Check return value from call to strlcpy(). If source string is truncated call pr_warn() to notify user. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Replace magic number with constantTobin C. Harding1-1/+1
Current call to strncmp() uses a magic number. There is a compile time constant defined for this buffer, included and used already at other sites in the file. Remove magic number. Replace with pre-existing compile time constant. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fbtft: Fix buffer overflow vulnerabilityTobin C. Harding1-1/+1
Module copies a user supplied string (module parameter) into a buffer using strncpy() and does not check that the buffer is null terminated. Replace call to strncpy() with call to strlcpy() ensuring that the buffer is null terminated. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-05staging: fbtft: fix unaligned parenthesesUmang Raghuvanshi3-12/+14
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 Bergmann22-26/+26
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 Raghuvanshi1-5/+5
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 Rauf8-32/+32
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 Singh1-16/+0
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 Shevchenko1-9/+7
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 Shevchenko1-0/+21
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 Shevchenko1-6/+1
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 Shevchenko4-29/+2
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 Shevchenko1-4/+4
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 Manni1-9/+9
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 Matheina1-8/+10
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 Singh1-11/+20
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 Almas1-5/+5
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 Canillas1-0/+1
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. Silva1-31/+37
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 Perches8-75/+323
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 Kalra1-6/+3
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 Stanojevic1-2/+2
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 Palminha1-2/+2
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 Bankar1-1/+1
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 Sharma1-2/+2
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 Sharma1-4/+4
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 Jacob1-28/+29
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 Jacob1-3/+5
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 Jacob1-1/+2
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 Jacob1-17/+26
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 Jacob1-20/+20
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 Jacob1-11/+12
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>