aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/fbtft/fbtft_device.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-18staging: fbtft: fixed format-string errors.Jeremy Sowden1-1/+1
Added __printf attribute to declaration of fbtft_dbg_hex and fixed mismatches between format-specifiers and arguments in several function calls. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18Staging: fbtft: Switch to the gpio descriptor interfaceNishad Kamdar1-336/+8
This switches the fbtft driver to use GPIO descriptors rather than numerical gpios: Utilize the GPIO library's intrinsic handling of OF GPIOs and polarity. If the line is flagged active low, gpiolib will deal with this. Remove gpios from platform device structure. Neither assign statically numbers to gpios in platform device nor allow gpios to be parsed as module parameters. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19staging: fbtft: fix strncmp() size warningYueHaibing1-1/+1
strncmp() stops comparing when either the end of one of the first two arguments is reached or when 'n' characters have been compared, whichever comes first.That means that strncmp(s1, s2, n) is equivalent to strcmp(s1, s2) if n exceeds the length of s1 or the length of s2. This patch avoids that the following warning is reported by smatch: drivers/staging/fbtft/fbtft_device.c:1458 fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32) Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: fbtft: Adjust some empty-line problems - StyleLeonardo Brás1-2/+0
Erases some blank lines. Signed-off-by: Leonardo Brás <leobras.c@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: fbtft: Changes gamma table to define.Leonardo Brás1-8/+5
Most of other "Gamma Tables" were already boxed on a define, just did the same to PIOLED. Signed-off-by: Leonardo Brás <leobras.c@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: fbtft: Fixes some alignment issues - StyleLeonardo Brás1-12/+13
Fixes (most) alignment issues pointed by checkpatch.pl. Signed-off-by: Leonardo Brás <leobras.c@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-02staging: fbtft: indent fbtft_device_display - last entry - pdev - devRadek Dostál1-5/+5
The dev section was opening curly bracket, but not adding ident, which resulted in two times "}," after each other with same indentation. Add ident at the right place fixes this problem. This formatting issue is not detectable by checkpatch.pl Signed-off-by: Radek Dostál <radek.dostal@streamunlimited.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: fbtft: remove redundant license textGreg Kroah-Hartman1-10/+0
Now that the SPDX tag is in all fbtft files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: fbtft: add SPDX identifiersGreg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the all of the staging fbtft drivers to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.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: Make some s16 arrays constJoe Perches1-4/+4
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: 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-01-25staging: fbtft: fix checkpatch decimal permissions errorAbdul Rauf1-19/+19
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>
2016-10-16staging: fbtft: Convert int arrays to s16Joe Perches1-6/+6
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-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-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-08-21Staging: fbtft: fixed unsigned type warningsMing Yang1-11/+11
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-03-28Staging: fbtft: fbtft_device: No space is necessary after cast.Sandhya Bankar1-3/+3
No space is necessary after cast. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fbtft: use to_platform_device()Geliang Tang1-1/+1
Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fbtft: use to_spi_deviceGeliang Tang1-1/+1
Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fbtft: Use standard MIPI DCS command defines for fbtft driverPriit Laes1-23/+48
This patch makes use of the standard MIPI Display Command Set to remove some of the magic constants found in source code. Signed-off-by: Priit Laes <plaes@plaes.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: fbtft: fix voltage settings for C-Berry28Dennis Menschel1-4/+4
This patch fixes some internal voltage settings for the C-Berry28 display. The original example source files for the C-Berry28 as provided by its vendor admatec contained six issues where a command parameter's value didn't match its corresponding comment. I've informed admatec about these discrepancies on 2015-08-25. In the meantime, I've assumed the comments to be more reliable than the code, and thus have used these values to write the initial C-Berry28 driver. After having received a reply from admatec on 2015-10-16 that the issues have been fixed in their example code, it has turned out that for the voltages VCOM and AVDD, the code was indeed correct, but the comments were wrong. This patch is meant to fix these two pending mistakes. Signed-off-by: Dennis Menschel <menschel-d@posteo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: fbtft: use MIPI DCS for ST7789V and C-Berry28Dennis Menschel1-3/+4
This patch makes use of the standard MIPI Display Command Set to remove redundant entries from the command enum of the ST7789V display controller and also some of the magic constants found in the init sequence of the C-Berry28 display. Signed-off-by: Dennis Menschel <menschel-d@posteo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: fbtft: add support for C-Berry28 displayDennis Menschel1-0/+74
This patch adds support for the C-Berry28, a small 2.8" color display with a resolution of 320x240 pixels from admatec for the Raspberry Pi. It uses the Sitronix ST7789V display controller along with a custom init sequence and custom gamma curves. Signed-off-by: Dennis Menschel <menschel-d@posteo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: fbtft: change log levelSudip Mukherjee1-6/+2
Reduce the log level of some of the pr_* calls and remove 2 pr_debug calls which just prints "init" and "exit". Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: fbtft: start using pr_fmtSudip Mukherjee1-38/+29
Instead of defining DRVNAME and using it in all calls to pr_* family of macros lets start using pr_fmt. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: fbtft: use dev_*Sudip Mukherjee1-8/+7
Use dev_* family of macros where we have a reference of a device. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: fbtft: do not use magic numbersSudip Mukherjee1-1/+1
Using magic numbers are not good coding practise. Use FBTFT_GPIO_NAME_SIZE as defined in the header files. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: fbtft: use strncpy instead of strcpySudip Mukherjee1-1/+2
Using strcpy() is a security risk as the destination buffer size is not checked and we may over-run the buffer. Use strncpy() instead, while mentioning the buffer size leaving place for the NULL termination. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging/fbtft : Add missing whitespace around operatorsAnish Bhatt1-2/+2
Add blank spaces around operators where recommended by checkpatch.pl Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging/fbtft : Fix multiple/missing blank line issuesAnish Bhatt1-1/+0
Remove or add blank lines as recommended by checkpatch.pl Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging/fbtft : Remove repeated set_addr_win debug messagesAnish Bhatt1-2/+0
fbtft_par_dbg(DEBUG_SET_ADDR_WIN.. ) is repeated in every set_addr_win() handler, this could be replicated by using the kernel function tracer instead. Signed-off-by: Anish Bhatt <anish@chelsio.com> Suggested-by: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging/fbtft : Remove FSF mailing addressAnish Bhatt1-4/+0
checkpatch.pl recommends that this is no longer required. Also replaces ASCII-art copyright notice with simple text Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14Staging: fbtft: Add support for the Ultrachip UC1611 LCD controllerHenri Chain1-0/+31
This is a driver chip for 240x160 4-bit greyscale LCDs. It is capable of 4-wire (8 bit) or 3-wire (9 bit) SPI that have both been tested. (It also has a 6800 or 8080-style parallel interface, but I have not included support for it.) Signed-off-by: Henri Chain <henri.chain@eleves.ec-nantes.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: fbtft: eliminate code duplicationAnton Gerasimov1-4/+2
Eliminated code duplication when searching for a display. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: fbtft: remove unnecessary spaces before tabsAnton Gerasimov1-2/+2
The patch removes spaces before tabs so that checkpatch.pl is content. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: fbtft: remove unnecessary line continuationsAnton Gerasimov1-16/+16
Removed unnecessary line continuations in several lines. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: fbtft: make module descriptions greppableAnton Gerasimov1-6/+3
Split module description strings are merged for searchability. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: fbtft: split long stringsAnton Gerasimov1-1/+2
Split long function declarations, function calls, comments etc. Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26staging: fbtft: Add support for ili9163 controllerKozhevnikov Anatoly1-0/+18
Driver for ili9163-based displays (for example: Nokia 5110) Signed-off-by: Kozhevnikov Anatoly <shilo.xyz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-24staging: fbtft: Do not use binary constantsGeert Uytterhoeven1-3/+3
Gcc < 4.3 doesn't understand binary constants (0b*): drivers/staging/fbtft/fbtft-sysfs.c:156:19: error: invalid suffix "b111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:3: error: invalid suffix "b1111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:11: error: invalid suffix "b1111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:19: error: invalid suffix "b11111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:28: error: invalid suffix "b1111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:36: error: invalid suffix "b1111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:44: error: invalid suffix "b1111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:159:52: error: invalid suffix "b11111" on integer constant drivers/staging/fbtft/fb_hx8340bn.c:160:3: error: invalid suffix "b111" on integer constant ... Hence use hexadecimal constants (0x*) instead. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15staging: fbtft: fbtft_device.c: remove extra parentheses around function argumentsAya Mahfouz1-2/+2
Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script: @@ expression e; identifier f; @@ f(..., -( e -) ,...) Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: fbtft: Fix Sparse warningsFrederic Jacob1-2/+2
This fixes the folowing sparse warnings: fb_hx8340bn.c:111:6: warning: symbol 'set_addr_win' was not declared. Should it be static? fbtft_device.c:32:19: warning: symbol 'spi_device' was not declared. Should it be static? fbtft_device.c:33:24: warning: symbol 'p_device' was not declared. Should it be static? Signed-off-by: Frederic Jacob <frederic.jacob.78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: fbtft: fix spacing errorsAya Mahfouz1-31/+57
This patch fixes the following checkpatch.pl errors: space prohibited before that ',' space required after that ',' spaces required around that '=' Given that the addition of spaces triggered the line over 80 characters warning, some lines were divided into two. Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17staging: fbtft: add fbtft_device driverThomas Petazzoni1-0/+1444
This commit adds the fbtft_device driver from the fbtft project at https://github.com/notro/fbtft. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Noralf Tronnes <notro@tronnes.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>