Skip to contentSkip to conversation

at91: video: add driver for Atmel HLCD controller

PATCH Superseded Songjun Wu 1 participant 3 messages Mar 15, 2017

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Songjun Wu

author
#0 lore raw

v3 cover at91: video: add driver for Atmel HLCD controller

The i2c driver includes two parts.
1) Driver code to implement the HLCD function.
2) Device tree binding documentation, it describes how to add the HLCD in device tree.

Changes in v3:
- Replace lcdc_readl/lcdc_writel with real/writel
- Replace while() with wait_for_bit().
- Disable the clock if the clock is enabled and
error occurs.
- Add 'atmel,output-mode' entry in dts.

Changes in v2:
- Due to the peripheral clock driver improvement, remove the unneccessary clock calling.

Songjun Wu (2):
at91: video: Support driver-model for the HLCD driver
at91: video: DT binding for HLCDC driver

 doc/device-tree-bindings/video/atme-hlcdc.txt |  42 +++
 drivers/video/Kconfig                         |   6 +
 drivers/video/atmel_hlcdfb.c                  | 481 ++++++++++++++++++++++----
 3 files changed, 458 insertions(+), 71 deletions(-)
 create mode 100644 doc/device-tree-bindings/video/atme-hlcdc.txt
Signature · 1 line
2.11.0
author
#1 lore raw

PATCH v3 1/2 at91: video: Support driver-model for the HLCD driver

Add driver-model support to this driver.

---

Changes in v3:
- Replace lcdc_readl/lcdc_writel with real/writel
- Replace while() with wait_for_bit().
- Disable the clock if the clock is enabled and
error occurs.

Changes in v2:
- Due to the peripheral clock driver improvement, remove the unneccessary clock calling.

 drivers/video/Kconfig        |   6 +
 drivers/video/atmel_hlcdfb.c | 481 ++++++++++++++++++++++++++++++++++++-------
 2 files changed, 416 insertions(+), 71 deletions(-)
drivers/video/Kconfig +6 -0
index 2069576958..0f49612cd0 100644
@@ -371,6 +371,12 @@ config DISPLAY
 	   The devices provide a simple interface to start up the display,
 	   read display information and enable it.
 
+config ATMEL_HLCD
+	bool "Enable ATMEL video support using HLCDC"
+	depends on DM_VIDEO
+	help
+	   HLCDC supports video output to an attached LCD panel.
+
 config VIDEO_BROADWELL_IGD
 	bool "Enable Intel Broadwell integrated graphics device"
 	depends on X86
drivers/video/atmel_hlcdfb.c +410 -71

572 lines not on this page · raw message

Signature · 1 line
2.11.0
author
#2 lore raw

PATCH v3 2/2 at91: video: DT binding for HLCDC driver

In reply to Songjun Wu

DT binding documentation for atmel HLCDC driver.

---

Changes in v3:
- Add 'atmel,output-mode' entry in dts.

Changes in v2: None

 doc/device-tree-bindings/video/atme-hlcdc.txt | 42 +++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 doc/device-tree-bindings/video/atme-hlcdc.txt
doc/device-tree-bindings/video/atme-hlcdc.txt new file +42 -0
new file mode 100644
index 0000000000..8a126943c0
@@ -0,0 +1,42 @@
+Atmel HLCDC Framebuffer
+-----------------------------------------------------
+Required properties:
+- compatible :
+	"atmel,sama5d2-hlcdc".
+- reg: physical base address of the controller and length of memory mapped
+       region.
+- clocks: phandles to input clocks.
+- atmel,vl-bpix: Bits per pixel.
+- atmel,output-mode: LCD Controller Output Mode,
+  The unit is bits per pixel, there are four values,
+  <12>, <16>, <18>, <24>, the default value is <24>.
+- atmel,guard-time: lcd guard time (Delay in frame periods).
+- display-timings: please refer the displaymode.txt.
+
+Example:
+hlcdc: hlcdc at f0000000 {
+	u-boot,dm-pre-reloc;
+	compatible = "atmel,sama5d2-hlcdc";
+	reg = <0xf0000000 0x2000>;
+	clocks = <&lcdc_clk>;
+	atmel,vl-bpix = <4>;
+	atmel,output-mode = <24>;
+	atmel,guard-time = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb666>;
+	status = "okay";
+
+	display-timings {
+		480x272 {
+			clock-frequency = <9000000>;
+			hactive = <480>;
+			vactive = <272>;
+			hsync-len = <41>;
+			hfront-porch = <2>;
+			hback-porch = <2>;
+			vfront-porch = <2>;
+			vback-porch = <2>;
+			vsync-len = <11>;
+		};
+	};
+};
\ No newline at end of file
Signature · 1 line
2.11.0