mirror of https://gitee.com/openkylin/linux.git
drm/mxsfb: Move axi clk enable/disable to crtc enable/disable
The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and immediately reenabled in mxsfb_enable_controller. Avoid this by moving the handling of axi clk one level up to mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for symmetry. This shouldn't have any functional effect. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Stefan Agner <stefan@agner.ch> Link: https://patchwork.freedesktop.org/patch/msgid/985c1f1cad250bd9ca154b3e4b3f913c310eeabd.1537191359.git.leonard.crestez@nxp.com
This commit is contained in:
parent
9c942096ba
commit
626a2c52f1
|
@ -129,7 +129,6 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb)
|
||||||
if (mxsfb->clk_disp_axi)
|
if (mxsfb->clk_disp_axi)
|
||||||
clk_prepare_enable(mxsfb->clk_disp_axi);
|
clk_prepare_enable(mxsfb->clk_disp_axi);
|
||||||
clk_prepare_enable(mxsfb->clk);
|
clk_prepare_enable(mxsfb->clk);
|
||||||
mxsfb_enable_axi_clk(mxsfb);
|
|
||||||
|
|
||||||
/* If it was disabled, re-enable the mode again */
|
/* If it was disabled, re-enable the mode again */
|
||||||
writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET);
|
writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET);
|
||||||
|
@ -159,8 +158,6 @@ static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb)
|
||||||
reg &= ~VDCTRL4_SYNC_SIGNALS_ON;
|
reg &= ~VDCTRL4_SYNC_SIGNALS_ON;
|
||||||
writel(reg, mxsfb->base + LCDC_VDCTRL4);
|
writel(reg, mxsfb->base + LCDC_VDCTRL4);
|
||||||
|
|
||||||
mxsfb_disable_axi_clk(mxsfb);
|
|
||||||
|
|
||||||
clk_disable_unprepare(mxsfb->clk);
|
clk_disable_unprepare(mxsfb->clk);
|
||||||
if (mxsfb->clk_disp_axi)
|
if (mxsfb->clk_disp_axi)
|
||||||
clk_disable_unprepare(mxsfb->clk_disp_axi);
|
clk_disable_unprepare(mxsfb->clk_disp_axi);
|
||||||
|
@ -208,7 +205,6 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
|
||||||
* running. This may lead to shifted pictures (FIFO issue?), so
|
* running. This may lead to shifted pictures (FIFO issue?), so
|
||||||
* first stop the controller and drain its FIFOs.
|
* first stop the controller and drain its FIFOs.
|
||||||
*/
|
*/
|
||||||
mxsfb_enable_axi_clk(mxsfb);
|
|
||||||
|
|
||||||
/* Mandatory eLCDIF reset as per the Reference Manual */
|
/* Mandatory eLCDIF reset as per the Reference Manual */
|
||||||
err = mxsfb_reset_block(mxsfb->base);
|
err = mxsfb_reset_block(mxsfb->base);
|
||||||
|
@ -269,12 +265,11 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
|
||||||
|
|
||||||
writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
|
writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
|
||||||
mxsfb->base + LCDC_VDCTRL4);
|
mxsfb->base + LCDC_VDCTRL4);
|
||||||
|
|
||||||
mxsfb_disable_axi_clk(mxsfb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb)
|
void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb)
|
||||||
{
|
{
|
||||||
|
mxsfb_enable_axi_clk(mxsfb);
|
||||||
mxsfb_crtc_mode_set_nofb(mxsfb);
|
mxsfb_crtc_mode_set_nofb(mxsfb);
|
||||||
mxsfb_enable_controller(mxsfb);
|
mxsfb_enable_controller(mxsfb);
|
||||||
}
|
}
|
||||||
|
@ -282,6 +277,7 @@ void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb)
|
||||||
void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb)
|
void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb)
|
||||||
{
|
{
|
||||||
mxsfb_disable_controller(mxsfb);
|
mxsfb_disable_controller(mxsfb);
|
||||||
|
mxsfb_disable_axi_clk(mxsfb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
|
void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
|
||||||
|
|
Loading…
Reference in New Issue