rk30 lcdc: add open and release interface
authoryxj <yxj@I7-CH.(none)>
Fri, 2 Mar 2012 02:56:37 +0000 (10:56 +0800)
committeryxj <yxj@I7-CH.(none)>
Fri, 2 Mar 2012 02:57:55 +0000 (10:57 +0800)
   fix a wrong register configratoin

drivers/video/rockchip/chips/rk30_lcdc.c
drivers/video/rockchip/rk_fb.c

index e9f7e5c65f5277c4f0ce2a6a633489a5de918999..af4c5a5819b70b8be9406f1f286c3b2a2e80f084 100644 (file)
@@ -393,7 +393,7 @@ static int win1_set_par(struct rk30_lcdc_device *lcdc_dev,rk_screen *screen,
     LcdWrReg(lcdc_dev, WIN1_SCL_FACTOR_CBR,  v_X_SCL_FACTOR(ScaleCbrX) | v_Y_SCL_FACTOR(ScaleCbrY));
     LcdMskReg(lcdc_dev, SYS_CTRL1, m_W1_EN|m_W1_FORMAT, v_W1_EN(1)|v_W1_FORMAT(par->format));
     LcdWrReg(lcdc_dev, WIN1_YRGB_MST, addr);
-    LcdWrReg(lcdc_dev, WIN0_ACT_INFO,v_ACT_WIDTH(xact) | v_ACT_HEIGHT(yact));
+    LcdWrReg(lcdc_dev, WIN1_ACT_INFO,v_ACT_WIDTH(xact) | v_ACT_HEIGHT(yact));
     LcdWrReg(lcdc_dev, WIN1_DSP_ST,v_DSP_STX(xpos) | v_DSP_STY(ypos));
     LcdWrReg(lcdc_dev, WIN1_DSP_INFO,v_DSP_WIDTH(par->xsize) | v_DSP_HEIGHT(par->ysize));
      // enable win1 color key and set the color to black(rgb=0)
index 56ec9a1f574a55b543d93b3a6b0975afcb90afda..6010f020d775bb8c00e07b8d3d109c7e32a9f6ee 100644 (file)
@@ -84,7 +84,28 @@ defautl:we alloc three buffer,one for fb0 and fb2 display ui,one for ipp rotate
         fb1 and fb3 are used for video play,the buffer is alloc by android,and
         pass the phy addr to fix.smem_start by ioctl
 ****************************************************************************/
+static int rk_fb_open(struct fb_info *info,int user)
+{
+    struct rk_fb_inf *inf = dev_get_drvdata(info->device);
+    struct fb_fix_screeninfo *fix = &info->fix;
+    if(!strcmp(fix->id,"fb1")){
+        inf->video_mode = 1;
+    }
+
+    return 0;
+    
+}
 
+static int rk_fb_release(struct fb_info *info,int user)
+{
+    struct rk_fb_inf *inf = dev_get_drvdata(info->device);
+    struct fb_fix_screeninfo *fix = &info->fix;
+    if(!strcmp(fix->id,"fb1")){
+        inf->video_mode = 0;
+    }
+
+    return 0;
+}
 static int rk_fb_ioctl(struct fb_info *info, unsigned int cmd,
                        unsigned long arg)
 {
@@ -394,6 +415,8 @@ static int fb_setcolreg(unsigned regno,
 
 static struct fb_ops fb_ops = {
     .owner          = THIS_MODULE,
+    .fb_open        = rk_fb_open,
+    .fb_release     = rk_fb_release,
     .fb_check_var   = rk_fb_check_var,
     .fb_set_par     = rk_fb_set_par,
     .fb_blank       = rk_fb_blank,