Skip to contentSkip to conversation

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

PATCH In review Kieran Bingham 2 participants 2 messages Sep 11, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: adv748x: Map v4l2_std_id to the internal reg value

From: Simon Yuan <[email protected]>

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 3e89586a64df ("media: i2c: adv748x: add adv748x driver")
[Kieran: Obtain the std from the afe->curr_norm]

---
Simon,

I've added your implicit Signed-off-by tag as part of resubmitting this patch. Please confirm your agreement to this!

 drivers/media/i2c/adv748x/adv748x-afe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/adv748x/adv748x-afe.c +6 -1
index 134d981d69d3..5188178588c9 100644
@@ -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);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 37 lines · On Tuesday, 12 September 2017 10:26:53 NZST Kieran Bingham wrote:

From: Simon Yuan <[email protected]>

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 3e89586a64df ("media: i2c: adv748x: add adv748x driver")
[Kieran: Obtain the std from the afe->curr_norm]

---
Simon,

I've added your implicit Signed-off-by tag as part of resubmitting this patch. Please confirm your agreement to this!

 drivers/media/i2c/adv748x/adv748x-afe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/i2c/adv748x/adv748x-afe.c index 134d981d69d3..5188178588c9 100644

drivers/media/i2c/adv748x/adv748x-afe.c +1 -0
@@ -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 */

drivers/media/i2c/adv748x/adv748x-afe.c +0 -0
 	ret = adv748x_afe_status(afe, NULL, std);
 

drivers/media/i2c/adv748x/adv748x-afe.c static int adv748x_afe_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) · line 247

Quoted 10 lines
drivers/media/i2c/adv748x/adv748x-afe.c +5 -1
+	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);

Hi Kieran,

No problem from me, please go ahead.

Best regards,
Simon