Lines Matching refs:gain

26  * The LTC6373 amplifier supports configuring gain using GPIO's with the following
30 * From here, it is observed that all values are multiples of the '2' gain setting,
56 int (*gain_dB_to_code)(int gain, int *code);
64 u32 gain;
71 int gain;
74 gain = (val * 1000) - (val2 / 1000);
76 gain = (val * 1000) + (val2 / 1000);
78 if (gain > inf->gain_max || gain < inf->gain_min)
83 return st->chip_info->gain_dB_to_code(gain, code);
86 static int hmc425a_gain_dB_to_code(int gain, int *code)
88 *code = ~((abs(gain) / 500) & 0x3F);
92 static int hmc540s_gain_dB_to_code(int gain, int *code)
94 *code = ~((abs(gain) / 1000) & 0xF);
98 static int adrf5740_gain_dB_to_code(int gain, int *code)
100 int temp = (abs(gain) / 2000) & 0xF;
107 static int ltc6373_gain_dB_to_code(int gain, int *code)
109 *code = ~(DIV_ROUND_CLOSEST(gain, LTC6373_CONVERSION_CONSTANT) + 3)
118 return st->chip_info->code_to_gain_dB(st->gain, val, val2);
149 int gain = ((~code & LTC6373_CONVERSION_MASK) - 3) *
152 *val = gain / 1000;
153 *val2 = (gain % 1000) * 1000;
205 st->gain = code;
207 ret = hmc425a_write(indio_dev, st->gain);
261 code = (powerdown) ? LTC6373_SHUTDOWN : st->gain;
312 .default_gain = -0x40, /* set default gain -31.5db*/
323 .default_gain = -0x10, /* set default gain -15.0db*/
334 .default_gain = 0xF, /* set default gain -22.0db*/
343 .gain_min = -12041, /* gain setting x0.25*/
344 .gain_max = 24082, /* gain setting x16 */
369 st->gain = st->chip_info->default_gain;
395 /* Set default gain */
396 hmc425a_write(indio_dev, st->gain);