Commit graph

28 commits

Author SHA1 Message Date
Sandhya Bankar 8cd977c316 Staging: fbtft: fbtft_device: No space is necessary after cast.
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-28 07:30:36 -07:00
Geliang Tang f6bfc25ee0 staging: fbtft: use to_platform_device()
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-07 19:42:23 -08:00
Geliang Tang 5d5ccf2196 staging: fbtft: use to_spi_device
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-07 19:42:23 -08:00
Priit Laes a79cb3901e staging: fbtft: Use standard MIPI DCS command defines for fbtft driver
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>
2016-02-07 19:39:27 -08:00
Dennis Menschel 646287ba9f staging: fbtft: fix voltage settings for C-Berry28
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-24 19:42:37 -07:00
Dennis Menschel 598af18afc staging: fbtft: use MIPI DCS for ST7789V and C-Berry28
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-24 19:42:37 -07:00
Dennis Menschel e9f6806551 staging: fbtft: add support for C-Berry28 display
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-10-13 10:49:12 -07:00
Sudip Mukherjee e714b7eab1 staging: fbtft: change log level
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-12 18:25:02 -07:00
Sudip Mukherjee 805deadbc2 staging: fbtft: start using pr_fmt
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-12 18:25:02 -07:00
Sudip Mukherjee 962539a068 staging: fbtft: use dev_*
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-12 18:25:02 -07:00
Sudip Mukherjee fb7014df15 staging: fbtft: do not use magic numbers
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-12 18:24:53 -07:00
Sudip Mukherjee eb6a2dbf32 staging: fbtft: use strncpy instead of strcpy
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-12 18:24:53 -07:00
Anish Bhatt 94c0a54427 staging/fbtft : Add missing whitespace around operators
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-12 18:24:37 -07:00
Anish Bhatt 1014c2ce08 staging/fbtft : Fix multiple/missing blank line issues
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-12 18:24:36 -07:00
Anish Bhatt e73221877a staging/fbtft : Remove repeated set_addr_win debug messages
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-12 18:24:36 -07:00
Anish Bhatt 4a1a838362 staging/fbtft : Remove FSF mailing address
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-09-12 18:24:35 -07:00
Henri Chain a1560f9bec Staging: fbtft: Add support for the Ultrachip UC1611 LCD controller
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-07-14 19:17:50 -07:00
Anton Gerasimov bc573c5131 staging: fbtft: eliminate code duplication
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-13 14:50:10 -07:00
Anton Gerasimov 8e56b95551 staging: fbtft: remove unnecessary spaces before tabs
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-13 14:50:10 -07:00
Anton Gerasimov 6c604d6657 staging: fbtft: remove unnecessary line continuations
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-13 14:50:10 -07:00
Anton Gerasimov 56cda8acd7 staging: fbtft: make module descriptions greppable
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-13 14:48:26 -07:00
Anton Gerasimov 3c588452c2 staging: fbtft: split long strings
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-06-13 14:48:26 -07:00
Kozhevnikov Anatoly 3b143b5503 staging: fbtft: Add support for ili9163 controller
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-26 13:06:54 +01:00
Geert Uytterhoeven 153fe94641 staging: fbtft: Do not use binary constants
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-24 23:06:56 +01:00
Aya Mahfouz b30367c086 staging: fbtft: fbtft_device.c: remove extra parentheses around function arguments
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-15 18:41:13 +01:00
Frederic Jacob cc060ed086 Staging: fbtft: Fix Sparse warnings
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-03-01 17:12:43 -08:00
Aya Mahfouz 73762b9dcb staging: fbtft: fix spacing errors
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-02-26 13:06:59 -08:00
Thomas Petazzoni 06d30f0208 staging: fbtft: add fbtft_device driver
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>
2015-01-17 16:46:48 -08:00