aboutsummaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173/dsi.c
diff options
context:
space:
mode:
authorJitao Shi <jitao.shi@mediatek.com>2016-07-15 14:23:53 +0800
committerMartin Roth <martinroth@google.com>2016-07-26 17:48:38 +0200
commit700b03962baac585c0c0dc1df764da5664574291 (patch)
tree3fe240a67463d36fdd1ef133a2cbc2f88f997d50 /src/soc/mediatek/mt8173/dsi.c
parent4cfde2a389ff348137db9c89db2e7517d62fe608 (diff)
meditek/mt8173: dsi: set mipi pin driving control on
We set this driving control to prevent signal attenuation caused by LVDS DRV termination. When DA_LVDSTX_PWR_ON is not set, LVSH has no power and LVDS DRV termination status is unknown (floating). This creates a chance that MIPI output would be influenced. The DSI's LP signal will be half voltage attenuation. There will be no display on panel. When DA_LVDSTX_PWR_ON is set, LVSH and LVDS DRV termination are effective and termination is fixed OFF. The DSI won't be influenced. We only need to set this register once, so we set it here to prevent repeatedly setting in the kernel when the system goes to recovery mode. BUG=chrome-os-partner:55296 BRANCH=none TEST=build pass elm and show ui Change-Id: Ie3ccf6fb611dd5a1e2c02b7825d42a92e61268c0 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: 0d25a27f300acc4b65a894110d3ee0cc9676cd12 Original-Change-Id: Ie71f9cc41924787be8539c576392034320b57a49 Original-Signed-off-by: Jitao Shi <jitao.shi@mediatek.com> Original-Reviewed-on: https://chromium-review.googlesource.com/360850 Original-Commit-Ready: jitao shi <jitao.shi@mediatek.com> Original-Tested-by: jitao shi <jitao.shi@mediatek.com> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/15807 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8173/dsi.c')
-rw-r--r--src/soc/mediatek/mt8173/dsi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8173/dsi.c b/src/soc/mediatek/mt8173/dsi.c
index 1d195719b0..3500bf1d01 100644
--- a/src/soc/mediatek/mt8173/dsi.c
+++ b/src/soc/mediatek/mt8173/dsi.c
@@ -20,6 +20,7 @@
#include <soc/i2c.h>
#include <soc/gpio.h>
#include <soc/dsi.h>
+#include <timer.h>
static int mtk_dsi_phy_clk_setting(u32 format, u32 lanes,
const struct edid *edid)
@@ -298,3 +299,21 @@ int mtk_dsi_init(u32 mode_flags, u32 format, u32 lanes,
return 0;
}
+
+void mtk_dsi_pin_drv_ctrl(void)
+{
+ struct stopwatch sw;
+
+ setbits_le32(&lvds_tx1->vopll_ctl3, RG_DA_LVDSTX_PWR_ON);
+
+ stopwatch_init_usecs_expire(&sw, 1000);
+
+ do {
+ if (stopwatch_expired(&sw)) {
+ printk(BIOS_ERR, "enable lvdstx_power failed!!!\n");
+ return;
+ }
+ } while ((read32(&lvds_tx1->vopll_ctl3) & RG_AD_LVDSTX_PWR_ACK) == 0);
+
+ clrbits_le32(&lvds_tx1->vopll_ctl3, RG_DA_LVDS_ISO_EN);
+}