]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Tue, 3 Sep 2019 20:11:41 +0000 (17:11 -0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:25:12 +0000 (16:25 +0100)
commit9d802d78e85c96dfa9fe5015ba855111b774061b
treebea09b1c6dd8fcfbf63920b6360db0355f5f1862
parent15ec1303de2bff8d826afa38cbc7e19008bc458e
media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support

BugLink: https://bugs.launchpad.net/bugs/1861085
commit 39034bb0c26b76a2c3abc54aa28c185f18b40c2f upstream.

Commit da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad
op get_fmt") converted a former ov6650_g_fmt() video operation callback
to an ov6650_get_fmt() pad operation callback.  However, the converted
function disregards a format->which flag that pad operations should
obey and always returns active frame format settings.

That can be fixed by always responding to V4L2_SUBDEV_FORMAT_TRY with
-EINVAL, or providing the response from a pad config argument, likely
updated by a former user call to V4L2_SUBDEV_FORMAT_TRY .set_fmt().
Since implementation of the latter is trivial, go for it.

Fixes: da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad op get_fmt")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/media/i2c/ov6650.c