Skip to content

Commit cc5f550

Browse files
trunghieulenxpkartben
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 ae63908 commit cc5f550

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
@@ -992,9 +992,13 @@ static int ov5640_set_ctrl_hue(const struct device *dev, int value)
992992
sign = 0x02;
993993
}
994994

995-
struct ov5640_reg hue_params[] = {{SDE_CTRL8_REG, sign},
996-
{SDE_CTRL1_REG, abs(cos_coef)},
997-
{SDE_CTRL2_REG, abs(sin_coef)}};
995+
struct ov5640_reg hue_params[] = {{SDE_CTRL1_REG, abs(cos_coef) & 0xFF},
996+
{SDE_CTRL2_REG, abs(sin_coef) & 0xFF}};
997+
998+
ret = ov5640_modify_reg(&cfg->i2c, SDE_CTRL8_REG, 0x7F, sign);
999+
if (ret < 0) {
1000+
return ret;
1001+
}
9981002

9991003
return ov5640_write_multi_regs(&cfg->i2c, hue_params, ARRAY_SIZE(hue_params));
10001004
}

0 commit comments

Comments
 (0)