entity->fd = open(entity->devname, O_RDWR);
if (entity->fd == -1) {
- printf("%s: Failed to open subdev device node %s\n", __func__,
- entity->devname);
+ media_dbg(entity->media,
+ "%s: Failed to open subdev device node %s\n", __func__,
+ entity->devname);
return -errno;
}
if (format->width == 0 || format->height == 0)
return 0;
- printf("Setting up format %s %ux%u on pad %s/%u\n",
- v4l2_subdev_pixelcode_to_string(format->code),
- format->width, format->height,
- pad->entity->info.name, pad->index);
+ media_dbg(pad->entity->media,
+ "Setting up format %s %ux%u on pad %s/%u\n",
+ v4l2_subdev_pixelcode_to_string(format->code),
+ format->width, format->height,
+ pad->entity->info.name, pad->index);
ret = v4l2_subdev_set_format(pad->entity, format, pad->index,
V4L2_SUBDEV_FORMAT_ACTIVE);
if (ret < 0) {
- printf("Unable to set format: %s (%d)\n", strerror(-ret), ret);
+ media_dbg(pad->entity->media,
+ "Unable to set format: %s (%d)\n",
+ strerror(-ret), ret);
return ret;
}
- printf("Format set: %s %ux%u\n",
- v4l2_subdev_pixelcode_to_string(format->code),
- format->width, format->height);
+ media_dbg(pad->entity->media,
+ "Format set: %s %ux%u\n",
+ v4l2_subdev_pixelcode_to_string(format->code),
+ format->width, format->height);
return 0;
}
if (crop->left == -1 || crop->top == -1)
return 0;
- printf("Setting up crop rectangle (%u,%u)/%ux%u on pad %s/%u\n",
- crop->left, crop->top, crop->width, crop->height,
- pad->entity->info.name, pad->index);
+ media_dbg(pad->entity->media,
+ "Setting up crop rectangle (%u,%u)/%ux%u on pad %s/%u\n",
+ crop->left, crop->top, crop->width, crop->height,
+ pad->entity->info.name, pad->index);
ret = v4l2_subdev_set_crop(pad->entity, crop, pad->index,
V4L2_SUBDEV_FORMAT_ACTIVE);
if (ret < 0) {
- printf("Unable to set crop rectangle: %s (%d)\n", strerror(-ret), ret);
+ media_dbg(pad->entity->media,
+ "Unable to set crop rectangle: %s (%d)\n",
+ strerror(-ret), ret);
return ret;
}
- printf("Crop rectangle set: (%u,%u)/%ux%u\n",
- crop->left, crop->top, crop->width, crop->height);
+ media_dbg(pad->entity->media,
+ "Crop rectangle set: (%u,%u)/%ux%u\n",
+ crop->left, crop->top, crop->width, crop->height);
return 0;
}
if (interval->numerator == 0)
return 0;
- printf("Setting up frame interval %u/%u on entity %s\n",
- interval->numerator, interval->denominator, entity->info.name);
+ media_dbg(entity->media,
+ "Setting up frame interval %u/%u on entity %s\n",
+ interval->numerator, interval->denominator,
+ entity->info.name);
ret = v4l2_subdev_set_frame_interval(entity, interval);
if (ret < 0) {
- printf("Unable to set frame interval: %s (%d)", strerror(-ret), ret);
+ media_dbg(entity->media,
+ "Unable to set frame interval: %s (%d)",
+ strerror(-ret), ret);
return ret;
}
- printf("Frame interval set: %u/%u\n",
- interval->numerator, interval->denominator);
+ media_dbg(entity->media, "Frame interval set: %u/%u\n",
+ interval->numerator, interval->denominator);
return 0;
}
pad = v4l2_subdev_parse_pad_format(media, &format, &crop, &interval,
p, &end);
if (pad == NULL) {
- printf("Unable to parse format\n");
+ media_dbg(media, "Unable to parse format\n");
return -EINVAL;
}
{ "Y10", V4L2_MBUS_FMT_Y10_1X10 },
{ "Y12", V4L2_MBUS_FMT_Y12_1X12 },
{ "YUYV", V4L2_MBUS_FMT_YUYV8_1X16 },
+ { "YUYV2X8", V4L2_MBUS_FMT_YUYV8_2X8 },
{ "UYVY", V4L2_MBUS_FMT_UYVY8_1X16 },
+ { "UYVY2X8", V4L2_MBUS_FMT_UYVY8_2X8 },
{ "SBGGR8", V4L2_MBUS_FMT_SBGGR8_1X8 },
{ "SGBRG8", V4L2_MBUS_FMT_SGBRG8_1X8 },
{ "SGRBG8", V4L2_MBUS_FMT_SGRBG8_1X8 },