From: Chris Zhong <zyw@rock-chips.com>
To: dianders@chromium.org, tfiga@chromium.org, heiko@sntech.de,
yzq@rock-chips.com, mark.rutland@arm.com,
devicetree@vger.kernel.org, robh+dt@kernel.org,
galak@codeaurora.org, pawel.moll@arm.com, seanpaul@chromium.org
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org,
Chris Zhong <zyw@rock-chips.com>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 06/11] drm/rockchip/dsi: return probe defer if attach panel failed
Date: Mon, 16 Jan 2017 18:08:26 +0800 [thread overview]
Message-ID: <1484561311-494-7-git-send-email-zyw@rock-chips.com> (raw)
In-Reply-To: <1484561311-494-1-git-send-email-zyw@rock-chips.com>
From: Mark Yao <mark.yao@rock-chips.com>
Return -EINVAL would cause mipi dsi bad behavior, probe defer
to ensure mipi find the correct mode,
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index d2a3efb..5e3f031 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -549,10 +549,14 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host,
dsi->channel = device->channel;
dsi->format = device->format;
dsi->panel = of_drm_find_panel(device->dev.of_node);
- if (dsi->panel)
- return drm_panel_attach(dsi->panel, &dsi->connector);
+ if (!dsi->panel) {
+ DRM_ERROR("failed to find panel\n");
+ return -EPROBE_DEFER;
+ }
- return -EINVAL;
+ drm_panel_attach(dsi->panel, &dsi->connector);
+
+ return 0;
}
static int dw_mipi_dsi_host_detach(struct mipi_dsi_host *host,
@@ -560,7 +564,8 @@ static int dw_mipi_dsi_host_detach(struct mipi_dsi_host *host,
{
struct dw_mipi_dsi *dsi = host_to_dsi(host);
- drm_panel_detach(dsi->panel);
+ if (dsi->panel)
+ drm_panel_detach(dsi->panel);
return 0;
}
--
2.6.3
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-01-16 10:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 10:08 [PATCH v2 0/11] Rockchip dw-mipi-dsi driver Chris Zhong
2017-01-16 10:08 ` [PATCH v2 01/11] dt-bindings: add rk3399 support for dw-mipi-rockchip Chris Zhong
2017-01-19 15:42 ` Rob Herring
2017-01-16 10:08 ` [PATCH v2 02/11] drm/rockchip/dsi: dw-mipi: support RK3399 mipi dsi Chris Zhong
2017-01-16 10:08 ` [PATCH v2 03/11] drm/rockchip/dsi: remove mode_valid function Chris Zhong
2017-01-16 10:08 ` [PATCH v2 04/11] dt-bindings: add power domain node for dw-mipi-rockchip Chris Zhong
2017-01-16 10:08 ` [PATCH v2 05/11] drm/rockchip/dsi: add dw-mipi power domain support Chris Zhong
2017-01-16 10:08 ` Chris Zhong [this message]
2017-01-16 10:08 ` [PATCH v2 07/11] drm/rockchip/dsi: fix mipi display can't found at init time Chris Zhong
2017-01-16 10:08 ` [PATCH v2 08/11] drm/rockchip/dsi: fix the issue can not send commands Chris Zhong
2017-01-16 10:08 ` [PATCH v2 09/11] drm/rockchip/dsi: decrease the value of Ths-prepare Chris Zhong
2017-01-16 10:08 ` [PATCH v2 10/11] drm/rockchip/dsi: fix phy clk lane stop state timeout Chris Zhong
2017-01-16 10:08 ` [PATCH v2 11/11] drm/rockchip/dsi: fix insufficient bandwidth of some panel Chris Zhong
2017-01-16 12:44 ` John Keeping
2017-01-17 9:31 ` Chris Zhong
[not found] ` <587DE489.2010004-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-01-17 10:54 ` John Keeping
2017-02-15 4:12 ` Chris Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484561311-494-7-git-send-email-zyw@rock-chips.com \
--to=zyw@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=galak@codeaurora.org \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=seanpaul@chromium.org \
--cc=tfiga@chromium.org \
--cc=yzq@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).