MediaTek Kompanio 1200 MT8195 - DisplayPort clocks fixes
Subsystems (2)
v3 cover MediaTek Kompanio 1200 MT8195 - DisplayPort clocks fixes
This series fixes the two DPINTF clocks to propagate rate change requests to their own parent (and also fixes vdo1_dpintf's parent name).
This is needed in order to stay clean in the DisplayPort driver and avoid adding (now useless) custom handling of clocks reparenting based on the wanted final clock rate.
Original v3: https://lore.kernel.org/all/[email protected]/
Changes in v3:
- Fixed tags ordering.
AngeloGioacchino Del Regno (2):
clk: mediatek: clk-mt8195-vdo0: Set rate on vdo0_dp_intf0_dp_intf's
parent
clk: mediatek: clk-mt8195-vdo1: Reparent and set rate on vdo1_dpintf's
parent
drivers/clk/mediatek/clk-mt8195-vdo0.c | 7 ++++++- drivers/clk/mediatek/clk-mt8195-vdo1.c | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.1
PATCH RESEND v3 1/2 clk: mediatek: clk-mt8195-vdo0: Set rate on vdo0_dp_intf0_dp_intf's parent
From: AngeloGioacchino Del Regno <[email protected]>
Add the CLK_SET_RATE_PARENT flag to the CLK_VDO0_DP_INTF0_DP_INTF
clock: this is required to trigger clock source selection on CLK_TOP_EDP, while avoiding to manage the enablement of the former separately from the latter in the displayport driver.
--- drivers/clk/mediatek/clk-mt8195-vdo0.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/clk/mediatek/clk-mt8195-vdo0.c +6 -1
@@ -37,6 +37,10 @@ static const struct mtk_gate_regs vdo0_2_cg_regs = {#define GATE_VDO0_2 (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &vdo0_2_cg_regs, _shift, &mtk_clk_gate_ops_setclr) +#define GATE_VDO0_2_FLAGS (_id, _name, _parent, _shift, _flags) \ + GATE_MTK_FLAGS(_id, _name, _parent, &vdo0_2_cg_regs, _shift, \ + &mtk_clk_gate_ops_setclr, _flags) +static const struct mtk_gate vdo0_clks[] = {/* VDO0_0 */ GATE_VDO0_0 (CLK_VDO0_DISP_OVL0 ,"vdo0_disp_ovl0" ,"top_vpp" ,0 ),
@@ -85,7 +89,8 @@ static const struct mtk_gate vdo0_clks[] = {/* VDO0_2 */ GATE_VDO0_2 (CLK_VDO0_DSI0_DSI ,"vdo0_dsi0_dsi" ,"top_dsi_occ" ,0 ),GATE_VDO0_2 (CLK_VDO0_DSI1_DSI ,"vdo0_dsi1_dsi" ,"top_dsi_occ" ,8 ), - GATE_VDO0_2(CLK_VDO0_DP_INTF0_DP_INTF, "vdo0_dp_intf0_dp_intf", "top_edp", 16), +GATE_VDO0_2_FLAGS (CLK_VDO0_DP_INTF0_DP_INTF ,"vdo0_dp_intf0_dp_intf" , + "top_edp", 16, CLK_SET_RATE_PARENT), };static int clk_mt8195_vdo0_probe (struct platform_device *pdev)
Signature · 1 line
2.37.1
Re: [RESEND PATCH v3 1/2] clk: mediatek: clk-mt8195-vdo0: Set rate on vdo0_dp_intf0_dp_intf's parent
Quoting Nícolas F. R. A. Prado (2022-08-16 12:32:55)
Quoted 7 lines
From: AngeloGioacchino Del Regno <[email protected]>
Add the
CLK_SET_RATE_PARENTflag to theCLK_VDO0_DP_INTF0_DP_INTF
clock: this is required to trigger clock source selection onCLK_TOP_EDP, while avoiding to manage the enablement of the former separately from the latter in the displayport driver.
Quoted 7 lines
Fixes 70282c90d4a2 ("clk: mediatek: Add MT8195 vdosys0 clock support")Signed-off-by AngeloGioacchino Del Regno <[email protected]>Tested-by Bo-Chen Chen <[email protected]>Reviewed-by Bo-Chen Chen <[email protected]>Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Applied to clk-next
PATCH RESEND v3 2/2 clk: mediatek: clk-mt8195-vdo1: Reparent and set rate on vdo1_dpintf's parent
In reply to Nícolas F. R. A. PradoFrom: AngeloGioacchino Del Regno <[email protected]>
Like it was done for the vdo0_dp_intf0_dp_intf clock (used for eDP), add the CLK_SET_RATE_PARENT flag to CLK_VDO1_DPINTF (used for DP) and also fix its parent clock name as it has to be "top_dp" for two reasons:
- This is its real parent!
- Likewise to eDP/VDO0 counterpart, we need clock source selection on CLK_TOP_DP.
--- drivers/clk/mediatek/clk-mt8195-vdo1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/mediatek/clk-mt8195-vdo1.c +5 -1
@@ -43,6 +43,10 @@ static const struct mtk_gate_regs vdo1_3_cg_regs = {#define GATE_VDO1_2 (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &vdo1_2_cg_regs, _shift, &mtk_clk_gate_ops_setclr) +#define GATE_VDO1_2_FLAGS (_id, _name, _parent, _shift, _flags) \ + GATE_MTK_FLAGS(_id, _name, _parent, &vdo1_2_cg_regs, _shift, \ + &mtk_clk_gate_ops_setclr, _flags) +#define GATE_VDO1_3 (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &vdo1_3_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
@@ -99,7 +103,7 @@ static const struct mtk_gate vdo1_clks[] = {GATE_VDO1_2 (CLK_VDO1_DISP_MONITOR_DPI0 ,"vdo1_disp_monitor_dpi0" ,"top_vpp" ,1 ),GATE_VDO1_2 (CLK_VDO1_DPI1 ,"vdo1_dpi1" ,"top_vpp" ,8 ),GATE_VDO1_2 (CLK_VDO1_DISP_MONITOR_DPI1 ,"vdo1_disp_monitor_dpi1" ,"top_vpp" ,9 ), -GATE_VDO1_2 (CLK_VDO1_DPINTF ,"vdo1_dpintf" ,"top_vpp" ,16 ), +GATE_VDO1_2_FLAGS (CLK_VDO1_DPINTF ,"vdo1_dpintf" ,"top_dp" ,16 ,CLK_SET_RATE_PARENT ),GATE_VDO1_2 (CLK_VDO1_DISP_MONITOR_DPINTF ,"vdo1_disp_monitor_dpintf" ,"top_vpp" ,17 ),/* VDO1_3 */ GATE_VDO1_3(CLK_VDO1_26M_SLOW, "vdo1_26m_slow", "clk26m", 8),
Signature · 1 line
2.37.1
Re: [RESEND PATCH v3 2/2] clk: mediatek: clk-mt8195-vdo1: Reparent and set rate on vdo1_dpintf's parent
Quoting Nícolas F. R. A. Prado (2022-08-16 12:32:56)
Quoted 10 lines
From: AngeloGioacchino Del Regno <[email protected]>
Like it was done for the
vdo0_dp_intf0_dp_intfclock (used for eDP), add theCLK_SET_RATE_PARENTflag toCLK_VDO1_DPINTF(used for DP) and also fix its parent clock name as it has to be "top_dp" for two reasons:
- This is its real parent!
- Likewise to eDP/VDO0 counterpart, we need clock source selection onCLK_TOP_DP.
Quoted 6 lines
Fixes 269987505ba9 ("clk: mediatek: Add MT8195 vdosys1 clock support")Signed-off-by AngeloGioacchino Del Regno <[email protected]>Tested-by Bo-Chen Chen <[email protected]>Reviewed-by Bo-Chen Chen <[email protected]>Signed-off-by Nícolas F. R. A. Prado <[email protected]>---
Applied to clk-next