[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210710132431.265985-1-linux@fw-web.de>
Date: Sat, 10 Jul 2021 15:24:31 +0200
From: Frank Wunderlich <linux@...web.de>
To: linux-mediatek@...ts.infradead.org
Cc: Frank Wunderlich <frank-w@...lic-files.de>,
Matthias Brugger <matthias.bgg@...il.com>,
CK Hu <ck.hu@...iatek.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Enric Balletbo Serra <eballetbo@...il.com>,
Dafna Hirschfeld <dafna.hirschfeld@...labora.com>,
David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>
Subject: [PATCH] soc: mediatek: mmsys: fix HDMI output on mt7623/bananapi-r2
From: Frank Wunderlich <frank-w@...lic-files.de>
HDMI output was broken on mt7623/BPI-R2 in 5.13 because function for
special output selection (mtk_mmsys_ddp_sout_sel) was dropped.
This function wrote 3 registers at one time and so it is not compatible
with the array-approach.
I re-added the old function and call this after the default routing table
was applied. This default routing table can still be used as the only
connection handled by mmsys on BPI-R2 is OVL0->RDMA0 and this is already
present in the default routing table
Fixes: 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers")
Signed-off-by: Frank Wunderlich <frank-w@...lic-files.de>
---
drivers/soc/mediatek/mtk-mmsys.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index 080660ef11bf..f91b7fdd417a 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -57,6 +57,25 @@ struct mtk_mmsys {
const struct mtk_mmsys_driver_data *data;
};
+static void mtk_mmsys_ddp_sout_sel(struct device *dev,
+ enum mtk_ddp_comp_id cur,
+ enum mtk_ddp_comp_id next)
+{
+ struct mtk_mmsys *mmsys = dev_get_drvdata(dev);
+
+ if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DSI0) {
+ writel_relaxed(BLS_TO_DSI_RDMA1_TO_DPI1,
+ mmsys->regs + DISP_REG_CONFIG_OUT_SEL);
+ } else if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DPI0) {
+ writel_relaxed(BLS_TO_DPI_RDMA1_TO_DSI,
+ mmsys->regs + DISP_REG_CONFIG_OUT_SEL);
+ writel_relaxed(DSI_SEL_IN_RDMA,
+ mmsys->regs + DISP_REG_CONFIG_DSI_SEL);
+ writel_relaxed(DPI_SEL_IN_BLS,
+ mmsys->regs + DISP_REG_CONFIG_DPI_SEL);
+ }
+}
+
void mtk_mmsys_ddp_connect(struct device *dev,
enum mtk_ddp_comp_id cur,
enum mtk_ddp_comp_id next)
@@ -71,6 +90,8 @@ void mtk_mmsys_ddp_connect(struct device *dev,
reg = readl_relaxed(mmsys->regs + routes[i].addr) | routes[i].val;
writel_relaxed(reg, mmsys->regs + routes[i].addr);
}
+
+ mtk_mmsys_ddp_sout_sel(dev, cur, next);
}
EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_connect);
--
2.25.1
Powered by blists - more mailing lists