Input: synaptics-rmi4 - fix enum_fmt
[sfrench/cifs-2.6.git] / drivers / input / rmi4 / rmi_f54.c
index 9ccf7ee0fc67d5cd0f969c7945d18e14bd1485b2..516fea06ed5950ed2764d5480e89c4fb92addf66 100644 (file)
@@ -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;
 }