Skip to content

Commit

Permalink
[media] rcar_vin: propagate querystd() error upstream
Browse files Browse the repository at this point in the history
rcar_vin_set_fmt() defaults to  PAL when the subdevice's querystd() method call
fails (e.g. due to I2C error).  This doesn't work very well when a camera being
used  outputs NTSC which has different order of fields and resolution.  Let  us
stop  pretending and return the actual error except  when the querystd() method
is not implemented,  in which case  we'll have  to set the 'field' variable  to
V4L2_FIELD_NONE.

Note that doing this would prevent video capture on at least Renesas Henninger/
Porter boards where I2C seems particularly buggy.

Signed-off-by: Sergei Shtylyov <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Sergei Shtylyov authored and mchehab committed Sep 25, 2015
1 parent db33386 commit 936ad89
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/media/platform/soc_camera/rcar_vin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,11 +1602,15 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd,
case V4L2_FIELD_INTERLACED:
/* Query for standard if not explicitly mentioned _TB/_BT */
ret = v4l2_subdev_call(sd, video, querystd, &std);
if (ret < 0)
std = V4L2_STD_625_50;

field = std & V4L2_STD_625_50 ? V4L2_FIELD_INTERLACED_TB :
V4L2_FIELD_INTERLACED_BT;
if (ret == -ENOIOCTLCMD) {
field = V4L2_FIELD_NONE;
} else if (ret < 0) {
return ret;
} else {
field = std & V4L2_STD_625_50 ?
V4L2_FIELD_INTERLACED_TB :
V4L2_FIELD_INTERLACED_BT;
}
break;
}

Expand Down

0 comments on commit 936ad89

Please sign in to comment.