Commit 9a952206 authored by Philipp Zabel's avatar Philipp Zabel Committed by Dmitry Torokhov

Input: synaptics-rmi4 - fix enum_fmt

Do not enumerate all formats, some of which the device may not even
support. Instead, only report the one fixed format of the currently
selected input that will survive try_fmt/s_fmt.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9f6da5d4
...@@ -456,25 +456,15 @@ static int rmi_f54_vidioc_fmt(struct file *file, void *priv, ...@@ -456,25 +456,15 @@ static int rmi_f54_vidioc_fmt(struct file *file, void *priv,
static int rmi_f54_vidioc_enum_fmt(struct file *file, void *priv, static int rmi_f54_vidioc_enum_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *fmt) struct v4l2_fmtdesc *fmt)
{ {
struct f54_data *f54 = video_drvdata(file);
if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL; return -EINVAL;
switch (fmt->index) { if (fmt->index)
case 0:
fmt->pixelformat = V4L2_TCH_FMT_DELTA_TD16;
break;
case 1:
fmt->pixelformat = V4L2_TCH_FMT_DELTA_TD08;
break;
case 2:
fmt->pixelformat = V4L2_TCH_FMT_TU16;
break;
default:
return -EINVAL; return -EINVAL;
}
fmt->pixelformat = f54->format.pixelformat;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment