Commit Graph
100 Commits
Author SHA1 Message Date
Sam Ravnborg 604057e984 video: fbdev: sis: Drop useless call to SiS_GetResInfo()
Coverity reported:

    Useless call (USELESS_CALL) side_effect_free: Calling
     SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex) is only useful for its
    return value, which is ignored.

And this is correct - so drop the call.

Signed-off-by: Sam Ravnborg <[email protected]>
Reported-by: Colin Ian King <[email protected]>
Addresses-Coverity: ("Useless call")
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Colin Ian King <[email protected]>
Cc: Thomas Winischhofer <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:36:52 +01:00
Sam Ravnborg 4aca4dbcac video: fbdev: controlfb: Fix set but not used warnings
The controlfb driver has a number of dummy defines for IO operations.
They were introduced in commit a07a63b0e2
("video: fbdev: controlfb: add COMPILE_TEST support").

The write variants did not use their value parameter in the
dummy versions, resulting in set but not used warnings.
Fix this by adding "(void)val" to silence the compiler.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Michael Ellerman <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:36:36 +01:00
Sam Ravnborg 86925b9f52 video: fbdev: efifb: Fix set but not used warning for screen_pitch
screen_pitch was asssigned a value which was never used.
Drop it to fix the warning

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Peter Jones <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:36:03 +01:00
Sam Ravnborg 96a84fc360 video: fbdev: gbefb: Fix set but not used warning
The variable "x" was set but never used.
Drop the redundant assignments.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:35:24 +01:00
Sam Ravnborg 54f572645c video: fbdev: goldfishfb: Fix defined but not used warning
The goldfish_fb_acpi_match table is only used with ACPI enabled.
Ifdef it out unless it is needed.
This is a similar fix to what other acpi drivers do.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:34:50 +01:00
Sam Ravnborg 5825e11c25 video: fbdev: wmt_ge_rops: Fix function not declared warnings
Include own header to fix "function not declared" warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Tony Prisk <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:34:36 +01:00
Sam Ravnborg 031d039f17 video: fbdev: mmp: Fix kernel-doc warning for lcd_spi_write
Add missing parameter and drop parameter that is not present

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:34:25 +01:00
Sam Ravnborg 3ccdcdf461 video: fbdev: sparc drivers: fix kernel-doc warnings for blank_mode
Fix kernel-doc warnings caused by a wrong parameter name
blank_mode => blank

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:34:08 +01:00
Sam Ravnborg 7143c92be8 video: fbdev: uvesafb: Fix set but not used warning
Fix W=1 warning by deleting unused local variable.

v2:
  - Updated subject (Lee)

v3:
  - Return early in case of an error (Thomas)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Michal Januszewski <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:33:48 +01:00
Sam Ravnborg e72ce1c4d1 video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core
Fix a few W=1 warnings about unused assignments.
Drop the unused error code.

v2:
  - Subject updated (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Qilong Zhang <[email protected]>
Cc: "Alexander A. Klimov" <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:33:28 +01:00
Sam Ravnborg e994a1b67b video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify
Fix kernel-doc warnings reported when using W=1

v2:
  - Improve subject (Lee)

v3:
  - Add RETURNS documentation (Thomas)

v4:
  - Use Return: not RETURNS (Randy)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: "Alexander A. Klimov" <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:31:56 +01:00
Sam Ravnborg 04a697f08a video: fbdev: hgafb: Fix kernel-doc warnings
Fix kernel-doc comments.

v2:
  - Updated subject (Lee)

v3:
  - Add space after ':' (Randy)
  - Fix name of function in comment

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Cc: Ferenc Bakonyi <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-08 18:31:11 +01:00
Sam Ravnborg 630a159a0b video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings
Fix warnings:
- drop kernel-doc for the two debug functions to avoid the warnings
- delete unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Zimemrmann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Saeed Mirzamohammadi <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-05 21:16:02 +01:00
Sam Ravnborg 5a15468b72 video: fbdev: uvesafb: Fix string related warnings
Two W=1 string related warnings.
- Using strncpy to copy string without null-termination generates a
  warning.  Use memcpy to copy only the relevant chars

- Fix a potential bug with a very long string, subtract one from the
  length to make room for the termination null.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Michal Januszewski <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-05 21:01:36 +01:00
Sam Ravnborg ab2b29e64e video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings
Fix several W=1 warnings
- Updated kernel-doc as needed
- Deleted unused local variable, it was assigned but never used

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-05 21:01:04 +01:00
Sam Ravnborg c96da175ba video: fbdev: omapfb: Fix set but not used warnings in dsi
Fix several W=1 warnings.
This removes unused code and avoids an assignment by moving
the use inside the conditional block.

The register read FLD_GET(r, 15, 8) could be dropped as it was done a
few lines before too.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Aditya Pakki <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-12-05 21:00:09 +01:00
Sam Ravnborg 025ae8255d video: fbdev: nvidia: Fix set but not used warnings
Fix warnings by deleting unused code. The register reads are
kept as it is unknown if there are any hidden side-effects.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:21:54 +01:00
Sam Ravnborg 4e4b1d92e2 video: fbdev: neofb: Fix set but not used warning for CursorMem
Fix W=1 warnings by removing unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Evgeny Novikov <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:21:08 +01:00
Sam Ravnborg 57e4bc8a48 video: fbdev: sstfb: Updated logging to fix set but not used warnings
Fix set but not used warnings by introducing no_printk variants
for the internal logging system for this driver.

Fix a new warning that popped up now that logging was checked for
correct printf format strings.

A more invasive fix had been to replace all the internal logging with
standard logging primitives - thats for another day.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Alex Dewar <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:59 +01:00
Sam Ravnborg 9b028f48e7 video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code/variables
- Use memcpy to copy a string without zero-termination
  strncpy() generates a warning

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Xiaofei Tan <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:56 +01:00
Sam Ravnborg 2f71315eaa video: fbdev: tgafb: Fix kernel-doc and set but not used warnings
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:50 +01:00
Sam Ravnborg b47e6ca3c0 video: fbdev: pm2fb: Fix kernel-doc warnings
Fixed a few kernel-doc issues to fix the warnings.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:43 +01:00
Sam Ravnborg 5c7ddcc801 video: fbdev: riva: Fix kernel-doc and set but not used warnings
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:36 +01:00
Sam Ravnborg f686b34c93 video: fbdev: tdfx: Fix set but not used warning in att_outb()
The tmp variable was assigned but the result was never used,
so delete the tmp variable.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:30 +01:00
Sam Ravnborg 9403c18953 video: fbdev: via: Fix set but not used warning for mode_crt_table
Fix warning by deleting the variable. The function call
viafb_get_best_mode() was verified to have no side-effects,
and thus could be dropped too.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Florian Tobias Schandinat <[email protected]>
Cc: [email protected]
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:24 +01:00
Sam Ravnborg 1a608758df video: fbdev: sis: Fix set but not used warnings in sis_main
Fix warnings by dropping unused variable and the
unused assignments.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Winischhofer <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:17 +01:00
Sam Ravnborg 2a74e8682a video: fbdev: sis: Fix set but not used warnings in init.c
Fix "set but not used" warnings by removing the code the assign the
variables and the definition of the variables.
A register read is kept as it may have unknown side-effects.

This removes a lot of unused code - which is always a good thing to do.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Winischhofer <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:04:08 +01:00
Sam Ravnborg e8a254362d video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay
Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers
so looks like data worth keeping around but not as code we build.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Winischhofer <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 20:02:50 +01:00
Sam Ravnborg 50b82a2d69 video: fbdev: sis: Fix defined but not used warnings
init.h defines static symbols, so it should only be included
once. Drop the include from sis.h as it is not needed.
This fixes a lot of warnings seen with a W=1 build.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Thomas Winischhofer <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 19:29:40 +01:00
Sam Ravnborg 0556461376 video: fbdev: aty: Fix set but not used warnings in mach64_ct
Fix W=1 warnings about variables assigned but never used.
- One variable is only used when CONFIG_FB_ATY_GENERIC_LCD is defined
  Fix so variable is only defined with CONFIG_FB_ATY_GENERIC_LCD
- Several variables was only assigned by a call to aty_ld_le32().
  Drop the variables but keep the call to aty_ld_le32() as it may
  have unexpected side-effects.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 19:29:19 +01:00
Sam Ravnborg 5800545626 video: fbdev: aty: Fix set but not used warnings
Fix W=1 warnings about variables assigned but never used.

- Drop variables that were set but never used
- Make variable definition conditional on ATARI

v2:
  - Fix m68k build error (kernel test robot)
  - Improve subject (Lee Jones)

Signed-off-by: Sam Ravnborg <[email protected]>
Reported-by: kernel test robot <[email protected]> # m68k build fix
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Vaibhav Gupta <[email protected]>
Cc: Jason Yan <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 19:28:35 +01:00
Sam Ravnborg 288b23719c video: fbdev: aty: Delete unused variable in radeon_monitor
Fix warning about variable that is asssigned a value but never used.
The variable was indeed never used so delete it.

Keep the call to radeon_probe_i2c_connector() as it may have
side-effects. It is unlikely but I could not verify that is was safe to
drop the call.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-30 19:28:09 +01:00
Sam Ravnborg 6fdf38e613 video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings
Fix following W=1 warnings:
- Fix set but not used variables that were used only for logging.
  Fixed by introducing no_printk() to trick compiler to think variables
  are used
- Fix kernel-doc warning by deleting an empty comment line

v3:
  - Fix grammar in commit message (Thomas)
v2:
  - Subject updated (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Cc: Kristoffer Ericson <[email protected]>
Cc: Lee Jones <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-29 22:51:07 +01:00
Sam Ravnborg b1cba76de6 video: fbcon: Fix warnings by using pr_debug() in fbcon
Replacing DPRINTK() statements with pr_debug fixes set but not used
warnings.  And moves to a more standard logging setup at the same time.

v2:
  - Fix indent (Joe)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Peilin Ye <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: George Kennedy <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Peter Rosin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-29 22:44:48 +01:00
Sam Ravnborg 891948966b video: Fix kernel-doc warnings in of_display_timing + of_videomode
Fix kernel-doc warnings reported when using W=1.

v3:
  - Do not replace '-' with ':' (Thomas)

v2:
  - Improve subject (Lee)

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-29 22:42:17 +01:00
Sam Ravnborg ab7cffb8d2 MIPS: ingenic: remove unused platform_data header file
There are no users of this headers file in the kernel.
All users are likely migrated to device tree which is a good thing.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Paul Cercueil <[email protected]>
Cc: Harvey Hunt <[email protected]>
Cc: [email protected]
Reviewed-by: Paul Cercueil <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
2020-10-27 12:49:06 +01:00
Sam Ravnborg a25b6b273f drm/panel: Use dev_ based logging
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Guido Günther <[email protected]>
Cc: Jerry Han <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Icenowy Zheng <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Guido Günther <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-18 22:32:37 +02:00
Sam Ravnborg 65d5c86fc5 drm/panel: sitronix: Use dev_ based logging
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Guido Günther <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Guido Günther <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-18 22:32:23 +02:00
Sam Ravnborg c8cf6990f9 drm/panel: raydium: Use dev_ based logging
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Guido Günther <[email protected]>
Cc: Robert Chiras <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Guido Günther <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-18 22:32:08 +02:00
Sam Ravnborg b75efff5f5 drm/panel: leadtek: Use dev_ based logging
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Guido Günther <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Guido Günther <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-18 22:31:48 +02:00
Sam Ravnborg 5936b3bdaa drm/panel: samsung: Use dev_ based logging
Standardize on the dev_ based logging and drop the include of drm_print.h.
Fix a few cases where "x@" was used when printing the mode.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Guido Günther <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Guido Günther <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-18 22:31:09 +02:00
Sam Ravnborg 018315d399 drm/mgag200: fix build on alpha arch
When building imgag200 for the alpha architecture it fails like this:
mgag200_drv.c:233:9: error: implicit declaration of function ‘vmalloc’
  233 |  bios = vmalloc(size);
      |         ^~~~~~~
      |         kmalloc

When building for other architectures vmalloc.h is pulled in via some
other header file - for example asm-generic/io.h.
Use an explicit include of vmalloc.h to fix the build.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Fixes: e20dfd27f7 ("drm/mgag200: Add support for G200 desktop cards")
Cc: Thomas Zimmermann <[email protected]>
Cc: Egbert Eich <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Lyude Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-08-07 22:52:48 +02:00
Sam Ravnborg 8f22c21dce drm/bridge: nxp-ptn3460: add drm_panel_bridge support
Prepare the bridge driver for use in a chained setup.

- Replacing direct use of drm_panel with drm_panel_bridge support.
- Make the connector creation optional

Note: the bridge panel will use the connector type from the panel.

v3:
  - Fix wrong logic in connector creation (Laurent)

v2:
  - Use panel_bridge for local variable name to align with other drivers
  - Fix that connector was created twice (Laurent)
  - Set bridge.type to DRM_MODE_CONNECTOR_LVDS.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 19:25:10 +02:00
Sam Ravnborg 4151c14cdd drm/bridge: nxp-ptn3460: add get_edid bridge operation
Add the get_edid() bridge operation to prepare for
use as a chained bridge.
Add helper function that is also used by the connector.

v2:
  - Fix memory leak (Laurent)
  - Do not save a copy of edid, read it when needed

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 19:24:20 +02:00
Sam Ravnborg de5e6c027a drm/bridge: tc358767: add drm_panel_bridge support
With the bridge operations implemented the last step to prepare
this driver for a chained setup is the use of the bridge panel driver.

The bridge panel driver is only used when a port@2 is present in
the DT. So when the display driver requests a connector
support both situations:
- connector created by bridge panel driver
- connector created by this driver

And on top, support that the display driver creates the connector,
which is the preferred setup.

Note: the bridge panel will use the connector type from the panel.

v3:
  - Fix wrong logic in connector creation (Laurent)

v2:
  - Merge connector and drm_panel_bridge patches
    and fix so we do not create two connectors (Laurent)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 19:23:52 +02:00
Sam Ravnborg 731f4badcb drm/bridge: tc358767: add get_edid bridge operation
Prepare for chained bridge with the addition of
get_edid support.

v2:
  - Fixed handling of edid storage (Laurent)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 19:22:27 +02:00
Sam Ravnborg 136d73a8c8 drm/bridge: tc358767: add detect bridge operation
Prepare the bridge driver for chained operation by adding
support for the detect operation.

v3:
  - Fix code to make it readable (Laurent)

v2:
  - Do not announce detect operation if there is no hpd pin (Laurent)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 19:22:26 +02:00
Sam Ravnborg a8ef18d7dd drm/bridge: megachips: make connector creation optional
Make the connector creation optional to enable usage of the
megachips-stdpxxxx-ge-b850v3-fw bridge with the DRM bridge connector
helper.

v2:
  - Set bridge.type to DRM_MODE_CONNECTOR_DisplayPort

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:24:41 +02:00
Sam Ravnborg 489ce80fa4 drm/bridge: megachips: add get_edid bridge operation
To prepare for a chained bridge setup add support for the
get_edid bridge operation.
There is no need for a copy of the edid - so drop
the pointer to the copy.

v2:
  - Fix so we do not leak memory (Laurent)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:24:25 +02:00
Sam Ravnborg a3d495ce5c drm/bridge: megachips: enable detect bridge operation
To prepare for use in a chained bridge setup enable the
detect operation.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:24:08 +02:00
Sam Ravnborg 77860a7c89 drm/bridge: megachips: get drm_device from bridge
Fix so drm_device is read from the bridge.
This is a preparation for the connector being optional.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:24:02 +02:00
Sam Ravnborg 43c601a6e8 drm/bridge: megachips: add helper to create connector
Factor out connector creation to a small helper function.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:23:55 +02:00
Sam Ravnborg 5b851515ef drm/bridge: parade-ps8622: add drm_panel_bridge support
Prepare the bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

The connecter is now either created by the panel bridge or the display
driver. So all code for connector creation in this driver is no longer
relevant and thus dropped.

The connector code had some special polling handling:
    connector.polled = DRM_CONNECTOR_POLL_HPD;
    drm_helper_hpd_irq_event(ps8622->bridge.dev);

This code was most likely added to speed up detection of the connector.
If really needed then this functionality belongs somewhere else.

Note: the bridge panel will use the connector type from the panel.

v2:
  - Fix to avoid creating connector twice (Laurent)
  - Drop all connector code - defer to bridge panel
  - Use panel_bridge for local variable to align with other drivers
  - Set bridge.type to DRM_MODE_CONNECTOR_LVDS;

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:22:14 +02:00
Sam Ravnborg 1644127f83 drm/bridge: tc358764: add drm_panel_bridge support
Prepare the tc358764 bridge driver for use in a chained setup by
replacing direct use of drm_panel with drm_panel_bridge support.

The bridge panel will use the connector type reported by the panel,
where the connector for this driver hardcodes DRM_MODE_CONNECTOR_LVDS.

The tc358764 did not add any additional info the the connector so the
connector creation is passed to the bridge panel driver.

v3:
  - Merge with patch to make connector creation optional to avoid
    creating two connectors (Laurent)
  - Pass connector creation to bridge panel, as this bridge driver
    did not add any extra info to the connector.
  - Set bridge.type to DRM_MODE_CONNECTOR_LVDS.

v2:
  - Use PTR_ERR_OR_ZERO() (kbuild test robot)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: kbuild test robot <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:21:07 +02:00
Sam Ravnborg 385ca38da2 drm/bridge: tc358764: drop drm_connector_(un)register
Drop drm_connector handling that is not needed:

- drm_dev_register() in the display controller driver takes
  care of registering connectors.
  So the call to drm_connector_register() call is not needed in the bridge
  driver.

- Use of drm_connector_unregister() is only required for drivers that
  explicit have called drm_dev_register.

- The reference counting using drm_connector_put() is likewise not needed.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:19:05 +02:00
Sam Ravnborg 9f069c6fbc drm/panel: panel-simple: add default connector_type
All panels shall report a connector type.
panel-simple has a lot of panels with no connector_type,
and for these fall back to DPI as the default.

v2:
  - Rebased on top of validation of panel description

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:18:52 +02:00
Sam Ravnborg ddb8e853dc drm/panel: panel-simple: validate panel description
Warn if we detect a panel with incomplete/wrong description.
This is inspired by a similar patch by Laurent that introduced checks
for LVDS panels - this extends the checks to the remaining type of
connectors.

This is known to warn for some of the existing panels but added
despite this as we need help from people using the panels to
add the missing info.
The checks are not complete but will catch the most common mistakes.

The checks at the same time serve as documentation for the minimum
required description for a panel.

The checks uses dev_warn() as we know this will hit. WARN() was
too noisy at the moment for anything else than LVDS.

v3:
  - %d => %u for bpc (Laurent)
v2:
  - Use dev_warn (Laurent)
  - Check for empty bus_flags

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 17:17:32 +02:00
Sam Ravnborg 2a1658bf92 drm/drm_fb_helper: fix fbdev with sparc64
Recent kernels have been reported to panic using the bochs_drm
framebuffer under qemu-system-sparc64 which was bisected to
commit 7a0483ac4f ("drm/bochs: switch to generic drm fbdev emulation").

The backtrace indicates that the shadow framebuffer copy in
drm_fb_helper_dirty_blit_real() is trying to access the real
framebuffer using a virtual address rather than use an IO access
typically implemented using a physical (ASI_PHYS) access on SPARC.

The fix is to replace the memcpy with memcpy_toio() from io.h.

memcpy_toio() uses writeb() where the original fbdev code
used sbus_memcpy_toio(). The latter uses sbus_writeb().

The difference between writeb() and sbus_memcpy_toio() is
that writeb() writes bytes in little-endian, where sbus_writeb() writes
bytes in big-endian. As endian does not matter for byte writes they are
the same. So we can safely use memcpy_toio() here.

Note that this only fixes bochs, in general fbdev helpers still have
issues with mixing up system memory and __iomem space. Fixing that will
require a lot more work.

v3:
  - Improved changelog (Daniel)
  - Added FIXME to fbdev_use_iomem (Daniel)

v2:
  - Added missing __iomem cast (kernel test robot)
  - Made changelog readable and fix typos (Mark)
  - Add flag to select iomem - and set it in the bochs driver

Signed-off-by: Sam Ravnborg <[email protected]>
Reported-by: Mark Cave-Ayland <[email protected]>
Reported-by: kernel test robot <[email protected]>
Tested-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Cc: Mark Cave-Ayland <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-27 16:47:46 +02:00
Sam Ravnborg 2a5c2ff584 drm/panel: add connector type to boe,hv070wsa-100 panel
The boe,hv070wsa-100 panel is a LVDS panel.
Fix connector type to reflect this.

With this change users of this panel do not have to specify the
connector type.

v4:
  - Add .bpc = 4 (Laurent)

v3:
  - Drop PIXDATA bus_flag, not relevant

v2:
  - Add .bus_format (Laurent)
  - Add .bus_flags

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-26 20:30:33 +02:00
Sam Ravnborg b6539a11e8 backlight: backlight: Make of_find_backlight static
There are no external users of of_find_backlight, as they have all
changed to use the managed version. Make of_find_backlight static to
prevent new external users.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:11 +01:00
Sam Ravnborg 0f6a3256fd backlight: backlight: Drop backlight_put()
There are no external users of backlight_put(). Drop it and open code
the two users in backlight.c.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:09 +01:00
Sam Ravnborg 51d53e5b06 backlight: Use backlight_get_brightness() throughout
Introduce the backlight_get_brightness() helper in all
video/backlight/* drivers. This simplifies the code and align the
implementation of the update_status() operation across the different
backlight drivers.

Some of the drivers gains a little extra functionality by the change
as they now respect the fb_blank() ioctl.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:06 +01:00
Sam Ravnborg a00a5feb1e backlight: jornada720_bl: Introduce backlight_is_blank()
Use the backlight_is_blank() helper to simplify the code a bit.

The jornada720_bl driver distinguish between backlight off
and brightness set to 0.

Thus this driver turn off backlight only when backlight_is_blank()
returns true.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:05 +01:00
Sam Ravnborg de7b490cdf backlight: gpio_backlight: Simplify update_status()
Introduce the use of backlight_get_brightness() to simplify the
update_status() operation. With the simpler implementation drop the
gpio_backlight_get_next_brightness() helper as it was now a
one-liner.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:05 +01:00
Sam Ravnborg 24d34617c2 backlight: cr_bllcd: Introduce gpio-backlight semantics
cr_bllcd can turn backlight ON or OFF.

Fix semantitics so they equals what we know from gpio-backlight.

 brightness == 0   => backlight off
 brightness == 1   => backlight on

Use the backlight_get_brightness() helper to simplify the code.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:04 +01:00
Sam Ravnborg 5a09765dde backlight: as3711_bl: Simplify update_status
Replaces the open-coded checks of the state, with the
backlight_get_brightness() helper. This increases readability of the
code and align the functionality across the drivers.

Furthermore drop the debug prints in update_status().
If we need debug printing then we can add it to the backlight core.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:03 +01:00
Sam Ravnborg 2144d00ed0 backlight: backlight: Introduce backlight_get_brightness()
Based on an idea from Emil Velikov, add a helper that checks
backlight_is_blank() and return 0 as brightness if display is blank or
the property value if not.

This allows us to simplify the update_status() implementation
in most of the backlight drivers.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:27:02 +01:00
Sam Ravnborg 5ab4246cfc doc-rst: Wire-up Backlight kernel-doc documentation
Include backlight so the documentation is now generated with make
htmldocs and friends.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:22 +01:00
Sam Ravnborg a1230eb2e3 backlight: backlight: Add overview and update existing doc
Add overview chapter to backlight.c.

Update existing kernel-doc to follow a more consistent style and drop
kernel-doc for deprecated functions.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:20 +01:00
Sam Ravnborg 9c4aa3118b backlight: backlight: Drop extern from prototypes
No need to put "extern" in front of prototypes. While touching the
prototypes adjust indent to follow the kernel style.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:10 +01:00
Sam Ravnborg 7ecdea4a02 backlight: generic_bl: Remove this driver as it is unused
The backlight_bl driver required initialization using
struct generic_bl_info. As there are no more references
to this struct there is no users left.
So it is safe to delete the driver.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:08 +01:00
Sam Ravnborg 2d15bb47f3 backlight: backlight: Document enums in backlight.h
Add kernel-doc documentation for the backlight enums

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:07 +01:00
Sam Ravnborg d160fd4e91 backlight: backlight: Document inline functions in backlight.h
Add documentation for the inline functions in backlight.h

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:26:06 +01:00
Sam Ravnborg 6f10cd124c backlight: backlight: Improve backlight_device documentation
Improve the documentation for backlight_device and adapt it to
kernel-doc style.

The updated documentation is more strict on how locking is used.
With the update neither update_lock nor ops_lock may be used
outside the backlight core.

This restriction was introduced to keep the locking simple
by keeping it in the core.

It was verified that this documents the current state by renaming
update_lock => bl_update_lock and ops_lock => bl_ops_lock.
The rename did not reveal any uses outside the backlight core.
The rename is NOT part of this patch.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Jingoo Han <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:25:56 +01:00
Sam Ravnborg cabf161335 backlight: backlight: Improve backlight_properties documentation
Improve the documentation for backlight_properties and adapt it to
kernel-doc style.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:21:28 +01:00
Sam Ravnborg ca7c20b213 backlight: backlight: Improve backlight_ops documentation
Improve the documentation for backlight_ops and adapt it to kernel-doc
style.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:19:24 +01:00
Sam Ravnborg 1c91b46555 backlight: backlight: Add backlight_is_blank()
The backlight support has three properties that express the state:
 - power
 - state
 - fb_blank

It is un-documented and easy to get wrong.
Add backlight_is_blank() helper to make it simpler
for drivers to get the check of the state correct.

A lot of drivers also includes checks for fb_blank.
This check is redundant when the state is checked
and thus not needed in this helper function.
But added anyway to avoid introducing subtle bugs
due to the creative use of fb_blank in some drivers.
Introducing this helper will for some drivers results in
added support for fb_blank. This will be a change in
functionality, which will improve the backlight driver.

Rolling out this helper to all relevant backlight drivers
will eliminate almost all accesses to fb_blank.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:17:12 +01:00
Sam Ravnborg 4edfe2248d backlight: backlight: Refactor fb_notifier_callback()
Increase readability of fb_notifier_callback() by removing
a few indent levels.

No functional change.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2020-07-20 10:17:04 +01:00
Sam Ravnborg 672c6b1fe6 dt-bindings: fix simple-framebuffer example
Now that dt-extract-example gained support for using root nodes
in examples, update the example for the simple-frambuffer binding to use it.

This gives us a better example and kill a long standing warning:

simple-framebuffer.example.dts:23.16-39.11:
Warning (chosen_node_is_root): /example-0/chosen: chosen node must be at root node

Note: To get the update dt-extract-example execute:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

v2:
  - fix spelling of framebuffer (Geert)
  - drop stdout-path (Rob)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-10 21:00:24 +02:00
Sam Ravnborg bb3431747a dt-bindings: display: convert sharp,lq101r1sx01 to DT Schema
This binding describes a panel with a secondary channel.

v3:
  - Add reg property and unit-address to dsi nodes (Rob)

v2:
  - add check for required properties if link2 is present (Rob)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-10 20:53:08 +02:00
Sam Ravnborg c3823f2a4e dt-bindings: display: convert samsung,s6e8aa0 to DT Schema
v2:
  - Add missing types (Rob)
  - Fix example to specify panel@0 (Rob)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-10 20:52:51 +02:00
Sam Ravnborg d70cf7e0fc dt-bindings: display: convert innolux,p079zca to DT Schema
As the binding matches panel-simple-dsi, added the compatible to the
panel-simple-dsi list.
With this change enable-gpios is now optional.

v2:
  - It is a DSI panel, add it to panel-simple-dsi (Rob)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Chris Zhong <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-10 20:50:25 +02:00
Sam Ravnborg 92703c7109 drm/drm_connector: use inline comments for drm_bus_flags
Use inline comments for the drm_bus_flags enum.
This makes it easier to add more description comments in the future
should the need arise.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:05:27 +02:00
Sam Ravnborg aa9d4081de drm/drm_connector: drop legacy drm_bus_flags values
Drop the now unused legacy drm_bus_flags values.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:05:15 +02:00
Sam Ravnborg f5436f7748 drm/panel: panel-simple: drop use of legacy drm_bus_flags
Replace all uses of the legacy drm_bus_flags with their relevant
_SAMPLE_ variant.
This is a 1:1 replacement, no effort was made to validate the actual
bus flags for the panels.

Note:
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_NEGEDGE
DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE = DRM_BUS_FLAG_PIXDATA_POSEDGE

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:05:00 +02:00
Sam Ravnborg a4b1e1abea drm/panel: novatek-nt39016: drop use of legacy drm_bus_flags
Drop use of the legacy drm_bus_flags member and use the more descriptive
_SAMPLE_ variant.
No functional change.

Note:
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_NEGEDGE

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:04:47 +02:00
Sam Ravnborg 8b0a3f65a7 drm/panel: raydium-rm67191: drop use of legacy drm_bus_flags
Use the non-legacy drm_bus_flag _SAMPLE_ member.
No functional change.

Note:
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_NEGEDGE

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Robert Chiras <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:04:33 +02:00
Sam Ravnborg 04f08f8831 drm/ingenic-drm: drop use of legacy drm_bus_flags
Replace the legacy member with the more descriptive _DRIVE_ variant.
No functional change.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Paul Cercueil <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:04:17 +02:00
Sam Ravnborg 31a5f44161 drm/tidss: drop use of legacy drm_bus_flags
Use the more descriptive _DRIVE_ variants thus avoiding the
legacy drm_bus_flags values.

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Jyri Sarha <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-07-01 11:03:42 +02:00
Sam Ravnborg 5a4784f49b drm/vblank: use drm_WARN for all warnings
Replace all the WARN_* variants with their drm_WARN counterparts.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-31 22:34:21 +02:00
Sam Ravnborg 02149a76d3 drm/vblank: use drm_* functions for logging
Replace all DRM_* logging functions with their drm_ counterparts.
checkpatch emits a few "quoted string split across lines",
which is left as is. The strings was already split in the original code
base and it would not increase readability to fix them.

v2:
  - added braces to if statement (Thomas)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-31 22:32:41 +02:00
Sam Ravnborg 3b5ac8b560 video: amba-clcd: use devm_of_find_backlight
Look up backlight device using devm_of_find_backlight().
This simplifies the code and prevents us from hardcoding
the node name in the driver.

v2:
  - Added Cc: Peter Ujfalusi

Signed-off-by: Sam Ravnborg <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Russell King <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Peter Ujfalusi <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-18 12:10:02 +02:00
Sam Ravnborg a18dc7401a drm/tilcdc: use devm_of_find_backlight
Look up backlight device using devm_of_find_backlight().
This simplifies the code and prevents us from hardcoding
the node name in the driver.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-17 14:55:29 +02:00
Sam Ravnborg 1efa9eff7b drm/omap: display: use devm_of_find_backlight
Look up backlight device using devm_of_find_backlight().
This simplifies the code and prevents us from hardcoding
the node name in the driver.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Zheng Bin <[email protected]>
Cc: Kate Stewart <[email protected]>
Cc: Enrico Weigelt <[email protected]>
Cc: Allison Randal <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-05-17 14:54:39 +02:00
Sam Ravnborg 8a45fe7053 samples: uhid: fix warnings in uhid-example
Fix warnings seen when building for 32-bit architecture.

Use "%xd" for arguments of type size_t to fix the warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
2020-05-17 18:52:01 +09:00
Sam Ravnborg 1c49f35e9e video: vt8500lcdfb: fix fallthrough warning
Fix following warning:
vt8500lcdfb.c: In function 'vt8500lcd_blank':
vt8500lcdfb.c:229:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR ||
         ^
vt8500lcdfb.c:233:2: note: here
     case FB_BLANK_UNBLANK:
     ^~~~

Adding a simple "fallthrough;" fixed the warning.
The fix was build tested.

Signed-off-by: Sam Ravnborg <[email protected]>
Reported-by: kbuild test robot <[email protected]>
Fixes: e41f1a9894 ("fbdev: Implement simple blanking in pseudocolor modes for vt8500lcdfb")
Cc: Alexey Charkov <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: <[email protected]> # v2.6.38+
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-17 15:50:08 +02:00
Sam Ravnborg 702a21425a dt-bindings: display: move DSI panels to panel-simple-dsi
Tomi noticed that several DSI panels was wrongly
described in panel-simple.yaml.
Move them to panel-simple-dsi.yaml where they belong.

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-15 18:05:46 +02:00
Sam Ravnborg 8b9e7ace12 dt-bindings: display: convert olimex,lcd-olinuxino to DT Schema
v2:
  - use "ic2" node name in example (Rob)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Stefan Mavrodiev <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-15 18:05:46 +02:00
Sam Ravnborg 5717f3b80d dt-bindings: display: convert lgphilips,lb035q02 to DT Schema
v2:
  - drop use of spi-slave.yaml (Maxime)
  - added unevaluatedProperties (maxime)

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-15 18:05:46 +02:00
Sam Ravnborg 90c8466e37 dt-bindings: display: convert seiko,43wvf1g to DT Schema
Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Marco Franchi <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Cc: Marco Franchi <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-04-15 18:05:46 +02:00