diff options
| author | Leonard Crestez <leonard.crestez@nxp.com> | 2018-09-17 09:42:11 -0400 |
|---|---|---|
| committer | Stefan Agner <stefan@agner.ch> | 2018-09-26 16:07:40 -0400 |
| commit | 626a2c52f1050b4581a0ffcd71245505b24315a2 (patch) | |
| tree | 36e5efad1078e3aed66f36517d5426762fe47cff /drivers/gpu/drm | |
| parent | 9c942096baeb37cf69df564bcf45fc37314e7e66 (diff) | |
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
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c index 0abe77675b76..e4fcbb65b969 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c | |||
| @@ -129,7 +129,6 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) | |||
| 129 | if (mxsfb->clk_disp_axi) | 129 | if (mxsfb->clk_disp_axi) |
| 130 | clk_prepare_enable(mxsfb->clk_disp_axi); | 130 | clk_prepare_enable(mxsfb->clk_disp_axi); |
| 131 | clk_prepare_enable(mxsfb->clk); | 131 | clk_prepare_enable(mxsfb->clk); |
| 132 | mxsfb_enable_axi_clk(mxsfb); | ||
| 133 | 132 | ||
| 134 | /* If it was disabled, re-enable the mode again */ | 133 | /* If it was disabled, re-enable the mode again */ |
| 135 | writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET); | 134 | writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET); |
| @@ -159,8 +158,6 @@ static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) | |||
| 159 | reg &= ~VDCTRL4_SYNC_SIGNALS_ON; | 158 | reg &= ~VDCTRL4_SYNC_SIGNALS_ON; |
| 160 | writel(reg, mxsfb->base + LCDC_VDCTRL4); | 159 | writel(reg, mxsfb->base + LCDC_VDCTRL4); |
| 161 | 160 | ||
| 162 | mxsfb_disable_axi_clk(mxsfb); | ||
| 163 | |||
| 164 | clk_disable_unprepare(mxsfb->clk); | 161 | clk_disable_unprepare(mxsfb->clk); |
| 165 | if (mxsfb->clk_disp_axi) | 162 | if (mxsfb->clk_disp_axi) |
| 166 | clk_disable_unprepare(mxsfb->clk_disp_axi); | 163 | clk_disable_unprepare(mxsfb->clk_disp_axi); |
| @@ -208,7 +205,6 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) | |||
| 208 | * running. This may lead to shifted pictures (FIFO issue?), so | 205 | * running. This may lead to shifted pictures (FIFO issue?), so |
| 209 | * first stop the controller and drain its FIFOs. | 206 | * first stop the controller and drain its FIFOs. |
| 210 | */ | 207 | */ |
| 211 | mxsfb_enable_axi_clk(mxsfb); | ||
| 212 | 208 | ||
| 213 | /* Mandatory eLCDIF reset as per the Reference Manual */ | 209 | /* Mandatory eLCDIF reset as per the Reference Manual */ |
| 214 | err = mxsfb_reset_block(mxsfb->base); | 210 | err = mxsfb_reset_block(mxsfb->base); |
| @@ -269,12 +265,11 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) | |||
| 269 | 265 | ||
| 270 | writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay), | 266 | writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay), |
| 271 | mxsfb->base + LCDC_VDCTRL4); | 267 | mxsfb->base + LCDC_VDCTRL4); |
| 272 | |||
| 273 | mxsfb_disable_axi_clk(mxsfb); | ||
| 274 | } | 268 | } |
| 275 | 269 | ||
| 276 | void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) | 270 | void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) |
| 277 | { | 271 | { |
| 272 | mxsfb_enable_axi_clk(mxsfb); | ||
| 278 | mxsfb_crtc_mode_set_nofb(mxsfb); | 273 | mxsfb_crtc_mode_set_nofb(mxsfb); |
| 279 | mxsfb_enable_controller(mxsfb); | 274 | mxsfb_enable_controller(mxsfb); |
| 280 | } | 275 | } |
| @@ -282,6 +277,7 @@ void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) | |||
| 282 | void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) | 277 | void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb) |
| 283 | { | 278 | { |
| 284 | mxsfb_disable_controller(mxsfb); | 279 | mxsfb_disable_controller(mxsfb); |
| 280 | mxsfb_disable_axi_clk(mxsfb); | ||
| 285 | } | 281 | } |
| 286 | 282 | ||
| 287 | void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, | 283 | void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, |
