|
@@ -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 v4l2_subdev *sd = soc_camera_to_subdev(icd);
|
|
struct device *dev = icd->parent;
|
|
struct device *dev = icd->parent;
|
|
int formats = 0, ret;
|
|
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;
|
|
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)
|
|
if (ret < 0)
|
|
/* No more formats */
|
|
/* No more formats */
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
- fmt = soc_mbus_get_fmtdesc(code);
|
|
|
|
|
|
+ fmt = soc_mbus_get_fmtdesc(code.code);
|
|
if (!fmt) {
|
|
if (!fmt) {
|
|
dev_warn(icd->parent,
|
|
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;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -679,25 +682,25 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
- switch (code) {
|
|
|
|
|
|
+ switch (code.code) {
|
|
case MEDIA_BUS_FMT_SBGGR10_1X10:
|
|
case MEDIA_BUS_FMT_SBGGR10_1X10:
|
|
formats++;
|
|
formats++;
|
|
if (xlate) {
|
|
if (xlate) {
|
|
xlate->host_fmt = &mx3_camera_formats[0];
|
|
xlate->host_fmt = &mx3_camera_formats[0];
|
|
- xlate->code = code;
|
|
|
|
|
|
+ xlate->code = code.code;
|
|
xlate++;
|
|
xlate++;
|
|
dev_dbg(dev, "Providing format %s using code 0x%x\n",
|
|
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;
|
|
break;
|
|
case MEDIA_BUS_FMT_Y10_1X10:
|
|
case MEDIA_BUS_FMT_Y10_1X10:
|
|
formats++;
|
|
formats++;
|
|
if (xlate) {
|
|
if (xlate) {
|
|
xlate->host_fmt = &mx3_camera_formats[1];
|
|
xlate->host_fmt = &mx3_camera_formats[1];
|
|
- xlate->code = code;
|
|
|
|
|
|
+ xlate->code = code.code;
|
|
xlate++;
|
|
xlate++;
|
|
dev_dbg(dev, "Providing format %s using code 0x%x\n",
|
|
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;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -709,7 +712,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id
|
|
formats++;
|
|
formats++;
|
|
if (xlate) {
|
|
if (xlate) {
|
|
xlate->host_fmt = fmt;
|
|
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",
|
|
dev_dbg(dev, "Providing format %c%c%c%c in pass-through mode\n",
|
|
(fmt->fourcc >> (0*8)) & 0xFF,
|
|
(fmt->fourcc >> (0*8)) & 0xFF,
|
|
(fmt->fourcc >> (1*8)) & 0xFF,
|
|
(fmt->fourcc >> (1*8)) & 0xFF,
|