Skip to content

Commit 9589a39

Browse files
Mark Yaorkhuangtao
authored andcommitted
drm/rockchip: support backlight device
Change-Id: Ib793b0dec8fe62027ca8e3085089d2e431b59eb5 Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
1 parent 4f519fe commit 9589a39

9 files changed

Lines changed: 651 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Rockchip DRM backlight device
2+
================================
3+
4+
Rockchip display controller(see VOP bindings[0]) support CABC function,
5+
and the CABC function required using VOP self pwm to control backlight,
6+
This backlight device manager the backlight PWM, auto select correct
7+
PWM for backlight.
8+
9+
Required properties:
10+
- compatible: Should be "rockchip,drm-backlight"
11+
12+
Other properties are same to commom PWM backlight bindings[1].
13+
14+
[0]: Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
15+
[1]: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
16+
17+
example:
18+
19+
backlight {
20+
compatible = "rockchip,drm-backlight";
21+
pwms = <&pwm 0 5000000>;
22+
23+
brightness-levels = <0 4 8 16 32 64 128 255>;
24+
default-brightness-level = <6>;
25+
26+
power-supply = <&vdd_bl_reg>;
27+
enable-gpios = <&gpio 58 0>;
28+
};
29+

Documentation/devicetree/bindings/display/rockchip/rockchip-drm.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Required properties:
1212
Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt
1313

1414
Optional properties
15+
- backlight: spacial backlight required by cabc function.
1516
- clocks: include clock specifiers corresponding to entries in the
1617
clock-names property.
1718
- clock-names: optional include
@@ -25,6 +26,7 @@ example:
2526
display-subsystem {
2627
compatible = "rockchip,display-subsystem";
2728
ports = <&vopl_out>, <&vopb_out>;
29+
backlight = <&backlight>
2830
clocks = <&cru PLL_VPLL>, <&cru PLL_CPLL>;
2931
clock-names = "hdmi-tmds-pll", "default-vop-pll";
3032
};

drivers/gpu/drm/rockchip/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,11 @@ config ROCKCHIP_DRM_TVE
8888
help
8989
Choose this option to enable support for Rockchip TVE controllers.
9090
say Y to enable its driver.
91+
92+
config ROCKCHIP_DRM_BACKLIGHT
93+
tristate "Rockchip DRM Backlight"
94+
depends on DRM_ROCKCHIP
95+
help
96+
This selects support for Rockchip backlight manager,
97+
Vop cabc function request using vop self pwm devices, needed a
98+
unique backlight devices to manager vop and soc pwm devices.

drivers/gpu/drm/rockchip/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ obj-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
1515
obj-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o
1616
obj-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
1717

18+
obj-$(CONFIG_ROCKCHIP_DRM_BACKLIGHT) += rockchip_drm_backlight.o
1819
obj-$(CONFIG_DRM_ROCKCHIP) += rockchip_vop_reg.o rockchipdrm.o
1920
obj-$(CONFIG_ROCKCHIP_DRM_TVE) += rockchip_drm_tve.o

0 commit comments

Comments
 (0)