From: Yakir Yang <ykk@rock-chips.com>
To: Inki Dae <inki.dae@samsung.com>,
Mark Yao <mark.yao@rock-chips.com>,
Jingoo Han <jingoohan1@gmail.com>,
Heiko Stuebner <heiko@sntech.de>
Cc: Thierry Reding <treding@nvidia.com>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Rob Herring <robh+dt@kernel.org>,
Andrzej Hajda <a.hajda@samsung.com>,
Joonyoung Shim <jy0922.shim@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
emil.l.velikov@gmail.com,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
Kishon Vijay Abraham I <kishon@ti.com>,
ajaynumb@gmail.com, javier@osg.samsung.com,
Andy Yan <andy.yan@rock-chips.com>,
Yakir Yang <ykk@rock-chips.com>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v10.1 15/19] drm: bridge: analogix/dp: move hpd detect to connector detect function
Date: Thu, 10 Dec 2015 16:50:08 +0800 [thread overview]
Message-ID: <1449737408-12920-1-git-send-email-ykk@rock-chips.com> (raw)
In-Reply-To: <1449470239-30667-1-git-send-email-ykk@rock-chips.com>
This change just make a little clean to make code more like
drm core expect, move hdp detect code from bridge->enable(),
and place them into connector->detect().
Note: Gustavo Padovan try to remove the controller and phy
power on function in bind time at bellow commit:
drm/exynos: do not start enabling DP at bind() phase
But for now the connector status don't hardcode to connected,
need to operate dp phy in .detect function, so we need to revert
parts if Gustavo Padovan's changes, add phy poweron
function in bind time.
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
Changes in v10.1:
- Move the panel prepare from get_modes time to bind time, and move
the panel unprepare from bridge->disable to unbind time. (Heiko)
Changes in v10:
- Revert parts of Gustavo Padovan's changes in commit:
drm/exynos: do not start enabling DP at bind() phase
Add dp phy poweron function in bind time.
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
- Take Jingoo suggest, add commit messages.
Changes in v3:
- move dp hpd detect to connector detect function.
Changes in v2: None
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 38 ++++++++++++----------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 00aee44..6a13167 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -901,12 +901,6 @@ static void analogix_dp_commit(struct analogix_dp_device *dp)
DRM_ERROR("failed to disable the panel\n");
}
- ret = analogix_dp_detect_hpd(dp);
- if (ret) {
- /* Cable has been disconnected, we're done */
- return;
- }
-
ret = analogix_dp_handle_edid(dp);
if (ret) {
dev_err(dp->dev, "unable to handle edid\n");
@@ -941,6 +935,11 @@ static void analogix_dp_commit(struct analogix_dp_device *dp)
enum drm_connector_status analogix_dp_detect(struct device *dev, bool force)
{
+ struct analogix_dp_device *dp = dev_get_drvdata(dev);
+
+ if (analogix_dp_detect_hpd(dp))
+ return connector_status_disconnected;
+
return connector_status_connected;
}
EXPORT_SYMBOL_GPL(analogix_dp_detect);
@@ -1006,13 +1005,6 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
pm_runtime_get_sync(dp->dev);
- if (dp->plat_data->panel) {
- if (drm_panel_prepare(dp->plat_data->panel)) {
- DRM_ERROR("failed to setup the panel\n");
- return;
- }
- }
-
if (dp->plat_data->power_on)
dp->plat_data->power_on(dp->plat_data);
@@ -1045,11 +1037,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->plat_data->power_off)
dp->plat_data->power_off(dp->plat_data);
- if (dp->plat_data->panel) {
- if (drm_panel_unprepare(dp->plat_data->panel))
- DRM_ERROR("failed to turnoff the panel\n");
- }
-
pm_runtime_put_sync(dp->dev);
dp->dpms_mode = DRM_MODE_DPMS_OFF;
@@ -1307,6 +1294,15 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
pm_runtime_enable(dev);
+ phy_power_on(dp->phy);
+
+ if (dp->plat_data->panel) {
+ if (drm_panel_prepare(dp->plat_data->panel)) {
+ DRM_ERROR("failed to setup the panel\n");
+ return -EBUSY;
+ }
+ }
+
ret = devm_request_irq(&pdev->dev, dp->irq, analogix_dp_irq_handler,
irq_flags, "analogix-dp", dp);
if (ret) {
@@ -1340,6 +1336,12 @@ void analogix_dp_unbind(struct device *dev, struct device *master,
struct analogix_dp_device *dp = dev_get_drvdata(dev);
analogix_dp_bridge_disable(dp->bridge);
+
+ if (dp->plat_data->panel) {
+ if (drm_panel_unprepare(dp->plat_data->panel))
+ DRM_ERROR("failed to turnoff the panel\n");
+ }
+
pm_runtime_disable(&pdev->dev);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
1.9.1
next prev parent reply other threads:[~2015-12-10 8:52 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 6:37 [PATCH v10 0/17] Add Analogix Core Display Port Driver Yakir Yang
2015-12-07 6:38 ` [PATCH v10 01/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Yakir Yang
2015-12-07 7:37 ` Yakir Yang
2015-12-07 6:38 ` [PATCH v10 02/17] drm: bridge: analogix/dp: fix some obvious code style Yakir Yang
2015-12-07 6:38 ` [PATCH v10 03/17] drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count Yakir Yang
2015-12-07 6:38 ` [PATCH v10 04/17] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range Yakir Yang
2015-12-07 6:39 ` [PATCH v10 05/17] dt-bindings: add document for analogix display port driver Yakir Yang
2015-12-08 15:01 ` Rob Herring
2015-12-09 1:02 ` Yakir Yang
2015-12-07 6:39 ` [PATCH v10 06/17] ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver Yakir Yang
2015-12-07 6:39 ` [PATCH v10 07/17] drm: rockchip: dp: add rockchip platform dp driver Yakir Yang
2015-12-07 6:39 ` [PATCH v10 08/17] dt-bindings: add document for rockchip variant of analogix_dp Yakir Yang
2015-12-08 15:03 ` Rob Herring
2015-12-09 1:05 ` Yakir Yang
2015-12-07 6:39 ` [PATCH v10 09/17] phy: Add driver for rockchip Display Port PHY Yakir Yang
2015-12-07 6:39 ` [PATCH v10 10/17] dt-bindings: add document for rockchip dp phy Yakir Yang
2015-12-08 15:06 ` Rob Herring
2015-12-09 1:16 ` Yakir Yang
2015-12-07 6:40 ` [PATCH v10 11/17] drm: rockchip: vop: add bpc and color mode setting Yakir Yang
2015-12-07 6:40 ` [PATCH v10 12/17] drm: bridge: analogix/dp: add some rk3288 special registers setting Yakir Yang
2015-12-07 6:40 ` [PATCH v10 13/17] drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 Yakir Yang
2015-12-07 6:40 ` [PATCH v10 14/17] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
2015-12-08 15:09 ` Rob Herring
2015-12-09 1:21 ` Yakir Yang
2015-12-07 6:40 ` [PATCH v10 15/17] drm: bridge: analogix/dp: move hpd detect to connector detect function Yakir Yang
2015-12-07 6:40 ` [PATCH v10 16/17] drm: bridge: analogix/dp: add edid modes parse in get_modes method Yakir Yang
2015-12-07 6:41 ` [PATCH v10 17/17] drm: bridge: analogix/dp: expand the look time for waiting AUX CH reply Yakir Yang
2015-12-07 7:52 ` [PATCH v11 01/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Yakir Yang
2015-12-08 15:33 ` [PATCH v10 0/17] Add Analogix Core Display Port Driver Heiko Stübner
[not found] ` <5667A4B6.4090708@rock-chips.com>
2015-12-09 14:51 ` Heiko Stübner
2015-12-09 2:06 ` [PATCH v10.1 05/17] dt-bindings: add document for analogix display port driver Yakir Yang
2015-12-09 2:07 ` [PATCH v10.1 08/17] dt-bindings: add document for rockchip variant of analogix_dp Yakir Yang
2015-12-09 2:07 ` [PATCH v10.1 10/17] dt-bindings: add document for rockchip dp phy Yakir Yang
2015-12-09 2:10 ` [PATCH v10.1 14/17] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
2015-12-09 4:25 ` Rob Herring
2015-12-09 5:55 ` Yakir Yang
2015-12-09 6:17 ` [PATCH v10.2 " Yakir Yang
2015-12-10 8:50 ` Yakir Yang [this message]
2015-12-10 8:52 ` [PATCH v10 18/19] drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time Yakir Yang
2015-12-10 8:55 ` [PATCH v10 19/19] drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time Yakir Yang
2015-12-15 0:06 ` [PATCH v10 0/17] Add Analogix Core Display Port Driver Heiko Stübner
2015-12-16 0:50 ` Yakir Yang
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=1449737408-12920-1-git-send-email-ykk@rock-chips.com \
--to=ykk@rock-chips.com \
--cc=a.hajda@samsung.com \
--cc=ajaynumb@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=gustavo.padovan@collabora.co.uk \
--cc=heiko@sntech.de \
--cc=inki.dae@samsung.com \
--cc=javier@osg.samsung.com \
--cc=jingoohan1@gmail.com \
--cc=jy0922.shim@samsung.com \
--cc=k.kozlowski@samsung.com \
--cc=kishon@ti.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.yao@rock-chips.com \
--cc=robh+dt@kernel.org \
--cc=sw0312.kim@samsung.com \
--cc=treding@nvidia.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
all inboxes | Powered by JetHome®