Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1706278ybx; Thu, 7 Nov 2019 16:04:31 -0800 (PST) X-Google-Smtp-Source: APXvYqys0u2PT1hj2qeL1eQPsRTOk9v000GuhupX0WdYfLYVj6vMX1/1tZuHjfq1BH7+V7qmS5U5 X-Received: by 2002:a17:906:e2c2:: with SMTP id gr2mr5905728ejb.31.1573171471309; Thu, 07 Nov 2019 16:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573171471; cv=none; d=google.com; s=arc-20160816; b=KDH06JmqUOWUlnHcUJCQ5F+kWGPDvu9qe/EXMN+/lCBXUgyBGgqZneiozO//n0xl86 vL5ZhsTGrwXLUul5lAslYodH9f4g+IfiCjHJBghOtB69hh5kYTWJMaJBMuOUQnfrEadb HAmrgoiqOKxEjSZxivbmA6qDw4LtLhkuTMd6FuJ5lGU2KAO3xQ6ZlaHiJc3oAQ7qD6lr OUU0aYf0w+69NWhHXFO4VFr7Bqj1t2wFP/NwfYOBEX3mB2eKFXocn6hth0Ttwh4/YxVn jdUgOPnEjPopX98P/xC1okSNwgFXkU76+abKp0OckdwAGDyLX9xWsaWIjjYRngqaSsTE BTFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zeeCECcFHbJI7EzAMnlxUIMGYm4wnd3CYCv+bOns8dM=; b=MZolOyL3Myoc7dqeJk97F69WA5thw8O9ZKNapRbY9WCktE3RoDk2q2q9/sLhBrIjkz 7zUKVaXUkHaopFgp1nCXzB80NjMYkRYuVep/vFmrNBJHol8jbgdGl8L8iaK3j0lRiFnd GgS/oKSgu3c1ql//5K22PetQ8L+hri1gcegkHDfmYboXO4X+EUwq5ztikk1xLb/e+WOQ DHNhvem/B9i1zKfd6c67+37mKOrH5TEiXGh+5OOLxAndswqh88m3pYUgVnEncUB4Z05P o8B7arbawmdMjdknuS2zTUF5CP31h9vT0Cy/PS1dQ1ECqzm6ih8xtch8un4WQyUQqcxB 3dbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30si2916267edj.289.2019.11.07.16.04.07; Thu, 07 Nov 2019 16:04:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbfKHAD0 (ORCPT + 99 others); Thu, 7 Nov 2019 19:03:26 -0500 Received: from gloria.sntech.de ([185.11.138.130]:49874 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbfKHADY (ORCPT ); Thu, 7 Nov 2019 19:03:24 -0500 Received: from ip5f5a6266.dynamic.kabel-deutschland.de ([95.90.98.102] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iSrk0-00065H-8a; Fri, 08 Nov 2019 01:03:04 +0100 From: Heiko Stuebner To: dri-devel@lists.freedesktop.org, a.hajda@samsung.com Cc: hjc@rock-chips.com, robh+dt@kernel.org, mark.rutland@arm.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, philippe.cornu@st.com, yannick.fertre@st.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, heiko@sntech.de, christoph.muellner@theobroma-systems.com, Heiko Stuebner Subject: [PATCH v2 1/5] drm/bridge/synopsys: dsi: move phy_ops callbacks around panel enablement Date: Fri, 8 Nov 2019 01:02:49 +0100 Message-Id: <20191108000253.8560-2-heiko.stuebner@theobroma-systems.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108000253.8560-1-heiko.stuebner@theobroma-systems.com> References: <20191108000253.8560-1-heiko.stuebner@theobroma-systems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If implementation-specific phy_ops need to be defined they probably should be enabled before trying to talk to the panel and disabled only after the panel was disabled. Right now they are enabled last and disabled first, so might make it impossible to talk to some panels - example for this being the px30 with an external Innosilicon dphy that needs the phy to be enabled to transfer commands to the panel. So move the calls appropriately. Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 675442bfc1bd..49f5600a1dea 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -797,9 +797,6 @@ static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge) struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops; - if (phy_ops->power_off) - phy_ops->power_off(dsi->plat_data->priv_data); - /* * Switch to command mode before panel-bridge post_disable & * panel unprepare. @@ -816,6 +813,9 @@ static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge) */ dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge); + if (phy_ops->power_off) + phy_ops->power_off(dsi->plat_data->priv_data); + if (dsi->slave) { dw_mipi_dsi_disable(dsi->slave); clk_disable_unprepare(dsi->slave->pclk); @@ -882,6 +882,9 @@ static void dw_mipi_dsi_mode_set(struct dw_mipi_dsi *dsi, /* Switch to cmd mode for panel-bridge pre_enable & panel prepare */ dw_mipi_dsi_set_mode(dsi, 0); + + if (phy_ops->power_on) + phy_ops->power_on(dsi->plat_data->priv_data); } static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, @@ -898,15 +901,11 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, static void dw_mipi_dsi_bridge_enable(struct drm_bridge *bridge) { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); - const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops; /* Switch to video mode for panel-bridge enable & panel enable */ dw_mipi_dsi_set_mode(dsi, MIPI_DSI_MODE_VIDEO); if (dsi->slave) dw_mipi_dsi_set_mode(dsi->slave, MIPI_DSI_MODE_VIDEO); - - if (phy_ops->power_on) - phy_ops->power_on(dsi->plat_data->priv_data); } static enum drm_mode_status -- 2.23.0