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 @@ -1021,15 +1021,18 @@ static int ov5640_set_ctrl_brightness(const struct device *dev, int value)
1021
1021
{
1022
1022
const struct ov5640_config * cfg = dev -> config ;
1023
1023
1024
- struct ov5640_reg brightness_params [] = {{SDE_CTRL8_REG , value >= 0 ? 0x01 : 0x09 },
1025
- {SDE_CTRL7_REG , abs (value ) & 0xff }};
1026
1024
int ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL0_REG , BIT (2 ), BIT (2 ));
1027
1025
1028
1026
if (ret ) {
1029
1027
return ret ;
1030
1028
}
1031
1029
1032
- return ov5640_write_multi_regs (& cfg -> i2c , brightness_params , ARRAY_SIZE (brightness_params ));
1030
+ ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL8_REG , BIT (3 ), value >= 0 ? 0 : BIT (3 ));
1031
+ if (ret < 0 ) {
1032
+ return ret ;
1033
+ }
1034
+
1035
+ return ov5640_write_reg (& cfg -> i2c , SDE_CTRL7_REG , (abs (value ) << 4 ) & 0xf0 );
1033
1036
}
1034
1037
1035
1038
static int ov5640_set_ctrl_contrast (const struct device * dev , int value )
You can’t perform that action at this time.
0 commit comments