aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-04-07 09:28:50 -0400
committerInki Dae <inki.dae@samsung.com>2015-04-12 22:39:42 -0400
commit1c363c7cccf64128087002b0779986ad16aff6dc (patch)
tree1f1188f0361bf0acde927ae5c4e0cb3843169f19 /drivers/gpu
parentd1222842c1c7c2760ebd412238d9bb6234e6742c (diff)
drm/exynos: Enable DP clock to fix display on Exynos5250 and other
After adding display power domain for Exynos5250 in commit 2d2c9a8d0a4f ("ARM: dts: add display power domain for exynos5250") the display on Chromebook Snow and others stopped working after boot. The reason for this suggested Andrzej Hajda: the DP clock was disabled. This clock is required by Display Port and is enabled by bootloader. However when FIMD driver probing was deferred, the display power domain was turned off. This effectively reset the value of DP clock enable register. When exynos-dp is later probed, the clock is not enabled and display is not properly configured: exynos-dp 145b0000.dp-controller: Timeout of video streamclk ok exynos-dp 145b0000.dp-controller: unable to config video Fixes: 2d2c9a8d0a4f ("ARM: dts: add display power domain for exynos5250") Cc: <stable@vger.kernel.org> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_dp_core.c10
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c19
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.h15
3 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
index bf17a60b40ed..1dbfba58f909 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -32,10 +32,16 @@
32#include <drm/bridge/ptn3460.h> 32#include <drm/bridge/ptn3460.h>
33 33
34#include "exynos_dp_core.h" 34#include "exynos_dp_core.h"
35#include "exynos_drm_fimd.h"
35 36
36#define ctx_from_connector(c) container_of(c, struct exynos_dp_device, \ 37#define ctx_from_connector(c) container_of(c, struct exynos_dp_device, \
37 connector) 38 connector)
38 39
40static inline struct exynos_drm_crtc *dp_to_crtc(struct exynos_dp_device *dp)
41{
42 return to_exynos_crtc(dp->encoder->crtc);
43}
44
39static inline struct exynos_dp_device * 45static inline struct exynos_dp_device *
40display_to_dp(struct exynos_drm_display *d) 46display_to_dp(struct exynos_drm_display *d)
41{ 47{
@@ -1070,6 +1076,8 @@ static void exynos_dp_poweron(struct exynos_dp_device *dp)
1070 } 1076 }
1071 } 1077 }
1072 1078
1079 fimd_dp_clock_enable(dp_to_crtc(dp), true);
1080
1073 clk_prepare_enable(dp->clock); 1081 clk_prepare_enable(dp->clock);
1074 exynos_dp_phy_init(dp); 1082 exynos_dp_phy_init(dp);
1075 exynos_dp_init_dp(dp); 1083 exynos_dp_init_dp(dp);
@@ -1094,6 +1102,8 @@ static void exynos_dp_poweroff(struct exynos_dp_device *dp)
1094 exynos_dp_phy_exit(dp); 1102 exynos_dp_phy_exit(dp);
1095 clk_disable_unprepare(dp->clock); 1103 clk_disable_unprepare(dp->clock);
1096 1104
1105 fimd_dp_clock_enable(dp_to_crtc(dp), false);
1106
1097 if (dp->panel) { 1107 if (dp->panel) {
1098 if (drm_panel_unprepare(dp->panel)) 1108 if (drm_panel_unprepare(dp->panel))
1099 DRM_ERROR("failed to turnoff the panel\n"); 1109 DRM_ERROR("failed to turnoff the panel\n");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf29a44cf77b..6d2858ae6ad5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -33,6 +33,7 @@
33#include "exynos_drm_crtc.h" 33#include "exynos_drm_crtc.h"
34#include "exynos_drm_plane.h" 34#include "exynos_drm_plane.h"
35#include "exynos_drm_iommu.h" 35#include "exynos_drm_iommu.h"
36#include "exynos_drm_fimd.h"
36 37
37/* 38/*
38 * FIMD stands for Fully Interactive Mobile Display and 39 * FIMD stands for Fully Interactive Mobile Display and
@@ -1191,6 +1192,24 @@ static int fimd_remove(struct platform_device *pdev)
1191 return 0; 1192 return 0;
1192} 1193}
1193 1194
1195void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)
1196{
1197 struct fimd_context *ctx = crtc->ctx;
1198 u32 val;
1199
1200 /*
1201 * Only Exynos 5250, 5260, 5410 and 542x requires enabling DP/MIE
1202 * clock. On these SoCs the bootloader may enable it but any
1203 * power domain off/on will reset it to disable state.
1204 */
1205 if (ctx->driver_data != &exynos5_fimd_driver_data)
1206 return;
1207
1208 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
1209 writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);
1210}
1211EXPORT_SYMBOL_GPL(fimd_dp_clock_enable);
1212
1194struct platform_driver fimd_driver = { 1213struct platform_driver fimd_driver = {
1195 .probe = fimd_probe, 1214 .probe = fimd_probe,
1196 .remove = fimd_remove, 1215 .remove = fimd_remove,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.h b/drivers/gpu/drm/exynos/exynos_drm_fimd.h
new file mode 100644
index 000000000000..b4fcaa568456
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef _EXYNOS_DRM_FIMD_H_
11#define _EXYNOS_DRM_FIMD_H_
12
13extern void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable);
14
15#endif /* _EXYNOS_DRM_FIMD_H_ */