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

Commit bc66c99a authored by Simon Yuan's avatar Simon Yuan Committed by Mauro Carvalho Chehab
Browse files

[media] media: i2c: adv748x: Map v4l2_std_id to the internal reg value



The video standard was not mapped to the corresponding value of the
internal video standard in adv748x_afe_querystd, causing the wrong
video standard to be selected.

Fixes: 3e89586a ("media: i2c: adv748x: add adv748x driver")
[Kieran: Obtain the std from the afe->curr_norm]

Signed-off-by: default avatarSimon Yuan <simon.yuan@navico.com>
Signed-off-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 15a35ca6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ static int adv748x_afe_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
{
	struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
	struct adv748x_state *state = adv748x_afe_to_state(afe);
	int afe_std;
	int ret;

	mutex_lock(&state->mutex);
@@ -235,8 +236,12 @@ static int adv748x_afe_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
	/* Read detected standard */
	ret = adv748x_afe_status(afe, NULL, std);

	afe_std = adv748x_afe_std(afe->curr_norm);
	if (afe_std < 0)
		goto unlock;

	/* Restore original state */
	adv748x_afe_set_video_standard(state, afe->curr_norm);
	adv748x_afe_set_video_standard(state, afe_std);

unlock:
	mutex_unlock(&state->mutex);