Lines Matching full:rsense
146 u32 rsense; member
444 *val = DIV_ROUND_CLOSEST(in * MILLI, st->rsense); in ltc4282_read_current_word()
459 *val = DIV_ROUND_CLOSEST(in * MILLI, st->rsense); in ltc4282_read_current_byte()
509 * P = CODE(16b) * 0.040 * Vfs(out) * 2^16 / ((2^16 - 1)^2 * Rsense) in ltc4282_read_power_word()
514 U16_MAX * (u64)st->rsense); in ltc4282_read_power_word()
519 st->rsense * int_pow(U16_MAX, 2)); in ltc4282_read_power_word()
537 int_pow(U8_MAX, 2) * st->rsense); in ltc4282_read_power_byte()
556 * ((2^16 - 1)^2 * Rsense) in ltc4282_read_energy()
560 * E = CODE(48b) * 40 * Vfs(out) * 256 / (U16_MAX * Rsense) in ltc4282_read_energy()
562 * As Rsense can have tenths of micro-ohm resolution, we need to in ltc4282_read_energy()
567 *val = DIV_ROUND_CLOSEST_ULL(temp * energy, st->rsense); in ltc4282_read_energy()
571 *val = DIV64_U64_ROUND_CLOSEST(temp, U16_MAX * (u64)st->rsense); in ltc4282_read_energy()
632 temp = val * int_pow(U8_MAX, 2) * st->rsense; in ltc4282_write_power_byte()
642 u64 temp = int_pow(U16_MAX, 2) * st->rsense, temp_2; in ltc4282_write_power_word()
950 u32 in = DIV_ROUND_CLOSEST_ULL((u64)val * st->rsense, DECA * MICRO); in ltc4282_write_curr()
1236 * rsense that is defined in ILIM_ADJUST. This is specially important for power
1237 * because for some rsense and vfsout values, if we allow the default raw 255
1254 st->power_max = DIV_ROUND_CLOSEST(st->vsense_max * DECA * MILLI, st->rsense) * st->vfs_out; in ltc4282_set_max_limits()
1359 ret = device_property_read_u32(dev, "adi,rsense-nano-ohms", in ltc4282_setup()
1360 &st->rsense); in ltc4282_setup()
1363 "Failed to read adi,rsense-nano-ohms\n"); in ltc4282_setup()
1364 if (st->rsense < CENTI) in ltc4282_setup()
1366 "adi,rsense-nano-ohms too small (< %lu)\n", in ltc4282_setup()
1370 * The resolution for rsense is tenths of micro (eg: 62.5 uOhm) which in ltc4282_setup()
1375 st->rsense /= CENTI; in ltc4282_setup()