diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2015-09-02 01:29:01 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-09-25 23:29:24 +0300 |
commit | 936ad8900c60b800f10b14afc3b9ab26a7182d26 (patch) | |
tree | 440c9183818e82273e2195266b745a0675212d7f /drivers/media/platform | |
parent | db33386ae31ff81b52d2f8a25a02d403ec8bf3f2 (diff) | |
download | linux-936ad8900c60b800f10b14afc3b9ab26a7182d26.tar.xz |
[media] rcar_vin: propagate querystd() error upstream
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 <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/soc_camera/rcar_vin.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 4069587ae8b6..1e277104b5fb 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -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; } |