Home
last modified time | relevance | path

Searched refs:raw_val (Results 1 – 13 of 13) sorted by relevance

/linux-6.6.21/drivers/iio/adc/
Dda9150-gpadc.c132 static inline int da9150_gpadc_gpio_6v_voltage_now(int raw_val) in da9150_gpadc_gpio_6v_voltage_now() argument
135 return (6 * ((raw_val * 1000) + 500)) / 1024; in da9150_gpadc_gpio_6v_voltage_now()
138 static inline int da9150_gpadc_ibus_current_avg(int raw_val) in da9150_gpadc_ibus_current_avg() argument
141 return (4 * ((raw_val * 1000) + 500)) / 2048; in da9150_gpadc_ibus_current_avg()
144 static inline int da9150_gpadc_vbus_21v_voltage_now(int raw_val) in da9150_gpadc_vbus_21v_voltage_now() argument
147 return (21 * ((raw_val * 1000) + 500)) / 1024; in da9150_gpadc_vbus_21v_voltage_now()
150 static inline int da9150_gpadc_vsys_6v_voltage_now(int raw_val) in da9150_gpadc_vsys_6v_voltage_now() argument
153 return (3 * ((raw_val * 1000) + 500)) / 512; in da9150_gpadc_vsys_6v_voltage_now()
159 int raw_val; in da9150_gpadc_read_processed() local
161 raw_val = da9150_gpadc_read_adc(gpadc, hw_chan); in da9150_gpadc_read_processed()
[all …]
Dab8500-gpadc.c896 int raw_val; in ab8500_gpadc_read_raw() local
906 raw_val = ab8500_gpadc_read(gpadc, ch, NULL); in ab8500_gpadc_read_raw()
907 if (raw_val < 0) in ab8500_gpadc_read_raw()
908 return raw_val; in ab8500_gpadc_read_raw()
911 *val = raw_val; in ab8500_gpadc_read_raw()
916 processed = ab8500_gpadc_ad_to_voltage(gpadc, ch->id, raw_val); in ab8500_gpadc_read_raw()
Dmax9611.c211 u16 *raw_val) in max9611_read_single() argument
244 *raw_val = ret; in max9611_read_single()
/linux-6.6.21/drivers/hwmon/
Dtps23861.c144 long raw_val; in tps23861_read_voltage() local
159 raw_val = le16_to_cpu(regval); in tps23861_read_voltage()
160 *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * VOLTAGE_LSB) / 1000; in tps23861_read_voltage()
168 long raw_val, current_lsb; in tps23861_read_current() local
184 raw_val = le16_to_cpu(regval); in tps23861_read_current()
185 *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * current_lsb) / 1000000; in tps23861_read_current()
460 unsigned int raw_val; in tps23861_port_resistance() local
468 raw_val = le16_to_cpu(regval); in tps23861_port_resistance()
469 switch (FIELD_GET(PORT_RESISTANCE_RSN_MASK, raw_val)) { in tps23861_port_resistance()
471 return (FIELD_GET(PORT_RESISTANCE_MASK, raw_val) * RESISTANCE_LSB) / 10000; in tps23861_port_resistance()
[all …]
/linux-6.6.21/drivers/iio/gyro/
Dmpu3050-core.c195 __be16 raw_val[3]; in mpu3050_start_sampling() local
214 raw_val[i] = cpu_to_be16(mpu3050->calibration[i]); in mpu3050_start_sampling()
216 ret = regmap_bulk_write(mpu3050->map, MPU3050_X_OFFS_USR_H, raw_val, in mpu3050_start_sampling()
217 sizeof(raw_val)); in mpu3050_start_sampling()
270 __be16 raw_val; in mpu3050_read_raw() local
335 &raw_val, sizeof(raw_val)); in mpu3050_read_raw()
342 *val = (s16)be16_to_cpu(raw_val); in mpu3050_read_raw()
349 &raw_val, in mpu3050_read_raw()
350 sizeof(raw_val)); in mpu3050_read_raw()
357 *val = be16_to_cpu(raw_val); in mpu3050_read_raw()
Dbmg160_core.c496 unsigned int raw_val; in bmg160_get_temp() local
505 ret = regmap_read(data->regmap, BMG160_REG_TEMP, &raw_val); in bmg160_get_temp()
513 *val = sign_extend32(raw_val, 7); in bmg160_get_temp()
526 __le16 raw_val; in bmg160_get_axis() local
535 ret = regmap_bulk_read(data->regmap, BMG160_AXIS_TO_REG(axis), &raw_val, in bmg160_get_axis()
536 sizeof(raw_val)); in bmg160_get_axis()
544 *val = sign_extend32(le16_to_cpu(raw_val), 15); in bmg160_get_axis()
/linux-6.6.21/drivers/iio/accel/
Dkxsd9.c166 __be16 raw_val; in kxsd9_read_raw() local
173 ret = regmap_bulk_read(st->map, chan->address, &raw_val, in kxsd9_read_raw()
174 sizeof(raw_val)); in kxsd9_read_raw()
177 nval = be16_to_cpu(raw_val); in kxsd9_read_raw()
Dbmi088-accel-core.c281 s16 raw_val; in bmi088_accel_get_axis() local
289 raw_val = le16_to_cpu(*(__le16 *)data->buffer); in bmi088_accel_get_axis()
290 *val = raw_val; in bmi088_accel_get_axis()
Dadxl372.c896 u16 raw_val; in adxl372_write_event_value() local
900 raw_val = DIV_ROUND_UP(val * 1000000, ADXL372_USCALE); in adxl372_write_event_value()
904 return adxl372_write_threshold_value(indio_dev, addr, raw_val); in adxl372_write_event_value()
907 return adxl372_write_threshold_value(indio_dev, addr, raw_val); in adxl372_write_event_value()
Dfxls8962af-core.c255 __le16 raw_val; in fxls8962af_get_out() local
267 &raw_val, sizeof(data->lower_thres)); in fxls8962af_get_out()
277 *val = sign_extend32(le16_to_cpu(raw_val), in fxls8962af_get_out()
Dbmc150-accel-core.c667 __le16 raw_val; in bmc150_accel_get_axis() local
677 &raw_val, sizeof(raw_val)); in bmc150_accel_get_axis()
684 *val = sign_extend32(le16_to_cpu(raw_val) >> chan->scan_type.shift, in bmc150_accel_get_axis()
/linux-6.6.21/drivers/iio/imu/bno055/
Dbno055.c661 __le16 raw_val; in bno055_read_simple_chan() local
667 &raw_val, sizeof(raw_val)); in bno055_read_simple_chan()
670 *val = sign_extend32(le16_to_cpu(raw_val), 15); in bno055_read_simple_chan()
679 &raw_val, sizeof(raw_val)); in bno055_read_simple_chan()
686 *val = -sign_extend32(le16_to_cpu(raw_val), 15); in bno055_read_simple_chan()
828 unsigned int raw_val; in bno055_read_temp_chan() local
831 ret = regmap_read(priv->regmap, BNO055_TEMP_REG, &raw_val); in bno055_read_temp_chan()
839 *val = raw_val * 1000; in bno055_read_temp_chan()
/linux-6.6.21/drivers/gpu/drm/bridge/
Dtc358768.c647 s32 raw_val; in tc358768_bridge_pre_enable() local
761 raw_val = tc358768_ns_to_cnt(60 + tc358768_ps_to_ns(2 * ui_ps), hsbyteclk_ps) - 5; in tc358768_bridge_pre_enable()
762 val = clamp(raw_val, 0, 127); in tc358768_bridge_pre_enable()
771 raw_val = tc358768_ns_to_cnt(145 - tc358768_ps_to_ns(3 * ui_ps), hsbyteclk_ps) - 10; in tc358768_bridge_pre_enable()
772 val2 = clamp(raw_val, 0, 127); in tc358768_bridge_pre_enable()
790 raw_val = tc358768_ns_to_cnt(60 + tc358768_ps_to_ns(18 * ui_ps), in tc358768_bridge_pre_enable()
792 val = clamp(raw_val, 0, 15); in tc358768_bridge_pre_enable()