Mt9e013: correct fps for different resolutions of different settings.
authorTao Jing <jing.tao@intel.com>
Tue, 17 Apr 2012 11:03:53 +0000 (19:03 +0800)
committerbuildbot <buildbot@intel.com>
Fri, 27 Apr 2012 16:01:51 +0000 (09:01 -0700)
BZ: 31575

correct the fps for different resolutions of different settings.

Change-Id: I3dcc05b11be3cadee5d11b2fac8bacec132ecdb1
Signed-off-by: Tao Jing <jing.tao@intel.com>
Signed-off-by: ziyux.jiang <ziyux.jiang@intel.com>
Reviewed-on: http://android.intel.com:8080/43702
Reviewed-by: Wang, Wen W <wen.w.wang@intel.com>
Reviewed-by: Gong, Shuguang <shuguang.gong@intel.com>
Reviewed-by: Koski, Anttu <anttu.koski@intel.com>
Tested-by: Koski, Anttu <anttu.koski@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/media/video/atomisp/atomisp_ioctl.c
drivers/media/video/mt9e013.c
drivers/media/video/mt9e013.h

index f3a860e..c53ec3e 100644 (file)
@@ -1606,9 +1606,21 @@ static int atomisp_s_parm(struct file *file, void *fh,
        }
 
        isp->sw_contex.run_mode = parm->parm.capture.capturemode;
+       ret = v4l2_subdev_call(isp->inputs[isp->input_curr].camera,
+                               video, s_parm, parm);
 
        mutex_unlock(&isp->input_lock);
-       return ret;
+       /*
+        * why do we think the return value -ENOIOCTLCMD is ok?
+        * that's because some sensor drivers may don't need s_parm
+        * to set their run_mode and so have no the s_parm interface.
+        */
+       if (ret && ret != -ENOIOCTLCMD) {
+               v4l2_err(&atomisp_dev,
+                           "failed to s_parm for sensor\n");
+               return ret;
+       }
+       return 0;
 }
 
 static int atomisp_s_parm_file(struct file *file, void *fh,
index 2665302..da1d8ee 100644 (file)
@@ -73,6 +73,7 @@ static struct mt9e013_resolution mt9e013_res_preview[] = {
                 .width =       820     ,
                 .height =      616     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -86,6 +87,7 @@ static struct mt9e013_resolution mt9e013_res_preview[] = {
                 .width =       1640    ,
                 .height =      956     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -105,6 +107,7 @@ static struct mt9e013_resolution mt9e013_res_still[] = {
                 .width =       1640    ,
                 .height =      1232    ,
                 .fps =         15      ,
+                .low_fps =     3       , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x0C1C, /* consistent with regs arrays */
@@ -118,6 +121,7 @@ static struct mt9e013_resolution mt9e013_res_still[] = {
                 .width =       3280    ,
                 .height =      1848    ,
                 .fps =         15      ,
+                .low_fps =     3       , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1258, /* consistent with regs arrays */
                 .lines_per_frame = 0x0AA4, /* consistent with regs arrays */
@@ -131,6 +135,7 @@ static struct mt9e013_resolution mt9e013_res_still[] = {
                 .width =       3280    ,
                 .height =      2464    ,
                 .fps =         15      ,
+                .low_fps =     3       , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1258, /* consistent with regs arrays */
                 .lines_per_frame = 0x0AA4, /* consistent with regs arrays */
@@ -149,6 +154,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       216     ,
                 .height =      176     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -162,6 +168,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       408     ,
                 .height =      308     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -175,6 +182,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       820     ,
                 .height =      616     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -188,6 +196,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       1640    ,
                 .height =      1024    ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -201,6 +210,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       1568    ,
                 .height =      880     ,
                 .fps =         30      ,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0       ,
                 .pixels_per_line = 0x1020, /* consistent with regs arrays */
                 .lines_per_frame = 0x060E, /* consistent with regs arrays */
@@ -214,6 +224,7 @@ static struct mt9e013_resolution mt9e013_res_video[] = {
                 .width =       2336,
                 .height =      1308,
                 .fps =         30,
+                .low_fps =     15      , /* fps when pixel clock is 96MHZ */
                 .used =        0,
                 .pixels_per_line = 0x113A, /* consistent with regs arrays */
                 .lines_per_frame = 0x05AB, /* consistent with regs arrays */
@@ -1817,6 +1828,7 @@ static int mt9e013_enum_framesizes(struct v4l2_subdev *sd,
 static int mt9e013_enum_frameintervals(struct v4l2_subdev *sd,
                                       struct v4l2_frmivalenum *fival)
 {
+       struct mt9e013_device *dev = to_mt9e013_sensor(sd);
        unsigned int index = fival->index;
 
        if (index >= N_RES)
@@ -1834,7 +1846,11 @@ static int mt9e013_enum_frameintervals(struct v4l2_subdev *sd,
 /*     fival->width = mt9e013_res[index].width;
        fival->height = mt9e013_res[index].height; */
        fival->discrete.numerator = 1;
-       fival->discrete.denominator = mt9e013_res[index].fps;
+       if (dev->platform_data->pixel_rate &&
+           dev->platform_data->pixel_rate() <= 96)
+               fival->discrete.denominator = mt9e013_res[index].low_fps;
+       else
+               fival->discrete.denominator = mt9e013_res[index].fps;
 
        return 0;
 }
index e596c17..780de85 100644 (file)
@@ -258,6 +258,7 @@ struct mt9e013_resolution {
        int width;
        int height;
        int fps;
+       int low_fps;
        bool used;
        unsigned short pixels_per_line;
        unsigned short lines_per_frame;