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 @@ -971,15 +971,18 @@ static int ov5640_set_ctrl_brightness(const struct device *dev, int value)
971
971
return - EINVAL ;
972
972
}
973
973
974
- struct ov5640_reg brightness_params [] = {{SDE_CTRL8_REG , value >= 0 ? 0x01 : 0x09 },
975
- {SDE_CTRL7_REG , abs (value ) & 0xff }};
976
974
int ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL0_REG , BIT (2 ), BIT (2 ));
977
975
978
976
if (ret ) {
979
977
return ret ;
980
978
}
981
979
982
- return ov5640_write_multi_regs (& cfg -> i2c , brightness_params , ARRAY_SIZE (brightness_params ));
980
+ ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL8_REG , BIT (3 ), value >= 0 ? 0 : BIT (3 ));
981
+ if (ret ) {
982
+ return ret ;
983
+ }
984
+
985
+ return ov5640_write_reg (& cfg -> i2c , SDE_CTRL7_REG , (abs (value ) << 4 ) & 0xf0 );
983
986
}
984
987
985
988
static int ov5640_set_ctrl_contrast (const struct device * dev , int value )
You can’t perform that action at this time.
0 commit comments