[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb3e9be4-9ce6-354f-bb7c-a4710edc1c1b@xs4all.nl>
Date: Thu, 29 Aug 2019 13:43:49 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: Matthew Michilot <matthew.michilot@...il.com>, lars@...afoo.de
Cc: mchehab@...nel.org, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Niklas Söderlund <niklas.soderlund@...natech.se>
Subject: Re: [PATCH] media: i2c: adv7180: fix adv7280 BT.656-4 compatibility
Adding Niklas.
Niklas, can you take a look at this?
Regards,
Hans
On 8/27/19 11:55 PM, Matthew Michilot wrote:
> From: Matthew Michilot <matthew.michilot@...il.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@...il.com>
> Reviewed-by: Tim Harvey <tharvey@...eworks.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,
>
Powered by blists - more mailing lists