Skip to contentSkip to conversation

drm/layerscape: Add sii9022a driver

PATCH In review Meng Yi 4 participants 8 messages Mar 9, 2016 – Mar 10, 2016

Subsystems (5)
lore
Share & tools
lore

Meng Yi

author
#0 lore raw

PATCH v3 1/3 drm/layerscape: Add sii9022a driver

The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i, and 1080p, the highest resolution supported 4K today. It also supports all PC resolutions up to UXGA for netbooks

---
 drivers/gpu/drm/i2c/Kconfig       |   6 +
 drivers/gpu/drm/i2c/Makefile      |   3 +
 drivers/gpu/drm/i2c/sii9022_drv.c | 449 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 458 insertions(+)
 create mode 100644 drivers/gpu/drm/i2c/sii9022_drv.c
drivers/gpu/drm/i2c/Kconfig +6 -0
index 22c7ed6..8646729 100644
@@ -31,4 +31,10 @@ config DRM_I2C_NXP_TDA998X
 	help
 	  Support for NXP Semiconductors TDA998X HDMI encoders.
 
+config DRM_I2C_SII9022
+	tristate "Silicon Image sii9022 TMDS transmitter"
+	help
+	  Support for sii9022 and similar single-link (or dual-link
+	  when used in pairs) TMDS transmitters.
+
 endmenu
drivers/gpu/drm/i2c/Makefile +3 -0
index 2c72eb5..cf2e8b9 100644
@@ -10,3 +10,6 @@ obj-$(CONFIG_DRM_I2C_SIL164) += sil164.o
 
 tda998x-y := tda998x_drv.o
 obj-$(CONFIG_DRM_I2C_NXP_TDA998X) += tda998x.o
+
+sii9022-y := sii9022_drv.o
+obj-$(CONFIG_DRM_I2C_SII9022) +=sii9022.o
drivers/gpu/drm/i2c/sii9022_drv.c new file +449 -0

449 lines not on this page · raw message

Signature · 6 lines
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#1 lore raw

PATCH v3 2/3 arm:dts:ls1021a: Add sii9022a dts node

This patch adds sii9022a node for ls1021a-twr.

---
Change in v3:
Using of_graph to describe connection to DCU.

---
 arch/arm/boot/dts/ls1021a-twr.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/ls1021a-twr.dts +18 -0
index 75ecaed..db7e465 100644
@@ -114,6 +114,12 @@
 &dcu {
 	fsl,panel = <&panel>;
 	status = "okay";
+
+	port@0 {
+		dcu_out_hdmi: endpoint {
+			remote-endpoint = <&sii9022a_out>;
+		};
+	};
 };
 
 &dspi1 {
@@ -178,6 +184,18 @@
 		VDDIO-supply = <&reg_3p3v>;
 		clocks = <&sys_mclk 1>;
 	};
+
+	sii9022a: hdmi@39 {
+		compatible = "sil,sii9022a";
+		reg = <0x39>;
+		interrupts = <GIC_SPI 167 IRQ_TYPE_EDGE_RISING>;
+
+		port@0 {
+			sii9022a_out: endpoint {
+				remote-endpoint = <&dcu_out_hdmi>;
+			};
+		};
+	};
 };
 
 &ifc {
Signature · 6 lines
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#2 lore raw

PATCH v3 3/3 drm/layerscape: Add HDMI driver for freescale DCU

In reply to Meng Yi

DCU is the shortcut of 'display controller unit', some HDMI transmitter attached to DCU, such as sii9022a, and this driver add the relavent functions to DRM framewrok.

---
Change in V3:
Use "of_graph" to describe the connection to DCU.
---

 .../bindings/display/bridge/sil,sii9022a.txt       |  55 ++++
 drivers/gpu/drm/fsl-dcu/Makefile                   |   1 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h          |   1 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c         | 292 +++++++++++++++++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c          |  12 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h       |  11 +
 6 files changed, 372 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt
 create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c
Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt new file +55 -0
new file mode 100644
index 0000000..20655f7
@@ -0,0 +1,55 @@
+Device-Tree bindings for the SiI902x hdmi transmitter.
+-----------------------------------------
+
+The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from
+standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i,
+and 1080p, the highest resolution supported by HDTVs today. It also supports all
+PC resolutions up to UXGA for netbooks
+
+Required properties:
+- compatible: 	Should be "sil,sii9022a".
+- reg: 		The I2C address of the device.
+- interrupts:	Interrupt number to the cpu.
+
+Required nodes:
+
+The sii9022 has one video ports. Its connection is modelled using the OF
+graph bindings specified in Documentation/devicetree/bindings/graph.txt.
+
+- Video port 0 for the HDMI output
+
+Example:
+-------
+
+/ {
+	hdmi-out {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con: endpoint {
+				remote-endpoint = <&sii9022a_out>;
+			};
+		};
+	};
+};
+
+&i2c1 {
+    sii9022: hdmi@39 {
+            compatible = "sil,sii9022a";
+            reg = <0x39>;
+            interrupts = <GIC_SPI 167 IRQ_TYPE_EDGE_RISING>;
+
+            ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                            reg = <0>;
+                            sii9022_out: endpoint {
+                                    remote-endpoint = <&hdmi_con>;
+                            };
+                    };
+            };
+    };
+};
drivers/gpu/drm/fsl-dcu/Makefile +1 -0
index 6ea1523..98cacc2 100644
@@ -1,6 +1,7 @@
 fsl-dcu-drm-y := fsl_dcu_drm_drv.o \
 		 fsl_dcu_drm_kms.o \
 		 fsl_dcu_drm_rgb.o \
+		 fsl_dcu_drm_hdmi.o \
 		 fsl_dcu_drm_plane.o \
 		 fsl_dcu_drm_crtc.o \
 		 fsl_dcu_drm_fbdev.o
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h +1 -0
index 6413ac9..7d1b0fd 100644
@@ -189,6 +189,7 @@ struct fsl_dcu_drm_device {
 	struct drm_fbdev_cma *fbdev;
 	struct drm_crtc crtc;
 	struct drm_encoder encoder;
+	struct drm_encoder_slave *slave;
 	struct fsl_dcu_drm_connector connector;
 	const struct fsl_dcu_soc_data *soc;
 };
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c new file +292 -0

292 lines not on this page · raw message

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +12 -0
index c564ec6..94b1111 100644
@@ -17,10 +17,18 @@
 #include "fsl_dcu_drm_crtc.h"
 #include "fsl_dcu_drm_drv.h"
 
+static void fsl_dcu_drm_output_poll_changed(struct drm_device *dev)
+{
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+
+	drm_fbdev_cma_hotplug_event(fsl_dev->fbdev);
+}
+
 static const struct drm_mode_config_funcs fsl_dcu_drm_mode_config_funcs = {
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 	.fb_create = drm_fb_cma_create,
+	.output_poll_changed = fsl_dcu_drm_output_poll_changed,
 };
 
 int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev)
@@ -43,10 +51,14 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev)
 	if (ret)
 		goto fail_encoder;
 
+	fsl_dcu_drm_hdmienc_create(fsl_dev, &fsl_dev->crtc);
+
 	ret = fsl_dcu_drm_connector_create(fsl_dev, &fsl_dev->encoder);
 	if (ret)
 		goto fail_connector;
 
+	fsl_dcu_drm_hdmicon_create(fsl_dev);
+
 	drm_mode_config_reset(fsl_dev->drm);
 	drm_kms_helper_poll_init(fsl_dev->drm);
 
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h +11 -0
index 7093109..fa0d7ed 100644
@@ -18,6 +18,13 @@ struct fsl_dcu_drm_connector {
 	struct drm_panel *panel;
 };
 
+struct fsl_dcu_drm_hdmicon {
+	struct drm_connector connector;
+	struct drm_encoder_slave *slave;
+	struct i2c_client *client;
+	enum drm_connector_status status;
+};
+
 static inline struct fsl_dcu_drm_connector *
 to_fsl_dcu_connector(struct drm_connector *con)
 {
@@ -29,5 +36,9 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev,
 				 struct drm_encoder *encoder);
 int fsl_dcu_drm_encoder_create(struct fsl_dcu_drm_device *fsl_dev,
 			       struct drm_crtc *crtc);
+int fsl_dcu_drm_hdmicon_create(struct fsl_dcu_drm_device *fsl_dev);
+int fsl_dcu_drm_hdmienc_create(struct fsl_dcu_drm_device *fsl_dev,
+			       struct drm_crtc *crtc);
+
 
 #endif /* __FSL_DCU_DRM_CONNECTOR_H__ */
Signature · 6 lines
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
In reply to Meng Yi

Hi Meng,

Quoted 6 lines · Meng Yi

The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i, and 1080p, the highest resolution supported 4K today. It also supports all PC resolutions up to UXGA for netbooks

An alternative approach (making a drm bridge) for the sii902x devices was taken by Boris a bit before your initial submission of this driver [1].
I believe that you guys can coordinate and once a decision is made whether a i2c or bridge driver (personally leaning towards the latter), you can work together and review each others' work.

Alternatively you can take a review/comment on a similar work (SiI8620 bridge device) by Andrzej, who would return the favour and check this series :-)

Regards,
Emil

[1] https://lists.freedesktop.org/archives/dri-devel/2016-January/098054.html
[2] https://lists.freedesktop.org/archives/dri-devel/2016-January/098199.html
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

+ Nicolas, Laurent and Rob

Hi,

Quoted 9 lines · On Wed, 9 Mar 2016 11:49:38 +0000 Emil Velikov <[email protected]> wrote:

Hi Meng,

Quoted 6 lines · Meng Yi

The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i, and 1080p, the highest resolution supported 4K today. It also supports all PC resolutions up to UXGA for netbooks

Quoted 6 lines

An alternative approach (making a drm bridge) for the sii902x devices was taken by Boris a bit before your initial submission of this driver [1].
I believe that you guys can coordinate and once a decision is made whether a i2c or bridge driver (personally leaning towards the latter), you can work together and review each others' work.

The reason I decided to expose the device as a drm_bridge is because there was several discussions about merging drm_bridge and drm_encoder_slave, and IIRC, the proposal was to move to the drm_bridge approach.

Another reason I've chosen to go for the drm_bridge solution is because I wanted to avoid as much as possible the development of a new glue for each new encoder bridge type (HDMI/DVI, DP, ...), and, AFAICT drm_bridge allow that, while it's a bit more complicated with drm_encoder_slave.

Quoted 4 lines

Alternatively you can take a review/comment on a similar work (SiI8620 bridge device) by Andrzej, who would return the favour and check this series :-)

Yes, I'll try to have a look.

Thanks,

Boris

Signature · 7 lines
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#5 lore raw

Hi Boris,

Quoted 10 lines · ,Boris Brezillon

The reason I decided to expose the device as a drm_bridge is because there was several discussions about merging drm_bridge and drm_encoder_slave, and IIRC, the proposal was to move to the drm_bridge approach.

Another reason I've chosen to go for the drm_bridge solution is because I wanted to avoid as much as possible the development of a new glue for each new encoder bridge type (HDMI/DVI, DP, ...), and, AFAICT drm_bridge allow that, while it's a bit more complicated with drm_encoder_slave.

I wil try to review this patch for my DCU's HDMI driver depend on it . And I will try to modify my HDMI driver to fit your patch.

Regards,
Meng

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Boris Brezillon

Hi Boris,

Quoted 14 lines · On Wednesday 09 March 2016 14:22:00 Boris Brezillon wrote:
Quoted 7 lines · On Wed, 9 Mar 2016 11:49:38 +0000 Emil Velikov wrote:
Quoted 5 lines · Meng Yi

The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i, and 1080p, the highest resolution supported 4K today. It also supports all PC resolutions up to UXGA for netbooks

Quoted 5 lines

An alternative approach (making a drm bridge) for the sii902x devices was taken by Boris a bit before your initial submission of this driver [1]. I believe that you guys can coordinate and once a decision is made whether a i2c or bridge driver (personally leaning towards the latter), you can work together and review each others' work.

Quoted 4 lines

The reason I decided to expose the device as a drm_bridge is because there was several discussions about merging drm_bridge and drm_encoder_slave, and IIRC, the proposal was to move to the drm_bridge approach.

That's correct. We're converting the adv7511 driver from the slave encoder framework to the bridge framework, and I really would like to see the remaining three drivers (ch7006, sil164 and tda998x) being converted too. We could then finally get rid of drm_slave_encoder.

Quoted 10 lines

Another reason I've chosen to go for the drm_bridge solution is because I wanted to avoid as much as possible the development of a new glue for each new encoder bridge type (HDMI/DVI, DP, ...), and, AFAICT drm_bridge allow that, while it's a bit more complicated with drm_encoder_slave.

Quoted 3 lines

Alternatively you can take a review/comment on a similar work (SiI8620 bridge device) by Andrzej, who would return the favour and check this series :-)

Yes, I'll try to have a look.

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#7 lore raw
In reply to Emil Velikov

Hi Emil,

Quoted 5 lines · Emil Velikov

An alternative approach (making a drm bridge) for the sii902x devices was taken by Boris a bit before your initial submission of this driver [1]. I believe that you guys can coordinate and once a decision is made whether a i2c or bridge driver (personally leaning towards the latter), you can work together and review each others' work.

Thanks for mention me about that.
Since my HDMI driver depend on sii902x driver, I also send out the sii902x driver. I will review and contribute to Boris's patch, and modify my HDMI driver to fit.

Quoted 2 lines

Alternatively you can take a review/comment on a similar work (SiI8620 bridge device) by Andrzej, who would return the favour and check this series :-)

I will take a review/comment on those patches. Thanks!

BR
Meng

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel