Skip to content

Commit 029eb74

Browse files
trunghieulenxpngphibang
authored andcommitted
drivers: video: ov5640: Fix HUE register write
SDE_CTRL8_REG's value must be modified using modify_register. Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com> Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent 84ee49e commit 029eb74

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/video/ov5640.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,13 @@ static int ov5640_set_ctrl_hue(const struct device *dev, int value)
996996
sign = 0x02;
997997
}
998998

999-
struct ov5640_reg hue_params[] = {{SDE_CTRL8_REG, sign},
1000-
{SDE_CTRL1_REG, abs(cos_coef)},
1001-
{SDE_CTRL2_REG, abs(sin_coef)}};
999+
struct ov5640_reg hue_params[] = {{SDE_CTRL1_REG, abs(cos_coef) & 0xFF},
1000+
{SDE_CTRL2_REG, abs(sin_coef) & 0xFF}};
1001+
1002+
ret = ov5640_modify_reg(&cfg->i2c, SDE_CTRL8_REG, 0x7F, sign);
1003+
if (ret) {
1004+
return ret;
1005+
}
10021006

10031007
return ov5640_write_multi_regs(&cfg->i2c, hue_params, ARRAY_SIZE(hue_params));
10041008
}

0 commit comments

Comments
 (0)