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)
971971 return - EINVAL ;
972972 }
973973
974- struct ov5640_reg brightness_params [] = {{SDE_CTRL8_REG , value >= 0 ? 0x01 : 0x09 },
975- {SDE_CTRL7_REG , abs (value ) & 0xff }};
976974 int ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL0_REG , BIT (2 ), BIT (2 ));
977975
978976 if (ret ) {
979977 return ret ;
980978 }
981979
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 );
983986}
984987
985988static int ov5640_set_ctrl_contrast (const struct device * dev , int value )
You can’t perform that action at this time.
0 commit comments