Skip to contentSkip to conversation

drm/msm: Fix issues with DT bindings

PATCH Superseded Archit Taneja 5 participants 38 messages May 3, 2016 – Jun 16, 2016 3 messages not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm/msm: Fix issues with DT bindings

Currently, none of the upstream Qualcomm DT files have the display device nodes populated, even when the DT binding documents are upstream.

I am not aware of all the issues with the bindings which has prevented it from getting merged, but 2 properties "connectors" (maintains a list of all the external interfaces (DSI, HDMI etc)) and "gpus" (list of GPU devices) seem like the ones that can't be merged.

This patch set aligns with the graph bindings to describe the connection between the display controller block (MDP) and the external encoder interfaces.

This is similar to the graph bindings used by some of the drivers (imx, rockchip), but not exactly the same. These drivers expect a top level "display-subsytem" DT node which lists down the display interface ports to be used. Our implementation just parses the interface ports in the MDP node as is, and add the components that are needed. I've Cc-ed Heiko and Philipp in case they had any comments on this.

The 'gpu' property is removed in a hack-ish way. The driver contains a list of all the compatible strings for gpus, and searches the entire OF firmware for a matching node. Once we know what's the right way to link the gpu and display nodes together (if needed at all) we can add the required binding.

The rest of the changes are minor cleanups and fixes to prepare the driver and binding documents before we really start adding the display nodes.

Archit Taneja (9):
drm/msm: Get mdss components via parsing ports drm/msm: Drop the gpu binding
drm/msm/mdp: mdp4: Update LCDC/LVDS port parsing
dt-bindings: msm/mdp: Remove connector and gpu bindings
dt-bindings: msm/dsi: Some binding doc cleanups drm/msm/dsi: Modify port parsing
drm/msm/dsi: Use generic PHY bindings
dt-bindings: msm/dsi: Modify port and PHY bindings
dt-bindings: msm/dsi: Add assigned clocks bindings

 .../devicetree/bindings/display/msm/dsi.txt        | 79 +++++++++++++++------
 .../devicetree/bindings/display/msm/mdp.txt        | 75 ++++++++++++++++++--
 drivers/gpu/drm/msm/dsi/dsi.c                      |  2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c                 | 10 +--
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c            |  8 ++-
 drivers/gpu/drm/msm/msm_drv.c                      | 80 +++++++++++++++++++---
 6 files changed, 213 insertions(+), 41 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

PATCH 1/9 drm/msm: Get mdss components via parsing ports

The driver currently identifies all the mdss components it needs by parsing a phandle list from the 'connectors' DT property.

Instead of this, describe a list of ports that the MDP hardware provides to the external world. These ports are linked to external encoder interfaces such as DSI, HDMI in MDSS. These are also the subcomponent devices that we need add. This description of ports complies with the generic graph bindings.

In MDP4, the LVDS port's output connects directly to the LVDS panel. In this case, we don't try to add it as a component.

---
 drivers/gpu/drm/msm/msm_drv.c | 54 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_drv.c +53 -1
index 955ddfd..30b8f3b 100644
@@ -1087,6 +1087,58 @@ static int add_components(struct device *dev, struct component_match **matchptr,
 	return 0;
 }
 
+/*
+ * Identify what components need to be added by parsing what the endpoints in
+ * our output ports are we. In the case of LVDS, there is no external component
+ * that we need to add since it's a part of MDP itself.
+ */
+static int add_mdss_components(struct device *dev,
+			       struct component_match **matchptr)
+{
+	struct device_node *np = dev->of_node;
+	struct device_node *ep_node;
+
+	for_each_endpoint_of_node(np, ep_node) {
+		struct device_node *intf;
+		struct of_endpoint ep;
+		int ret;
+
+		ret = of_graph_parse_endpoint(ep_node, &ep);
+		if (ret) {
+			dev_err(dev, "unable to parse port endpoint\n");
+			of_node_put(ep_node);
+			return ret;
+		}
+
+		/*
+		 * The LCDC/LVDS port on MDP4 is a speacial case where the
+		 * remote-endpoint isn't a component that we need to add
+		 */
+		if (of_device_is_compatible(np, "qcom,mdp4") && ep.port == 0) {
+			of_node_put(ep_node);
+			continue;
+		}
+
+		/*
+		 * It's okay if some of the ports don't have a remote endpoint
+		 * specified. It just means that the port isn't connected to
+		 * any external interface.
+		 */
+		intf = of_graph_get_remote_port_parent(ep_node);
+		if (!intf) {
+			of_node_put(ep_node);
+			continue;
+		}
+
+		component_match_add(dev, matchptr, compare_of, intf);
+
+		of_node_put(intf);
+		of_node_put(ep_node);
+	}
+
+	return 0;
+}
+
 static int msm_drm_bind(struct device *dev)
 {
 	return msm_drm_init(dev, &msm_driver);
@@ -1110,7 +1162,7 @@ static int msm_pdev_probe(struct platform_device *pdev)
 {
 	struct component_match *match = NULL;
 
-	add_components(&pdev->dev, &match, "connectors");
+	add_mdss_components(&pdev->dev, &match);
 	add_components(&pdev->dev, &match, "gpus");
 
 	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

PATCH 2/9 drm/msm: Drop the gpu binding

In reply to Archit Taneja

The driver currently identifies the GPU components it needs by parsing a phandle list from the 'gpus' DT property.

This isn't the right binding to go with. So, for now, just search all device nodes and find the gpu node we need by parsing a list of compatible strings.

Once we know how to link the kms and gpu drivers, we'll drop this method and use the correct binding.

---
 drivers/gpu/drm/msm/msm_drv.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +19 -7
index 30b8f3b..f717a69 100644
@@ -1068,20 +1068,32 @@ static int compare_of(struct device *dev, void *data)
 	return dev->of_node == data;
 }
 
-static int add_components(struct device *dev, struct component_match **matchptr,
-		const char *name)
+static const char * const msm_compatible_gpus[] = {
+	"qcom,adreno-3xx",
+	"qcom,kgsl-3d0",
+};
+
+/*
+ * We don't know what's the best binding to link the gpu with the drm device.
+ * Fow now, we just hunt for all the possible gpus that we support, and add them
+ * as components.
+ */
+static int add_gpu_components(struct device *dev,
+			      struct component_match **matchptr)
 {
-	struct device_node *np = dev->of_node;
 	unsigned i;
 
-	for (i = 0; ; i++) {
+	for (i = 0; i < ARRAY_SIZE(msm_compatible_gpus); i++) {
 		struct device_node *node;
 
-		node = of_parse_phandle(np, name, i);
+		node = of_find_compatible_node(NULL, NULL,
+					       msm_compatible_gpus[i]);
 		if (!node)
-			break;
+			continue;
 
 		component_match_add(dev, matchptr, compare_of, node);
+
+		of_node_put(node);
 	}
 
 	return 0;
@@ -1163,7 +1175,7 @@ static int msm_pdev_probe(struct platform_device *pdev)
 	struct component_match *match = NULL;
 
 	add_mdss_components(&pdev->dev, &match);
-	add_components(&pdev->dev, &match, "gpus");
+	add_gpu_components(&pdev->dev, &match);
 
 	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 	return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

PATCH 3/9 drm/msm/mdp: mdp4: Update LCDC/LVDS port parsing

In reply to Archit Taneja

The LCDC port is the first in the list of the output ports in MDP4. Mention this explicitly in the driver.

---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +6 -2
index f8e0cea..cd129f4 100644
@@ -263,9 +263,13 @@ static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev)
 	struct device_node *endpoint, *panel_node;
 	struct device_node *np = dev->dev->of_node;
 
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	/*
+	 * LCDC/LVDS is the first port described in the list of ports in the
+	 * MDP4 DT node.
+	 */
+	endpoint = of_graph_get_endpoint_by_regs(np, 0, -1);
 	if (!endpoint) {
-		DBG("no endpoint in MDP4 to fetch LVDS panel\n");
+		DBG("no LVDS panel remote endpoint\n");
 		return NULL;
 	}
 
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

PATCH 4/9 dt-bindings: msm/mdp: Remove connector and gpu bindings

In reply to Archit Taneja

The MDP DT node now contains a list of ports that describe how it connects to external encoder interfaces like DSI and HDMI. These follow the standard of_graph bindings, and allow us to get rid of the 'connectors' phandle that contained a list of all the external encoders connected to MDP.

The GPU phandle is removed too until we figure out what's the right way to specify it in DT.

---
 .../devicetree/bindings/display/msm/mdp.txt        | 75 ++++++++++++++++++++--
 1 file changed, 71 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/display/msm/mdp.txt +71 -4
index a214f6c..5f6ae3c 100644
@@ -6,7 +6,6 @@ Required properties:
   * "qcom,mdp5" - mdp5
 - reg: Physical base address and length of the controller's registers.
 - interrupts: The interrupt signal from the display controller.
-- connectors: array of phandles for output device(s)
 - clocks: device clocks
   See ../clocks/clock-bindings.txt for details.
 - clock-names: the following clocks are required.
@@ -24,9 +23,33 @@ Required properties:
    * "core_clk"
    * "lut_clk" (some MDP5 versions may not need this)
    * "vsync_clk"
+- ports: contains the list of output ports from MDP. These connect to interfaces
+  that are external to the MDP hardware, such as HDMI, DSI, EDP etc (LVDS is a
+  special case since it is a part of the MDP block itself).
+
+  Each output port contains an endpoint that describes how it is connected to an
+  external interface. These are described by the standard properties documented
+  here:
+	Documentation/devicetree/bindings/graph.txt
+	Documentation/devicetree/bindings/media/video-interfaces.txt
+
+  For MDP4, the output port mappings are:
+	Port 0 -> LCDC/LVDS
+	Port 1 -> DSI1 Cmd/Video
+	Port 2 -> DSI2 Cmd/Video
+	Port 3 -> DTV
+
+ For MDP5, the availability of output ports vary across each SoC revision, but
+ they generally have the following mapping:
+	Port 0 -> MDP_INTF0 (eDP)
+	Port 1 -> MDP_INTF1 (DSI1)
+	Port 2 -> MDP_INTF2 (DSI2)
+	Port 3 -> MDP_INTF3 (HDMI)
+
+ See drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c to see what all INTFs a particular
+ SoC revision has enabled.
 
 Optional properties:
-- gpus: phandle for gpu device
 - clock-names: the following clocks are optional:
   * "lut_clk"
 
@@ -35,11 +58,25 @@ Example:
 / {
 	...
 
-	mdp: qcom,mdp@5100000 {
+	hdmi: hdmi@4a00000 {
+		...
+		ports {
+			...
+			port@0 {
+				reg = <0>;
+				hdmi_in: endpoint {
+					remote-endpoint = <&mdp_dtv_out>;
+				};
+			};
+			...
+		};
+		...
+	};
+
+	mdp: mdp@5100000 {
 		compatible = "qcom,mdp4";
 		reg = <0x05100000 0xf0000>;
 		interrupts = <GIC_SPI 75 0>;
-		connectors = <&hdmi>;
 		gpus = <&gpu>;
 		clock-names =
 		    "core_clk",
@@ -55,5 +92,35 @@ Example:
 		    <&mmcc TV_SRC>,
 		    <&mmcc HDMI_TV_CLK>,
 		    <&mmcc MDP_TV_CLK>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					mdp_lvds_out: endpoint {
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					mdp_dsi1_out: endpoint {
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					mdp_dsi2_out: endpoint {
+					};
+				};
+
+				port@3 {
+					reg = <3>;
+					mdp_dtv_out: endpoint {
+						remote-endpoint = <&hdmi_in>;
+					};
+				};
+		};
 	};
 };
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#11 lore raw

PATCH 5/9 dt-bindings: msm/dsi: Some binding doc cleanups

In reply to a message not in the archive

Some cleanups:

- Use simpler names for DT nodes in the example
- Fix phandle for specifying data lane mapping in the example.
- Use references instead of dumping Document links everywhere

---
 .../devicetree/bindings/display/msm/dsi.txt        | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +12 -11
index f5948c4..bf41d7c 100644
@@ -11,8 +11,7 @@ Required properties:
   be 0 or 1, since we have 2 DSI controllers at most for now.
 - interrupts: The interrupt signal from the DSI block.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]
 - clock-names: the following clocks are required:
   * "mdp_core_clk"
   * "iface_clk"
@@ -31,8 +30,7 @@ Required properties:
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
-  See files in Documentation/devicetree/bindings/display/panel/ for each supported
-  panel.
+  See files in [2] for each supported panel.
 - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
   driving a panel which needs 2 DSI links.
 - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -48,7 +46,7 @@ Optional properties:
 
   DSI Endpoint properties:
   - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See Documentation/devicetree/bindings/graph.txt for device graph info.
+    See [3] for device graph info.
   - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
     to the physical lanes on the given platform. The value contained in
     index n describes what logical data lane is mapped to the physical data
@@ -89,8 +87,7 @@ Required properties:
 - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
   be 0 or 1, since we have 2 DSI PHYs at most for now.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]
 - clock-names: the following clocks are required:
   * "iface_clk"
 - vddio-supply: phandle to vdd-io regulator device node
@@ -99,8 +96,12 @@ Optional properties:
 - qcom,dsi-phy-regulator-ldo-mode: Boolean value indicating if the LDO mode PHY
   regulator is wanted.
 
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+[2] Documentation/devicetree/bindings/display/panel/
+[3] Documentation/devicetree/bindings/graph.txt
+
 Example:
-	mdss_dsi0: qcom,mdss_dsi@fd922800 {
+	dsi0: dsi@fd922800 {
 		compatible = "qcom,mdss-dsi-ctrl";
 		qcom,dsi-host-index = <0>;
 		interrupt-parent = <&mdss_mdp>;
@@ -128,7 +129,7 @@ Example:
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&mdss_dsi_phy0>;
+		qcom,dsi-phy = <&dsi_phy0>;
 
 		qcom,dual-dsi-mode;
 		qcom,master-dsi;
@@ -156,12 +157,12 @@ Example:
 		port {
 			dsi0_out: endpoint {
 				remote-endpoint = <&panel_in>;
-				lanes = <0 1 2 3>;
+				qcom,data-lane-map = <0 1 2 3>;
 			};
 		};
 	};
 
-	mdss_dsi_phy0: qcom,mdss_dsi_phy@fd922a00 {
+	dsi_phy0: dsi_phy@fd922a00 {
 		compatible = "qcom,dsi-phy-28nm-hpm";
 		qcom,dsi-phy-index = <0>;
 		reg-names =
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#17 lore raw

PATCH 6/9 drm/msm/dsi: Modify port parsing

In reply to Archit Taneja

The DSI interface is going to have two ports defined in its device node. The first port is always going to be the link between the MDP output and the input to DSI, the second port is going to be the link between the DSI output and the connected panel/bridge:

----- ----- -------

| MDP | ------> | DSI | ------> | Panel |
 -----           -----           -------
        (Port 0)       (Port 1)

Until now, there was only one Port representing the output. Update the DSI host driver such that it parses Port #1 for a connected device.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +5 -5
index 51fbbf8..15c70ac 100644
@@ -1616,12 +1616,12 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 	}
 
 	/*
-	 * Get the first endpoint node. In our case, dsi has one output port
-	 * to which the panel is connected. Don't return an error if a port
-	 * isn't defined. It's possible that there is nothing connected to
-	 * the dsi output.
+	 * Get the endpoint of the output port of the DSI host. In our case,
+	 * this is mapped to port number with reg = 1. Don't return an error if
+	 * the remote endpoint isn't defined. It's possible that there is
+	 * nothing connected to the dsi output.
 	 */
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	endpoint = of_graph_get_endpoint_by_regs(np, 1, -1);
 	if (!endpoint) {
 		dev_dbg(dev, "%s: no endpoint\n", __func__);
 		return 0;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#18 lore raw

PATCH 7/9 drm/msm/dsi: Use generic PHY bindings

In reply to Archit Taneja

The DSI host links to the DSI PHY device using a custom binding. Switch to the generic PHY bindings. The DSI PHY driver itself doesn't use the common PHY framework for now.

---
 drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi.c +1 -1
index 6edcd6f..ec572f8 100644
@@ -29,7 +29,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
 	struct platform_device *phy_pdev;
 	struct device_node *phy_node;
 
-	phy_node = of_parse_phandle(pdev->dev.of_node, "qcom,dsi-phy", 0);
+	phy_node = of_parse_phandle(pdev->dev.of_node, "phys", 0);
 	if (!phy_node) {
 		dev_err(&pdev->dev, "cannot find phy device\n");
 		return -ENXIO;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#14 lore raw

PATCH 8/9 dt-bindings: msm/dsi: Modify port and PHY bindings

In reply to a message not in the archive

The DSI node now has two ports that describe the connection between the MDP interface output and the DSI input, and the connection between the DSI output and the connected panel/bridge. Update the properties and the example.

Also, use generic PHY bindings instead of the custom one.

---
 .../devicetree/bindings/display/msm/dsi.txt        | 53 +++++++++++++++-------
 1 file changed, 37 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +37 -16
index bf41d7c..0223f06 100644
@@ -25,12 +25,18 @@ Required properties:
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
-- qcom,dsi-phy: phandle to DSI PHY device node
+- phys: phandle to DSI PHY device node
+- phy-names: the name of the corresponding PHY device
 - syscon-sfpb: A phandle to mmss_sfpb syscon node (only for DSIv2)
+- ports: Contains 2 DSI controller ports as child nodes. Each port contains
+  an endpoint subnode as defined in [2] and [3]. port@0 describes the
+  connection between the MDP interface output and the DSI input. port@1
+  describes the connection between the DSI output and the connected
+  panel/bridge.
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
-  See files in [2] for each supported panel.
+  See files in [4] for each supported panel.
 - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
   driving a panel which needs 2 DSI links.
 - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -42,15 +48,15 @@ Optional properties:
 - pinctrl-names: the pin control state names; should contain "default"
 - pinctrl-0: the default pinctrl state (active)
 - pinctrl-n: the "sleep" pinctrl state
-- port: DSI controller output port, containing one endpoint subnode.
 
   DSI Endpoint properties:
-  - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See [3] for device graph info.
+  - remote-endpoint: For port@0, set to phandle of the connected panel/bridge's
+    input endpoint. For port@1, set to the MDP interface output.
   - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
     to the physical lanes on the given platform. The value contained in
     index n describes what logical data lane is mapped to the physical data
-    lane n (DATAn, where n lies between 0 and 3).
+    lane n (DATAn, where n lies between 0 and 3). Only for the endpoint in
+    port@1.
 
     For example:
 
@@ -97,8 +103,9 @@ Optional properties:
   regulator is wanted.
 
 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/display/panel/
-[3] Documentation/devicetree/bindings/graph.txt
+[2] Documentation/devicetree/bindings/graph.txt
+[3] Documentation/devicetree/bindings/media/video-interfaces.txt
+[4] Documentation/devicetree/bindings/display/panel/
 
 Example:
 	dsi0: dsi@fd922800 {
@@ -129,7 +136,8 @@ Example:
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&dsi_phy0>;
+		phys = <&dsi_phy0>;
+		phy-names ="dsi_phy";
 
 		qcom,dual-dsi-mode;
 		qcom,master-dsi;
@@ -139,6 +147,26 @@ Example:
 		pinctrl-0 = <&mdss_dsi_active>;
 		pinctrl-1 = <&mdss_dsi_suspend>;
 
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				dsi0_in: endpoint {
+					remote-endpoint = <&mdp_intf1_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				dsi0_out: endpoint {
+					remote-endpoint = <&panel_in>;
+					qcom,data-lane-map = <0 1 2 3>;
+				};
+			};
+		};
+
 		panel: panel@0 {
 			compatible = "sharp,lq101r1sx01";
 			reg = <0>;
@@ -153,13 +181,6 @@ Example:
 				};
 			};
 		};
-
-		port {
-			dsi0_out: endpoint {
-				remote-endpoint = <&panel_in>;
-				qcom,data-lane-map = <0 1 2 3>;
-			};
-		};
 	};
 
 	dsi_phy0: dsi_phy@fd922a00 {
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#19 lore raw

PATCH 9/9 dt-bindings: msm/dsi: Add assigned clocks bindings

In reply to Archit Taneja

The PLL in the DSI PHY block generates 2 clock outputs (Byte and Pixel clocks) that are fed into the Multimedia Clock Controller (MMCC). The MMCC uses these as source clocks for some of its RCGs to generate clocks that finally feed to the DSI host controller.

Use the assigned clocks DT bindings to set up the MMCC RCGs that feed to the DSI host. Use the DSI PHY provided clocks to set up the parents of these assigned clocks.

---
 Documentation/devicetree/bindings/display/msm/dsi.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/display/msm/dsi.txt +15 -0
index 0223f06..686f475 100644
@@ -22,6 +22,10 @@ Required properties:
   * "core_clk"
   For DSIv2, we need an additional clock:
    * "src_clk"
+- assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
+  See [1] for more details.
+- assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
+  by a DSI PHY block.
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
@@ -90,6 +94,8 @@ Required properties:
   * "dsi_pll"
   * "dsi_phy"
   * "dsi_phy_regulator"
+- clock-cells: Must be 1. The DSI PHY block acts as a clock provider, creating
+  2 clocks: A byte clock (index 0), and a pixel clock (index 1).
 - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
   be 0 or 1, since we have 2 DSI PHYs at most for now.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
@@ -132,6 +138,14 @@ Example:
 			<&mmcc MDSS_AHB_CLK>,
 			<&mmcc MDSS_MDP_CLK>,
 			<&mmcc MDSS_PCLK0_CLK>;
+
+		assigned-clocks =
+				 <&mmcc BYTE0_CLK_SRC>,
+				 <&mmcc PCLK0_CLK_SRC>;
+		assigned-clock-parents =
+				 <&dsi0_phy 0>,
+				 <&dsi0_phy 1>;
+
 		vdda-supply = <&pma8084_l2>;
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
@@ -195,6 +209,7 @@ Example:
 			<0xfd922d80 0x7b>;
 		clock-names = "iface_clk";
 		clocks = <&mmcc MDSS_AHB_CLK>;
+		#clock-cells = <1>;
 		vddio-supply = <&pma8084_l12>;
 
 		qcom,dsi-phy-regulator-ldo-mode;
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

Re: [PATCH 2/9] drm/msm: Drop the gpu binding

In reply to Archit Taneja
Quoted 33 lines · Archit Taneja

The driver currently identifies the GPU components it needs by parsing a phandle list from the 'gpus' DT property.

This isn't the right binding to go with. So, for now, just search all device nodes and find the gpu node we need by parsing a list of compatible strings.

Once we know how to link the kms and gpu drivers, we'll drop this method and use the correct binding.

---
 drivers/gpu/drm/msm/msm_drv.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +8 -2
index 30b8f3b..f717a69 100644
@@ -1068,20 +1068,32 @@ static int compare_of(struct device *dev, void *data)
        return dev->of_node == data;
 }
 
-static int add_components(struct device *dev, struct component_match **matchptr,
-               const char *name)
+static const char * const msm_compatible_gpus[] = {
+       "qcom,adreno-3xx",
+       "qcom,kgsl-3d0",
+};
+
+/*
+ * We don't know what's the best binding to link the gpu with the drm device.
+ * Fow now, we just hunt for all the possible gpus that we support, and add them

drivers/gpu/drm/msm/msm_drv.c static int compare_of(struct device *dev, void *data) · line 1086

Quoted 10 lines
drivers/gpu/drm/msm/msm_drv.c +5 -2
+ * as components.
+ */
+static int add_gpu_components(struct device *dev,
+                             struct component_match **matchptr)
 {
-       struct device_node *np = dev->of_node;
        unsigned i;
 
-       for (i = 0; ; i++) {
+       for (i = 0; i < ARRAY_SIZE(msm_compatible_gpus); i++) {

You can use of_find_matching_node() here instead of a loop.

Rob

#6 lore raw

Re: [PATCH 3/9] drm/msm/mdp: mdp4: Update LCDC/LVDS port parsing

In reply to Archit Taneja

Am Dienstag, den 03.05.2016, 16:27 +0530 schrieb Archit Taneja:

Quoted 17 lines

The LCDC port is the first in the list of the output ports in MDP4. Mention this explicitly in the driver.

---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +0 -1
index f8e0cea..cd129f4 100644
@@ -263,9 +263,13 @@ static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev)
 	struct device_node *endpoint, *panel_node;
 	struct device_node *np = dev->dev->of_node;
 
-	endpoint = of_graph_get_next_endpoint(np, NULL);

drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev) · line 274

Quoted 10 lines
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +6 -1
+	/*
+	 * LCDC/LVDS is the first port described in the list of ports in the
+	 * MDP4 DT node.
+	 */
+	endpoint = of_graph_get_endpoint_by_regs(np, 0, -1);
 	if (!endpoint) {
-		DBG("no endpoint in MDP4 to fetch LVDS panel\n");
+		DBG("no LVDS panel remote endpoint\n");
 		return NULL;
 	}

Oh nice, I wasn't aware of of_graph_get_endpoint_by_regs(). We should switch imx-drm and exynos to use it, too.

regards
Philipp

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

#15 lore raw

Re: [PATCH 8/9] dt-bindings: msm/dsi: Modify port and PHY bindings

In reply to Archit Taneja

Am Dienstag, den 03.05.2016, 16:28 +0530 schrieb Archit Taneja:

Quoted 17 lines

The DSI node now has two ports that describe the connection between the MDP interface output and the DSI input, and the connection between the DSI output and the connected panel/bridge. Update the properties and the example.

Also, use generic PHY bindings instead of the custom one.

---
 .../devicetree/bindings/display/msm/dsi.txt        | 53 +++++++++++++++-------
 1 file changed, 37 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
index bf41d7c..0223f06 100644

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 29

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -1
@@ -25,12 +25,18 @@ Required properties:
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
-- qcom,dsi-phy: phandle to DSI PHY device node
+- phys: phandle to DSI PHY device node
+- phy-names: the name of the corresponding PHY device

Should "dsi_phy" be specified here?

Also is there any kind of system to the PHY naming? I've seen more bindings use hyphen instead of underscore in the name, for example. I have called the MediaTek MIPI_TX PHY "dphy" for no other reason than it's a MIPI D-PHY.

Quoted 21 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +6 -2
 - syscon-sfpb: A phandle to mmss_sfpb syscon node (only for DSIv2)
+- ports: Contains 2 DSI controller ports as child nodes. Each port contains
+  an endpoint subnode as defined in [2] and [3]. port@0 describes the
+  connection between the MDP interface output and the DSI input. port@1
+  describes the connection between the DSI output and the connected
+  panel/bridge.
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
-  See files in [2] for each supported panel.
+  See files in [4] for each supported panel.
 - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
   driving a panel which needs 2 DSI links.
 - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -42,15 +48,15 @@ Optional properties:
 - pinctrl-names: the pin control state names; should contain "default"
 - pinctrl-0: the default pinctrl state (active)
 - pinctrl-n: the "sleep" pinctrl state
-- port: DSI controller output port, containing one endpoint subnode.
 
   DSI Endpoint properties:

Documentation/devicetree/bindings/display/msm/dsi.txt Optional properties: · line 59

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +4 -3
-  - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See [3] for device graph info.
+  - remote-endpoint: For port@0, set to phandle of the connected panel/bridge's
+    input endpoint. For port@1, set to the MDP interface output.
   - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
     to the physical lanes on the given platform. The value contained in
     index n describes what logical data lane is mapped to the physical data
-    lane n (DATAn, where n lies between 0 and 3).
+    lane n (DATAn, where n lies between 0 and 3). Only for the endpoint in
+    port@1.

I approve of the of graph change, but I notice that the qcom,data-lane-map is very similar to the data-lanes property documented in Documentation/devicetree/bindings/media/video-interfaces.txt for MIPI CSI-2. Could that maybe be reused for DSI?

Quoted 41 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +18 -3
     For example:
 
@@ -97,8 +103,9 @@ Optional properties:
   regulator is wanted.
 
 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/display/panel/
-[3] Documentation/devicetree/bindings/graph.txt
+[2] Documentation/devicetree/bindings/graph.txt
+[3] Documentation/devicetree/bindings/media/video-interfaces.txt
+[4] Documentation/devicetree/bindings/display/panel/
 
 Example:
 	dsi0: dsi@fd922800 {
@@ -129,7 +136,8 @@ Example:
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&dsi_phy0>;
+		phys = <&dsi_phy0>;
+		phy-names ="dsi_phy";
 
 		qcom,dual-dsi-mode;
 		qcom,master-dsi;
@@ -139,6 +147,26 @@ Example:
 		pinctrl-0 = <&mdss_dsi_active>;
 		pinctrl-1 = <&mdss_dsi_suspend>;
 
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				dsi0_in: endpoint {
+					remote-endpoint = <&mdp_intf1_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;

Documentation/devicetree/bindings/display/msm/dsi.txt Example: · line 172

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +7 -0
+				dsi0_out: endpoint {
+					remote-endpoint = <&panel_in>;
+					qcom,data-lane-map = <0 1 2 3>;
+				};
+			};
+		};
+
 		panel: panel@0 {
 			compatible = "sharp,lq101r1sx01";
 			reg = <0>;

If the panel is connected via port@1, why is this still needed?

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
@@ -153,13 +181,6 @@ Example:
 				};
 			};
 		};

Documentation/devicetree/bindings/display/msm/dsi.txt Example: · line 186

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -7
-
-		port {
-			dsi0_out: endpoint {
-				remote-endpoint = <&panel_in>;
-				qcom,data-lane-map = <0 1 2 3>;
-			};
-		};
 	};
 
 	dsi_phy0: dsi_phy@fd922a00 {

regards
Philipp

#12 lore raw

Re: [PATCH 5/9] dt-bindings: msm/dsi: Some binding doc cleanups

In reply to Archit Taneja

Am Dienstag, den 03.05.2016, 16:27 +0530 schrieb Archit Taneja:

Quoted 16 lines

Some cleanups:

- Use simpler names for DT nodes in the example
- Fix phandle for specifying data lane mapping in the example.
- Use references instead of dumping Document links everywhere

---
 .../devicetree/bindings/display/msm/dsi.txt        | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
index f5948c4..bf41d7c 100644

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 14

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -2
@@ -11,8 +11,7 @@ Required properties:
   be 0 or 1, since we have 2 DSI controllers at most for now.
 - interrupts: The interrupt signal from the DSI block.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]

s/descirbed/described/

Quoted 23 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -3
 - clock-names: the following clocks are required:
   * "mdp_core_clk"
   * "iface_clk"
@@ -31,8 +30,7 @@ Required properties:
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
-  See files in Documentation/devicetree/bindings/display/panel/ for each supported
-  panel.
+  See files in [2] for each supported panel.
 - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
   driving a panel which needs 2 DSI links.
 - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -48,7 +46,7 @@ Optional properties:
 
   DSI Endpoint properties:
   - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See Documentation/devicetree/bindings/graph.txt for device graph info.
+    See [3] for device graph info.
   - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
     to the physical lanes on the given platform. The value contained in
     index n describes what logical data lane is mapped to the physical data

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 90

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -2
@@ -89,8 +87,7 @@ Required properties:
 - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
   be 0 or 1, since we have 2 DSI PHYs at most for now.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]

s/descirbed/described/

Quoted 28 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +6 -2
 - clock-names: the following clocks are required:
   * "iface_clk"
 - vddio-supply: phandle to vdd-io regulator device node
@@ -99,8 +96,12 @@ Optional properties:
 - qcom,dsi-phy-regulator-ldo-mode: Boolean value indicating if the LDO mode PHY
   regulator is wanted.
 
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+[2] Documentation/devicetree/bindings/display/panel/
+[3] Documentation/devicetree/bindings/graph.txt
+
 Example:
-	mdss_dsi0: qcom,mdss_dsi@fd922800 {
+	dsi0: dsi@fd922800 {
 		compatible = "qcom,mdss-dsi-ctrl";
 		qcom,dsi-host-index = <0>;
 		interrupt-parent = <&mdss_mdp>;
@@ -128,7 +129,7 @@ Example:
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&mdss_dsi_phy0>;
+		qcom,dsi-phy = <&dsi_phy0>;
 
 
 		qcom,dual-dsi-mode;
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
 		qcom,master-dsi;

Documentation/devicetree/bindings/display/msm/dsi.txt Example: · line 160

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -1
@@ -156,12 +157,12 @@ Example:
 		port {
 			dsi0_out: endpoint {
 				remote-endpoint = <&panel_in>;
-				lanes = <0 1 2 3>;
+				qcom,data-lane-map = <0 1 2 3>;

See my comment about the CSI-2 data-lanes binding in the other mail, could the existing binding be reused?

regards
Philipp

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

#4 lore raw

Re: [PATCH 2/9] drm/msm: Drop the gpu binding

In reply to Rob Herring
Quoted 42 lines · Rob Herring
Quoted 41 lines · Archit Taneja

The driver currently identifies the GPU components it needs by parsing a phandle list from the 'gpus' DT property.

This isn't the right binding to go with. So, for now, just search all device nodes and find the gpu node we need by parsing a list of compatible strings.

Once we know how to link the kms and gpu drivers, we'll drop this method and use the correct binding.

---
  drivers/gpu/drm/msm/msm_drv.c | 26 +++++++++++++++++++-------
  1 file changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +12 -3
index 30b8f3b..f717a69 100644
@@ -1068,20 +1068,32 @@ static int compare_of(struct device *dev, void *data)
         return dev->of_node == data;
  }
 
-static int add_components(struct device *dev, struct component_match **matchptr,
-               const char *name)
+static const char * const msm_compatible_gpus[] = {
+       "qcom,adreno-3xx",
+       "qcom,kgsl-3d0",
+};
+
+/*
+ * We don't know what's the best binding to link the gpu with the drm device.
+ * Fow now, we just hunt for all the possible gpus that we support, and add them
+ * as components.
+ */
+static int add_gpu_components(struct device *dev,
+                             struct component_match **matchptr)
  {
-       struct device_node *np = dev->of_node;
         unsigned i;
 
Quoted 4 lines

drivers/gpu/drm/msm/msm_drv.c static int compare_of(struct device *dev, void *data) · line 1086

Quoted 2 lines
drivers/gpu/drm/msm/msm_drv.c +1 -1
-       for (i = 0; ; i++) {
+       for (i = 0; i < ARRAY_SIZE(msm_compatible_gpus); i++) {

You can use of_find_matching_node() here instead of a loop.

I'll switch to that.

Thanks,
Archit

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
#16 lore raw

Re: [PATCH 8/9] dt-bindings: msm/dsi: Modify port and PHY bindings

In reply to Philipp Zabel
Quoted 27 lines · Philipp Zabel

Am Dienstag, den 03.05.2016, 16:28 +0530 schrieb Archit Taneja:

Quoted 17 lines

The DSI node now has two ports that describe the connection between the MDP interface output and the DSI input, and the connection between the DSI output and the connected panel/bridge. Update the properties and the example.

Also, use generic PHY bindings instead of the custom one.

---
  .../devicetree/bindings/display/msm/dsi.txt        | 53 +++++++++++++++-------
  1 file changed, 37 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
index bf41d7c..0223f06 100644

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 29

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -1
@@ -25,12 +25,18 @@ Required properties:
  - vdd-supply: phandle to vdd regulator device node
  - vddio-supply: phandle to vdd-io regulator device node
  - vdda-supply: phandle to vdda regulator device node
-- qcom,dsi-phy: phandle to DSI PHY device node
+- phys: phandle to DSI PHY device node
+- phy-names: the name of the corresponding PHY device

Should "dsi_phy" be specified here?

Quoted 4 lines

Also is there any kind of system to the PHY naming? I've seen more bindings use hyphen instead of underscore in the name, for example. I have called the MediaTek MIPI_TX PHY "dphy" for no other reason than it's a MIPI D-PHY.

I agree with the hyphen part, I'll switch to that.

The DSI PHY block isn't only the D-PHY interface, it also contains a PLL and some logic to support more complex configurations (for example, syncing with the PHY connected to another DSI output). That's the main reason why I left the name as "dsi_phy".

Quoted 21 lines
Quoted 21 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +6 -2
  - syscon-sfpb: A phandle to mmss_sfpb syscon node (only for DSIv2)
+- ports: Contains 2 DSI controller ports as child nodes. Each port contains
+  an endpoint subnode as defined in [2] and [3]. port@0 describes the
+  connection between the MDP interface output and the DSI input. port@1
+  describes the connection between the DSI output and the connected
+  panel/bridge.
 
  Optional properties:
  - panel@0: Node of panel connected to this DSI controller.
-  See files in [2] for each supported panel.
+  See files in [4] for each supported panel.
  - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
    driving a panel which needs 2 DSI links.
  - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -42,15 +48,15 @@ Optional properties:
  - pinctrl-names: the pin control state names; should contain "default"
  - pinctrl-0: the default pinctrl state (active)
  - pinctrl-n: the "sleep" pinctrl state
-- port: DSI controller output port, containing one endpoint subnode.
 
Quoted 16 lines

Documentation/devicetree/bindings/display/msm/dsi.txt Optional properties: · line 59

Quoted 11 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +4 -3
    DSI Endpoint properties:
-  - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See [3] for device graph info.
+  - remote-endpoint: For port@0, set to phandle of the connected panel/bridge's
+    input endpoint. For port@1, set to the MDP interface output.
    - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
      to the physical lanes on the given platform. The value contained in
      index n describes what logical data lane is mapped to the physical data
-    lane n (DATAn, where n lies between 0 and 3).
+    lane n (DATAn, where n lies between 0 and 3). Only for the endpoint in
+    port@1.

I approve of the of graph change, but I notice that the qcom,data-lane-map is very similar to the data-lanes property documented in Documentation/devicetree/bindings/media/video-interfaces.txt for MIPI CSI-2. Could that maybe be reused for DSI?

You're right. I missed out on the existing binding when I posted this. One difference in this binding is that the indices here point to the physical lanes, and the value contained in the index is the logical lane (that's how it's described in the register documentation). For the "data-lanes" property, it's the other way round. It's still better to use the existing binding. I'll post a separate patch to update this.

Quoted 46 lines
Quoted 46 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +22 -3
      For example:
 
@@ -97,8 +103,9 @@ Optional properties:
    regulator is wanted.
 
  [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/display/panel/
-[3] Documentation/devicetree/bindings/graph.txt
+[2] Documentation/devicetree/bindings/graph.txt
+[3] Documentation/devicetree/bindings/media/video-interfaces.txt
+[4] Documentation/devicetree/bindings/display/panel/
 
  Example:
  	dsi0: dsi@fd922800 {
@@ -129,7 +136,8 @@ Example:
  		vdd-supply = <&pma8084_l22>;
  		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&dsi_phy0>;
+		phys = <&dsi_phy0>;
+		phy-names ="dsi_phy";
 
  		qcom,dual-dsi-mode;
  		qcom,master-dsi;
@@ -139,6 +147,26 @@ Example:
  		pinctrl-0 = <&mdss_dsi_active>;
  		pinctrl-1 = <&mdss_dsi_suspend>;
 
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				dsi0_in: endpoint {
+					remote-endpoint = <&mdp_intf1_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				dsi0_out: endpoint {
+					remote-endpoint = <&panel_in>;
+					qcom,data-lane-map = <0 1 2 3>;
+				};
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dsi.txt Example: · line 172

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +3 -0
+			};
+		};
+
  		panel: panel@0 {
  			compatible = "sharp,lq101r1sx01";
  			reg = <0>;

If the panel is connected via port@1, why is this still needed?

Did you mean that the numbering(reg prop) isn't needed? If so, yeah, I missed out on that. I'll remove it. Thanks for pointing it out.

Archit

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
#13 lore raw

Re: [PATCH 5/9] dt-bindings: msm/dsi: Some binding doc cleanups

In reply to Philipp Zabel
Quoted 41 lines · Philipp Zabel

Am Dienstag, den 03.05.2016, 16:27 +0530 schrieb Archit Taneja:

Quoted 16 lines

Some cleanups:

- Use simpler names for DT nodes in the example
- Fix phandle for specifying data lane mapping in the example.
- Use references instead of dumping Document links everywhere

---
  .../devicetree/bindings/display/msm/dsi.txt        | 23 +++++++++++-----------
  1 file changed, 12 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
index f5948c4..bf41d7c 100644

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 14

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -2
@@ -11,8 +11,7 @@ Required properties:
    be 0 or 1, since we have 2 DSI controllers at most for now.
  - interrupts: The interrupt signal from the DSI block.
  - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]

s/descirbed/described/

Quoted 15 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -2
  - clock-names: the following clocks are required:
    * "mdp_core_clk"
    * "iface_clk"
@@ -31,8 +30,7 @@ Required properties:
 
  Optional properties:
  - panel@0: Node of panel connected to this DSI controller.
-  See files in Documentation/devicetree/bindings/display/panel/ for each supported
-  panel.
+  See files in [2] for each supported panel.
  - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
    driving a panel which needs 2 DSI links.
  - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -48,7 +46,7 @@ Optional properties:
 
Quoted 16 lines
Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -1
    DSI Endpoint properties:
    - remote-endpoint: set to phandle of the connected panel's endpoint.
-    See Documentation/devicetree/bindings/graph.txt for device graph info.
+    See [3] for device graph info.
    - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
      to the physical lanes on the given platform. The value contained in
      index n describes what logical data lane is mapped to the physical data

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 90

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +1 -2
@@ -89,8 +87,7 @@ Required properties:
  - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
    be 0 or 1, since we have 2 DSI PHYs at most for now.
  - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks as descirbed in [1]

s/descirbed/described/

Thanks, will fix these.

Quoted 26 lines
Quoted 26 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +6 -2
  - clock-names: the following clocks are required:
    * "iface_clk"
  - vddio-supply: phandle to vdd-io regulator device node
@@ -99,8 +96,12 @@ Optional properties:
  - qcom,dsi-phy-regulator-ldo-mode: Boolean value indicating if the LDO mode PHY
    regulator is wanted.
 
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+[2] Documentation/devicetree/bindings/display/panel/
+[3] Documentation/devicetree/bindings/graph.txt
+
  Example:
-	mdss_dsi0: qcom,mdss_dsi@fd922800 {
+	dsi0: dsi@fd922800 {
  		compatible = "qcom,mdss-dsi-ctrl";
  		qcom,dsi-host-index = <0>;
  		interrupt-parent = <&mdss_mdp>;
@@ -128,7 +129,7 @@ Example:
  		vdd-supply = <&pma8084_l22>;
  		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&mdss_dsi_phy0>;
+		qcom,dsi-phy = <&dsi_phy0>;
 
 
Quoted 11 lines

Documentation/devicetree/bindings/display/msm/dsi.txt Example: · line 160

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +0 -0
  		qcom,dual-dsi-mode;

qcom,master-dsi;

Documentation/devicetree/bindings/display/msm/dsi.txt +1 -1
@@ -156,12 +157,12 @@ Example:
  		port {
  			dsi0_out: endpoint {
  				remote-endpoint = <&panel_in>;
-				lanes = <0 1 2 3>;
+				qcom,data-lane-map = <0 1 2 3>;

See my comment about the CSI-2 data-lanes binding in the other mail, could the existing binding be reused?

Yes, I'll incorporate the existing binding.

Thanks for the review.

Archit

Signature · 5 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#8 lore raw

Re: [PATCH 4/9] dt-bindings: msm/mdp: Remove connector and gpu bindings

In reply to Archit Taneja
Quoted 8 lines · Archit Taneja

The MDP DT node now contains a list of ports that describe how it connects to external encoder interfaces like DSI and HDMI. These follow the standard of_graph bindings, and allow us to get rid of the 'connectors' phandle that contained a list of all the external encoders connected to MDP.

The GPU phandle is removed too until we figure out what's the right way to specify it in DT.

[...]

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/mdp.txt +5 -0
+  For MDP4, the output port mappings are:
+	Port 0 -> LCDC/LVDS
+	Port 1 -> DSI1 Cmd/Video
+	Port 2 -> DSI2 Cmd/Video
+	Port 3 -> DTV

Documentation/devicetree/bindings/display/msm/mdp.txt Required properties: · line 50

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/mdp.txt +10 -0
+
+ For MDP5, the availability of output ports vary across each SoC revision, but
+ they generally have the following mapping:
+	Port 0 -> MDP_INTF0 (eDP)
+	Port 1 -> MDP_INTF1 (DSI1)
+	Port 2 -> MDP_INTF2 (DSI2)
+	Port 3 -> MDP_INTF3 (HDMI)
+
+ See drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c to see what all INTFs a particular
+ SoC revision has enabled.

The binding doc shouldn't depend on kernel code. You need to document it here.

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

maintainer
#20 lore raw

Re: [PATCH 9/9] dt-bindings: msm/dsi: Add assigned clocks bindings

In reply to Archit Taneja
Quoted 30 lines · Archit Taneja

The PLL in the DSI PHY block generates 2 clock outputs (Byte and Pixel clocks) that are fed into the Multimedia Clock Controller (MMCC). The MMCC uses these as source clocks for some of its RCGs to generate clocks that finally feed to the DSI host controller.

Use the assigned clocks DT bindings to set up the MMCC RCGs that feed to the DSI host. Use the DSI PHY provided clocks to set up the parents of these assigned clocks.

---
 Documentation/devicetree/bindings/display/msm/dsi.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/display/msm/dsi.txt +4 -0
index 0223f06..686f475 100644
@@ -22,6 +22,10 @@ Required properties:
   * "core_clk"
   For DSIv2, we need an additional clock:
    * "src_clk"
+- assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
+  See [1] for more details.
+- assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
+  by a DSI PHY block.
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 98

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -0
@@ -90,6 +94,8 @@ Required properties:
   * "dsi_pll"
   * "dsi_phy"
   * "dsi_phy_regulator"
+- clock-cells: Must be 1. The DSI PHY block acts as a clock provider, creating
+  2 clocks: A byte clock (index 0), and a pixel clock (index 1).

You can't really add new required properties unless they are for a new compatible string.

Rob

#9 lore raw

Re: [PATCH 4/9] dt-bindings: msm/mdp: Remove connector and gpu bindings

In reply to Rob Herring
Quoted 22 lines · Rob Herring
Quoted 8 lines · Archit Taneja

The MDP DT node now contains a list of ports that describe how it connects to external encoder interfaces like DSI and HDMI. These follow the standard of_graph bindings, and allow us to get rid of the 'connectors' phandle that contained a list of all the external encoders connected to MDP.

The GPU phandle is removed too until we figure out what's the right way to specify it in DT.

[...]

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/mdp.txt +10 -0
+  For MDP4, the output port mappings are:
+	Port 0 -> LCDC/LVDS
+	Port 1 -> DSI1 Cmd/Video
+	Port 2 -> DSI2 Cmd/Video
+	Port 3 -> DTV
+
+ For MDP5, the availability of output ports vary across each SoC revision, but
+ they generally have the following mapping:
+	Port 0 -> MDP_INTF0 (eDP)
+	Port 1 -> MDP_INTF1 (DSI1)
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/mdp.txt Required properties: · line 50

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/mdp.txt +5 -0
+	Port 2 -> MDP_INTF2 (DSI2)
+	Port 3 -> MDP_INTF3 (HDMI)
+
+ See drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c to see what all INTFs a particular
+ SoC revision has enabled.

The binding doc shouldn't depend on kernel code. You need to document it here.

Okay. I'll list the available interfaces for each SoC revision.

Thanks,
Archit

Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#21 lore raw

Re: [PATCH 9/9] dt-bindings: msm/dsi: Add assigned clocks bindings

In reply to Rob Herring
Quoted 31 lines · Rob Herring
Quoted 30 lines · Archit Taneja

The PLL in the DSI PHY block generates 2 clock outputs (Byte and Pixel clocks) that are fed into the Multimedia Clock Controller (MMCC). The MMCC uses these as source clocks for some of its RCGs to generate clocks that finally feed to the DSI host controller.

Use the assigned clocks DT bindings to set up the MMCC RCGs that feed to the DSI host. Use the DSI PHY provided clocks to set up the parents of these assigned clocks.

---
  Documentation/devicetree/bindings/display/msm/dsi.txt | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/display/msm/dsi.txt +4 -0
index 0223f06..686f475 100644
@@ -22,6 +22,10 @@ Required properties:
    * "core_clk"
    For DSIv2, we need an additional clock:
     * "src_clk"
+- assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
+  See [1] for more details.
+- assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
+  by a DSI PHY block.
  - vdd-supply: phandle to vdd regulator device node
  - vddio-supply: phandle to vdd-io regulator device node
  - vdda-supply: phandle to vdda regulator device node
@@ -90,6 +94,8 @@ Required properties:
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 98

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -0
    * "dsi_pll"
    * "dsi_phy"
    * "dsi_phy_regulator"
+- clock-cells: Must be 1. The DSI PHY block acts as a clock provider, creating
+  2 clocks: A byte clock (index 0), and a pixel clock (index 1).

You can't really add new required properties unless they are for a new compatible string.

Does this hold even when currently there isn't any device tree file in the kernel that has this DT node in it?

I was trying to get all the properties in place before posting out patches that actually add the nodes into the platform files. Currently, they exist only DT files in downstream kernels.

Thanks,
Archit

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Acked-by
#23 lore raw

Re: [PATCH 9/9] dt-bindings: msm/dsi: Add assigned clocks bindings

In reply to a message not in the archive
Quoted 43 lines · Archit Taneja
Quoted 31 lines · Rob Herring
Quoted 30 lines · Archit Taneja

The PLL in the DSI PHY block generates 2 clock outputs (Byte and Pixel clocks) that are fed into the Multimedia Clock Controller (MMCC). The MMCC uses these as source clocks for some of its RCGs to generate clocks that finally feed to the DSI host controller.

Use the assigned clocks DT bindings to set up the MMCC RCGs that feed to the DSI host. Use the DSI PHY provided clocks to set up the parents of these assigned clocks.

---
 Documentation/devicetree/bindings/display/msm/dsi.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/display/msm/dsi.txt +4 -0
index 0223f06..686f475 100644
@@ -22,6 +22,10 @@ Required properties:
   * "core_clk"
   For DSIv2, we need an additional clock:
    * "src_clk"
+- assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
+  See [1] for more details.
+- assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
+  by a DSI PHY block.
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
@@ -90,6 +94,8 @@ Required properties:
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dsi.txt Required properties: · line 98

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dsi.txt +2 -0
   * "dsi_pll"
   * "dsi_phy"
   * "dsi_phy_regulator"
+- clock-cells: Must be 1. The DSI PHY block acts as a clock provider, creating
+  2 clocks: A byte clock (index 0), and a pixel clock (index 1).

You can't really add new required properties unless they are for a new compatible string.

Quoted 2 lines

Does this hold even when currently there isn't any device tree file in the kernel that has this DT node in it?

Generally it should, but in this case that is fine.

Quoted 3 lines

I was trying to get all the properties in place before posting out patches that actually add the nodes into the platform files. Currently, they exist only DT files in downstream kernels.

"If it is not upstream, it doesn't exist." :)

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#24 lore raw

v2 cover drm/msm: Fix issues with DT bindings

In reply to Archit Taneja

Currently, none of the upstream Qualcomm DT files have the display device nodes populated, even when the DT binding documents are upstream.

This revision drops the patches that add components via parsing ports. The component addition changes will be handled in a separate patchset later. These contain mostly misc DT fixes, in preparation for full DT support. This also incorporates some of the comments given for the previous revision.

changes in v2:
- Drop patches that allowed component addition via MDP port parsing.
- Use a more standard data lanes binding for DSI.
- Use hyphen in the common PHY binding names for the examples.
- Add some DT related fixes for MDP4/5 clocks.

Original revision:
https://lists.freedesktop.org/archives/dri-devel/2016-May/106653.html

Archit Taneja (10):
drm/msm/mdp5: Don't get source of MDP core clock drm/msm/mdp4: Clean up some MDP4 clocks
dt-bindings: msm/mdp: Fix up clock related bindings drm/msm/dsi: Modify port parsing drm/msm/dsi: Use generic PHY bindings drm/msm/dsi: Use a standard DT binding for data lanes
dt-bindings: msm/dsi: Use standard data lanes binding
dt-bindings: msm/dsi: Modify port and PHY bindings
dt-bindings: msm/dsi: Add assigned clocks bindings
dt-bindings: msm/dsi: Some binding doc cleanups

 .../devicetree/bindings/display/msm/dsi.txt        | 117 ++++++++++++++-------
 .../devicetree/bindings/display/msm/mdp.txt        |  10 +-
 drivers/gpu/drm/msm/dsi/dsi.c                      |   2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c                 |  27 +++--
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_dtv_encoder.c    |  31 +++---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c            |   2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c            |   7 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h            |   1 -
 8 files changed, 116 insertions(+), 81 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

PATCH v2 1/10 drm/msm/mdp5: Don't get source of MDP core clock

In reply to a message not in the archive

The driver expects DT to provide the parent to MDP core clock. The only operation done to the parent clock is to set a rate. This can be achieved by setting the rate on the core clock itsef. Don't try to get the parent clock anymore.

---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 7 ++-----
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +2 -5
index 1d840ae..b46961e 100644
@@ -629,9 +629,6 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
 	ret = get_clk(pdev, &mdp5_kms->ahb_clk, "iface_clk", true);
 	if (ret)
 		goto fail;
-	ret = get_clk(pdev, &mdp5_kms->src_clk, "core_clk_src", true);
-	if (ret)
-		goto fail;
 	ret = get_clk(pdev, &mdp5_kms->core_clk, "core_clk", true);
 	if (ret)
 		goto fail;
@@ -646,7 +643,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
 	 * rate first, then figure out hw revision, and then set a
 	 * more optimal rate:
 	 */
-	clk_set_rate(mdp5_kms->src_clk, 200000000);
+	clk_set_rate(mdp5_kms->core_clk, 200000000);
 
 	read_hw_revision(mdp5_kms, &major, &minor);
 
@@ -661,7 +658,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
 	mdp5_kms->caps = config->hw->mdp.caps;
 
 	/* TODO: compute core clock rate at runtime */
-	clk_set_rate(mdp5_kms->src_clk, config->hw->max_clk);
+	clk_set_rate(mdp5_kms->core_clk, config->hw->max_clk);
 
 	/*
 	 * Some chipsets have a Shared Memory Pool (SMP), while others
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h +0 -1
index 9a25898..9cf5aa4 100644
@@ -49,7 +49,6 @@ struct mdp5_kms {
 
 	struct clk *axi_clk;
 	struct clk *ahb_clk;
-	struct clk *src_clk;
 	struct clk *core_clk;
 	struct clk *lut_clk;
 	struct clk *vsync_clk;
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#34 lore raw

PATCH v2 2/10 drm/msm/mdp4: Clean up some MDP4 clocks

In reply to Archit Taneja

Fix some issues with MDP4 clocks:

- mdp4_dtv_encoder tries to get "src_clk", which is a RCG(TV_SRC) in MSM8960 and APQ8064. This isn't something the driver should access or configure. Instead of this, configure the "mdp_clk" (MDP_TV_CLK), a branch clock in MMCC that has the TV_SRC as its parent. Setting rate/enabling the "mdp_clk" will eventually configure "src_clk", which is what we want.
- Rename "mdp_clk" to "tv_clk" because that's slightly less confusing.
- Rename "mdp_axi_clk" to "bus_clk" because that's what we do elsewhere too.

---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_dtv_encoder.c | 31 ++++++++++---------------
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c         |  2 +-
 2 files changed, 13 insertions(+), 20 deletions(-)
drivers/gpu/drm/msm/mdp/mdp4/mdp4_dtv_encoder.c +12 -19
index 35ad78a..24258e3 100644
@@ -23,7 +23,6 @@
 
 struct mdp4_dtv_encoder {
 	struct drm_encoder base;
-	struct clk *src_clk;
 	struct clk *hdmi_clk;
 	struct clk *mdp_clk;
 	unsigned long int pixclock;
@@ -179,7 +178,6 @@ static void mdp4_dtv_encoder_disable(struct drm_encoder *encoder)
 	 */
 	mdp_irq_wait(&mdp4_kms->base, MDP4_IRQ_EXTERNAL_VSYNC);
 
-	clk_disable_unprepare(mdp4_dtv_encoder->src_clk);
 	clk_disable_unprepare(mdp4_dtv_encoder->hdmi_clk);
 	clk_disable_unprepare(mdp4_dtv_encoder->mdp_clk);
 
@@ -208,19 +206,21 @@ static void mdp4_dtv_encoder_enable(struct drm_encoder *encoder)
 
 	bs_set(mdp4_dtv_encoder, 1);
 
-	DBG("setting src_clk=%lu", pc);
+	DBG("setting mdp_clk=%lu", pc);
 
-	ret = clk_set_rate(mdp4_dtv_encoder->src_clk, pc);
+	ret = clk_set_rate(mdp4_dtv_encoder->mdp_clk, pc);
 	if (ret)
-		dev_err(dev->dev, "failed to set src_clk to %lu: %d\n", pc, ret);
-	clk_prepare_enable(mdp4_dtv_encoder->src_clk);
-	ret = clk_prepare_enable(mdp4_dtv_encoder->hdmi_clk);
-	if (ret)
-		dev_err(dev->dev, "failed to enable hdmi_clk: %d\n", ret);
+		dev_err(dev->dev, "failed to set mdp_clk to %lu: %d\n",
+			pc, ret);
+
 	ret = clk_prepare_enable(mdp4_dtv_encoder->mdp_clk);
 	if (ret)
 		dev_err(dev->dev, "failed to enabled mdp_clk: %d\n", ret);
 
+	ret = clk_prepare_enable(mdp4_dtv_encoder->hdmi_clk);
+	if (ret)
+		dev_err(dev->dev, "failed to enable hdmi_clk: %d\n", ret);
+
 	mdp4_write(mdp4_kms, REG_MDP4_DTV_ENABLE, 1);
 
 	mdp4_dtv_encoder->enabled = true;
@@ -235,7 +235,7 @@ static const struct drm_encoder_helper_funcs mdp4_dtv_encoder_helper_funcs = {
 long mdp4_dtv_round_pixclk(struct drm_encoder *encoder, unsigned long rate)
 {
 	struct mdp4_dtv_encoder *mdp4_dtv_encoder = to_mdp4_dtv_encoder(encoder);
-	return clk_round_rate(mdp4_dtv_encoder->src_clk, rate);
+	return clk_round_rate(mdp4_dtv_encoder->mdp_clk, rate);
 }
 
 /* initialize encoder */
@@ -257,13 +257,6 @@ struct drm_encoder *mdp4_dtv_encoder_init(struct drm_device *dev)
 			 DRM_MODE_ENCODER_TMDS, NULL);
 	drm_encoder_helper_add(encoder, &mdp4_dtv_encoder_helper_funcs);
 
-	mdp4_dtv_encoder->src_clk = devm_clk_get(dev->dev, "src_clk");
-	if (IS_ERR(mdp4_dtv_encoder->src_clk)) {
-		dev_err(dev->dev, "failed to get src_clk\n");
-		ret = PTR_ERR(mdp4_dtv_encoder->src_clk);
-		goto fail;
-	}
-
 	mdp4_dtv_encoder->hdmi_clk = devm_clk_get(dev->dev, "hdmi_clk");
 	if (IS_ERR(mdp4_dtv_encoder->hdmi_clk)) {
 		dev_err(dev->dev, "failed to get hdmi_clk\n");
@@ -271,9 +264,9 @@ struct drm_encoder *mdp4_dtv_encoder_init(struct drm_device *dev)
 		goto fail;
 	}
 
-	mdp4_dtv_encoder->mdp_clk = devm_clk_get(dev->dev, "mdp_clk");
+	mdp4_dtv_encoder->mdp_clk = devm_clk_get(dev->dev, "tv_clk");
 	if (IS_ERR(mdp4_dtv_encoder->mdp_clk)) {
-		dev_err(dev->dev, "failed to get mdp_clk\n");
+		dev_err(dev->dev, "failed to get tv_clk\n");
 		ret = PTR_ERR(mdp4_dtv_encoder->mdp_clk);
 		goto fail;
 	}
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +1 -1
index f145d25..388663a 100644
@@ -492,7 +492,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
 		goto fail;
 	}
 
-	mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "mdp_axi_clk");
+	mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "bus_clk");
 	if (IS_ERR(mdp4_kms->axi_clk)) {
 		dev_err(dev->dev, "failed to get axi_clk\n");
 		ret = PTR_ERR(mdp4_kms->axi_clk);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#27 lore raw

PATCH v2 3/10 dt-bindings: msm/mdp: Fix up clock related bindings

In reply to a message not in the archive

MDP5:
- Don't ask for source clock

MDP4:
- Give a better name for MDP_TV_CLK
- Remove TV_SRC
- Add MDP_AXI_CLK

---
 Documentation/devicetree/bindings/display/msm/mdp.txt | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/display/msm/mdp.txt +4 -6
index a214f6c..1d3d79d 100644
@@ -13,14 +13,13 @@ Required properties:
   For MDP4:
    * "core_clk"
    * "iface_clk"
+   * "bus_clk"
    * "lut_clk"
-   * "src_clk"
    * "hdmi_clk"
-   * "mdp_clk"
+   * "tv_clk"
   For MDP5:
    * "bus_clk"
    * "iface_clk"
-   * "core_clk_src"
    * "core_clk"
    * "lut_clk" (some MDP5 versions may not need this)
    * "vsync_clk"
@@ -45,14 +44,13 @@ Example:
 		    "core_clk",
 		    "iface_clk",
 		    "lut_clk",
-		    "src_clk",
 		    "hdmi_clk",
 		    "mdp_clk";
 		clocks =
-		    <&mmcc MDP_SRC>,
+		    <&mmcc MDP_CLK>,
 		    <&mmcc MDP_AHB_CLK>,
+		    <&mmcc MDP_AXI_CLK>,
 		    <&mmcc MDP_LUT_CLK>,
-		    <&mmcc TV_SRC>,
 		    <&mmcc HDMI_TV_CLK>,
 		    <&mmcc MDP_TV_CLK>;
 	};
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#35 lore raw

PATCH v2 4/10 drm/msm/dsi: Modify port parsing

In reply to Archit Taneja

The DSI interface is going to have two ports defined in its device node. The first port is always going to be the link between the MDP output and the input to DSI, the second port is going to be the link between the DSI output and the connected panel/bridge:

----- ----- -------

| MDP | ------> | DSI | ------> | Panel |
 -----           -----           -------
        (Port 0)       (Port 1)

Until now, there was only one Port representing the output. Update the DSI host driver such that it parses Port #1 for a connected device.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +5 -5
index a3e47ad8..4f1335e 100644
@@ -1602,12 +1602,12 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 	}
 
 	/*
-	 * Get the first endpoint node. In our case, dsi has one output port
-	 * to which the panel is connected. Don't return an error if a port
-	 * isn't defined. It's possible that there is nothing connected to
-	 * the dsi output.
+	 * Get the endpoint of the output port of the DSI host. In our case,
+	 * this is mapped to port number with reg = 1. Don't return an error if
+	 * the remote endpoint isn't defined. It's possible that there is
+	 * nothing connected to the dsi output.
 	 */
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	endpoint = of_graph_get_endpoint_by_regs(np, 1, -1);
 	if (!endpoint) {
 		dev_dbg(dev, "%s: no endpoint\n", __func__);
 		return 0;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#36 lore raw

PATCH v2 5/10 drm/msm/dsi: Use generic PHY bindings

In reply to Archit Taneja

The DSI host links to the DSI PHY device using a custom binding. Switch to the generic PHY bindings. The DSI PHY driver itself doesn't use the common PHY framework for now.

---
 drivers/gpu/drm/msm/dsi/dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi.c +1 -1
index 6edcd6f..ec572f8 100644
@@ -29,7 +29,7 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
 	struct platform_device *phy_pdev;
 	struct device_node *phy_node;
 
-	phy_node = of_parse_phandle(pdev->dev.of_node, "qcom,dsi-phy", 0);
+	phy_node = of_parse_phandle(pdev->dev.of_node, "phys", 0);
 	if (!phy_node) {
 		dev_err(&pdev->dev, "cannot find phy device\n");
 		return -ENXIO;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#37 lore raw

PATCH v2 6/10 drm/msm/dsi: Use a standard DT binding for data lanes

In reply to Archit Taneja

A more standard DT binding describing data lanes already exists here:
Documentation/devicetree/bindings/media/video-interfaces.txt

Use this binding instead of "qcom,data-lane-map". One difference in the standard binding w.r.t to the existing binding is that it provides a logical to physical mapping instead of the other way round. Tweak the code to translate the data the way we want it.

The MSM DSI DT bindings aren't used anywhere at the moment, so it's okay to update this property.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +14 -3
index 4f1335e..e6a8cd1 100644
@@ -1543,7 +1543,7 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
 	u32 lane_map[4];
 	int ret, i, len, num_lanes;
 
-	prop = of_find_property(ep, "qcom,data-lane-map", &len);
+	prop = of_find_property(ep, "data-lanes", &len);
 	if (!prop) {
 		dev_dbg(dev, "failed to find data lane mapping\n");
 		return -EINVAL;
@@ -1558,7 +1558,7 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
 
 	msm_host->num_data_lanes = num_lanes;
 
-	ret = of_property_read_u32_array(ep, "qcom,data-lane-map", lane_map,
+	ret = of_property_read_u32_array(ep, "data-lanes", lane_map,
 					 num_lanes);
 	if (ret) {
 		dev_err(dev, "failed to read lane data\n");
@@ -1573,8 +1573,19 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
 		const int *swap = supported_data_lane_swaps[i];
 		int j;
 
+		/*
+		 * the data-lanes array we get from DT has a logical->physical
+		 * mapping. The "data lane swap" register field represents
+		 * supported configurations in a physical->logical mapping.
+		 * Translate the DT mapping to what we understand and find a
+		 * configuration that works.
+		 */
 		for (j = 0; j < num_lanes; j++) {
-			if (swap[j] != lane_map[j])
+			if (lane_map[j] < 0 || lane_map[j] > 3)
+				dev_err(dev, "bad physical lane entry %u\n",
+					lane_map[j]);
+
+			if (swap[lane_map[j]] != j)
 				break;
 		}
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#30 lore raw

PATCH v2 7/10 dt-bindings: msm/dsi: Use standard data lanes binding

In reply to a message not in the archive

The "qcom,data-lane-map" binding mentioned in the document is changed to the more generic "data-lanes" property specified in:

Documentation/devicetree/bindings/media/video-interfaces.txt

The previous binding expressed physical to logical data lane mappings, the standard "data-lanes" binding uses logical to physical data lane mappings. Update the docs to reflect this change. The example had the property incorrectly named as "lanes", update this too.

The MSM DSI DT bindings aren't used anywhere at the moment, so it's okay to update this property.

---
 .../devicetree/bindings/display/msm/dsi.txt        | 37 +++++++++++-----------
 1 file changed, 19 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +19 -18
index f5948c4..9d2d2bb 100644
@@ -49,29 +49,30 @@ Optional properties:
   DSI Endpoint properties:
   - remote-endpoint: set to phandle of the connected panel's endpoint.
     See Documentation/devicetree/bindings/graph.txt for device graph info.
-  - qcom,data-lane-map: this describes how the logical DSI lanes are mapped
-    to the physical lanes on the given platform. The value contained in
-    index n describes what logical data lane is mapped to the physical data
-    lane n (DATAn, where n lies between 0 and 3).
+  - data-lanes: this describes how the physical DSI data lanes are mapped
+    to the logical lanes on the given platform. The value contained in
+    index n describes what physical lane is mapped to the logical lane n
+    (DATAn, where n lies between 0 and 3). The clock lane position is fixed
+    and can't be changed. Hence, they aren't a part of the DT bindings. For
+    more info, see Documentation/devicetree/bindings/media/video-interfaces.txt
 
     For example:
 
-    qcom,data-lane-map = <3 0 1 2>;
+    data-lanes = <3 0 1 2>;
 
-    The above mapping describes that the logical data lane DATA3 is mapped to
-    the physical data lane DATA0, logical DATA0 to physical DATA1, logic DATA1
-    to phys DATA2 and logic DATA2 to phys DATA3.
+    The above mapping describes that the logical data lane DATA0 is mapped to
+    the physical data lane DATA3, logical DATA1 to physical DATA0, logic DATA2
+    to phys DATA1 and logic DATA3 to phys DATA2.
 
     There are only a limited number of physical to logical mappings possible:
-
-    "0123": Logic 0->Phys 0; Logic 1->Phys 1; Logic 2->Phys 2; Logic 3->Phys 3;
-    "3012": Logic 3->Phys 0; Logic 0->Phys 1; Logic 1->Phys 2; Logic 2->Phys 3;
-    "2301": Logic 2->Phys 0; Logic 3->Phys 1; Logic 0->Phys 2; Logic 1->Phys 3;
-    "1230": Logic 1->Phys 0; Logic 2->Phys 1; Logic 3->Phys 2; Logic 0->Phys 3;
-    "0321": Logic 0->Phys 0; Logic 3->Phys 1; Logic 2->Phys 2; Logic 1->Phys 3;
-    "1032": Logic 1->Phys 0; Logic 0->Phys 1; Logic 3->Phys 2; Logic 2->Phys 3;
-    "2103": Logic 2->Phys 0; Logic 1->Phys 1; Logic 0->Phys 2; Logic 3->Phys 3;
-    "3210": Logic 3->Phys 0; Logic 2->Phys 1; Logic 1->Phys 2; Logic 0->Phys 3;
+    <0 1 2 3>
+    <1 2 3 0>
+    <2 3 0 1>
+    <3 0 1 2>
+    <0 3 2 1>
+    <1 0 3 2>
+    <2 1 0 3>
+    <3 2 1 0>
 
 DSI PHY:
 Required properties:
@@ -156,7 +157,7 @@ Example:
 		port {
 			dsi0_out: endpoint {
 				remote-endpoint = <&panel_in>;
-				lanes = <0 1 2 3>;
+				data-lanes = <0 1 2 3>;
 			};
 		};
 	};
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#38 lore raw

PATCH v2 8/10 dt-bindings: msm/dsi: Modify port and PHY bindings

In reply to Archit Taneja

The DSI node now has two ports that describe the connection between the MDP interface output and the DSI input, and the connection between the DSI output and the connected panel/bridge. Update the properties and the example.

Also, use generic PHY bindings instead of the custom one.

---
v2:
- Use hyphen for dsi phy name

 .../devicetree/bindings/display/msm/dsi.txt        | 45 ++++++++++++++++------
 1 file changed, 34 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +34 -11
index 9d2d2bb..6442408 100644
@@ -26,8 +26,14 @@ Required properties:
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
-- qcom,dsi-phy: phandle to DSI PHY device node
+- phys: phandle to DSI PHY device node
+- phy-names: the name of the corresponding PHY device
 - syscon-sfpb: A phandle to mmss_sfpb syscon node (only for DSIv2)
+- ports: Contains 2 DSI controller ports as child nodes. Each port contains
+  an endpoint subnode as defined in these documents:
+
+  Documentation/devicetree/bindings/graph.txt
+  Documentation/devicetree/bindings/media/video-interfaces.txt
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
@@ -44,11 +50,14 @@ Optional properties:
 - pinctrl-names: the pin control state names; should contain "default"
 - pinctrl-0: the default pinctrl state (active)
 - pinctrl-n: the "sleep" pinctrl state
-- port: DSI controller output port, containing one endpoint subnode.
+- ports: contains DSI controller input and output ports as children, each
+  containing one endpoint subnode.
 
   DSI Endpoint properties:
-  - remote-endpoint: set to phandle of the connected panel's endpoint.
+  - remote-endpoint: For port@0, set to phandle of the connected panel/bridge's
+    input endpoint. For port@1, set to the MDP interface output.
     See Documentation/devicetree/bindings/graph.txt for device graph info.
+
   - data-lanes: this describes how the physical DSI data lanes are mapped
     to the logical lanes on the given platform. The value contained in
     index n describes what physical lane is mapped to the logical lane n
@@ -129,7 +138,8 @@ Example:
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		qcom,dsi-phy = <&mdss_dsi_phy0>;
+		phys = <&mdss_dsi_phy0>;
+		phy-names ="dsi-phy";
 
 		qcom,dual-dsi-mode;
 		qcom,master-dsi;
@@ -139,6 +149,26 @@ Example:
 		pinctrl-0 = <&mdss_dsi_active>;
 		pinctrl-1 = <&mdss_dsi_suspend>;
 
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				dsi0_in: endpoint {
+					remote-endpoint = <&mdp_intf1_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				dsi0_out: endpoint {
+					remote-endpoint = <&panel_in>;
+					data-lanes = <0 1 2 3>;
+				};
+			};
+		};
+
 		panel: panel@0 {
 			compatible = "sharp,lq101r1sx01";
 			reg = <0>;
@@ -153,13 +183,6 @@ Example:
 				};
 			};
 		};
-
-		port {
-			dsi0_out: endpoint {
-				remote-endpoint = <&panel_in>;
-				data-lanes = <0 1 2 3>;
-			};
-		};
 	};
 
 	mdss_dsi_phy0: qcom,mdss_dsi_phy@fd922a00 {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#40 lore raw

PATCH v2 9/10 dt-bindings: msm/dsi: Add assigned clocks bindings

In reply to Archit Taneja

The PLL in the DSI PHY block generates 2 clock outputs (Byte and Pixel clocks) that are fed into the Multimedia Clock Controller (MMCC). The MMCC uses these as source clocks for some of its RCGs to generate clocks that finally feed to the DSI host controller.

Use the assigned clocks DT bindings to set up the MMCC RCGs that feed to the DSI host. Use the DSI PHY provided clocks to set up the parents of these assigned clocks.

---
 Documentation/devicetree/bindings/display/msm/dsi.txt | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +15 -1
index 6442408..f458929 100644
@@ -12,7 +12,6 @@ Required properties:
 - interrupts: The interrupt signal from the DSI block.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
 - clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
 - clock-names: the following clocks are required:
   * "mdp_core_clk"
   * "iface_clk"
@@ -23,6 +22,10 @@ Required properties:
   * "core_clk"
   For DSIv2, we need an additional clock:
    * "src_clk"
+- assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
+- assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
+  by a DSI PHY block.
+  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
@@ -96,6 +99,8 @@ Required properties:
   * "dsi_pll"
   * "dsi_phy"
   * "dsi_phy_regulator"
+- clock-cells: Must be 1. The DSI PHY block acts as a clock provider, creating
+  2 clocks: A byte clock (index 0), and a pixel clock (index 1).
 - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
   be 0 or 1, since we have 2 DSI PHYs at most for now.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
@@ -134,6 +139,14 @@ Example:
 			<&mmcc MDSS_AHB_CLK>,
 			<&mmcc MDSS_MDP_CLK>,
 			<&mmcc MDSS_PCLK0_CLK>;
+
+		assigned-clocks =
+				 <&mmcc BYTE0_CLK_SRC>,
+				 <&mmcc PCLK0_CLK_SRC>;
+		assigned-clock-parents =
+				 <&mdss_dsi_phy0 0>,
+				 <&mdss_dsi_phy0 1>;
+
 		vdda-supply = <&pma8084_l2>;
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
@@ -197,6 +210,7 @@ Example:
 			<0xfd922d80 0x7b>;
 		clock-names = "iface_clk";
 		clocks = <&mmcc MDSS_AHB_CLK>;
+		#clock-cells = <1>;
 		vddio-supply = <&pma8084_l12>;
 
 		qcom,dsi-phy-regulator-ldo-mode;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#32 lore raw

PATCH v2 10/10 dt-bindings: msm/dsi: Some binding doc cleanups

In reply to a message not in the archive

Some cleanups:

- Use simpler names for DT nodes in the example
- Use references instead of dumping Document links everywhere

---
 .../devicetree/bindings/display/msm/dsi.txt        | 45 +++++++++++-----------
 1 file changed, 22 insertions(+), 23 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi.txt +22 -23
index f458929..6b1cab1 100644
@@ -11,7 +11,7 @@ Required properties:
   be 0 or 1, since we have 2 DSI controllers at most for now.
 - interrupts: The interrupt signal from the DSI block.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
+- clocks: Phandles to device clocks.
 - clock-names: the following clocks are required:
   * "mdp_core_clk"
   * "iface_clk"
@@ -24,8 +24,7 @@ Required properties:
    * "src_clk"
 - assigned-clocks: Parents of "byte_clk" and "pixel_clk" for the given platform.
 - assigned-clock-parents: The Byte clock and Pixel clock PLL outputs provided
-  by a DSI PHY block.
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+  by a DSI PHY block. See [1] for details on clock bindings.
 - vdd-supply: phandle to vdd regulator device node
 - vddio-supply: phandle to vdd-io regulator device node
 - vdda-supply: phandle to vdda regulator device node
@@ -33,15 +32,11 @@ Required properties:
 - phy-names: the name of the corresponding PHY device
 - syscon-sfpb: A phandle to mmss_sfpb syscon node (only for DSIv2)
 - ports: Contains 2 DSI controller ports as child nodes. Each port contains
-  an endpoint subnode as defined in these documents:
-
-  Documentation/devicetree/bindings/graph.txt
-  Documentation/devicetree/bindings/media/video-interfaces.txt
+  an endpoint subnode as defined in [2] and [3].
 
 Optional properties:
 - panel@0: Node of panel connected to this DSI controller.
-  See files in Documentation/devicetree/bindings/display/panel/ for each supported
-  panel.
+  See files in [4] for each supported panel.
 - qcom,dual-dsi-mode: Boolean value indicating if the DSI controller is
   driving a panel which needs 2 DSI links.
 - qcom,master-dsi: Boolean value indicating if the DSI controller is driving
@@ -58,15 +53,15 @@ Optional properties:
 
   DSI Endpoint properties:
   - remote-endpoint: For port@0, set to phandle of the connected panel/bridge's
-    input endpoint. For port@1, set to the MDP interface output.
-    See Documentation/devicetree/bindings/graph.txt for device graph info.
+    input endpoint. For port@1, set to the MDP interface output. See [2] for
+    device graph info.
 
   - data-lanes: this describes how the physical DSI data lanes are mapped
     to the logical lanes on the given platform. The value contained in
     index n describes what physical lane is mapped to the logical lane n
     (DATAn, where n lies between 0 and 3). The clock lane position is fixed
-    and can't be changed. Hence, they aren't a part of the DT bindings. For
-    more info, see Documentation/devicetree/bindings/media/video-interfaces.txt
+    and can't be changed. Hence, they aren't a part of the DT bindings. See
+    [3] for more info on the data-lanes property.
 
     For example:
 
@@ -104,8 +99,7 @@ Required properties:
 - qcom,dsi-phy-index: The ID of DSI PHY hardware instance. This should
   be 0 or 1, since we have 2 DSI PHYs at most for now.
 - power-domains: Should be <&mmcc MDSS_GDSC>.
-- clocks: device clocks
-  See Documentation/devicetree/bindings/clocks/clock-bindings.txt for details.
+- clocks: Phandles to device clocks. See [1] for details on clock bindings.
 - clock-names: the following clocks are required:
   * "iface_clk"
 - vddio-supply: phandle to vdd-io regulator device node
@@ -114,11 +108,16 @@ Optional properties:
 - qcom,dsi-phy-regulator-ldo-mode: Boolean value indicating if the LDO mode PHY
   regulator is wanted.
 
+[1] Documentation/devicetree/bindings/clocks/clock-bindings.txt
+[2] Documentation/devicetree/bindings/graph.txt
+[3] Documentation/devicetree/bindings/media/video-interfaces.txt
+[4] Documentation/devicetree/bindings/display/panel/
+
 Example:
-	mdss_dsi0: qcom,mdss_dsi@fd922800 {
+	dsi0: dsi@fd922800 {
 		compatible = "qcom,mdss-dsi-ctrl";
 		qcom,dsi-host-index = <0>;
-		interrupt-parent = <&mdss_mdp>;
+		interrupt-parent = <&mdp>;
 		interrupts = <4 0>;
 		reg-names = "dsi_ctrl";
 		reg = <0xfd922800 0x200>;
@@ -144,14 +143,14 @@ Example:
 				 <&mmcc BYTE0_CLK_SRC>,
 				 <&mmcc PCLK0_CLK_SRC>;
 		assigned-clock-parents =
-				 <&mdss_dsi_phy0 0>,
-				 <&mdss_dsi_phy0 1>;
+				 <&dsi_phy0 0>,
+				 <&dsi_phy0 1>;
 
 		vdda-supply = <&pma8084_l2>;
 		vdd-supply = <&pma8084_l22>;
 		vddio-supply = <&pma8084_l12>;
 
-		phys = <&mdss_dsi_phy0>;
+		phys = <&dsi_phy0>;
 		phy-names ="dsi-phy";
 
 		qcom,dual-dsi-mode;
@@ -159,8 +158,8 @@ Example:
 		qcom,sync-dual-dsi;
 
 		pinctrl-names = "default", "sleep";
-		pinctrl-0 = <&mdss_dsi_active>;
-		pinctrl-1 = <&mdss_dsi_suspend>;
+		pinctrl-0 = <&dsi_active>;
+		pinctrl-1 = <&dsi_suspend>;
 
 		ports {
 			#address-cells = <1>;
@@ -198,7 +197,7 @@ Example:
 		};
 	};
 
-	mdss_dsi_phy0: qcom,mdss_dsi_phy@fd922a00 {
+	dsi_phy0: dsi-phy@fd922a00 {
 		compatible = "qcom,dsi-phy-28nm-hpm";
 		qcom,dsi-phy-index = <0>;
 		reg-names =
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Acked-by on v2 3/10
#28 lore raw

Re: [PATCH v2 03/10] dt-bindings: msm/mdp: Fix up clock related bindings

In reply to Archit Taneja
Quoted 7 lines · Archit Taneja

MDP5:
- Don't ask for source clock

MDP4:
- Give a better name for MDP_TV_CLK
- Remove TV_SRC
- Add MDP_AXI_CLK

This could use the explanation in the commit msg why it is okay you are breaking compatibility.

With that,

maintainer Acked-by on v2 7/10
#31 lore raw

Re: [PATCH v2 07/10] dt-bindings: msm/dsi: Use standard data lanes binding

In reply to Archit Taneja
Quoted 10 lines · Archit Taneja

The "qcom,data-lane-map" binding mentioned in the document is changed to the more generic "data-lanes" property specified in:

Documentation/devicetree/bindings/media/video-interfaces.txt

The previous binding expressed physical to logical data lane mappings, the standard "data-lanes" binding uses logical to physical data lane mappings. Update the docs to reflect this change. The example had the property incorrectly named as "lanes", update this too.

Quoted 7 lines

The MSM DSI DT bindings aren't used anywhere at the moment, so it's okay to update this property.

---
 .../devicetree/bindings/display/msm/dsi.txt        | 37 +++++++++++-----------
 1 file changed, 19 insertions(+), 18 deletions(-)
maintainer Acked-by on v2 8/10
#39 lore raw

Re: [PATCH v2 08/10] dt-bindings: msm/dsi: Modify port and PHY bindings

In reply to Archit Taneja
Quoted 7 lines · Archit Taneja

The DSI node now has two ports that describe the connection between the MDP interface output and the DSI input, and the connection between the DSI output and the connected panel/bridge. Update the properties and the example.

Also, use generic PHY bindings instead of the custom one.

Quoted 7 lines

---
v2:
- Use hyphen for dsi phy name

 .../devicetree/bindings/display/msm/dsi.txt        | 45 ++++++++++++++++------
 1 file changed, 34 insertions(+), 11 deletions(-)
maintainer Acked-by on v2 10/10
#33 lore raw

Re: [PATCH v2 10/10] dt-bindings: msm/dsi: Some binding doc cleanups

In reply to Archit Taneja
Quoted 9 lines · Archit Taneja

Some cleanups:

- Use simpler names for DT nodes in the example
- Use references instead of dumping Document links everywhere

---
 .../devicetree/bindings/display/msm/dsi.txt        | 45 +++++++++++-----------
 1 file changed, 22 insertions(+), 23 deletions(-)

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

#29 lore raw

Re: [PATCH v2 03/10] dt-bindings: msm/mdp: Fix up clock related bindings

In reply to Rob Herring
Quoted 11 lines · Rob Herring
Quoted 7 lines · Archit Taneja

MDP5:
- Don't ask for source clock

MDP4:
- Give a better name for MDP_TV_CLK
- Remove TV_SRC
- Add MDP_AXI_CLK

This could use the explanation in the commit msg why it is okay you are breaking compatibility.

Sure, I'll do that. Thanks for the reviews.

Archit

Quoted 5 lines

With that,

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation