Skip to content

Commit b985172

Browse files
plagniojtomba
authored andcommitted
video: atmel_lcdfb: add device tree suport
get display timings from device tree Use videomode helpers to get display timings and configurations from device tree Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent ce3b64f commit b985172

File tree

3 files changed

+291
-32
lines changed

3 files changed

+291
-32
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Atmel LCDC Framebuffer
2+
-----------------------------------------------------
3+
4+
Required properties:
5+
- compatible :
6+
"atmel,at91sam9261-lcdc" ,
7+
"atmel,at91sam9263-lcdc" ,
8+
"atmel,at91sam9g10-lcdc" ,
9+
"atmel,at91sam9g45-lcdc" ,
10+
"atmel,at91sam9g45es-lcdc" ,
11+
"atmel,at91sam9rl-lcdc" ,
12+
"atmel,at32ap-lcdc"
13+
- reg : Should contain 1 register ranges(address and length)
14+
- interrupts : framebuffer controller interrupt
15+
- display: a phandle pointing to the display node
16+
17+
Required nodes:
18+
- display: a display node is required to initialize the lcd panel
19+
This should be in the board dts.
20+
- default-mode: a videomode within the display with timing parameters
21+
as specified below.
22+
23+
Example:
24+
25+
fb0: fb@0x00500000 {
26+
compatible = "atmel,at91sam9g45-lcdc";
27+
reg = <0x00500000 0x1000>;
28+
interrupts = <23 3 0>;
29+
pinctrl-names = "default";
30+
pinctrl-0 = <&pinctrl_fb>;
31+
display = <&display0>;
32+
status = "okay";
33+
#address-cells = <1>;
34+
#size-cells = <1>;
35+
36+
};
37+
38+
Atmel LCDC Display
39+
-----------------------------------------------------
40+
Required properties (as per of_videomode_helper):
41+
42+
- atmel,dmacon: dma controler configuration
43+
- atmel,lcdcon2: lcd controler configuration
44+
- atmel,guard-time: lcd guard time (Delay in frame periods)
45+
- bits-per-pixel: lcd panel bit-depth.
46+
47+
Optional properties (as per of_videomode_helper):
48+
- atmel,lcdcon-backlight: enable backlight
49+
- atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
50+
- atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
51+
52+
Example:
53+
display0: display {
54+
bits-per-pixel = <32>;
55+
atmel,lcdcon-backlight;
56+
atmel,dmacon = <0x1>;
57+
atmel,lcdcon2 = <0x80008002>;
58+
atmel,guard-time = <9>;
59+
atmel,lcd-wiring-mode = <1>;
60+
61+
display-timings {
62+
native-mode = <&timing0>;
63+
timing0: timing0 {
64+
clock-frequency = <9000000>;
65+
hactive = <480>;
66+
vactive = <272>;
67+
hback-porch = <1>;
68+
hfront-porch = <1>;
69+
vback-porch = <40>;
70+
vfront-porch = <1>;
71+
hsync-len = <45>;
72+
vsync-len = <1>;
73+
};
74+
};
75+
};

drivers/video/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,8 @@ config FB_ATMEL
996996
select FB_CFB_FILLRECT
997997
select FB_CFB_COPYAREA
998998
select FB_CFB_IMAGEBLIT
999+
select FB_MODE_HELPERS
1000+
select VIDEOMODE_HELPERS
9991001
help
10001002
This enables support for the AT91/AT32 LCD Controller.
10011003

0 commit comments

Comments
 (0)