diff options
author | Philipp Zabel | 2019-04-27 02:31:43 +0200 |
---|---|---|
committer | Dmitry Torokhov | 2019-04-27 02:35:08 +0200 |
commit | 9a952206904de36cd11f3ca50b2fad01d789e25e (patch) | |
tree | 8b51835bf56e0446dfeaef777f5ce0c7cb5284a3 /drivers/input | |
parent | Input: synaptics-rmi4 - fill initial format (diff) | |
download | kernel-qcow2-linux-9a952206904de36cd11f3ca50b2fad01d789e25e.tar.gz kernel-qcow2-linux-9a952206904de36cd11f3ca50b2fad01d789e25e.tar.xz kernel-qcow2-linux-9a952206904de36cd11f3ca50b2fad01d789e25e.zip |
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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/rmi4/rmi_f54.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c index 9ccf7ee0fc67..516fea06ed59 100644 --- a/drivers/input/rmi4/rmi_f54.c +++ b/drivers/input/rmi4/rmi_f54.c @@ -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, struct v4l2_fmtdesc *fmt) { + struct f54_data *f54 = video_drvdata(file); + if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - switch (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: + if (fmt->index) return -EINVAL; - } + + fmt->pixelformat = f54->format.pixelformat; return 0; } |