/linux-6.6.21/drivers/iio/adc/ |
D | da9150-gpadc.c | 132 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 …]
|
D | ab8500-gpadc.c | 896 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()
|
D | max9611.c | 211 u16 *raw_val) in max9611_read_single() argument 244 *raw_val = ret; in max9611_read_single()
|
/linux-6.6.21/drivers/hwmon/ |
D | tps23861.c | 144 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/ |
D | mpu3050-core.c | 195 __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()
|
D | bmg160_core.c | 496 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/ |
D | kxsd9.c | 166 __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()
|
D | bmi088-accel-core.c | 281 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()
|
D | adxl372.c | 896 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()
|
D | fxls8962af-core.c | 255 __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()
|
D | bmc150-accel-core.c | 667 __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/ |
D | bno055.c | 661 __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/ |
D | tc358768.c | 647 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()
|