Lines Matching full:gain

179  * Available scales with gain 1x - 1024x, timings 55, 100, 200, 400 mS
180 * Time impacts to gain: 1x, 2x, 4x, 8x.
182 * => Max total gain is HWGAIN * gain by integration time (8 * 1024) = 8192
187 * total gain 8192 will be 1953125
192 * On BU27010 available scales with gain 1x - 4096x,
193 * timings 55, 100, 200, 400 mS. Time impacts to gain: 1x, 2x, 4x, 8x.
195 * => Max total gain is HWGAIN * gain by integration time (8 * 4096)
197 * Using NANO precision for scale we must use scale 64x corresponding gain 1x
202 /* See the data sheet for the "Gain Setting" table */
292 * All the RGBC channels share the same gain.
293 * IR gain can be fine-tuned from the gain set for the RGBC by 2 bit, but this
294 * would yield quite complex gain setting. Especially since not all bit
295 * compinations are supported. And in any case setting GAIN for RGBC will
296 * always also change the IR-gain.
298 * On top of this, the selector '0' which corresponds to hw-gain 1X on RGBC,
299 * corresponds to gain 2X on IR. Rest of the selctors correspond to same gains
300 * though. This, however, makes it not possible to use shared gain for all
330 * We don't allow setting scale for IR (because of shared gain bits).
374 * Prevent changing gain/time config when scale is read/written.
376 * Prevent changing gain/time when data is read.
457 * gain and integration time settings and we need to ensure those are
487 * We do always set also the LOW bits of IR-gain because othervice we in bu27008_write_gain_sel()
488 * would risk resulting an invalid GAIN register value. in bu27008_write_gain_sel()
491 * values were such that HW could support both gain settings. in bu27008_write_gain_sel()
492 * Eg, when the shared bits were same for both gain values. in bu27008_write_gain_sel()
497 * This would end up with nasty logic for computing gain values for in bu27008_write_gain_sel()
527 * Gain 'selector' is composed of two registers. Selector is 6bit value, in bu27010_write_gain_sel()
528 * 4 high bits being the RGBC gain fieild in MODE_CONTROL1 register and in bu27010_write_gain_sel()
529 * two low bits being the channel specific gain in MODE_CONTROL2. in bu27010_write_gain_sel()
532 * the MODE_CONTROL1 value (RGBC gain part). in bu27010_write_gain_sel()
561 * If we always "lock" the gain selectors for all channels to prevent in bu27008_get_gain_sel()
587 * We always "lock" the gain selectors for all channels to prevent in bu27010_get_gain_sel()
591 * Read the channel0 gain. in bu27010_get_gain_sel()
599 /* Read the shared gain */ in bu27010_get_gain_sel()
605 * The gain selector is made as a combination of common RGBC gain and in bu27010_get_gain_sel()
606 * the channel specific gain. The channel specific gain forms the low in bu27010_get_gain_sel()
607 * bits of selector and RGBC gain is appended right after it. in bu27010_get_gain_sel()
609 * Compose the selector from channel0 gain and shared RGBC gain. in bu27010_get_gain_sel()
760 static int bu27008_get_gain(struct bu27008_data *data, struct iio_gts *gts, int *gain) in bu27008_get_gain() argument
770 dev_err(data->dev, "unknown gain value 0x%x\n", sel); in bu27008_get_gain()
774 *gain = ret; in bu27008_get_gain()
779 static int bu27008_set_gain(struct bu27008_data *data, int gain) in bu27008_set_gain() argument
783 ret = iio_gts_find_sel_by_gain(&data->gts, gain); in bu27008_set_gain()
829 int gain, ret; in _bu27008_get_scale() local
836 ret = bu27008_get_gain(data, gts, &gain); in _bu27008_get_scale()
844 return iio_gts_get_scale(gts, gain, ret, val, val2); in _bu27008_get_scale()
920 dev_dbg(data->dev, "optimal gain out of range\n"); in bu27008_try_set_int_time()
924 "Total gain increase. Risk of saturation"); in bu27008_try_set_int_time()
930 dev_dbg(data->dev, "scale changed, new gain %u\n", new_gain); in bu27008_try_set_int_time()