[media] v4l2: replace enum_mbus_fmt by enum_mbus_code
[sfrench/cifs-2.6.git] / drivers / media / platform / soc_camera / mx3_camera.c
index 3435fd2ca8ecd2d56f06386375556efb0e2d0c3b..a29848976f92a7e9c4e35d35ee4954852ece3043 100644 (file)
@@ -659,18 +659,21 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
        struct device *dev = icd->parent;
        int formats = 0, ret;
-       u32 code;
+       struct v4l2_subdev_mbus_code_enum code = {
+               .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+               .index = idx,
+       };
        const struct soc_mbus_pixelfmt *fmt;
 
-       ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code);
+       ret = v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code);
        if (ret < 0)
                /* No more formats */
                return 0;
 
-       fmt = soc_mbus_get_fmtdesc(code);
+       fmt = soc_mbus_get_fmtdesc(code.code);
        if (!fmt) {
                dev_warn(icd->parent,
-                        "Unsupported format code #%u: 0x%x\n", idx, code);
+                        "Unsupported format code #%u: 0x%x\n", idx, code.code);
                return 0;
        }
 
@@ -679,25 +682,25 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
        if (ret < 0)
                return 0;
 
-       switch (code) {
+       switch (code.code) {
        case MEDIA_BUS_FMT_SBGGR10_1X10:
                formats++;
                if (xlate) {
                        xlate->host_fmt = &mx3_camera_formats[0];
-                       xlate->code     = code;
+                       xlate->code     = code.code;
                        xlate++;
                        dev_dbg(dev, "Providing format %s using code 0x%x\n",
-                               mx3_camera_formats[0].name, code);
+                               mx3_camera_formats[0].name, code.code);
                }
                break;
        case MEDIA_BUS_FMT_Y10_1X10:
                formats++;
                if (xlate) {
                        xlate->host_fmt = &mx3_camera_formats[1];
-                       xlate->code     = code;
+                       xlate->code     = code.code;
                        xlate++;
                        dev_dbg(dev, "Providing format %s using code 0x%x\n",
-                               mx3_camera_formats[1].name, code);
+                               mx3_camera_formats[1].name, code.code);
                }
                break;
        default:
@@ -709,7 +712,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
        formats++;
        if (xlate) {
                xlate->host_fmt = fmt;
-               xlate->code     = code;
+               xlate->code     = code.code;
                dev_dbg(dev, "Providing format %c%c%c%c in pass-through mode\n",
                        (fmt->fourcc >> (0*8)) & 0xFF,
                        (fmt->fourcc >> (1*8)) & 0xFF,