[media] v4l2: replace enum_mbus_fmt by enum_mbus_code
[deliverable/linux.git] / drivers / media / platform / soc_camera / rcar_vin.c
index 9351f64dee7b4fcfb3e03368022eade6dea8f73e..8796bdce671f3f07f4926db8cd510b872d5b83b8 100644 (file)
@@ -1318,16 +1318,19 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
        int ret, k, n;
        int formats = 0;
        struct rcar_vin_cam *cam;
-       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)
                return 0;
 
-       fmt = soc_mbus_get_fmtdesc(code);
+       fmt = soc_mbus_get_fmtdesc(code.code);
        if (!fmt) {
-               dev_warn(dev, "unsupported format code #%u: %d\n", idx, code);
+               dev_warn(dev, "unsupported format code #%u: %d\n", idx, code.code);
                return 0;
        }
 
@@ -1408,7 +1411,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
        if (!idx)
                cam->extra_fmt = NULL;
 
-       switch (code) {
+       switch (code.code) {
        case MEDIA_BUS_FMT_YUYV8_1X16:
        case MEDIA_BUS_FMT_YUYV8_2X8:
        case MEDIA_BUS_FMT_YUYV10_2X10:
@@ -1422,9 +1425,9 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
                formats += n;
                for (k = 0; xlate && k < n; k++, xlate++) {
                        xlate->host_fmt = &rcar_vin_formats[k];
-                       xlate->code = code;
+                       xlate->code = code.code;
                        dev_dbg(dev, "Providing format %s using code %d\n",
-                               rcar_vin_formats[k].name, code);
+                               rcar_vin_formats[k].name, code.code);
                }
                break;
        default:
@@ -1440,7 +1443,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
        formats++;
        if (xlate) {
                xlate->host_fmt = fmt;
-               xlate->code = code;
+               xlate->code = code.code;
                xlate++;
        }
 
This page took 0.042313 seconds and 5 git commands to generate.