/linux-6.12.1/drivers/media/usb/gspca/ |
D | autogain_functions.c | 22 s32 gain, orig_gain, exposure, orig_exposure; in gspca_expo_autogain() local 28 orig_gain = gain = v4l2_ctrl_g_ctrl(gspca_dev->gain); in gspca_expo_autogain() 40 if (gain > gain_knee) in gspca_expo_autogain() 41 gain--; in gspca_expo_autogain() 44 else if (gain > gspca_dev->gain->default_value) in gspca_expo_autogain() 45 gain--; in gspca_expo_autogain() 48 else if (gain > gspca_dev->gain->minimum) in gspca_expo_autogain() 49 gain--; in gspca_expo_autogain() 53 if (gain < gspca_dev->gain->default_value) in gspca_expo_autogain() 54 gain++; in gspca_expo_autogain() [all …]
|
D | sonixb.c | 582 u8 gain = gspca_dev->gain->val; in setgain() local 589 i2c[3] = 0x3f - gain; in setgain() 590 i2c[4] = 0x3f - gain; in setgain() 591 i2c[5] = 0x3f - gain; in setgain() 601 i2c[4] = 255 - gain; in setgain() 608 gain = 255 - gain; in setgain() 610 i2c[3] |= (gain & 0x80) >> 7; in setgain() 611 i2c[3] |= (gain & 0x40) >> 5; in setgain() 612 i2c[3] |= (gain & 0x20) >> 3; in setgain() 613 i2c[3] |= (gain & 0x10) >> 1; in setgain() [all …]
|
/linux-6.12.1/drivers/staging/media/atomisp/pci/isp/kernels/dp/dp_1.0/ |
D | ia_css_dp.host.c | 51 int gain = from->gain; in ia_css_dp_encode() local 62 to->gain = in ia_css_dp_encode() 63 uDIGIT_FITTING(from->gain, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 66 uDIGIT_FITTING(gain * gr / r, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 68 uDIGIT_FITTING(gain * gb / r, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 70 uDIGIT_FITTING(gain * gb / b, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 72 uDIGIT_FITTING(gain * gr / b, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 74 uDIGIT_FITTING(gain * r / gr, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 76 uDIGIT_FITTING(gain * b / gr, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() 78 uDIGIT_FITTING(gain * b / gb, 8, SH_CSS_DP_GAIN_SHIFT); in ia_css_dp_encode() [all …]
|
/linux-6.12.1/drivers/iio/amplifiers/ |
D | hmc425a.c | 56 int (*gain_dB_to_code)(int gain, int *code); 64 u32 gain; member 71 int gain; in gain_dB_to_code() local 74 gain = (val * 1000) - (val2 / 1000); in gain_dB_to_code() 76 gain = (val * 1000) + (val2 / 1000); in gain_dB_to_code() 78 if (gain > inf->gain_max || gain < inf->gain_min) in gain_dB_to_code() 83 return st->chip_info->gain_dB_to_code(gain, code); in gain_dB_to_code() 86 static int hmc425a_gain_dB_to_code(int gain, int *code) in hmc425a_gain_dB_to_code() argument 88 *code = ~((abs(gain) / 500) & 0x3F); in hmc425a_gain_dB_to_code() 92 static int hmc540s_gain_dB_to_code(int gain, int *code) in hmc540s_gain_dB_to_code() argument [all …]
|
D | ad8366.c | 120 int code, gain = 0; in ad8366_read_raw() local 129 gain = code * 253 + 4500; in ad8366_read_raw() 132 gain = 15000 - code * 1000; in ad8366_read_raw() 135 gain = 20000 - 31500 + code * 500; in ad8366_read_raw() 138 gain = -1 * code * 500; in ad8366_read_raw() 141 gain = -1 * code * 250; in ad8366_read_raw() 146 *val = gain / 1000; in ad8366_read_raw() 147 *val2 = (gain % 1000) * 1000; in ad8366_read_raw() 167 int code = 0, gain; in ad8366_write_raw() local 172 gain = (val * 1000) - (val2 / 1000); in ad8366_write_raw() [all …]
|
/linux-6.12.1/drivers/iio/ |
D | industrialio-gts-helper.c | 302 per_time_gains[i][j] = gts->hwgain_table[j].gain * in iio_gts_build_avail_scale_table() 525 if (g->sel < 0 || g->gain <= 0) in sanity_check_gain() 552 int gain, mul, res; in iio_gts_sanity_check() local 554 gain = gts->hwgain_table[g].gain; in iio_gts_sanity_check() 557 if (check_mul_overflow(gain, mul, &res)) in iio_gts_sanity_check() 715 int iio_gts_find_sel_by_gain(struct iio_gts *gts, int gain) in iio_gts_find_sel_by_gain() argument 720 if (gts->hwgain_table[i].gain == gain) in iio_gts_find_sel_by_gain() 741 return gts->hwgain_table[i].gain; in iio_gts_find_gain_by_sel() 758 int gain = gts->hwgain_table[i].gain; in iio_gts_get_min_gain() local 761 min = gain; in iio_gts_get_min_gain() [all …]
|
/linux-6.12.1/drivers/iio/accel/ |
D | st_accel_core.c | 156 .gain = IIO_G_TO_M_S_2(1000), 161 .gain = IIO_G_TO_M_S_2(2000), 166 .gain = IIO_G_TO_M_S_2(4000), 171 .gain = IIO_G_TO_M_S_2(12000), 235 .gain = IIO_G_TO_M_S_2(1000), 240 .gain = IIO_G_TO_M_S_2(2000), 245 .gain = IIO_G_TO_M_S_2(3900), 319 .gain = IIO_G_TO_M_S_2(61), 324 .gain = IIO_G_TO_M_S_2(122), 329 .gain = IIO_G_TO_M_S_2(183), [all …]
|
/linux-6.12.1/drivers/iio/magnetometer/ |
D | st_magn_core.c | 179 .gain = 1100, 185 .gain = 855, 191 .gain = 670, 197 .gain = 450, 203 .gain = 400, 209 .gain = 330, 215 .gain = 230, 258 .gain = 909, 264 .gain = 1169, 270 .gain = 1492, [all …]
|
/linux-6.12.1/drivers/iio/frequency/ |
D | admfm2000.c | 32 u32 gain[2]; member 82 int gain; in admfm2000_read_raw() local 87 gain = ~(st->gain[chan->channel]) * -1000; in admfm2000_read_raw() 88 *val = gain / 1000; in admfm2000_read_raw() 89 *val2 = (gain % 1000) * 1000; in admfm2000_read_raw() 103 int gain, ret; in admfm2000_write_raw() local 106 gain = (val * 1000) - (val2 / 1000); in admfm2000_write_raw() 108 gain = (val * 1000) + (val2 / 1000); in admfm2000_write_raw() 110 if (gain > ADMFM2000_MAX_GAIN || gain < ADMFM2000_MIN_GAIN) in admfm2000_write_raw() 116 st->gain[chan->channel] = ~((abs(gain) / 1000) & 0x1F); in admfm2000_write_raw() [all …]
|
/linux-6.12.1/drivers/media/dvb-frontends/ |
D | stv6111.c | 535 s32 gain; in table_lookup() local 543 gain = table[0].value; in table_lookup() 545 gain = table[imax].value; in table_lookup() 556 gain = table[imin].value; in table_lookup() 558 gain += ((s32)(reg_value - table[imin].reg_value) * in table_lookup() 562 return gain; in table_lookup() 569 s32 gain; in get_rf_strength() local 589 gain = table_lookup(lnagain_nf_lookup, in get_rf_strength() 594 gain = table_lookup(lnagain_iip3_lookup, in get_rf_strength() 598 gain += table_lookup(gain_rfagc_lookup, in get_rf_strength() [all …]
|
/linux-6.12.1/Documentation/userspace-api/media/v4l/ |
D | ext-ctrls-rf-tuner.rst | 50 Enables/disables LNA automatic gain control (AGC) 53 Enables/disables mixer automatic gain control (AGC) 56 Enables/disables IF automatic gain control (AGC) 61 LNA gain and the RF gain in this document is that the LNA gain is 62 integrated in the tuner chip while the RF gain is a separate chip. 63 There may be both RF and LNA gain controls in the same device. The 67 LNA (low noise amplifier) gain is first gain stage on the RF tuner 70 ``V4L2_CID_RF_TUNER_RF_GAIN`` to understand how RF gain and LNA gain 75 Mixer gain is second gain stage on the RF tuner signal path. It is 81 IF gain is last gain stage on the RF tuner signal path. It is
|
/linux-6.12.1/drivers/net/wireless/mediatek/mt76/mt76x2/ |
D | phy.c | 15 s8 gain; in mt76x2_adjust_high_lna_gain() local 17 gain = FIELD_GET(MT_BBP_AGC_LNA_HIGH_GAIN, in mt76x2_adjust_high_lna_gain() 19 gain -= offset / 2; in mt76x2_adjust_high_lna_gain() 20 mt76_rmw_field(dev, MT_BBP(AGC, reg), MT_BBP_AGC_LNA_HIGH_GAIN, gain); in mt76x2_adjust_high_lna_gain() 26 s8 gain; in mt76x2_adjust_agc_gain() local 28 gain = FIELD_GET(MT_BBP_AGC_GAIN, mt76_rr(dev, MT_BBP(AGC, reg))); in mt76x2_adjust_agc_gain() 29 gain += offset; in mt76x2_adjust_agc_gain() 30 mt76_rmw_field(dev, MT_BBP(AGC, reg), MT_BBP_AGC_GAIN, gain); in mt76x2_adjust_agc_gain() 144 int base_power, gain; in mt76x2_phy_set_txpower() local 163 gain = min(txp_0, txp_1); in mt76x2_phy_set_txpower() [all …]
|
/linux-6.12.1/drivers/iio/adc/ |
D | hx711.c | 29 int gain; member 49 static int hx711_get_gain_to_pulse(int gain) in hx711_get_gain_to_pulse() argument 54 if (hx711_gain_to_scale[i].gain == gain) in hx711_get_gain_to_pulse() 59 static int hx711_get_gain_to_scale(int gain) in hx711_get_gain_to_scale() argument 64 if (hx711_gain_to_scale[i].gain == gain) in hx711_get_gain_to_scale() 75 return hx711_gain_to_scale[i].gain; in hx711_get_scale_to_gain() 308 int gain; in hx711_write_raw() local 321 gain = hx711_get_scale_to_gain(val2); in hx711_write_raw() 322 if (gain < 0) { in hx711_write_raw() 324 return gain; in hx711_write_raw() [all …]
|
D | ad7780.c | 65 unsigned int gain; member 122 *val = voltage_uv * st->gain; in ad7780_read_raw() 148 unsigned int full_scale, gain; in ad7780_write_raw() local 160 gain = DIV_ROUND_CLOSEST_ULL(vref, full_scale); in ad7780_write_raw() 161 gain = DIV_ROUND_CLOSEST(gain, val2); in ad7780_write_raw() 162 st->gain = gain; in ad7780_write_raw() 163 if (gain < AD7780_GAIN_MIDPOINT) in ad7780_write_raw() 164 gain = 0; in ad7780_write_raw() 166 gain = 1; in ad7780_write_raw() 167 gpiod_set_value(st->gain_gpio, gain); in ad7780_write_raw() [all …]
|
D | ab8500-gpadc.c | 200 s64 gain; member 286 if (!gpadc->cal_data[AB8500_CAL_VMAIN].gain) { in ab8500_gpadc_ad_to_voltage() 293 res = (int) (ad_value * gpadc->cal_data[AB8500_CAL_VMAIN].gain + in ab8500_gpadc_ad_to_voltage() 304 if (!gpadc->cal_data[AB8500_CAL_BTEMP].gain) { in ab8500_gpadc_ad_to_voltage() 311 res = (int) (ad_value * gpadc->cal_data[AB8500_CAL_BTEMP].gain + in ab8500_gpadc_ad_to_voltage() 318 if (!gpadc->cal_data[AB8500_CAL_VBAT].gain) { in ab8500_gpadc_ad_to_voltage() 325 res = (int) (ad_value * gpadc->cal_data[AB8500_CAL_VBAT].gain + in ab8500_gpadc_ad_to_voltage() 362 if (!gpadc->cal_data[AB8500_CAL_IBAT].gain) { in ab8500_gpadc_ad_to_voltage() 369 res = (int) (ad_value * gpadc->cal_data[AB8500_CAL_IBAT].gain + in ab8500_gpadc_ad_to_voltage() 773 gpadc->cal_data[AB8500_CAL_VMAIN].gain = AB8500_GPADC_CALIB_SCALE * in ab8500_gpadc_read_calibration_data() [all …]
|
/linux-6.12.1/drivers/iio/gyro/ |
D | st_gyro_core.c | 104 .gain = IIO_DEGREE_TO_RAD(8750), 109 .gain = IIO_DEGREE_TO_RAD(17500), 114 .gain = IIO_DEGREE_TO_RAD(70000), 182 .gain = IIO_DEGREE_TO_RAD(8750), 187 .gain = IIO_DEGREE_TO_RAD(17500), 192 .gain = IIO_DEGREE_TO_RAD(70000), 256 .gain = IIO_DEGREE_TO_RAD(8750), 261 .gain = IIO_DEGREE_TO_RAD(17500), 266 .gain = IIO_DEGREE_TO_RAD(70000), 330 .gain = IIO_DEGREE_TO_RAD(8750), [all …]
|
/linux-6.12.1/drivers/iio/light/ |
D | zopt2201.c | 77 u8 gain; member 83 unsigned int gain; /* gain factor */ member 94 unsigned int gain; /* gain factor */ member 118 u8 gain; /* gain register value */ member 147 u8 gain; /* gain register value */ member 275 zopt2201_gain_uvb[data->gain].gain; in zopt2201_read_raw() 280 *val = zopt2201_gain_als[data->gain].scale; in zopt2201_read_raw() 283 *val = zopt2201_gain_uvb[data->gain].scale; in zopt2201_read_raw() 338 static int zopt2201_set_gain(struct zopt2201_data *data, u8 gain) in zopt2201_set_gain() argument 342 ret = i2c_smbus_write_byte_data(data->client, ZOPT2201_LS_GAIN, gain); in zopt2201_set_gain() [all …]
|
D | rohm-bu27034.c | 275 static int bu27034_get_gain(struct bu27034_data *data, int chan, int *gain) in bu27034_get_gain() argument 293 *gain = ret; in bu27034_get_gain() 313 int gain, ret; in _bu27034_get_scale() local 315 ret = bu27034_get_gain(data, channel, &gain); in _bu27034_get_scale() 323 return iio_gts_get_scale(&data->gts, gain, ret, val, val2); in _bu27034_get_scale() 361 static int bu27034_set_gain(struct bu27034_data *data, int chan, int gain) in bu27034_set_gain() argument 365 ret = iio_gts_find_sel_by_gain(&data->gts, gain); in bu27034_set_gain() 507 struct bu27034_gain_check gain; in bu27034_set_scale() local 515 gain.chan = BU27034_CHAN_DATA1; in bu27034_set_scale() 517 gain.chan = BU27034_CHAN_DATA0; in bu27034_set_scale() [all …]
|
/linux-6.12.1/include/linux/iio/ |
D | iio-gts-helper.h | 27 int gain; member 74 .gain = (_gain), \ 166 int iio_gts_find_sel_by_gain(struct iio_gts *gts, int gain); 175 static inline bool iio_gts_valid_gain(struct iio_gts *gts, int gain) in iio_gts_valid_gain() argument 177 return iio_gts_find_sel_by_gain(gts, gain) >= 0; in iio_gts_valid_gain() 180 int iio_find_closest_gain_low(struct iio_gts *gts, int gain, bool *in_range); 191 int iio_gts_get_scale(struct iio_gts *gts, int gain, int time, int *scale_int,
|
/linux-6.12.1/drivers/isdn/mISDN/ |
D | dsp_biquad.h | 16 int32_t gain; member 27 int32_t gain, int32_t a1, int32_t a2, int32_t b1, int32_t b2) in biquad2_init() argument 29 bq->gain = gain; in biquad2_init() 44 z0 = sample * bq->gain + bq->z1 * bq->a1 + bq->z2 * bq->a2; in biquad2()
|
/linux-6.12.1/drivers/hwmon/ |
D | ina238.c | 110 int gain; member 201 (1000 * (4 - data->gain + 1)); in ina238_read_in() 228 regval = (regval * 1000 * (4 - data->gain + 1)) / in ina238_write_in() 276 *val = div_s64((s16)regval * INA238_FIXED_SHUNT * data->gain, in ina238_read_current() 301 data->gain, 20 * data->rshunt); in ina238_read_power() 315 data->gain, 20 * data->rshunt); in ina238_read_power() 348 1000ULL * INA238_FIXED_SHUNT * data->gain); in ina238_write_power() 565 if (device_property_read_u32(dev, "ti,shunt-gain", &data->gain) < 0) in ina238_probe() 566 data->gain = 4; /* Default of ADCRANGE = 0 */ in ina238_probe() 567 if (data->gain != 1 && data->gain != 4) { in ina238_probe() [all …]
|
/linux-6.12.1/sound/pci/echoaudio/ |
D | indigoio_dsp.c | 33 int gain); 107 int gain) in set_vmixer_gain() argument 118 chip->vmixer_gain[output][pipe] = gain; in set_vmixer_gain() 120 chip->comm_page->vmixer[index] = gain; in set_vmixer_gain() 123 "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); in set_vmixer_gain()
|
D | indigodj_dsp.c | 33 int gain); 137 int gain) in set_vmixer_gain() argument 148 chip->vmixer_gain[output][pipe] = gain; in set_vmixer_gain() 150 chip->comm_page->vmixer[index] = gain; in set_vmixer_gain() 153 "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); in set_vmixer_gain()
|
D | indigo_dsp.c | 33 int gain); 137 int gain) in set_vmixer_gain() argument 148 chip->vmixer_gain[output][pipe] = gain; in set_vmixer_gain() 150 chip->comm_page->vmixer[index] = gain; in set_vmixer_gain() 153 "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain); in set_vmixer_gain()
|
/linux-6.12.1/Documentation/userspace-api/media/drivers/ |
D | ccs.rst | 69 Analogue gain model 72 The CCS defines an analogue gain model where the gain can be calculated using 75 gain = m0 * x + c0 / (m1 * x + c1) 85 The analogue gain (``x`` in the formula) is controlled through 88 Alternate analogue gain model 91 The CCS defines another analogue gain model called alternate analogue gain. In 92 this case, the formula to calculate actual gain consists of linear and 95 gain = linear * 2 ^ exponent
|