]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
i.MX video: add ipuv3_fb_shutdown()
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 24 Sep 2013 09:02:42 +0000 (11:02 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 24 Sep 2013 09:02:42 +0000 (11:02 +0200)
drivers/video/mxc_ipuv3_fb.c
include/ipu.h

index 6a147d5186af55d5a0cbccdff9cfd5c772154d7b..d4f12e931e491881da0b84357d6475ef8cd4cbcc 100644 (file)
@@ -23,6 +23,8 @@
 #include <ipu.h>
 #include <video_fb.h>
 #include <mxcfb.h>
+
+#include "ipu_regs.h"
 #include "videomodes.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -435,6 +437,30 @@ static int mxcfb_unmap_video_memory(struct fb_info *fbi)
        return 0;
 }
 
+void ipuv3_fb_shutdown(void)
+{
+       int i;
+       struct ipu_stat *stat = (struct ipu_stat *)IPU_STAT;
+
+       for (i = 0; i < ARRAY_SIZE(mxcfb_info); i++) {
+               struct fb_info *fbi = mxcfb_info[i];
+
+               if (fbi) {
+                       struct mxcfb_info *mxc_fbi = fbi->par;
+
+                       ipu_disable_channel(mxc_fbi->ipu_ch);
+                       ipu_uninit_channel(mxc_fbi->ipu_ch);
+               }
+       }
+
+       clk_enable(g_ipu_clk);
+       for (i = 0; i < ARRAY_SIZE(stat->int_stat); i++) {
+               __raw_writel(__raw_readl(&stat->int_stat[i]),
+                       &stat->int_stat[i]);
+       }
+       clk_disable(g_ipu_clk);
+}
+
 /*
  * Initializes the framebuffer information pointer. After allocating
  * sufficient memory for the framebuffer structure, the fields are
index 44cb7f7e5f09bfb9a7616e66ca1c6c62dbcae8f3..b8cf52147a32d38732a161b7a63c894d6c5dba90 100644 (file)
@@ -222,6 +222,7 @@ int ipuv3_fb_init(struct fb_videomode *mode, int di,
                unsigned int interface_pix_fmt,
                ipu_di_clk_parent_t di_clk_parent,
                unsigned long di_clk_val, int bpp);
+void ipuv3_fb_shutdown(void);
 
 int32_t ipu_init_channel(ipu_channel_t channel, ipu_channel_params_t *params);
 void ipu_uninit_channel(ipu_channel_t channel);