]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/sun4i: Fix DE2 mixer size
authorJernej Skrabec <jernej.skrabec@siol.net>
Sun, 4 Nov 2018 18:26:47 +0000 (19:26 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 5 Nov 2018 09:34:49 +0000 (10:34 +0100)
DE2 mixer is always 0x6000 bytes in size on all known SoCs.

While at it, introduce a macro for that.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181104182705.18047-11-jernej.skrabec@siol.net
drivers/gpu/drm/sun4i/sun8i_mixer.c
drivers/gpu/drm/sun4i/sun8i_mixer.h

index 6129c350f7bd79e45032b45eaa561a75d602a0d9..6769ec08c0d3900195a28f4c33050f11957d0766 100644 (file)
@@ -460,7 +460,7 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master,
        base = sun8i_blender_base(mixer);
 
        /* Reset the registers */
-       for (i = 0x0; i < 0x20000; i += 4)
+       for (i = 0; i < DE2_MIXER_UNIT_SIZE; i += 4)
                regmap_write(mixer->engine.regs, i, 0);
 
        /* Enable the mixer */
index 025550a1f53945415e730ecea2a42077dea8cdf3..09e0f4428c1e47e6eecc226c6bd9141c702c0408 100644 (file)
@@ -29,6 +29,8 @@
 
 #define SUN8I_MIXER_GLOBAL_DBUFF_ENABLE                BIT(0)
 
+#define DE2_MIXER_UNIT_SIZE                    0x6000
+
 #define DE2_BLD_BASE                           0x1000
 #define DE2_CH_BASE                            0x2000
 #define DE2_CH_SIZE                            0x1000