Home
last modified time | relevance | path

Searched refs:gain (Results 1 – 25 of 205) sorted by relevance

123456789

/drivers/media/usb/gspca/
Dautogain_functions.c22 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 …]
Dsonixb.c582 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 …]
Dsn9c2028.c31 struct v4l2_ctrl *gain; member
293 set_gain(gspca_dev, sd->gain->val); in sd_s_ctrl()
314 sd->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, in sd_init_controls()
714 if (sd->gain) in start_genius_videocam_live()
715 set_gain(gspca_dev, v4l2_ctrl_g_ctrl(sd->gain)); in start_genius_videocam_live()
857 s32 cur_gain = v4l2_ctrl_g_ctrl(sd->gain); in do_autogain()
863 if (cur_gain == sd->gain->maximum) in do_autogain()
866 v4l2_ctrl_s_ctrl(sd->gain, cur_gain); in do_autogain()
869 if (cur_gain == sd->gain->minimum) in do_autogain()
872 v4l2_ctrl_s_ctrl(sd->gain, cur_gain); in do_autogain()
Dsn9c20x.c77 struct v4l2_ctrl *gain; member
1495 u8 gain[8] = {sd->i2c_intf, sd->i2c_addr, in set_gain() local
1499 gain[7] = 0x15; /* or 1d ? */ in set_gain()
1507 gain[0] |= (2 << 4); in set_gain()
1508 gain[3] = ov_gain[g]; in set_gain()
1511 gain[0] |= (3 << 4); in set_gain()
1512 gain[2] = 0x35; in set_gain()
1513 gain[3] = micron1_gain[g] >> 8; in set_gain()
1514 gain[4] = micron1_gain[g]; in set_gain()
1517 gain[0] |= (3 << 4); in set_gain()
[all …]
Dtouptek.c289 u16 gain, u16 global_gain) in setbgain() argument
294 ((u32)global_gain) * gain / GAIN_MAX; in setbgain()
302 REG_BLUE_GAIN, normalized, gain); in setbgain()
308 u16 gain, u16 global_gain) in setrgain() argument
313 ((u32)global_gain) * gain / GAIN_MAX; in setrgain()
321 REG_RED_GAIN, normalized, gain); in setrgain()
602 setggain(gspca_dev, gspca_dev->gain->val); in sd_s_ctrl()
606 setbgain(gspca_dev, sd->blue->val, gspca_dev->gain->val); in sd_s_ctrl()
610 setrgain(gspca_dev, sd->red->val, gspca_dev->gain->val); in sd_s_ctrl()
632 gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, in sd_init_controls()
/drivers/staging/media/atomisp/pci/isp/kernels/dp/dp_1.0/
Dia_css_dp.host.c51 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 …]
/drivers/iio/accel/
Dst_accel_core.c156 .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 …]
/drivers/iio/magnetometer/
Dst_magn_core.c179 .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 …]
/drivers/iio/amplifiers/
Dhmc425a.c42 u32 gain; member
62 int code, gain = 0; in hmc425a_read_raw() local
68 code = st->gain; in hmc425a_read_raw()
72 gain = ~code * -500; in hmc425a_read_raw()
76 *val = gain / 1000; in hmc425a_read_raw()
77 *val2 = (gain % 1000) * 1000; in hmc425a_read_raw()
95 int code = 0, gain; in hmc425a_write_raw() local
99 gain = (val * 1000) - (val2 / 1000); in hmc425a_write_raw()
101 gain = (val * 1000) + (val2 / 1000); in hmc425a_write_raw()
103 if (gain > inf->gain_max || gain < inf->gain_min) in hmc425a_write_raw()
[all …]
Dad8366.c113 int code, gain = 0; in ad8366_read_raw() local
122 gain = code * 253 + 4500; in ad8366_read_raw()
125 gain = 15000 - code * 1000; in ad8366_read_raw()
128 gain = 20000 - 31500 + code * 500; in ad8366_read_raw()
131 gain = -1 * code * 250; in ad8366_read_raw()
136 *val = gain / 1000; in ad8366_read_raw()
137 *val2 = (gain % 1000) * 1000; in ad8366_read_raw()
157 int code = 0, gain; in ad8366_write_raw() local
162 gain = (val * 1000) - (val2 / 1000); in ad8366_write_raw()
164 gain = (val * 1000) + (val2 / 1000); in ad8366_write_raw()
[all …]
DKconfig16 gain amplifiers. This driver supports the following gain amplifiers
20 ADL5240 Digitally controlled variable gain amplifier (VGA)
42 gain amplifiers or step attenuators.
/drivers/media/dvb-frontends/
Dstv6111.c535 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 …]
/drivers/net/wireless/mediatek/mt76/mt76x2/
Dphy.c15 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 …]
/drivers/iio/adc/
Dhx711.c29 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()
309 int gain; in hx711_write_raw() local
322 gain = hx711_get_scale_to_gain(val2); in hx711_write_raw()
323 if (gain < 0) { in hx711_write_raw()
325 return gain; in hx711_write_raw()
[all …]
Dad7780.c65 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 …]
Dab8500-gpadc.c200 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 …]
/drivers/iio/light/
Dzopt2201.c77 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 …]
/drivers/iio/gyro/
Dst_gyro_core.c104 .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 …]
/drivers/hwmon/
Dina238.c110 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 …]
/drivers/isdn/mISDN/
Ddsp_biquad.h16 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()
/drivers/input/
Dff-memless.c47 int gain; member
242 int gain) in ml_combine_effects() argument
255 x = fixp_mult(fixp_sin16(i), level) * gain / 0xffff; in ml_combine_effects()
256 y = fixp_mult(-fixp_cos16(i), level) * gain / 0xffff; in ml_combine_effects()
269 strong = (u32)new->u.rumble.strong_magnitude * gain / 0xffff; in ml_combine_effects()
270 weak = (u32)new->u.rumble.weak_magnitude * gain / 0xffff; in ml_combine_effects()
296 i = i * gain / 0x7fff; in ml_combine_effects()
380 ml_combine_effects(combo_effect, state, ml->gain); in ml_get_combo_effect()
416 static void ml_ff_set_gain(struct input_dev *dev, u16 gain) in ml_ff_set_gain() argument
421 ml->gain = gain; in ml_ff_set_gain()
[all …]
/drivers/staging/media/atomisp/i2c/
Datomisp-gc0310.c417 static int gc0310_set_gain(struct v4l2_subdev *sd, int gain) in gc0310_set_gain() argument
424 if (gain < 0x20) in gc0310_set_gain()
425 gain = 0x20; in gc0310_set_gain()
426 if (gain > 0x80) in gc0310_set_gain()
427 gain = 0x80; in gc0310_set_gain()
429 if (gain >= 0x20 && gain < 0x40) { in gc0310_set_gain()
431 dgain = gain; in gc0310_set_gain()
434 dgain = gain / 2; in gc0310_set_gain()
437 dev_dbg(&client->dev, "gain=0x%x again=0x%x dgain=0x%x\n", gain, again, dgain); in gc0310_set_gain()
455 int gain, int digitgain) in __gc0310_set_exposure() argument
[all …]
/drivers/media/usb/gspca/stv06xx/
Dstv06xx_st6422.c51 static int setgain(struct sd *sd, u8 gain);
213 static int setgain(struct sd *sd, u8 gain) in setgain() argument
218 err = stv06xx_write_bridge(sd, 0x0509, gain); in setgain()
222 err = stv06xx_write_bridge(sd, 0x050a, gain); in setgain()
226 err = stv06xx_write_bridge(sd, 0x050b, gain); in setgain()
/drivers/media/i2c/
Dmt9t001.c498 static u16 mt9t001_gain_value(s32 *gain) in mt9t001_gain_value() argument
514 if (*gain <= 32) in mt9t001_gain_value()
515 return *gain; in mt9t001_gain_value()
517 if (*gain <= 64) { in mt9t001_gain_value()
518 *gain &= ~1; in mt9t001_gain_value()
519 return (1 << 6) | (*gain >> 1); in mt9t001_gain_value()
522 *gain &= ~7; in mt9t001_gain_value()
523 return ((*gain - 64) << 5) | (1 << 6) | 32; in mt9t001_gain_value()
558 struct v4l2_ctrl *gain = mt9t001->gains[i]; in mt9t001_s_ctrl() local
560 if (gain->val != gain->cur.val) in mt9t001_s_ctrl()
[all …]
/drivers/iio/imu/st_lsm6dsx/
Dst_lsm6dsx_shub.c61 .gain = 1500,
120 .gain = 146,
124 .gain = 292,
128 .gain = 438,
132 .gain = 584,
577 *val2 = sensor->gain; in st_lsm6dsx_shub_read_raw()
590 u32 gain) in st_lsm6dsx_shub_set_full_scale() argument
600 if (fs_table->fs_avl[i].gain == gain) in st_lsm6dsx_shub_set_full_scale()
613 sensor->gain = gain; in st_lsm6dsx_shub_set_full_scale()
700 settings->fs_table.fs_avl[i].gain); in st_lsm6dsx_shub_scale_avail()
[all …]

123456789