Searched refs:scale_in (Results 1 – 3 of 3) sorted by relevance
/linux-5.19.10/drivers/hwmon/ |
D | w83627ehf.c | 291 static inline long in_from_reg(u8 reg, u8 nr, const u16 *scale_in) in in_from_reg() argument 293 return DIV_ROUND_CLOSEST(reg * scale_in[nr], 100); in in_from_reg() 296 static inline u8 in_to_reg(u32 val, u8 nr, const u16 *scale_in) in in_to_reg() argument 298 return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); in in_to_reg() 320 const u16 *scale_in; member 706 data->in_##reg[channel] = in_to_reg(val, channel, data->scale_in); \ 1470 *val = in_from_reg(data->in[channel], channel, data->scale_in); in w83627ehf_do_read_in() 1474 data->scale_in); in w83627ehf_do_read_in() 1478 data->scale_in); in w83627ehf_do_read_in() 1864 data->scale_in = scale_in_w83627uhg; in w83627ehf_probe() [all …]
|
D | w83793.c | 143 static u8 scale_in[] = { 2, 2, 2, 16, 16, 16, 8, 24, 24, 16 }; variable 967 val = val * scale_in[index] + scale_in_add[index]; in show_in() 987 val = (val + scale_in[index] / 2) / scale_in[index]; in store_in() 993 val -= scale_in_add[index] / scale_in[index]; in store_in()
|
D | nct6775-core.c | 913 static const u16 scale_in[15] = { variable 920 return DIV_ROUND_CLOSEST(reg * scale_in[nr], 100); in in_from_reg() 925 return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); in in_to_reg()
|