File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -988,8 +988,9 @@ static int ov5640_set_ctrl_brightness(const struct device *dev, int value)
988988static int ov5640_set_ctrl_contrast (const struct device * dev , int value )
989989{
990990 const struct ov5640_config * cfg = dev -> config ;
991+ const struct ov5640_data * data = dev -> data ;
991992
992- if (!IN_RANGE (value , 0 , UINT8_MAX )) {
993+ if (!IN_RANGE (value , - UINT8_MAX , UINT8_MAX )) {
993994 return - EINVAL ;
994995 }
995996
@@ -999,6 +1000,11 @@ static int ov5640_set_ctrl_contrast(const struct device *dev, int value)
9991000 return ret ;
10001001 }
10011002
1003+ ret = ov5640_modify_reg (& cfg -> i2c , SDE_CTRL6_REG , BIT (2 ), value >= 0 ? 0 : BIT (2 ));
1004+ if (ret ) {
1005+ return ret ;
1006+ }
1007+
10021008 return ov5640_write_reg (& cfg -> i2c , SDE_CTRL6_REG , value & 0xff );
10031009}
10041010
You can’t perform that action at this time.
0 commit comments