Hi Bingbu, On Fri, Sep 21, 2018 at 03:20:19PM +0800, Bing Bu Cao wrote: ... > >> + try_fmt->field = V4L2_FIELD_NONE; > >> + > >> + mutex_unlock(&imx319->mutex); > >> + > >> + return 0; > >> +} > >> + > >> +static int imx319_update_digital_gain(struct imx319 *imx319, u32 d_gain) > >> +{ > >> + int ret; > >> + > >> + ret = imx319_write_reg(imx319, IMX319_REG_DPGA_USE_GLOBAL_GAIN, 1, 1); > >> + if (ret) > >> + return ret; > > You could do this write right after powering the sensor on, couldn't you? > Sakari, > Use IMX319_REG_DPGA_USE_GLOBAL_GAIN to do digital gain control, 1 for all > color and 0 for by color. For all color, use register > IMX319_REG_DIG_GAIN_GLOBAL to set the digital gain value, otherwise use > other registers below. By default the digital gain select is not set and > the gain will be set by color via setting register 0x0210, 0x0212, > 0x0213, these registers were set during powering on. So I prefer to only > change the default digital gain control if any digital gain request. > > Does this make sense? Why are per-component gains used at all when they always have the same value and the sensor supports global gain? -- Kind regards, Sakari Ailus sakari.ailus@xxxxxxxxxxxxxxx