From: Tim Harvey <tharvey@gateworks.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Matthew Michilot <matthew.michilot@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media <linux-media@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: i2c: adv7180: fix adv7280 BT.656-4 compatibility
Date: Mon, 23 Sep 2019 15:04:47 -0700 [thread overview]
Message-ID: <CAJ+vNU11HTcP8L5J2Xg+Rmhvb8JDYemhJxt-GaGG5Myk3n38Tw@mail.gmail.com> (raw)
In-Reply-To: <20190829142931.GZ28351@bigcity.dyn.berto.se>
On Thu, Aug 29, 2019 at 7:29 AM Niklas Söderlund
<niklas.soderlund@ragnatech.se> wrote:
>
> Hi,
>
> On 2019-08-29 13:43:49 +0200, Hans Verkuil wrote:
> > Adding Niklas.
> >
> > Niklas, can you take a look at this?
>
> I'm happy to have a look at this. I'm currently moving so all my boards
> are in a box somewhere. I hope to have my lab up and running next week,
> so if this is not urgent I will look at it then.
>
Niklas,
Have you looked at this yet? Without this patch the ADV7280A does not
output proper BT.656. We tested this on a Gateworks Ventana GW5404-G
which uses the ADV7280A connected to the IMX6 CSI parallel bus. I'm
hoping to see this get merged and perhaps backported to older kernels.
Regards,
Tim
> >
> > Regards,
> >
> > Hans
> >
> > On 8/27/19 11:55 PM, Matthew Michilot wrote:
> > > From: Matthew Michilot <matthew.michilot@gmail.com>
> > >
> > > Captured video would be out of sync when using the adv7280 with
> > > the BT.656-4 protocol. Certain registers (0x04, 0x31, 0xE6) had to
> > > be configured properly to ensure BT.656-4 compatibility.
> > >
> > > An error in the adv7280 reference manual suggested that EAV/SAV mode
> > > was enabled by default, however upon inspecting register 0x31, it was
> > > determined to be disabled by default.
> > >
> > > Signed-off-by: Matthew Michilot <matthew.michilot@gmail.com>
> > > Reviewed-by: Tim Harvey <tharvey@gateworks.com>
> > > ---
> > > drivers/media/i2c/adv7180.c | 15 +++++++++++++--
> > > 1 file changed, 13 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> > > index 99697baad2ea..27da424dce76 100644
> > > --- a/drivers/media/i2c/adv7180.c
> > > +++ b/drivers/media/i2c/adv7180.c
> > > @@ -94,6 +94,7 @@
> > > #define ADV7180_REG_SHAP_FILTER_CTL_1 0x0017
> > > #define ADV7180_REG_CTRL_2 0x001d
> > > #define ADV7180_REG_VSYNC_FIELD_CTL_1 0x0031
> > > +#define ADV7180_VSYNC_FIELD_CTL_1_NEWAV 0x12
> > > #define ADV7180_REG_MANUAL_WIN_CTL_1 0x003d
> > > #define ADV7180_REG_MANUAL_WIN_CTL_2 0x003e
> > > #define ADV7180_REG_MANUAL_WIN_CTL_3 0x003f
> > > @@ -935,10 +936,20 @@ static int adv7182_init(struct adv7180_state *state)
> > > adv7180_write(state, ADV7180_REG_EXTENDED_OUTPUT_CONTROL, 0x57);
> > > adv7180_write(state, ADV7180_REG_CTRL_2, 0xc0);
> > > } else {
> > > - if (state->chip_info->flags & ADV7180_FLAG_V2)
> > > + if (state->chip_info->flags & ADV7180_FLAG_V2) {
> > > + /* ITU-R BT.656-4 compatible */
> > > adv7180_write(state,
> > > ADV7180_REG_EXTENDED_OUTPUT_CONTROL,
> > > - 0x17);
> > > + ADV7180_EXTENDED_OUTPUT_CONTROL_NTSCDIS);
> > > + /* Manually set NEWAVMODE */
> > > + adv7180_write(state,
> > > + ADV7180_REG_VSYNC_FIELD_CTL_1,
> > > + ADV7180_VSYNC_FIELD_CTL_1_NEWAV);
> > > + /* Manually set V bit end position in NTSC mode */
> > > + adv7180_write(state,
> > > + ADV7180_REG_NTSC_V_BIT_END,
> > > + ADV7180_NTSC_V_BIT_END_MANUAL_NVEND);
> > > + }
> > > else
> > > adv7180_write(state,
> > > ADV7180_REG_EXTENDED_OUTPUT_CONTROL,
> > >
> >
>
> --
> Regards,
> Niklas Söderlund
next prev parent reply other threads:[~2019-09-23 22:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 21:55 [PATCH] media: i2c: adv7180: fix adv7280 BT.656-4 compatibility Matthew Michilot
2019-08-29 11:43 ` Hans Verkuil
2019-08-29 14:29 ` Niklas Söderlund
2019-09-23 22:04 ` Tim Harvey [this message]
2019-09-27 19:04 ` Niklas Söderlund
2019-09-27 19:26 ` Tim Harvey
2019-09-27 20:43 ` Niklas Söderlund
2019-10-02 21:31 ` Tim Harvey
2019-10-08 0:27 ` Steve Longerbeam
2019-09-27 19:21 ` Fabio Estevam
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=CAJ+vNU11HTcP8L5J2Xg+Rmhvb8JDYemhJxt-GaGG5Myk3n38Tw@mail.gmail.com \
--to=tharvey@gateworks.com \
--cc=hverkuil@xs4all.nl \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=matthew.michilot@gmail.com \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/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;
as well as URLs for NNTP newsgroup(s).