1
0
Fork 0
Commit Graph

7597 Commits (ed5bd7a47fd77166860e39f857ae8e3fe25c836c)

Author SHA1 Message Date
Linus Torvalds e1d1ea549b fbdev changes for v4.15:
- convert timers to use timer_setup() (Kees Cook, Thierry Reding)
 
 - fix panels support on iMX boards in mxsfb driver (Stefan Agner)
 
 - fix timeout on EDID read in udlfb driver (Ladislav Michl)
 
 - add missing modes to fix out of bounds access in controlfb driver
   (Geert Uytterhoeven)
 
 - update initialisation paths in sa1100fb driver to be more robust
   (Russell King)
 
 - fix error handling path of ->probe method in au1200fb driver
   (Christophe JAILLET)
 
 - fix handling of cases when either panel or crt is defined in sm501fb
   driver (Sudip Mukherjee, Colin Ian King)
 
 - add ability to the Goldfish FB driver to be recognized by OS via DT
   (Aleksandar Markovic)
 
 - structures constifications (Bhumika Goyal)
 
 - misc fixes (Allen Pais, Gustavo A. R. Silva, Dan Carpenter)
 
 - misc cleanups (Colin Ian King, Himanshu Jha, Markus Elfring)
 
 - remove dead igafb driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJaEto8AAoJEH4ztj+gR8ILrLkP+wcGcsZHGqte7bpwnEpQa/D8
 x0nlP3qNdx9pGDhZRZahexSmnLYajwg22iO3HdbuCy7k/WWtv6R+BREKQ1yEIHUP
 kmH5QMgKunWs36PITuxVRQ9GDwZK1pk+XAR0M3XBUOw8OKoqwiiX8z+5c3YxWQ4X
 0VgEBEijnZs9exZgTY0UNVBKzy4GC9HXRjDW7cicOSVX7TW7yURU2wL79ANqW+Ba
 eelbaPCDD3aPIFRWWKI/BH467Jyqnrol0u08ZZcqzMo92TQHmoYOctVuYlp3WM1j
 HOi/N/fdhKUPoadkr1av1VUQAIN+Cx+8lFAaihilaAbaIcd515UWu4Jqrt8SjTZ2
 xVfitJ58EaR++EJjfrwxyOkSIWlG6mH5y3IYwvV3N6WGiqhy5srue6MzI/ofX+Iz
 h2HNVXcIlMJmtCmOVUkk2zECyCFPN0S4+eTrRUUdPVQBCWNfqKm6mS2/p39P6mrE
 HfE4Jav/EXn7p2UBVRt8EYbWcdLCuIPdGc+buA+7z0Nu4AsPUMtkiuLpuKtE0sXs
 bq0Vv7ac07ZFxTjfnsPPrgBE9aBL5jtC8jnez2IRVMppfTIgah9xm32wQh43WzIM
 JgH4JxKaQgirmMHE3GGZASh4f9rj5M/Ia0ybQOVbwtxykKaFG8oIYyotJVP7MwDK
 +fl/CPKXfbpijliE5mDz
 =afFm
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-v4.15' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
 "There is nothing really major here (though removal of the dead igafb
  driver stands out in diffstat).

  Summary:

   - convert timers to use timer_setup() (Kees Cook, Thierry Reding)

   - fix panels support on iMX boards in mxsfb driver (Stefan Agner)

   - fix timeout on EDID read in udlfb driver (Ladislav Michl)

   - add missing modes to fix out of bounds access in controlfb driver
     (Geert Uytterhoeven)

   - update initialisation paths in sa1100fb driver to be more robust
     (Russell King)

   - fix error handling path of ->probe method in au1200fb driver
     (Christophe JAILLET)

   - fix handling of cases when either panel or crt is defined in
     sm501fb driver (Sudip Mukherjee, Colin Ian King)

   - add ability to the Goldfish FB driver to be recognized by OS via DT
     (Aleksandar Markovic)

   - structures constifications (Bhumika Goyal)

   - misc fixes (Allen Pais, Gustavo A. R. Silva, Dan Carpenter)

   - misc cleanups (Colin Ian King, Himanshu Jha, Markus Elfring)

   - remove dead igafb driver"

* tag 'fbdev-v4.15' of git://github.com/bzolnier/linux: (42 commits)
  OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
  video: fbdev: sm501fb: fix potential null pointer dereference on fbi
  fbcon: Initialize ops->info early
  video: fbdev: Convert timers to use timer_setup()
  video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup()
  fbdev: controlfb: Add missing modes to fix out of bounds access
  video: fbdev: sis_main: mark expected switch fall-throughs
  video: fbdev: cirrusfb: mark expected switch fall-throughs
  video: fbdev: aty: radeon_pm: mark expected switch fall-throughs
  video: fbdev: sm501fb: mark expected switch fall-through in sm501fb_blank_crt
  video: fbdev: intelfb: remove redundant variables
  video/fbdev/dnfb: Use common error handling code in dnfb_probe()
  sm501fb: suspend and resume fb if it exists
  sm501fb: unregister framebuffer only if registered
  sm501fb: deallocate colormap only if allocated
  video: goldfishfb: Add support for device tree bindings
  Documentation: Add device tree binding for Goldfish FB driver
  video: udlfb: Fix read EDID timeout
  video: fbdev: remove dead igafb driver
  video: fbdev: mxsfb: fix pixelclock polarity
  ...
2017-11-20 21:50:24 -10:00
Linus Torvalds a0e136e5da Merge branch 'work.get_user_pages_fast' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull get_user_pages_fast() conversion from Al Viro:
 "A bunch of places switched to get_user_pages_fast()"

* 'work.get_user_pages_fast' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  ceph: use get_user_pages_fast()
  pvr2fs: use get_user_pages_fast()
  atomisp: use get_user_pages_fast()
  st: use get_user_pages_fast()
  via_dmablit(): use get_user_pages_fast()
  fsl_hypervisor: switch to get_user_pages_fast()
  rapidio: switch to get_user_pages_fast()
  vchiq_2835_arm: switch to get_user_pages_fast()
2017-11-17 12:38:51 -08:00
Dan Carpenter 5f215d2524 OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
We cap the upper bound of "fbnum" but we also need to check for
negatives or make the type unsigned.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-17 17:21:49 +01:00
Colin Ian King 5fa1f45de8 video: fbdev: sm501fb: fix potential null pointer dereference on fbi
The pointer fbi is dereferenced with par = fbi->par before there is a
null check on fbi, hence there is a potential null pointer dereference
on a null par.  Fix this by moving the dereference after the null
pointer check.

Detected by CoverityScan, CID#1461301 ("Dereference before null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-17 17:21:48 +01:00
Linus Torvalds 9c7a867ebd - Fix-ups
- Handle 32bit overflow; pwm_bl
    - Remove redundant code/checks; tps65217_bl, ili922x
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJaDaGyAAoJEFGvii+H/HdhCpUP/A5ulsrmGU4VdibUDw4aRqxl
 SS8ABIbOyXMYwPdYH5FeXuumMJAWfuagfNaxWAvo2fMdwe4ZRerDqmo+bPhM47wU
 ji3LvtRXqapPNfdWFYirGD7wmlxD5CURZ588zB6sAmANsvnpP9ceBRkCQFEn1KmM
 sqyvcq/qmlFM7c2JY/Qdtb+YFF1HaNiIG7XjPEshP8QX2GNzo3HQfy+XOzVNLKdy
 9R5J9lhDAGmeQ8QWMfF9M16MnoF3EznHRadttJhmBBqq8k8cJq+7p49l9JijmGNc
 Ro3Ss2sIvX0BbcWCde50eGtgAXqwlf1SuNsO0fJ9Hksvl8teE+Q8vtdyKwQsiSc+
 yJueD/pc/G3B11UEv6DBJfJSuFyVjvjWvXanLyUVVmMuj+/nurlE8wfhQnmMjc3+
 d3slePOpncrfez+0fhL3ImB3MEFkTthej+lhMayJs+rQd6gf3hs6fFp4pXSzbDCi
 EV5UleHLmwbt6geSo7rS5AHu1h1FGsCMiQrG5T9W7tF/i6WdvZxjK5IuGf6oe1jb
 bwkMdf3qTze/dyNsCkCd9YdyorfOOkn+xcg2o76ClqOj0TjB1BIB0ExhWQ+qzYlc
 kX9JzNJ0ROnG1/6NsgR+t6h+DXIaxlrA9sUi83F+245+FEF33Eq3SYv0nk2X0n6V
 3TwZeeOUtvEaeYSdwsjx
 =KIqd
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:

   - handle 32bit overflow in pwm_bl

   - remove redundant code/checks in tps65217_bl and ili922x

* tag 'backlight-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: ili922x: Remove redundant variable len
  backlight: tps65217_bl: Remove unnecessary default brightness check
  backlight: pwm_bl: Fix overflow condition
2017-11-16 10:36:46 -08:00
Linus Torvalds d3092e4e99 - New Drivers
- Add support for Cherry Trail Dollar Cove TI PMIC
    - Add support for Add Spreadtrum SC27xx series PMICs
 
  - New Device Support
    - Add support Regulator to axp20x
 
  - New Functionality
    - Add DT support; aspeed-scu sc27xx-pmic
    - Add power saving support; rts5249
 
  - Fix-ups
    - DT clean-up/rework; tps65217, max77693, iproc-cdru, iproc-mhb, tps65218
    - Staticise/constify; stw481x
    - Use new succinct IRQ API; fsl-imx25-tsadc
    - Kconfig fix-ups; MFD_TPS65218
    - Identify SPI method; lpc_ich
    - Use managed resources (devm_*) calls; ssbi
    - Remove unused/obsolete code/documentation; mc13xxx
 
  - Bug Fixes
    - Fix typo in MAINTAINERS
    - Fix error handling; mxs-lradc
    - Clean-up IRQs on .remove; fsl-imx25-tsadc
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJaDaBsAAoJEFGvii+H/HdhfGUP/itBfs94YdkUeDFyWzfbg6ib
 X1t+3mXhPQiVAt91EBwl6JD7FQgdqoB/g4pNf937bFQ+Rm8Sd4R/a5J1KQ8Zta4H
 QaMmlhi6Fy5NWh2gmjuC3KoGOeXz9zAaaDH3SeAs98XCN55Akf6Tt1Us2Wp9VHkq
 PoMfwZXlqb4KggvEaraQS4QvTVXuKIoq49LmqUMxBhInMwoT9qwiI/PSWDfirzQk
 TLA3LOEjLpRKZQuHR+kovQOU2wnwmiOhBFuVuaYixPqDYFvm3/2KtuPKW79KzQPX
 vsi7/x4ShPB55extHPhuoRkjbp/7gvZQS2iW5NufJfrcu3m1kEnu5DLAB6e+4SHs
 ZE52MviFrCFoAXyXRvHBdzqgGKEzq2Jhlse4j+HRXVLOzIW8PzVM4MkZvfVFcqYx
 4BQuxdM6+oUGAqeKlmydaMTng8o/UfRainQ1dIGAblk5DCR+SHxqt582f9qyLAhT
 55OMFJG/bQ4cW86EXWtp+8DUA4Aoz5ZIJ+C5IrYKOA2ScQo//imoH5Hz1PH1m91O
 GebDdw7AijGLbSqXSu4aRfFe9+Whyo2387A+1Zd9zdfLyiOQ1n5ty6ClRsCfDJ8P
 K4ONmZL7H5n8I8j3eyivn+k1MelIdfG0hB8YS0NnYvR3pR9AY1NWCgO0f4rfyU9o
 whyvIqg22EepnbEJjjFv
 =LAK+
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New drivers:
   - Add support for Cherry Trail Dollar Cove TI PMIC
   - Add support for Add Spreadtrum SC27xx series PMICs

  New device support:
   - Add support Regulator to axp20x

  New functionality:
   - Add DT support; aspeed-scu sc27xx-pmic
   - Add power saving support; rts5249

  Fix-ups:
   - DT clean-up/rework; tps65217, max77693, iproc-cdru, iproc-mhb, tps65218
   - Staticise/constify; stw481x
   - Use new succinct IRQ API; fsl-imx25-tsadc
   - Kconfig fix-ups; MFD_TPS65218
   - Identify SPI method; lpc_ich
   - Use managed resources (devm_*) calls; ssbi
   - Remove unused/obsolete code/documentation; mc13xxx

  Bug fixes:
   - Fix typo in MAINTAINERS
   - Fix error handling; mxs-lradc
   - Clean-up IRQs on .remove; fsl-imx25-tsadc"

* tag 'mfd-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (21 commits)
  dt-bindings: mfd: mc13xxx: Remove obsolete property
  mfd: axp20x: Add axp20x-regulator cell for AXP813
  mfd: Add Spreadtrum SC27xx series PMICs driver
  dt-bindings: mfd: Add Spreadtrum SC27xx PMIC documentation
  mfd: ssbi: Use devm_of_platform_populate()
  mfd: fsl-imx25: Clean up irq settings during removal
  mfd: mxs-lradc: Fix error handling in mxs_lradc_probe()
  mfd: lpc_ich: Avoton/Rangeley uses SPI_BYT method
  mfd: tps65218: Introduce dependency on CONFIG_OF
  mfd: tps65218: Correct the config description
  MAINTAINERS: Fix Dialog search term for watchdog binding file
  mfd: fsl-imx25: Set irq handler and data in one go
  mfd: rts5249: Add support for RTS5250S power saving
  ACPI / PMIC: Add opregion driver for Intel Dollar Cove TI PMIC
  mfd: Add support for Cherry Trail Dollar Cove TI PMIC
  syscon: dt-bindings: Add binding document for iProc MHB block
  syscon: dt-bindings: Add binding doc for Broadcom iProc CDRU
  mfd: max77693: Add muic of_compatible in mfd_cell
  mfd: stw481x: Make three arrays static const, reduces object code size
  mfd: tps65217: Introduce dependency on CONFIG_OF
  ...
2017-11-16 09:15:57 -08:00
Thierry Reding d447ebf9c7 fbcon: Initialize ops->info early
During console takeover, which happens for all DRM/KMS setups using the
fbdev helpers, fbcon_startup() is called before fbcon_init() and as a
result con2fb_acquire_newinfo() will not be called (info->fbcon_par was
set to non-NULL in fbcon_startup()) to assign ops->info.

This causes the cursor_timer_handler() to unreference a NULL pointer.

Avoid this by unconditionally assigning ops->info during fbcon_startup()
so that it will be available early, but keep the additional assignment
in con2fb_acquire_newinfo() to support console remapping at runtime.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-13 18:16:31 +01:00
Kees Cook 6c78935777 video: fbdev: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. One tracking pointer was added.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Lechner <david@lechnology.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
[b.zolnierkie: ported it over pxa3xx_gcu changes]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-10 16:34:52 +01:00
Kees Cook e4a67df75a video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

This also fixes the use of the "priv" variable in QERROR(), since it was
pointing to struct timer_list, not struct pxa3xx_gcu_priv.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
[b.zolnierkie: trivial build fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-10 16:34:51 +01:00
Geert Uytterhoeven ac831a379d fbdev: controlfb: Add missing modes to fix out of bounds access
Dan's static analysis says:

    drivers/video/fbdev/controlfb.c:560 control_setup()
    error: buffer overflow 'control_mac_modes' 20 <= 21

Indeed, control_mac_modes[] has only 20 elements, while VMODE_MAX is 22,
which may lead to an out of bounds read when parsing vmode commandline
options.

The bug was introduced in v2.4.5.6, when 2 new modes were added to
macmodes.h, but control_mac_modes[] wasn't updated:

https://kernel.opensuse.org/cgit/kernel/diff/include/video/macmodes.h?h=v2.5.2&id=29f279c764808560eaceb88fef36cbc35c529aad

Augment control_mac_modes[] with the two new video modes to fix this.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:33 +01:00
Gustavo A. R. Silva 826bb72879 video: fbdev: sis_main: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 115025
Addresses-Coverity-ID: 115026
Addresses-Coverity-ID: 115027
Addresses-Coverity-ID: 115028
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:33 +01:00
Gustavo A. R. Silva 8c15220868 video: fbdev: cirrusfb: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in this particular case I placed the "fall through" comment
on its own line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:32 +01:00
Gustavo A. R. Silva 0101f48ae5 video: fbdev: aty: radeon_pm: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:32 +01:00
Gustavo A. R. Silva f5ed28d318 video: fbdev: sm501fb: mark expected switch fall-through in sm501fb_blank_crt
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:32 +01:00
Colin Ian King 3725369f94 video: fbdev: intelfb: remove redundant variables
Variables err_max, err_target and f_best are being assigned values but
these are never read, hence they are redundant variables and can be
removed. Cleans up clang warnings:

drivers/video/fbdev/intelfb/intelfbhw.c:946:2: warning: Value stored to
'err_max' is never read
drivers/video/fbdev/intelfb/intelfbhw.c:947:2: warning: Value stored to
'err_target' is never read
drivers/video/fbdev/intelfb/intelfbhw.c:995:6: warning: Value stored to
'f_best' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Maik Broemme <mbroemme@libmpq.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:32 +01:00
Markus Elfring 6b04e9f256 video/fbdev/dnfb: Use common error handling code in dnfb_probe()
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:31 +01:00
Sudip Mukherjee ffb66624ca sm501fb: suspend and resume fb if it exists
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, suspend or resume it
only if it is defined.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:31 +01:00
Sudip Mukherjee 35bfbf70b2 sm501fb: unregister framebuffer only if registered
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:31 +01:00
Sudip Mukherjee d9b1fe6516 sm501fb: deallocate colormap only if allocated
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device deallocate the colormap only if that particular fb is defined.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:31 +01:00
Aleksandar Markovic 31ff6b2a42 video: goldfishfb: Add support for device tree bindings
Add ability to the Goldfish FB driver to be recognized by OS via DT.

Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
Signed-off-by: Goran Ferenc <goran.ferenc@mips.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Cc: Douglas Leung <douglas.leung@mips.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Petar Jovanovic <petar.jovanovic@mips.com>
Cc: Raghu Gandham <raghu.gandham@mips.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:31 +01:00
Ladislav Michl c987694755 video: udlfb: Fix read EDID timeout
While usb_control_msg function expects timeout in miliseconds, a value
of HZ is used. Replace it with USB_CTRL_GET_TIMEOUT and also fix error
message which looks like:
udlfb: Read EDID byte 78 failed err ffffff92
as error is either negative errno or number of bytes transferred use %d
format specifier.

Returned EDID is in second byte, so return error when less than two bytes
are received.

Fixes: 18dffdf891 ("staging: udlfb: enhance EDID and mode handling support")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Cc: Bernie Thompson <bernie@plugable.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:30 +01:00
Bartlomiej Zolnierkiewicz 1e7d4beba2 video: fbdev: remove dead igafb driver
igafb driver hasn't compiled since at least kernel v2.6.34 as
commit 6016a363f6 ("of: unify phandle name in struct device_node")
missed updating igafb.c to use dp->phandle instead of dp->node.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:30 +01:00
Stefan Agner 2d81482821 video: fbdev: mxsfb: fix pixelclock polarity
The PIXDATA flags of the display_flags enum are controller centric,
e.g. NEGEDGE means the controller shall drive the data signals on
pixelclocks negative edge. However, the drivers flag is display
centric: Sample the data on negative (falling) edge.

Therefore, change the if statement to check for the POSEDGE flag
(which is typically not set):
Drive on positive edge => sample on negative edge

Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Liu Ying <Ying.Liu@freescale.com>
Cc: Lothar Waßmann <LW@KARO-electronics.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Mauro Salvini <mauro.salvini@smigroup.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:30 +01:00
Christophe JAILLET ab798b9087 video: fbdev: au1200fb: Style clean up
Style clean-up.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:30 +01:00
Christophe JAILLET 0620865611 video: fbdev: au1200fb: Propagate an error code
We should propagate the error code returned by 'fb_alloc_cmap()' instead
of returning -EFAULT.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:29 +01:00
Christophe JAILLET 58a81afcff video: fbdev: au1200fb: Remove some dead code
There is no need to shut gcc up. It should not complain.
Axe 'fbdev', it is never used in this function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:29 +01:00
Christophe JAILLET 6bbbb6805a video: fbdev: au1200fb: Fix error handling path
Rewrite the exit path based on 'au1200fb_drv_remove()'.
We can safely iterate for all already handled planes. Even if not
completely initialized, the functions that are called will silently accept
the 'fb_info' structure that is passed.

As soon as we find a NULL in the '_au1200fb_infos' array, we know that we
have released all what we needed to release. So we can 'break'.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:29 +01:00
Christophe JAILLET 703a4af427 video: fbdev: au1200fb: Fix incorrect IRQ freeing
'au1200fb_drv_probe()' can not fail after a successful call to
'request_irq()'. So there is no point to call 'free_irq()' in the error
handling path.

Moreover, the hard coded AU1200_LCD_INT looks boggus since
commit 1630d85a83 ("au1200fb: fix hardcoded IRQ").

So, remove it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
[b.zolnierkie: patch summary and description fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:29 +01:00
Christophe JAILLET 451f130602 video: fbdev: au1200fb: Release some resources if a memory allocation fails
We should go through the error handling code instead of returning -ENOMEM
directly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:28 +01:00
Christophe JAILLET 8cae353e6b video: fbdev: au1200fb: Return an error code if a memory allocation fails
'ret' is known to be 0 at this point.
In case of memory allocation error in 'framebuffer_alloc()', return
-ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:28 +01:00
Christophe JAILLET 2e307cba0c video: fbdev: au1200fb: Fix a potential double free
If 'fb_alloc_cmap()' fails, 'fbi->pseudo_palette' is freed and an error
code is returned by 'au1200fb_init_fbinfo()'.
The only caller, 'au1200fb_drv_probe()' goes to an error handling path
where resources allocated in 'fb_alloc_cmap()' are freed.
This leads to a double free of 'fbi->pseudo_palette'.

Fix it by letting the caller free all resources in case of failure in
'au1200fb_init_fbinfo()'.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-11-09 18:09:28 +01:00
Colin Ian King 29fae2c1db backlight: ili922x: Remove redundant variable len
The variable len is assigned but never read, therefore it is redundant
and can be removed. Cleans up clang warning:

drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len'
is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-11-08 10:43:49 +00:00
Greg Kroah-Hartman b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Russell King cb6bc3ff59 video: sa1100fb: move pseudo palette into sa1100fb_info structure
Move the pseudo palette inside the driver private data structure so we
don't have to play tricks to cater for it.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:13 +02:00
Russell King 0ab76581a9 video: sa1100fb: fix video memory allocation leak
Don't leak the video memory allocation if register_framebuffer() fails.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:13 +02:00
Russell King c244f8e48c video: sa1100fb: clean up failure path
We merely return from the failed path, so remove all the gotos and use
return statements instead.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Russell King 5634cbab48 video: sa1100fb: use devm_gpio_request_one()
Switch to using devm_gpio_request_one() to request the shannon gpio
and move the request before the video memory allocation, so we request
all device managed resources before this large allocation attempt.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Russell King f6fc8c9dbd video: sa1100fb: use devm_request_irq()
Use devm_request_irq() to request the interrupt (a little earlier too)
so we can avoid having to manually clean this up.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Russell King df6b228768 video: sa1100fb: use devm_ioremap_resource()
Use devm_ioremap_resource() to map the LCD controller memory region,
and remove the unnecessary cleanup for this.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Russell King e43064ccd4 video: sa1100fb: use devm_clk_get()
Use devm_clk_get() to get the clock for the LCD.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Russell King ba1d36ba09 video: sa1100fb: use devm_kzalloc()
Use devm_kzalloc() when allocating the private data for the framebuffer
device.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Himanshu Jha 5eabff1cb9 video: fbdev: pxa3xx_gcu: Use setup_timer and mod_timer
Use setup_timer and mod_timer API instead of structure assignments.

This is done using Coccinelle and semantic patch used
for this as follows:

@@
expression x,y,z,a,b;
@@

-init_timer (&x);
+setup_timer (&x, y, z);
+mod_timer (&a, b);
-x.function = y;
-x.data = z;
-x.expires = b;
-add_timer(&a);

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-17 16:01:12 +02:00
Keerthy 511cb17448 mfd: tps65217: Introduce dependency on CONFIG_OF
Currently the driver boots only via device tree hence add a
dependency on CONFIG_OF. This leaves with a bunch of unused code
so clean that up. This patch also makes use of probe_new function
in place of the probe function so as to avoid passing i2c_device_id.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-10-13 10:42:58 +01:00
Christos Gkekas 5158cc2d4e backlight: tps65217_bl: Remove unnecessary default brightness check
Variable val holds the default brightness and is unsigned, therefore
checking whether it is less than zero is redundant.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-10-13 10:41:31 +01:00
Derek Basehore 5d0c49aceb backlight: pwm_bl: Fix overflow condition
This fixes an overflow condition that can happen with high max
brightness and period values in compute_duty_cycle. This fixes it by
using a 64 bit variable for computing the duty cycle.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-10-13 10:41:20 +01:00
Colin Ian King 0c09dd051b video: fbdev: radeon: make const array post_divs static, reduces object code size
Don't populate the read-only const array post_divs on the stack,
instead make it static. Makes the object code smaller by 90 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  40231	   8584	    896	  49711	   c22f	radeon_base.o

After:
   text	   data	    bss	    dec	    hex	filename
  39914	   8744	    960	  49618	   c1d2	radeon_base.o

(gcc version 7.2.0, x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-12 18:28:26 +02:00
Bhumika Goyal 3961e9ac3a video: fbdev: dnfb: make fb_var_screeninfo static and const
Make this structure static as it is not referenced in any other
file. Make it const as it is used only during a copy operation.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
[b.zolnierkie: split from combined patch]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-12 18:18:23 +02:00
Colin Ian King b90b3eca16 video: fbdev: sis: make const array specialtv static, reduces object code size
Don't populate the const array specialtv on the stack, instead make it
static.  Makes the object code smaller by over 1100 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
 179899	   7504	      0	 187403	  2dc0b	drivers/video/fbdev/sis/init301.o

After:
   text	   data	    bss	    dec	    hex	filename
 178720	   7568	      0	 186288	  2d7b0	drivers/video/fbdev/sis/init301.o

(gcc version 7.2.0, x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-12 18:18:23 +02:00
Colin Ian King 160d9a6b27 video: fbdev: aty: make const arrays static, reduces object code size
Don't populate the const arrays ragepro_tbl and ragexl_tbl on the stack,
instead make them static.  Makes the object code smaller by over 380 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  41089	  10592	    768	  52449	   cce1 atyfb_base.o

After:
   text	   data	    bss	    dec	    hex	filename
  40544	  10752	    768	  52064	   cb60	atyfb_base.o

(gcc version 7.2.0, x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-12 18:18:23 +02:00
Allen Pais 0619d9e8f1 video: fbdev: matroxfb: return -ENOMEM on allocation failure
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2017-10-12 18:18:23 +02:00