summaryrefslogtreecommitdiff
path: root/drivers/soc/mediatek/mtk-mmsys.h
diff options
context:
space:
mode:
authorHsiao Chien Sung <shawn.sung@mediatek.com>2023-10-24 16:00:32 +0300
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2023-12-11 13:36:11 +0300
commitc0349314d5a0ddabdde136c1ac72e0254beb36bb (patch)
treebdf53bf01468db0fbc01d43df08a1cb4071039a7 /drivers/soc/mediatek/mtk-mmsys.h
parentdfd78c1e1c1628b5c5b4d7b4cd4d51f3ef6593ff (diff)
downloadlinux-c0349314d5a0ddabdde136c1ac72e0254beb36bb.tar.xz
soc: mediatek: Support MT8188 VDOSYS1 in mtk-mmsys
- Add register definitions for MT8188 - Add VDOSYS1 routing table - Update MUTEX definitions accordingly - Set VSYNC length from 0x40 (default) to 1 since ETHDR is bypassed Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Diffstat (limited to 'drivers/soc/mediatek/mtk-mmsys.h')
-rw-r--r--drivers/soc/mediatek/mtk-mmsys.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
index 6725403d2e3a..9d8507f98b7a 100644
--- a/drivers/soc/mediatek/mtk-mmsys.h
+++ b/drivers/soc/mediatek/mtk-mmsys.h
@@ -86,6 +86,34 @@ struct mtk_mmsys_routes {
u32 val;
};
+/**
+ * struct mtk_mmsys_driver_data - Settings of the mmsys
+ * @clk_driver: Clock driver name that the mmsys is using
+ * (defined in drivers/clk/mediatek/clk-*.c).
+ * @routes: Routing table of the mmsys.
+ * It provides mux settings from one module to another.
+ * @num_routes: Array size of the routes.
+ * @sw0_rst_offset: Register offset for the reset control.
+ * @num_resets: Number of reset bits that are defined
+ * @is_vppsys: Whether the mmsys is VPPSYS (Video Processing Pipe)
+ * or VDOSYS (Video). Only VDOSYS needs to be added to drm driver.
+ * @vsync_len: VSYNC length of the MIXER.
+ * VSYNC is usually triggered by the connector, so its length is a
+ * fixed value when the frame rate is decided, but ETHDR and
+ * MIXER generate their own VSYNC due to hardware design, therefore
+ * MIXER has to sync with ETHDR by adjusting VSYNC length.
+ * On MT8195, there is no such setting so we use the gap between
+ * falling edge and rising edge of SOF (Start of Frame) signal to
+ * do the job, but since MT8188, VSYNC_LEN setting is introduced to
+ * solve the problem and is given 0x40 (ticks) as the default value.
+ * Please notice that this value has to be set to 1 (minimum) if
+ * ETHDR is bypassed, otherwise MIXER could wait too long and causing
+ * underflow.
+ *
+ * Each MMSYS (multi-media system) may have different settings, they may use
+ * different clock sources, mux settings, reset control ...etc., and these
+ * differences are all stored here.
+ */
struct mtk_mmsys_driver_data {
const char *clk_driver;
const struct mtk_mmsys_routes *routes;
@@ -93,6 +121,7 @@ struct mtk_mmsys_driver_data {
const u16 sw0_rst_offset;
const u32 num_resets;
const bool is_vppsys;
+ const u8 vsync_len;
};
/*