diff mbox

[6/6] media: adv7180: fix field type

Message ID 20160729174012.14331-7-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show

Commit Message

Niklas Söderlund July 29, 2016, 5:40 p.m. UTC
From: Steve Longerbeam <slongerbeam@gmail.com>

The ADV7180 and ADV7182 transmit whole fields, bottom field followed
by top (or vice-versa, depending on detected video standard). So
for chips that do not have support for explicitly setting the field
mode, set the field mode to V4L2_FIELD_ALTERNATE.

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
[Niklas: changed filed type from V4L2_FIELD_SEQ_{TB,BT} to
V4L2_FIELD_ALTERNATE]
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/i2c/adv7180.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Sergei Shtylyov July 29, 2016, 7:10 p.m. UTC | #1
On 07/29/2016 08:40 PM, Niklas Söderlund wrote:

> From: Steve Longerbeam <slongerbeam@gmail.com>
>
> The ADV7180 and ADV7182 transmit whole fields, bottom field followed
> by top (or vice-versa, depending on detected video standard). So
> for chips that do not have support for explicitly setting the field
> mode, set the field mode to V4L2_FIELD_ALTERNATE.
>
> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> [Niklas: changed filed type from V4L2_FIELD_SEQ_{TB,BT} to
> V4L2_FIELD_ALTERNATE]
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Tested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

    IIUC, it's a 4th version of this patch; you should have kept the original 
change log (below --- tearline) and indicated that in the subject.

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Longerbeam July 29, 2016, 7:32 p.m. UTC | #2
On 07/29/2016 12:10 PM, Sergei Shtylyov wrote:
> On 07/29/2016 08:40 PM, Niklas Söderlund wrote:
>
>> From: Steve Longerbeam <slongerbeam@gmail.com>
>>
>> The ADV7180 and ADV7182 transmit whole fields, bottom field followed
>> by top (or vice-versa, depending on detected video standard). So
>> for chips that do not have support for explicitly setting the field
>> mode, set the field mode to V4L2_FIELD_ALTERNATE.
>>
>> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
>> [Niklas: changed filed type from V4L2_FIELD_SEQ_{TB,BT} to
>> V4L2_FIELD_ALTERNATE]
>> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
>
> Tested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
>    IIUC, it's a 4th version of this patch; you should have kept the 
> original change log (below --- tearline) and indicated that in the 
> subject.
>
> MBR, Sergei

This version is fine with me. The i.mx6 h/w motion-compensation 
deinterlacer (VDIC)
needs to know the field order, and it can't get that info from 
V4L2_FIELD_ALTERNATE,
but it can still determine the order via querystd().

But I agree the change log should be preserved, and the 
V4L2_FIELD_ALTERNATE change
added to the change log.

Acked-by: Steve Longerbeam <slongerbeam@gmail.com>

Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Niklas Söderlund July 29, 2016, 8:16 p.m. UTC | #3
On 2016-07-29 12:32:30 -0700, Steve Longerbeam wrote:
> 
> On 07/29/2016 12:10 PM, Sergei Shtylyov wrote:
> > On 07/29/2016 08:40 PM, Niklas Söderlund wrote:
> > 
> > > From: Steve Longerbeam <slongerbeam@gmail.com>
> > > 
> > > The ADV7180 and ADV7182 transmit whole fields, bottom field followed
> > > by top (or vice-versa, depending on detected video standard). So
> > > for chips that do not have support for explicitly setting the field
> > > mode, set the field mode to V4L2_FIELD_ALTERNATE.
> > > 
> > > Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> > > [Niklas: changed filed type from V4L2_FIELD_SEQ_{TB,BT} to
> > > V4L2_FIELD_ALTERNATE]
> > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > 
> > Tested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > 
> >    IIUC, it's a 4th version of this patch; you should have kept the
> > original change log (below --- tearline) and indicated that in the
> > subject.
> > 
> > MBR, Sergei
> 
> This version is fine with me. The i.mx6 h/w motion-compensation deinterlacer
> (VDIC)
> needs to know the field order, and it can't get that info from
> V4L2_FIELD_ALTERNATE,
> but it can still determine the order via querystd().
> 
> But I agree the change log should be preserved, and the V4L2_FIELD_ALTERNATE
> change
> added to the change log.

Yes, I will send a v2 containing the changelog. My bad for dropping it.

> 
> Acked-by: Steve Longerbeam <slongerbeam@gmail.com>
> 
> Steve
> 
>
diff mbox

Patch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index a8b434b..c6fed71 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -680,10 +680,13 @@  static int adv7180_set_pad_format(struct v4l2_subdev *sd,
 	switch (format->format.field) {
 	case V4L2_FIELD_NONE:
 		if (!(state->chip_info->flags & ADV7180_FLAG_I2P))
-			format->format.field = V4L2_FIELD_INTERLACED;
+			format->format.field = V4L2_FIELD_ALTERNATE;
 		break;
 	default:
-		format->format.field = V4L2_FIELD_INTERLACED;
+		if (state->chip_info->flags & ADV7180_FLAG_I2P)
+			format->format.field = V4L2_FIELD_INTERLACED;
+		else
+			format->format.field = V4L2_FIELD_ALTERNATE;
 		break;
 	}
 
@@ -1253,8 +1256,13 @@  static int adv7180_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	state->client = client;
-	state->field = V4L2_FIELD_INTERLACED;
 	state->chip_info = (struct adv7180_chip_info *)id->driver_data;
+	state->curr_norm = V4L2_STD_NTSC;
+
+	if (state->chip_info->flags & ADV7180_FLAG_I2P)
+		state->field = V4L2_FIELD_INTERLACED;
+	else
+		state->field = V4L2_FIELD_ALTERNATE;
 
 	if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
 		state->csi_client = i2c_new_dummy(client->adapter,
@@ -1274,7 +1282,6 @@  static int adv7180_probe(struct i2c_client *client,
 
 	state->irq = client->irq;
 	mutex_init(&state->mutex);
-	state->curr_norm = V4L2_STD_NTSC;
 	if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED)
 		state->powered = true;
 	else