]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: rockchip: vop: Simplify rkvop_enable
authorJagan Teki <jagan@edgeble.ai>
Wed, 17 Jan 2024 07:51:43 +0000 (13:21 +0530)
committerAnatolij Gustschin <agust@denx.de>
Sun, 21 Apr 2024 07:07:00 +0000 (09:07 +0200)
Get the regs from priv pointer instead of passing it an argument.

This would simplify the code and better readability.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
drivers/video/rockchip/rk_vop.c

index c514e2a0e4492c6782b403b0021c22598c0fddf3..158ba7cbf6901ad42389dcc491d10f0deb44e17b 100644 (file)
@@ -39,11 +39,13 @@ enum vop_pol {
        DCLK_INVERT    = 3
 };
 
-static void rkvop_enable(struct udevice *dev, struct rk3288_vop *regs, ulong fbbase,
+static void rkvop_enable(struct udevice *dev, ulong fbbase,
                         int fb_bits_per_pixel,
                         const struct display_timing *edid,
                         struct reset_ctl *dclk_rst)
 {
+       struct rk_vop_priv *priv = dev_get_priv(dev);
+       struct rk3288_vop *regs = priv->regs;
        u32 lb_mode;
        u32 rgb_mode;
        u32 hactive = edid->hactive.typ;
@@ -243,9 +245,7 @@ static void rkvop_mode_set(struct udevice *dev,
 static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
 {
        struct video_priv *uc_priv = dev_get_uclass_priv(dev);
-       struct rk_vop_priv *priv = dev_get_priv(dev);
        int vop_id, remote_vop_id;
-       struct rk3288_vop *regs = priv->regs;
        struct display_timing timing;
        struct udevice *disp;
        int ret;
@@ -380,7 +380,7 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
                return ret;
        }
 
-       rkvop_enable(dev, regs, fbbase, 1 << l2bpp, &timing, &dclk_rst);
+       rkvop_enable(dev, fbbase, 1 << l2bpp, &timing, &dclk_rst);
 
        ret = display_enable(disp, 1 << l2bpp, &timing);
        if (ret)