Home
last modified time | relevance | path

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

/drivers/gpu/drm/amd/display/dc/calcs/
Dcustom_float.c33 uint32_t *mantissa, in build_custom_float() argument
49 *mantissa = 0; in build_custom_float()
78 *mantissa = 0; in build_custom_float()
117 *mantissa = dc_fixpt_floor(mantiss); in build_custom_float()
125 uint32_t mantissa, in setup_custom_float() argument
144 if (mantissa & ~mantissa_mask) { in setup_custom_float()
146 mantissa = mantissa_mask; in setup_custom_float()
159 if (mantissa & mask) in setup_custom_float()
187 uint32_t mantissa; in convert_to_custom_float_format() local
192 value, format, &negative, &mantissa, &exponenta) && in convert_to_custom_float_format()
[all …]
/drivers/iio/light/
Dmax44009.c174 int mantissa; in max44009_lux_raw() local
181 mantissa = ((hi & 0xf) << 4) | (lo & 0xf); in max44009_lux_raw()
191 return exponent * mantissa; in max44009_lux_raw()
301 int mantissa, exp; in max44009_threshold_byte_from_fraction() local
309 mantissa = integral * MAX44009_SCALE_DENOMINATOR; in max44009_threshold_byte_from_fraction()
310 mantissa /= MAX44009_SCALE_NUMERATOR; in max44009_threshold_byte_from_fraction()
313 mantissa += fractional / MAX44009_FRACT_MULT * in max44009_threshold_byte_from_fraction()
316 for (exp = 0; mantissa > 0xff; exp++) in max44009_threshold_byte_from_fraction()
317 mantissa >>= 1; in max44009_threshold_byte_from_fraction()
319 mantissa >>= 4; in max44009_threshold_byte_from_fraction()
[all …]
Dopt3001.c171 u16 mantissa, int *val, int *val2) in opt3001_to_iio_ret() argument
175 lux = 10 * (mantissa << exponent); in opt3001_to_iio_ret()
227 u16 mantissa; in opt3001_get_lux() local
340 mantissa = OPT3001_REG_MANTISSA(opt->result); in opt3001_get_lux()
342 opt3001_to_iio_ret(opt, exponent, mantissa, val, val2); in opt3001_get_lux()
479 u16 mantissa; in opt3001_write_event_value() local
496 mantissa = (((val * 1000) + (val2 / 1000)) / 10) >> exponent; in opt3001_write_event_value()
497 value = (exponent << 12) | mantissa; in opt3001_write_event_value()
502 opt->high_thresh_mantissa = mantissa; in opt3001_write_event_value()
507 opt->low_thresh_mantissa = mantissa; in opt3001_write_event_value()
/drivers/hwmon/pmbus/
Dzl6100.c63 s32 mantissa; in zl6100_l2d() local
67 mantissa = ((s16)((l & 0x7ff) << 5)) >> 5; in zl6100_l2d()
69 val = mantissa; in zl6100_l2d()
87 s16 exponent = 0, mantissa; in zl6100_d2l() local
111 mantissa = DIV_ROUND_CLOSEST(val, 1000); in zl6100_d2l()
114 if (mantissa > 0x3ff) in zl6100_d2l()
115 mantissa = 0x3ff; in zl6100_d2l()
119 mantissa = -mantissa; in zl6100_d2l()
122 return (mantissa & 0x7ff) | ((exponent << 11) & 0xf800); in zl6100_d2l()
Dbpa-rs600.c49 int ret, exponent, mantissa; in bpa_rs600_read_vin() local
57 mantissa = ret & 0x7ff; in bpa_rs600_read_vin()
60 mantissa >>= 1; in bpa_rs600_read_vin()
62 ret = (exponent << 11) | mantissa; in bpa_rs600_read_vin()
Dxdpe12284.c27 s32 mantissa; in xdpe122_read_word_data() local
39 mantissa = ((s16)((ret & GENMASK(10, 0)) << 5)) >> 5; in xdpe122_read_word_data()
40 val = mantissa * 1000L; in xdpe122_read_word_data()
Dpmbus_core.c602 s32 mantissa; in pmbus_reg2data_linear() local
607 mantissa = (u16) sensor->data; in pmbus_reg2data_linear()
610 mantissa = ((s16)((sensor->data & 0x7ff) << 5)) >> 5; in pmbus_reg2data_linear()
613 val = mantissa; in pmbus_reg2data_linear()
738 s16 exponent = 0, mantissa; in pmbus_data2reg_linear() local
790 mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff); in pmbus_data2reg_linear()
794 mantissa = -mantissa; in pmbus_data2reg_linear()
797 return (mantissa & 0x7ff) | ((exponent << 11) & 0xf800); in pmbus_data2reg_linear()
/drivers/usb/serial/
Dpl2303.c612 unsigned int baseline, mantissa, exponent; in pl2303_encode_baud_rate_divisor() local
622 mantissa = baseline / baud; in pl2303_encode_baud_rate_divisor()
623 if (mantissa == 0) in pl2303_encode_baud_rate_divisor()
624 mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */ in pl2303_encode_baud_rate_divisor()
626 while (mantissa >= 512) { in pl2303_encode_baud_rate_divisor()
628 mantissa >>= 2; /* divide by 4 */ in pl2303_encode_baud_rate_divisor()
632 mantissa = 511; in pl2303_encode_baud_rate_divisor()
639 buf[1] = exponent << 1 | mantissa >> 8; in pl2303_encode_baud_rate_divisor()
640 buf[0] = mantissa & 0xff; in pl2303_encode_baud_rate_divisor()
643 baud = (baseline / mantissa) >> (exponent << 1); in pl2303_encode_baud_rate_divisor()
[all …]
/drivers/iio/chemical/
Dsps30.c42 int mantissa = val & GENMASK(22, 0); in sps30_float_to_int_clamped() local
48 if (!exp && !mantissa) in sps30_float_to_int_clamped()
54 return ((((1 << 23) + mantissa) * 100) >> 23) >> (-exp); in sps30_float_to_int_clamped()
59 val = (1 << exp) + (mantissa >> shift); in sps30_float_to_int_clamped()
63 fraction = mantissa & GENMASK(shift - 1, 0); in sps30_float_to_int_clamped()
Dscd30_core.c92 mantissa = float32 & GENMASK(22, 0), in scd30_float_to_fp() local
97 if (!exp && !mantissa) in scd30_float_to_fp()
104 return sign * ((((BIT(23) + mantissa) * 100) >> 23) >> exp); in scd30_float_to_fp()
109 float32 = BIT(exp) + (mantissa >> shift); in scd30_float_to_fp()
110 fraction = mantissa & GENMASK(shift - 1, 0); in scd30_float_to_fp()
/drivers/net/wireless/mediatek/mt76/mt76x0/
Dphy.c667 u32 mantissa = val << 4; in mt76x0_phy_lin2db() local
671 while (mantissa < BIT(15)) { in mt76x0_phy_lin2db()
672 mantissa <<= 1; in mt76x0_phy_lin2db()
676 while (mantissa > 0xffff) { in mt76x0_phy_lin2db()
677 mantissa >>= 1; in mt76x0_phy_lin2db()
683 if (mantissa <= 47104) in mt76x0_phy_lin2db()
684 data = mantissa + (mantissa >> 3) + (mantissa >> 4) - 38400; in mt76x0_phy_lin2db()
686 data = mantissa - (mantissa >> 3) - (mantissa >> 6) - 23040; in mt76x0_phy_lin2db()
/drivers/clk/ti/
Ddpll3xxx.c305 u32 v, ctrl, mod_freq_divider, exponent, mantissa; in omap3_noncore_dpll_ssc_program() local
326 mantissa = mod_freq_divider; in omap3_noncore_dpll_ssc_program()
327 while ((mantissa > 127) && (exponent < 7)) { in omap3_noncore_dpll_ssc_program()
329 mantissa /= 2; in omap3_noncore_dpll_ssc_program()
331 if (mantissa > 127) in omap3_noncore_dpll_ssc_program()
332 mantissa = 127; in omap3_noncore_dpll_ssc_program()
336 v |= mantissa << __ffs(dd->ssc_modfreq_mant_mask); in omap3_noncore_dpll_ssc_program()
/drivers/net/ethernet/marvell/octeontx2/nic/
Dotx2_tc.c119 u32 *mantissa, u32 *div_exp) in otx2_get_egress_rate_cfg() argument
140 *mantissa = tmp * 2; in otx2_get_egress_rate_cfg()
142 *mantissa = tmp / (1ULL << (*exp - 7)); in otx2_get_egress_rate_cfg()
146 *mantissa = MAX_RATE_MANTISSA; in otx2_get_egress_rate_cfg()
154 u32 exp, mantissa, div_exp; in otx2_get_txschq_rate_regval() local
159 otx2_get_egress_rate_cfg(maxrate, &exp, &mantissa, &div_exp); in otx2_get_txschq_rate_regval()
166 FIELD_PREP(TLX_RATE_MANTISSA, mantissa) | BIT_ULL(0); in otx2_get_txschq_rate_regval()
172 FIELD_PREP(TLX_RATE_MANTISSA, mantissa) | BIT_ULL(0); in otx2_get_txschq_rate_regval()
/drivers/isdn/mISDN/
Ddsp_audio.c124 int sign, exponent, mantissa; in linear2ulaw() local
135 mantissa = (sample >> (exponent + 3)) & 0x0F; in linear2ulaw()
136 ulawbyte = ~(sign | (exponent << 4) | mantissa); in linear2ulaw()
/drivers/md/bcache/
Dutil.h576 unsigned int mantissa = 1 << fract_bits; /* Implicit bit */ in fract_exp_two() local
578 mantissa += x & (mantissa - 1); in fract_exp_two()
581 return mantissa << x >> fract_bits; in fract_exp_two()
Dbset.c247 unsigned int mantissa:BKEY_MANTISSA_BITS; member
632 f->mantissa = bfloat_mantissa(m, f) - 1; in make_bfloat()
976 if (f->mantissa >= bfloat_mantissa(search, f)) in bset_search_tree()
/drivers/iio/proximity/
Disl29501.c444 int mantissa; in isl29501_write_ext() local
450 mantissa = corr >> max_exp; in isl29501_write_ext()
452 ret = isl29501_write_coeff(isl29501, i, mantissa); in isl29501_write_ext()
/drivers/gpu/drm/amd/display/dc/inc/hw/
Dopp.h136 uint32_t mantissa; member
/drivers/isdn/hardware/mISDN/
Dhfcmulti.c1828 u_int mantissa; in hfcmulti_dtmf() local
1867 mantissa = w_float & 0x0fff; in hfcmulti_dtmf()
1869 mantissa |= 0xfffff000; in hfcmulti_dtmf()
1872 mantissa ^= 0x1000; in hfcmulti_dtmf()
1873 mantissa <<= (exponent - 1); in hfcmulti_dtmf()
1877 coeff[co << 1] = mantissa; in hfcmulti_dtmf()
1886 mantissa = w_float & 0x0fff; in hfcmulti_dtmf()
1888 mantissa |= 0xfffff000; in hfcmulti_dtmf()
1891 mantissa ^= 0x1000; in hfcmulti_dtmf()
1892 mantissa <<= (exponent - 1); in hfcmulti_dtmf()
[all …]
/drivers/pcmcia/
Dcistpl.c34 static const u_char mantissa[] = { variable
45 (mantissa[(((v)>>3)&15)-1] * exponent[(v)&7] / 10)
48 (mantissa[((v)>>3)&15] * exponent[(v)&7] / 10)
/drivers/usb/gadget/
Dcomposite.c810 u8 mantissa; in bos_desc() local
817 mantissa = 10; in bos_desc()
819 mantissa = 5 << ssid; in bos_desc()
833 FIELD_PREP(USB_SSP_SUBLINK_SPEED_LSM, mantissa)); in bos_desc()
/drivers/tty/serial/
Dstm32-usart.c814 u32 usartdiv, mantissa, fraction, oversampling; in stm32_usart_set_termios() local
941 mantissa = (usartdiv / oversampling) << USART_BRR_DIV_M_SHIFT; in stm32_usart_set_termios()
943 writel_relaxed(mantissa | fraction, port->membase + ofs->brr); in stm32_usart_set_termios()
/drivers/usb/core/
Dhub.c2787 u16 mantissa; in get_port_ssp_rate() local
2805 mantissa = FIELD_GET(USB_SSP_SUBLINK_SPEED_LSM, attr); in get_port_ssp_rate()
2809 mantissa /= 1000; in get_port_ssp_rate()
2811 if (mantissa >= 10 && lanes == 1) in get_port_ssp_rate()
2814 if (mantissa >= 10 && lanes == 2) in get_port_ssp_rate()
2817 if (mantissa >= 5 && lanes == 2) in get_port_ssp_rate()
/drivers/atm/
Diphase.c343 u32 exp, mantissa, cps;
347 mantissa = rate & M_MASK;
350 cps = (1 << M_BITS) | mantissa;
/drivers/staging/media/ipu3/
Dipu3-css-params.c51 int mantissa = (1 << exponent) * output_width; in imgu_css_scaler_setup_lut() local
78 coeff *= mantissa; in imgu_css_scaler_setup_lut()