mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
media: atomisp-ov2680: Fix ov2680_write_reg() always writing 0 to 16 bit registers
The shift << 16 of the value in the code path for 16 bit values is bogus, put_unaligned_be16() takes the lower 16 bits which will not always be 0. This was causing __ov2680_set_exposure() to always set the OV2680_AGC and OV2680_TIMING_VTS registers to 0. Link: https://lore.kernel.org/linux-media/20211107171549.267583-10-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
bc53e5bdbc
commit
9f7b638637
@@ -86,7 +86,7 @@ static int ov2680_write_reg(struct i2c_client *client, unsigned int len,
|
||||
int ret;
|
||||
|
||||
if (len == 2)
|
||||
put_unaligned_be16(val << (8 * (4 - len)), buf + 2);
|
||||
put_unaligned_be16(val, buf + 2);
|
||||
else if (len == 1)
|
||||
buf[2] = val;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user