In fbtft_framebuffer_alloc the error handling path should take care of
releasing frame buffer after it is allocated via framebuffer_alloc, too.
Therefore, in two failure cases the goto destination is changed to
address this issue.
Fixes: c296d5f995 ("staging: fbtft: core support")
Signed-off-by: Navid Emamdoost <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor
interface") removed the gpio code from fbtft_device rendering it useless.
fbtft_device is a module that was used on the Raspberry Pi to dynamically
add fbtft devices when the Pi didn't have Device Tree support.
Just remove the module since it's the responsibility of Device Tree, ACPI
or platform code to add devices.
Fixes: c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor interface")
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor
interface") removed setting gpios via platform data. This means that
fbtft will now only work with Device Tree so set the dependency.
This also prevents a NULL pointer deref on non-DT platform because
fbtftops.request_gpios is not set in that case anymore.
Fixes: c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: stable <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor
interface") breaks GPIO handling. In several places, checks to only set
a GPIO if it was configured ended up backwards.
I have tested this fix. The fixed driver works with a ili9486
display connected to a raspberry pi via SPI.
Fixes: c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor interface")
Tested-by: Jan Sebastian Götte <[email protected]>
Reviewed-by: Nicolas Saenz Julienne <[email protected]>
Signed-off-by: Jan Sebastian Götte <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Typically gpiod_set_value calls would assert the reset line and
then release it using the symantics of:
gpiod_set_value(par->gpio.reset, 0);
... delay
gpiod_set_value(par->gpio.reset, 1);
And the gpio binding would specify the polarity.
Prior to conversion to gpiod calls the polarity in the DT
was ignored and assumed to be active low. Fix it so that
DT polarity is respected.
Fixes: c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor interface")
Reviewed-by: Nicolas Saenz Julienne <[email protected]>
Tested-by: Nicolas Saenz Julienne <[email protected]>
Tested-by: Jan Sebastian Götte <[email protected]>
Signed-off-by: Phil Reid <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Conversion to use gpio descriptors broke all gpio lookups as
devm_gpiod_get_index was converted to use dev->driver->name for
the gpio name lookup. Fix this by using the name param. In
addition gpiod_get post-fixes the -gpios to the name so that
shouldn't be included in the call. However this then breaks the
of_find_property call to see if the gpio entry exists as all
fbtft treats all gpios as optional. So use devm_gpiod_get_index_optional
instead which achieves the same thing and is simpler.
Nishad confirmed the changes where only ever compile tested.
Fixes: c440eee1a7 ("Staging: fbtft: Switch to the gpio descriptor interface")
Reviewed-by: Nicolas Saenz Julienne <[email protected]>
Tested-by: Nicolas Saenz Julienne <[email protected]>
Tested-by: Jan Sebastian Götte <[email protected]>
Signed-off-by: Phil Reid <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There are a few remaining drivers/staging/*/Kconfig files that do not
have SPDX identifiers in them. Add the correct GPL-2.0 identifier to
them to make scanning tools happy.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
Signed-off-by: Payal Kshirsagar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
Signed-off-by: Payal Kshirsagar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Convert a ternary statement into a if statement which is detected while
resolving "WARNING: line over 80 characters". Use BIT() macro instead
manually left shifting.
Signed-off-by: Bhagyashri Dighole <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Convert a macro to an inline function to improve type safety and make
the code simpler.
Signed-off-by: Bhagyashri Dighole <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix line with over 80 characters to get rid of the warning
given by checkpatch
Signed-off-by: Daniela Mormocea <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the checkpatch.pl warning:
WARNING:line over 80 characters
Move Parameters to the next lines with proper alignment
Signed-off-by: Bhanusree Pola <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove unnecesessary extra blank line before the closing brace,
to solve the checkpatch.pl check:
CHECK: Extra blank line not required before closing brace '}'
Signed-off-by: Bhanusree Pola <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Replacing all occurrences of (1<<x) with BIT(x) to fix checkpatch issue.
CHECK:Prefer using the BIT macro
Signed-off-by: Mamta Shukla <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Most of other "Gamma Tables" were already boxed on a define, just did the same to PIOLED.
Signed-off-by: Leonardo Brás <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Puts macro arguments in parenthesis to avoid precedence issues.
Some large lines were broken to fit the 80-char limit.
Signed-off-by: Leonardo Brás <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Pull backlight updates from Lee Jones:
"Core Frameworks
- Provide helpers to enable/disable backlight
- Provide standard and devres versions OF find helpers
New Drivers:
- Add support for the Zodiac Inflight Innovations RAVE Supervisory
Processor
New Functionality:
- Allow pwm-on/pwm-off delay to be specified via DT
Bug Fixes:
- Fix ordering of the power {en,dis}able and PWM {en,dis}able
signals
- Fix Device Tree node look-up"
* tag 'backlight-next-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
backlight: as3711_bl: Fix Device Tree node leaks
backlight: tps65217_bl: Fix Device Tree node lookup
backlight: max8925_bl: Fix Device Tree node lookup
backlight: as3711_bl: Fix Device Tree node lookup
MAINTAINERS: Add dri-devel for backlight subsystem patches
backlight: Nuke BL_CORE_DRIVER1
staging: fbtft: Stop using BL_CORE_DRIVER1
backlight: pandora: Stop using BL_CORE_DRIVER1
backlight: generic-bl: Remove DRIVER1 state
backlight: Nuke unused backlight.props.state states
backlight: otm3225a: Add support for ORISE OTM3225A LCD SoC
backlight: pwm_bl: Don't use GPIOF_* with gpiod_get_direction
pwm-backlight: Add support for PWM delays proprieties.
dt-bindings: pwm-backlight: Add PWM delay proprieties.
pwm-backlight: Enable/disable the PWM before/after LCD enable toggle.
dt-bindings: backlight: Add binding for RAVE SP backlight driver
backlight: Add RAVE SP backlight driver
Leaking driver internal tracking into the already massively confusing
backlight power tracking is really confusing.
Luckily we have already a drvdata structure, so fixing this is really
easy.
Signed-off-by: Daniel Vetter <[email protected]>
Acked-by: Daniel Thompson <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Fix checkpatch.pl warnings of lines exceeding 80 columns.
Break lines in order to reduce instructions lengths to less than 80 columns.
Signed-off-by: Renato Soma <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
To make sure that these drivers do not leave staging before they
are properly converted to use the new GPIO descriptor API, create
the TODO file with this work item.
Cc: Thomas Petazzoni <[email protected]>
Cc: Noralf Tronnes <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Since nothing builds/depends on FB_TFT_SSD1325, we could remove it.
Signed-off-by: Corentin Labbe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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 <[email protected]>
Cc: Kate Stewart <[email protected]>
Cc: Philippe Ombredanne <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This fixes the checkpatch message:
CHECK: Alignment should match open parenthesis
#1380: FILE: drivers/staging/fbtft/fbtft-core.c:1380:
+ dev_warn(dev,
+ "no default functions for regwidth=%d and buswidth=%d\n",
Signed-off-by: Luis Gerhorst <[email protected]>
Signed-off-by: Jonny Schaefer <[email protected]>
Acked-by: Alexander Wuerstlein <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The Linux kernel coding style states that braces should only be used
when necessary.
This fixes the checkpatch warning
WARNING: line over 80 characters
+ } else if (display->regwidth == 8 && display->buswidth == 9 && par->spi) {
introduced by patch #1.
Signed-off-by: Luis Gerhorst <[email protected]>
Acked-by: Jonny Schaefer <[email protected]>
Acked-by: Alexander Wuerstlein <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>