Commit 24467b3f authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Dorota Czaplejewicz
Browse files

hi846: cleanup setting digital gain

parent 75aca1c7
......@@ -787,31 +787,19 @@ static int hi846_update_digital_gain(struct hi846 *hi846, u16 d_gain)
{
int ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_GR_GAIN_H, d_gain >> 8);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_GR_GAIN_L, d_gain & 0xff);
ret = hi846_write_reg_16(hi846, HI846_REG_MWB_GR_GAIN_H, d_gain);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_GB_GAIN_H, d_gain >> 8);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_GB_GAIN_L, d_gain & 0xff);
ret = hi846_write_reg_16(hi846, HI846_REG_MWB_GB_GAIN_H, d_gain);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_R_GAIN_H, d_gain >> 8);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_R_GAIN_L, d_gain & 0xff);
ret = hi846_write_reg_16(hi846, HI846_REG_MWB_R_GAIN_H, d_gain);
if (ret)
return ret;
ret = hi846_write_reg(hi846, HI846_REG_MWB_B_GAIN_H, d_gain >> 8);
if (ret)
return ret;
return hi846_write_reg(hi846, HI846_REG_MWB_B_GAIN_L, d_gain & 0xff);
return hi846_write_reg_16(hi846, HI846_REG_MWB_B_GAIN_H, d_gain);
}
static int hi846_test_pattern(struct hi846 *hi846, u32 pattern)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment