History log of /linux-master/drivers/staging/fbtft/fb_ssd1351.c
Revision Date Author Comments
# 009c95c8 19-Feb-2024 Thomas Zimmermann <tzimmermann@suse.de>

staging/fbtft: Include <linux/backlight.h>

Resolves the proxy include via <linux/fb.h>, which does not require the
backlight header.

v3:
* fix grammar in commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Helge Deller <deller@gmx.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240219093941.3684-4-tzimmermann@suse.de


# 66d653c3 07-Jun-2022 Stephen Kitt <steve@sk2.org>

staging: ftbft: Use backlight helper

backlight_properties.fb_blank is deprecated. The states it represents
are handled by other properties; but instead of accessing those
properties directly, drivers should use the helpers provided by
backlight.h.

Instead of manually checking the power state in struct
backlight_properties, use backlight_is_blank().

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Len Baker <len.baker@gmx.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220607185516.1129900-1-steve@sk2.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7865dd24 05-Nov-2021 Noralf Trønnes <noralf@tronnes.org>

staging/fbtft: Fix backlight

Commit b4a1ed0cd18b ("fbdev: make FB_BACKLIGHT a tristate") forgot to
update fbtft breaking its backlight support when FB_BACKLIGHT is a module.

Since FB_TFT selects FB_BACKLIGHT there's no need for this conditional
so just remove it and we're good.

Fixes: b4a1ed0cd18b ("fbdev: make FB_BACKLIGHT a tristate")
Cc: <stable@vger.kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://lore.kernel.org/r/20211105204358.2991-1-noralf@tronnes.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ec03c210 03-May-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

staging: fbtft: Rectify GPIO handling

The infamous commit c440eee1a7a1 ("Staging: staging: fbtft: Switch to
the GPIO descriptor interface") broke GPIO handling completely.
It has already four commits to rectify and it seems not enough.
In order to fix the mess here we:

1) Set default to "inactive" for all requested pins

2) Fix CS#, RD#, and WR# pins polarity since it's active low
and GPIO descriptor interface takes it into consideration
from the Device Tree or ACPI

3) Consolidate chip activation (CS# assertion) under default
->reset() callback

To summarize the expectations about polarity for GPIOs:

RD# Low
WR# Low
CS# Low
RESET# Low
DC or RS High
RW High
Data 0 .. 15 High

See also Adafruit learning course [1] for the example of the schematics.

While at it, drop unneeded NULL checks, since GPIO API is tolerant to that.

[1]: https://learn.adafruit.com/adafruit-2-8-and-3-2-color-tft-touchscreen-breakout-v2/downloads

Fixes: 92e3e884887c ("Staging: fbtft: Fix GPIO handling")
Fixes: b918d1c27066 ("Staging: fbtft: Fix reset assertion when using gpio descriptor")
Fixes: dbc4f989c878 ("Staging: fbtft: Fix probing of gpio descriptor")
Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: Jan Sebastian Götte <linux@jaseg.net>
Cc: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 36cbd685 02-Apr-2019 Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>

staging: fbtft: fb_ssd1351.c: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4973c2e6 25-Feb-2019 Bhanusree Pola <bhanusreemahesh@gmail.com>

Staging: fbtft: Alignment should match open parenthesis

Clear the warning found by checkpatch.pl
WARNING:Alignment should match open parenthesis

Adjust paremeters in fbtft_par_dbg and write_reg.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c440eee1 16-Jan-2019 Nishad Kamdar <nishadkamdar@gmail.com>

Staging: fbtft: Switch to the gpio descriptor interface

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>


# 1315e8ba 07-Aug-2018 Leonardo Brás <leobras.c@gmail.com>

staging: fbtft: Erases some repetitive usage of function name - Style

Changes this functions to avoid using "blank" on debug twice. Improves log readability.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e66f30ee 07-Aug-2018 Leonardo Brás <leobras.c@gmail.com>

staging: fbtft: A bit more information on dev_err.

Adds a bit more information on debug.
The line break was to avoid obfuscating the parameters on the end of a large line.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 333c7b94 07-Aug-2018 Leonardo Brás <leobras.c@gmail.com>

staging: fbtft: Fixes some alignment issues - Style

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>


# ab608b34 16-Jul-2018 Matthias Wolf <der_wolf_@web.de>

staging: fbtft: Fix line continuation

Fix checkpatch warning: avoid unnecessary line continuation
to allow grepping of whole error message.

Signed-off-by: Matthias Wolf <der_wolf_@web.de>
Signed-off-by: Felix Siegel <felix.siegel@stud.uni-hannover.de>
Signed-off-by: Tim Cofala <cofala@stud.uni-hannover.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 783de57c 11-Jan-2018 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: fbtft: add SPDX identifiers

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>


# 307a0824 05-Feb-2017 Umang Raghuvanshi <u@umangis.me>

staging: fbtft: fix unaligned parentheses

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>


# 22eb36b8 02-Feb-2017 Arnd Bergmann <arnd@arndb.de>

staging: fbtft: change 'gamma' array to u32

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>


# e3f680dd 15-Sep-2016 Gargi Sharma <gs051095@gmail.com>

staging: fbtft: add spaces around <<

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>


# 007afa8b 15-Sep-2016 Gargi Sharma <gs051095@gmail.com>

staging: fbtft: move && operator for logical continuation

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>


# 1c41494a 17-Jul-2016 Ming Yang <minos.future@gmail.com>

Staging: fbtft: fixed unsigned type warnings

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>


# ed400c96 14-Oct-2015 Cristina Moraru <cristina.moraru09@gmail.com>

staging: fbtft: Fix multi-line comment style

Thus use the preferred style for multi-line coments as
mentioned in Documentation/CodingStyle.

It also silences 'Block comments use * on subsequent lines'
checkpatch.pl warnings.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6f6347ef 30-Sep-2015 Shraddha Barke <shraddha.6596@gmail.com>

Staging: fbtft: Remove debug messages related to DEBUG_BACKLIGHT

Remove debug messages related to fbtft_par_dbg(DEBUG_BACKLIGHT.. )
as this info can be obtained using kernel function tracer

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 64ffdc38 21-Sep-2015 Shraddha Barke <shraddha.6596@gmail.com>

Staging: fbtft: Remove debug messages

Remove debug messages related to fbtft_par_dbg(DEBUG_INIT_DISPLAY.. )
as this info can be obtained using kernel function tracer

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1014c2ce 03-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# e7322187 03-Sep-2015 Anish Bhatt <anish7@gmail.com>

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>


# 23801e34 02-Sep-2015 Mike Rapoport <rppt@kernel.org>

staging: fbtft: fb_ssd1351: define backlight_ops statically

instead of devm_kzalloc'ing them

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 153fe946 20-Mar-2015 Geert Uytterhoeven <geert@linux-m68k.org>

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>


# fad0d05f 02-Mar-2015 Dilek Uzulmez <dilekuzulmez@gmail.com>

Staging: fbtft: Remove unnecessary 'out of memory' message.

This patch fixes checkpatch.pl warning in file fb_ssd1351.c
WARNING: Possible unnecessary 'out of memory' message

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54a8de19 19-Feb-2015 aybuke ozdemir <aybuke.147@gmail.com>

Staging: fbtft: Added blank line after declaration

WARNING: Missing a blank line after declaration
chackpatch.pl warning in fb_ssd1351.c

Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 883daf0a 31-Dec-2014 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

staging: fbtft: add fb_ssd1351 driver

This commit adds the fb_ssd1351 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>