summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/adv7180.c
diff options
context:
space:
mode:
authorBenjamin Marty <info@benjaminmarty.ch>2022-05-12 13:02:10 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-06-20 10:30:31 +0100
commitdb9edaaff137699d4bc5dc3328afa748fb8f5c93 (patch)
tree8a29a5d0675263803939f693c237696914de6b7a /drivers/media/i2c/adv7180.c
parent56280c64ecacc971734fad4618b33061fc40b6d7 (diff)
media: i2c: adv7180: fix reserved bit in Video Selection 2
This bit is marked as reserved in the ADV Hardware Reference Manual. Resetting this bit seems to cause increased video noise. Setting this bit according to the Hardware Reference Manual reduces the video noise immediately. Signed-off-by: Benjamin Marty <info@benjaminmarty.ch> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/i2c/adv7180.c')
-rw-r--r--drivers/media/i2c/adv7180.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index e3a57c178c6b..5fde5243722d 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -43,6 +43,7 @@
#define ADV7180_INPUT_CONTROL_INSEL_MASK 0x0f
#define ADV7182_REG_INPUT_VIDSEL 0x0002
+#define ADV7182_REG_INPUT_RESERVED BIT(2)
#define ADV7180_REG_OUTPUT_CONTROL 0x0003
#define ADV7180_REG_EXTENDED_OUTPUT_CONTROL 0x0004
@@ -1060,7 +1061,9 @@ static int adv7182_init(struct adv7180_state *state)
static int adv7182_set_std(struct adv7180_state *state, unsigned int std)
{
- return adv7180_write(state, ADV7182_REG_INPUT_VIDSEL, std << 4);
+ /* Failing to set the reserved bit can result in increased video noise */
+ return adv7180_write(state, ADV7182_REG_INPUT_VIDSEL,
+ (std << 4) | ADV7182_REG_INPUT_RESERVED);
}
enum adv7182_input_type {