Skip to content

Commit da12135

Browse files
trunghieulenxpkartben
authored andcommitted
drivers: video: ov5640: Fix constrast value sign
Fix sign's register for constrast value. Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com> Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent a3c31a5 commit da12135

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/video/ov5640.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,11 @@ static int ov5640_set_ctrl_contrast(const struct device *dev, int value)
10451045
return ret;
10461046
}
10471047

1048+
ret = ov5640_modify_reg(&cfg->i2c, SDE_CTRL6_REG, BIT(2), value >= 0 ? 0 : BIT(2));
1049+
if (ret < 0) {
1050+
return ret;
1051+
}
1052+
10481053
return ov5640_write_reg(&cfg->i2c, SDE_CTRL6_REG, value & 0xff);
10491054
}
10501055

0 commit comments

Comments
 (0)