linux/drivers
Sam Ravnborg 152dbdeab1 drm/panel: add backlight support
Panels often support backlight as specified in a device tree.
Update the drm_panel infrastructure to support this to
simplify the drivers.

With this the panel driver just needs to add the following to the
probe() function:

    err = drm_panel_of_backlight(panel);
    if (err)
            return err;

Then drm_panel will handle all the rest.

There is one caveat with the backlight support.
If drm_panel_(enable|disable) are called multiple times
in a row then backlight_(enable|disable) will be called multiple times.

The above will happen when a panel drivers unconditionally
calls drm_panel_disable() in their shutdown() function,
whan the panel is already disabled and then shutdown() is called.

Reading the backlight code it seems safe to call
the backlight_(enable|disable) several times.

v3:
- Improve comments, fix grammar (Laurent)
- Do not fail in drm_panel_of_backlight() if no DT support (Laurent)
- Log if backlight_(enable|disable) fails (Laurent)
- Improve drm_panel_of_backlight() docs
- Updated changelog with backlight analysis (triggered by Laurent)

v2:
- Drop test of CONFIG_DRM_PANEL in header-file (Laurent)
- do not enable backlight if ->enable() returns an error

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207140353.23967-3-sam@ravnborg.org
2019-12-09 22:57:26 +01:00
..
accessibility
acpi ACPI fixes for 5.4-rc4 2019-10-18 08:38:26 -07:00
amba
android
ata
atm
auxdisplay
base drivers/base/memory.c: don't access uninitialized memmaps in soft_offline_page_store() 2019-10-19 06:32:31 -04:00
bcma
block zram: fix race between backing_dev_show and backing_dev_store 2019-10-19 06:32:32 -04:00
bluetooth
bus
cdrom
char
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf udmabuf: implement begin_cpu_access/end_cpu_access hooks 2019-12-05 08:57:45 +01:00
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu drm/panel: add backlight support 2019-12-09 22:57:26 +01:00
greybus
hid HID: picoLCD: constify fb ops 2019-12-09 15:49:16 +02:00
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2019-10-17 11:18:44 -07:00
interconnect
iommu iommu/amd: Check PM_LEVEL_SIZE() condition in locked section 2019-10-18 16:52:37 +02:00
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md for-linus-2019-10-18 2019-10-18 22:29:36 -04:00
media media/videobuf2: Drop dma_buf->k(un)map support 2019-11-25 22:36:15 +01:00
memory
memstick
message
mfd
misc drm/tee_shm: Drop dma_buf_k(unmap) support 2019-11-25 22:36:25 +01:00
mmc
mtd
mux
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-19 17:09:11 -04:00
nfc
ntb
nubus
nvdimm
nvme nvme-pci: Set the prp2 correctly when using more than 4k page 2019-10-18 23:09:41 +09:00
nvmem
of
opp
oprofile
parisc
parport
pci PCI: PM: Fix pci_power_up() 2019-10-15 23:51:36 +02:00
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-10-19 17:09:11 -04:00
sbus
scsi Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> 2019-10-18 08:08:53 -07:00
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging staging/android/ion: delete dma_buf->kmap/unmap implemenation 2019-11-25 22:36:01 +01:00
target
tc
tee drm/tee_shm: Drop dma_buf_k(unmap) support 2019-11-25 22:36:25 +01:00
thermal
thunderbolt
tty
uio
usb
vfio
vhost
video video: constify fb ops across all drivers 2019-12-05 10:57:53 +02:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen/gntdev-dmabuf: Ditch dummy map functions 2019-11-25 22:36:52 +01:00
zorro
Kconfig
Makefile