Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f1ccf16 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2-subdev: support new 'which' field in enum_mbus_code



Support the new 'which' field in the enum_mbus_code ops. Most drivers do not
need to be changed since they always return the same enumeration regardless
of the 'which' field.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 20058f90
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2327,6 +2327,7 @@ vpfe_async_bound(struct v4l2_async_notifier *notifier,

		memset(&mbus_code, 0, sizeof(mbus_code));
		mbus_code.index = j;
		mbus_code.which = V4L2_SUBDEV_FORMAT_ACTIVE;
		ret = v4l2_subdev_call(subdev, pad, enum_mbus_code,
			       NULL, &mbus_code);
		if (ret)
+2 −2
Original line number Diff line number Diff line
@@ -2133,7 +2133,7 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,

	case CCDC_PAD_SOURCE_OF:
		format = __ccdc_get_format(ccdc, cfg, code->pad,
					   V4L2_SUBDEV_FORMAT_TRY);
					   code->which);

		if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
		    format->code == MEDIA_BUS_FMT_UYVY8_2X8) {
@@ -2164,7 +2164,7 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd,
			return -EINVAL;

		format = __ccdc_get_format(ccdc, cfg, code->pad,
					   V4L2_SUBDEV_FORMAT_TRY);
					   code->which);

		/* A pixel code equal to 0 means that the video port doesn't
		 * support the input format. Don't enumerate any pixel code.
+1 −1
Original line number Diff line number Diff line
@@ -703,7 +703,7 @@ static int ccp2_enum_mbus_code(struct v4l2_subdev *sd,
			return -EINVAL;

		format = __ccp2_get_format(ccp2, cfg, CCP2_PAD_SINK,
					      V4L2_SUBDEV_FORMAT_TRY);
					      code->which);
		code->code = format->code;
	}

+1 −1
Original line number Diff line number Diff line
@@ -909,7 +909,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd,
		code->code = csi2_input_fmts[code->index];
	} else {
		format = __csi2_get_format(csi2, cfg, CSI2_PAD_SINK,
					   V4L2_SUBDEV_FORMAT_TRY);
					   code->which);
		switch (code->index) {
		case 0:
			/* Passthrough sink pad code */
+1 −1
Original line number Diff line number Diff line
@@ -1431,7 +1431,7 @@ static int resizer_enum_mbus_code(struct v4l2_subdev *sd,
			return -EINVAL;

		format = __resizer_get_format(res, cfg, RESZ_PAD_SINK,
					      V4L2_SUBDEV_FORMAT_TRY);
					      code->which);
		code->code = format->code;
	}

Loading