Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321AbbFVOy4 (ORCPT ); Mon, 22 Jun 2015 10:54:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36070 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753038AbbFVOyg (ORCPT ); Mon, 22 Jun 2015 10:54:36 -0400 From: Archit Taneja To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, hali@codeaurora.org, linux-kernel@vger.kernel.org, Archit Taneja Subject: [PATCH 2/3] drm/msm: dsi host: Use device graph parsing to parse connected panel Date: Mon, 22 Jun 2015 20:24:20 +0530 Message-Id: <1434984861-22948-3-git-send-email-architt@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1434984861-22948-1-git-send-email-architt@codeaurora.org> References: <1434984861-22948-1-git-send-email-architt@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5369 Lines: 172 The dsi host looks for the connected panel node by parsing for a child named 'panel'. This hierarchy isn't very flexible. The connected panel is forced to be a child to the dsi host, and hence, a mipi dsi device. This isn't suitable for dsi devices that don't use mipi dsi as their control bus. Follow the of_graph approach of creating ports and endpoints to represent the connections between the dsi host and the panel connected to it. In our case, the dsi host will only have one output port, linked to the panel's input port. Update DT binding documentation with device graph usage info. Signed-off-by: Archit Taneja --- Documentation/devicetree/bindings/drm/msm/dsi.txt | 15 ++++++ drivers/gpu/drm/msm/dsi/dsi_host.c | 64 +++++++++++++++++------ 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/drm/msm/dsi.txt b/Documentation/devicetree/bindings/drm/msm/dsi.txt index 6ccd860..c88ec3c 100644 --- a/Documentation/devicetree/bindings/drm/msm/dsi.txt +++ b/Documentation/devicetree/bindings/drm/msm/dsi.txt @@ -25,6 +25,9 @@ Required properties: - 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 +- port: DSI controller output port. This contains one endpoint subnode, with its + remote-endpoint set to the phandle of the connected panel's endpoint. + See Documentation/devicetree/bindings/graph.txt for device graph info. Optional properties: - panel@0: Node of panel connected to this DSI controller. @@ -101,6 +104,18 @@ Example: power-supply = <...>; backlight = <...>; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + }; + + port { + dsi0_out: endpoint { + remote-endpoint = <&panel_in>; + }; }; }; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 1751659..ab0b23b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include