From: Steve Longerbeam <slongerbeam@gmail.com>
To: lars@metafoo.de
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org,
Steve Longerbeam <steve_longerbeam@mentor.com>
Subject: [PATCH v3 9/9] media: adv7180: fix field type
Date: Sat, 23 Jul 2016 10:00:49 -0700 [thread overview]
Message-ID: <1469293249-6774-10-git-send-email-steve_longerbeam@mentor.com> (raw)
In-Reply-To: <1469293249-6774-1-git-send-email-steve_longerbeam@mentor.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 SEQ_BT for PAL, and SEQ_TB for NTSC (there
seems to be conflicting info on field order of PAL vs NTSC, so follow
what is in adv7183.c).
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
v3: no changes
v2:
- the init of state->curr_norm in probe needs to be moved up, ahead
of the init of state->field.
---
drivers/media/i2c/adv7180.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 6bcc652..3b8041e 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -718,10 +718,17 @@ 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 =
+ (state->curr_norm & V4L2_STD_525_60) ?
+ V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT;
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 =
+ (state->curr_norm & V4L2_STD_525_60) ?
+ V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT;
break;
}
@@ -1365,8 +1372,14 @@ 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 = (state->curr_norm & V4L2_STD_525_60) ?
+ V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT;
adv7180_of_parse(state);
@@ -1396,7 +1409,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
--
1.9.1
prev parent reply other threads:[~2016-07-23 17:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 17:00 [PATCH v3 0/9] adv7180 subdev fixes, v3 Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 1/9] media: adv7180: Fix broken interrupt register access Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 2/9] media: adv7180: define more registers Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 3/9] media: adv7180: add support for NEWAVMODE Steve Longerbeam
2016-07-25 12:13 ` Ian Arkver
[not found] ` <b2f5e6ab-86f0-7caf-40bd-8b3259dce5cd@gmail.com>
2016-07-25 17:55 ` Steve Longerbeam
2016-07-25 19:36 ` Ian Arkver
2016-07-25 22:04 ` Steve Longerbeam
2016-07-25 22:24 ` Ian Arkver
2016-07-26 1:57 ` Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 4/9] media: adv7180: add power pin control Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 5/9] media: adv7180: implement g_parm Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 6/9] media: adv7180: change mbus format to UYVY Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 7/9] v4l: Add signal lock status to source change events Steve Longerbeam
2016-07-23 17:00 ` [PATCH v3 8/9] media: adv7180: enable lock/unlock interrupts Steve Longerbeam
2016-07-23 17:00 ` Steve Longerbeam [this message]
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=1469293249-6774-10-git-send-email-steve_longerbeam@mentor.com \
--to=slongerbeam@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox