All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	sergei.shtylyov@cogentembedded.com, slongerbeam@gmail.com
Cc: lars@metafoo.de, mchehab@kernel.org, hans.verkuil@cisco.com,
	"Steve Longerbeam" <steve_longerbeam@mentor.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 6/6] media: adv7180: fix field type
Date: Fri, 29 Jul 2016 19:40:12 +0200	[thread overview]
Message-ID: <20160729174012.14331-7-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20160729174012.14331-1-niklas.soderlund+renesas@ragnatech.se>

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(-)

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
-- 
2.9.0


  parent reply	other threads:[~2016-07-29 17:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29 17:40 [PATCH 0/6] Fix adv7180 and rcar-vin field handling Niklas Söderlund
2016-07-29 17:40 ` [PATCH 1/6] media: rcar-vin: allow field to be changed Niklas Söderlund
2016-07-29 21:04   ` Sergei Shtylyov
2016-08-01 16:52     ` Niklas Söderlund
2016-08-01 16:52       ` Niklas Söderlund
2016-08-01 17:55       ` Hans Verkuil
2016-08-01 17:55         ` Hans Verkuil
2016-07-29 17:40 ` [PATCH 2/6] media: rcar-vin: fix bug in scaling Niklas Söderlund
2016-07-29 17:40 ` [PATCH 3/6] media: rcar-vin: fix height for TOP and BOTTOM fields Niklas Söderlund
2016-07-29 17:40 ` [PATCH 4/6] media: rcar-vin: add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
2016-07-30 21:55   ` Sergei Shtylyov
2016-08-01 16:53     ` Niklas Söderlund
2016-08-01 16:53       ` Niklas Söderlund
2016-08-02  9:41   ` Hans Verkuil
2016-08-02 10:32     ` Niklas Söderlund
2016-08-02 10:32       ` Niklas Söderlund
2016-08-02 10:39       ` Hans Verkuil
2016-08-02 10:39         ` Hans Verkuil
2016-08-02 11:02         ` Niklas Söderlund
2016-08-02 11:02           ` Niklas Söderlund
2016-08-02 11:21           ` Hans Verkuil
2016-08-02 11:21             ` Hans Verkuil
2016-07-29 17:40 ` [PATCH 5/6] media: adv7180: fill in mbus format in set_fmt Niklas Söderlund
2016-07-29 17:40 ` Niklas Söderlund [this message]
2016-07-29 19:10   ` [PATCH 6/6] media: adv7180: fix field type Sergei Shtylyov
2016-07-29 19:32     ` Steve Longerbeam
2016-07-29 20:16       ` Niklas Söderlund
2016-07-29 20:16         ` Niklas Söderlund
2016-08-02  9:43 ` [PATCH 0/6] Fix adv7180 and rcar-vin field handling Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729174012.14331-7-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=hans.verkuil@cisco.com \
    --cc=lars@metafoo.de \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=slongerbeam@gmail.com \
    --cc=steve_longerbeam@mentor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.