/linux/drivers/media/usb/gspca/ |
H A D | autogain_functions.c | 3 * Functions for auto gain. 9 /* auto gain and exposure algorithm based on the knee algorithm described here: 12 Returns 0 if no changes were made, 1 if the gain and or exposure settings 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() [all …]
|
H A D | sonixb.c | 14 0x10 high nibble red gain low nibble blue gain 15 0x11 low nibble green gain 17 0x05 red gain 0-127 18 0x06 blue gain 0-127 19 0x07 green gain 0-127 115 if we adjust the gain or exposure we must ignore at least the next frame for 230 add a bit additional red gain and a lot additional blue gain, which 291 0x09 Blue Gain 292 0x0a Green1 Gain 293 0x0b Green2 Gain [all …]
|
/linux/sound/soc/tegra/ |
H A D | tegra210_sfc.c | 54 0x0001d727,//input gain 58 0x00000002,//output gain 60 0x000005d6,//input gain 64 0x00000003,//output gain 77 0x0000015f,//input gain 81 0x00000001//output gain 86 0x0001d727,//input gain 90 0x00000002//output gain 95 0x0001d727,//input gain 99 0x00000002,//output gain [all …]
|
/linux/sound/soc/codecs/ |
H A D | es83xx-dsm-common.h | 158 /* Volume - Gain */ 159 #define LINEIN_GAIN_0db 0x00 /* gain = 0db */ 160 #define LINEIN_GAIN_3db 0x01 /* gain = +3db */ 161 #define LINEIN_GAIN_6db 0x02 /* gain = +6db */ 162 #define LINEIN_GAIN_9db 0x03 /* gain = +9db */ 163 #define LINEIN_GAIN_12db 0x04 /* gain = +12db */ 164 #define LINEIN_GAIN_15db 0x05 /* gain = +15db */ 165 #define LINEIN_GAIN_18db 0x06 /* gain = +18db */ 166 #define LINEIN_GAIN_21db 0x07 /* gain = +21db */ 167 #define LINEIN_GAIN_24db 0x08 /* gain = +24db */ [all …]
|
/linux/drivers/iio/ |
H A D | industrialio-gts-helper.c | 2 /* gain-time-scale conversion helpers for IIO light sensors 22 * iio_gts_get_gain - Convert scale to total gain 24 * Internal helper for converting scale to total gain. 29 * @scale: Linearized scale to compute the gain for. 31 * Return: (floored) gain corresponding to the scale. -EINVAL if scale 45 * gain_get_scale_fraction - get the gain or time based on scale and known one 50 * @scale: Linearized scale to compute the gain/time for. 51 * @known: Either integration time or gain depending on which one is known 52 * @unknown: Pointer to variable where the computed gain/time is stored 54 * Internal helper for computing unknown fraction of total gain. [all …]
|
/linux/sound/soc/mediatek/mt8186/ |
H A D | mt8186-dai-hw-gain.c | 3 // MediaTek ALSA SoC Audio DAI HW Gain Control 12 #define HW_GAIN_1_EN_W_NAME "HW GAIN 1 Enable" 13 #define HW_GAIN_2_EN_W_NAME "HW GAIN 2 Enable" 58 /* let hw gain ramp up, set cur gain to 0 */ in mtk_hw_gain_event() 61 /* set target gain to 0 */ in mtk_hw_gain_event() 96 SND_SOC_DAPM_INPUT("HW Gain 1 Out Endpoint"), 97 SND_SOC_DAPM_INPUT("HW Gain 2 Out Endpoint"), 98 SND_SOC_DAPM_OUTPUT("HW Gain 1 In Endpoint"), 102 {"HW Gain 1 In", NULL, "HW_GAIN1_IN_CH1"}, 103 {"HW Gain 1 In", NULL, "HW_GAIN1_IN_CH2"}, [all …]
|
/linux/drivers/iio/amplifiers/ |
H A D | hmc425a.c | 3 * HMC425A and similar Gain Amplifiers 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; 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() [all …]
|
H A D | ad8366.c | 3 * AD8366 and similar Gain Amplifiers 4 * This driver supports the following gain amplifiers: 5 * AD8366 Dual-Digital Variable Gain Amplifier (VGA) 6 * ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) 7 * ADL5240 Digitally controlled variable gain amplifier (VGA) 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() [all …]
|
H A D | Kconfig | 3 # Gain Amplifiers, etc. 10 tristate "Analog Devices AD8366 and similar Gain Amplifiers" 16 gain amplifiers. This driver supports the following gain amplifiers 18 AD8366 Dual-Digital Variable Gain Amplifier (VGA) 19 ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) 20 ADL5240 Digitally controlled variable gain amplifier (VGA) 40 tristate "Analog Devices HMC425A and similar GPIO Gain Amplifiers" 44 gain amplifiers or step attenuators.
|
/linux/include/linux/iio/ |
H A D | iio-gts-helper.h | 2 /* gain-time-scale conversion helpers for IIO light sensors 15 * struct iio_gain_sel_pair - gain - selector values 18 * (gain) using a register interface. This structure describes amplification 21 * @gain: Gain (multiplication) value. Gain must be positive, negative 23 * @sel: Selector (usually register value) used to indicate this gain. 27 int gain; member 36 * of measured values (gain). This structure describes the relation of 74 .gain = (_gain), \ 118 * @gts: Gain time scale descriptor 137 * @gts: Gain time scale descriptor [all …]
|
/linux/Documentation/userspace-api/media/v4l/ |
H A 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/drivers/staging/media/atomisp/pci/isp/kernels/dp/dp_1.0/ |
H A 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/drivers/iio/light/ |
H A D | rohm-bu27008.c | 183 * Available scales with gain 1x - 1024x, timings 55, 100, 200, 400 mS 184 * Time impacts to gain: 1x, 2x, 4x, 8x. 186 * => Max total gain is HWGAIN * gain by integration time (8 * 1024) = 8192 191 * total gain 8192 will be 1953125 196 * On BU27010 available scales with gain 1x - 4096x, 197 * timings 55, 100, 200, 400 mS. Time impacts to gain: 1x, 2x, 4x, 8x. 199 * => Max total gain is HWGAIN * gain by integration time (8 * 4096) 201 * Using NANO precision for scale we must use scale 64x corresponding gain 1x 206 /* See the data sheet for the "Gain Setting" table */ 296 * All the RGBC channels share the same gain. [all …]
|
H A D | rohm-bu27034.c | 97 * Available scales with gain 1x - 1024x, timings 55, 100, 200, 400 mS 98 * Time impacts to gain: 1x, 2x, 4x, 8x. 100 * => Max total gain is HWGAIN * gain by integration time (8 * 1024) = 8192 101 * if 1x gain is scale 1, scale for 2x gain is 0.5, 4x => 0.25, 104 * Using NANO precision for scale, we must use scale 16x corresponding gain 1x 109 /* See the data sheet for the "Gain Setting" table */ 117 /* Available gain settings */ 129 * multiplying impact to the data register values (similar to gain). 132 * the scale is doubled. Eg, time impact to total gain is x1, x2, x4, x8. 198 * Protect gain and time during scale adjustment and data reading. [all …]
|
/linux/drivers/iio/test/ |
H A D | iio-test-gts.c | 2 /* Unit tests for IIO light sensor gain-time-scale helpers 73 /* Keep the gain and time tables unsorted to test the sorting */ 161 /* Ok times, negative gain */ in test_init_iio_gts_invalid() 167 /* gain * time overflow int */ in test_init_iio_gts_invalid() 186 * Meas time 100 => gain by time 2x in test_iio_gts_find_gain_for_scale_using_time() 187 * TEST_SCALE_8X matches total gain 8x in test_iio_gts_find_gain_for_scale_using_time() 196 * Meas time 200 => gain by time 4x in test_iio_gts_find_gain_for_scale_using_time() 197 * TEST_SCALE_256X matches total gain 256x in test_iio_gts_find_gain_for_scale_using_time() 203 /* Min time, Min gain */ in test_iio_gts_find_gain_for_scale_using_time() 209 /* Max time, Max gain */ in test_iio_gts_find_gain_for_scale_using_time() [all …]
|
/linux/drivers/iio/adc/ |
H A D | hx711.c | 24 /* gain to pulse and scale conversion */ 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() 83 int gain_set; /* gain set on device */ 84 int gain_chan_a; /* gain for channel A */ 206 /* after a reset the gain is 128 */ in hx711_reset() [all …]
|
H A 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 …]
|
/linux/drivers/net/wireless/broadcom/b43/ |
H A D | phy_n.h | 28 #define B43_NPHY_C1_CGAINI B43_PHY_N(0x01C) /* Core 1 compute gain info */ 29 #define B43_NPHY_C1_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ 31 #define B43_NPHY_C1_CGAINI_CLIPGBKOFF 0x03E0 /* Clip gain backoff */ 33 #define B43_NPHY_C1_CGAINI_GAINSTEP 0x1C00 /* Gain step */ 36 #define B43_NPHY_C1_CCK_CGAINI B43_PHY_N(0x01D) /* Core 1 CCK compute gain info */ 37 #define B43_NPHY_C1_CCK_CGAINI_GAINBKOFF 0x001F /* Gain backoff */ 38 #define B43_NPHY_C1_CCK_CGAINI_CLIPGBKOFF 0x01E0 /* CCK barely clip gain backoff */ 39 #define B43_NPHY_C1_MINMAX_GAIN B43_PHY_N(0x01E) /* Core 1 min/max gain */ 40 #define B43_NPHY_C1_MINGAIN 0x00FF /* Minimum gain */ 42 #define B43_NPHY_C1_MAXGAIN 0xFF00 /* Maximum gain */ [all …]
|
/linux/drivers/net/wireless/mediatek/mt76/mt76x2/ |
H A 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/drivers/staging/media/atomisp/pci/isp/kernels/ctc/ctc_1.0/ |
H A D | ia_css_ctc_types.h | 25 /* Fractional bits for CTC gain (used only for ISP1). 28 * of gain(=8), but also the bits(=5) to convert chroma 31 * Gain (struct ia_css_ctc_table) : u5.8 34 * Output = (Input * Gain) >> IA_CSS_CTC_COEF_SHIFT 60 u16 y0; /** 1st kneepoint gain. 63 u16 y1; /** 2nd kneepoint gain. 66 u16 y2; /** 3rd kneepoint gain. 69 u16 y3; /** 4th kneepoint gain. 72 u16 y4; /** 5th kneepoint gain. 75 u16 y5; /** 6th kneepoint gain. [all …]
|
/linux/drivers/iio/accel/ |
H A 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/drivers/comedi/drivers/ |
H A D | dt2811.c | 28 * - A/D ranges are not programmable but the gain is. The AI subdevice has 29 * a range_table containing all the possible analog input range/gain 31 * your board configuration and the desired gain to correctly convert 33 * gain. 57 #define DT2811_ADGCR_REG 0x01 /* r/w A/D Gain/Channel */ 105 * The gain may be set to 1, 2, 4, or 8 (on the dt2811-pgh) or to 110 BIP_RANGE(5), /* range 0: gain=1 */ 111 BIP_RANGE(2.5), /* range 1: gain=2 */ 112 BIP_RANGE(1.25), /* range 2: gain=4 */ 113 BIP_RANGE(0.625), /* range 3: gain=8 */ [all …]
|
/linux/Documentation/userspace-api/media/drivers/ |
H A 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
|
/linux/drivers/iio/magnetometer/ |
H A 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/Documentation/devicetree/bindings/iio/dac/ |
H A D | adi,ad3552r.yaml | 93 adi,gain-offset: 94 description: Gain offset used in the above formula 99 adi,gain-scaling-p: 100 description: GainP = 1 / ( 2 ^ adi,gain-scaling-p) 104 adi,gain-scaling-n: 105 description: GainN = 1 / ( 2 ^ adi,gain-scaling-n) 113 - adi,gain-offset 114 - adi,gain-scaling-p 115 - adi,gain-scaling-n 233 adi,gain-offset = <5>; [all …]
|