File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1025,15 +1025,18 @@ static int ov5640_set_ctrl_brightness(const struct device *dev, int value)
1025
1025
{
1026
1026
const struct ov5640_config * cfg = dev -> config ;
1027
1027
1028
- struct ov5640_reg brightness_params [] = {{SDE_CTRL8_REG , value >= 0 ? 0x01 : 0x09 },
1029
- {SDE_CTRL7_REG , abs (value ) & 0xff }};
1030
1028
int ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL0_REG , BIT (2 ), BIT (2 ));
1031
1029
1032
1030
if (ret ) {
1033
1031
return ret ;
1034
1032
}
1035
1033
1036
- return ov5640_write_multi_regs (& cfg -> i2c , brightness_params , ARRAY_SIZE (brightness_params ));
1034
+ ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL8_REG , BIT (3 ), value >= 0 ? 0 : BIT (3 ));
1035
+ if (ret ) {
1036
+ return ret ;
1037
+ }
1038
+
1039
+ return ov5640_write_reg (& cfg -> i2c , SDE_CTRL7_REG , (abs (value ) << 4 ) & 0xf0 );
1037
1040
}
1038
1041
1039
1042
static int ov5640_set_ctrl_contrast (const struct device * dev , int value )
You can’t perform that action at this time.
0 commit comments