drm/sun4i: Move access control before setting the register as documented
authorMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 18 Jan 2019 14:51:27 +0000 (15:51 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 18 Jan 2019 20:11:47 +0000 (21:11 +0100)
Unlike what is currently being done, the ACCESS_CTRL bit documentation asks
that this bit should be set before modifying any register. The code in the
BSP also does this, so make sure we do this as well.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190118145133.21281-18-paul.kocialkowski@bootlin.com
drivers/gpu/drm/sun4i/sun4i_frontend.c

index 1153539f3aef2819a84c27fd884e715c237503e0..88ac77518610b697393499833e61266bbc2c1b00 100644 (file)
@@ -75,6 +75,10 @@ static void sun4i_frontend_scaler_init(struct sun4i_frontend *frontend)
 {
        int i;
 
+       regmap_write_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG,
+                         SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL,
+                         SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL);
+
        for (i = 0; i < 32; i++) {
                regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZCOEF0_REG(i),
                             sun4i_frontend_horz_coef[2 * i]);
@@ -90,9 +94,6 @@ static void sun4i_frontend_scaler_init(struct sun4i_frontend *frontend)
                             sun4i_frontend_vert_coef[i]);
        }
 
-       regmap_update_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG,
-                          SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL,
-                          SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL);
 }
 
 int sun4i_frontend_init(struct sun4i_frontend *frontend)