/linux-6.1.9/drivers/ata/ |
D | pata_cypress.c | 69 time_16 = clamp_val(t.recover - 1, 0, 15) | in cy82c693_set_piomode() 70 (clamp_val(t.active - 1, 0, 15) << 4); in cy82c693_set_piomode() 71 time_8 = clamp_val(t.act8b - 1, 0, 15) | in cy82c693_set_piomode() 72 (clamp_val(t.rec8b - 1, 0, 15) << 4); in cy82c693_set_piomode() 78 addr |= clamp_val(t.setup - 1, 0, 15); in cy82c693_set_piomode() 88 addr |= (clamp_val(t.setup - 1, 0, 15) << 4); in cy82c693_set_piomode()
|
D | pata_legacy.c | 395 active = clamp_val(t.active, 2, 15); in ht6560a_set_piomode() 396 recover = clamp_val(t.recover, 4, 15); in ht6560a_set_piomode() 429 active = clamp_val(t.active, 2, 15); in ht6560b_set_piomode() 430 recover = clamp_val(t.recover, 2, 16) & 0x0F; in ht6560b_set_piomode() 513 active = clamp_val(t.active, 2, 17) - 2; in opti82c611a_set_piomode() 514 recover = clamp_val(t.recover, 1, 16) - 1; in opti82c611a_set_piomode() 515 setup = clamp_val(t.setup, 1, 4) - 1; in opti82c611a_set_piomode() 592 active = clamp_val(t.active, 2, 17) - 2; in opti82c46x_set_piomode() 593 recover = clamp_val(t.recover, 1, 16) - 1; in opti82c46x_set_piomode() 594 setup = clamp_val(t.setup, 1, 4) - 1; in opti82c46x_set_piomode() [all …]
|
D | pata_amd.c | 86 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(at.setup, 1, 4) - 1) << ((3 - dn) << 1)); in timing_setup() 91 ((clamp_val(at.act8b, 1, 16) - 1) << 4) | (clamp_val(at.rec8b, 1, 16) - 1)); in timing_setup() 95 ((clamp_val(at.active, 1, 16) - 1) << 4) | (clamp_val(at.recover, 1, 16) - 1)); in timing_setup() 99 t = at.udma ? (0xc0 | (clamp_val(at.udma, 2, 5) - 2)) : 0x03; in timing_setup() 103 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 2, 10)]) : 0x03; in timing_setup() 107 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 10)]) : 0x03; in timing_setup() 111 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 15)]) : 0x03; in timing_setup()
|
D | pata_via.c | 284 setup |= (clamp_val(t.setup, 1, 4) - 1) << shift; in via_do_set_mode() 290 ((clamp_val(t.act8b, 1, 16) - 1) << 4) | (clamp_val(t.rec8b, 1, 16) - 1)); in via_do_set_mode() 292 ((clamp_val(t.active, 1, 16) - 1) << 4) | (clamp_val(t.recover, 1, 16) - 1)); in via_do_set_mode() 298 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 5) - 2)) : 0x03; in via_do_set_mode() 301 ut = t.udma ? (0xe8 | (clamp_val(t.udma, 2, 9) - 2)) : 0x0f; in via_do_set_mode() 304 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; in via_do_set_mode() 307 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; in via_do_set_mode()
|
D | pata_ns87410.c | 79 at.active = clamp_val(at.active, 2, 16) - 2; in ns87410_set_piomode() 80 at.setup = clamp_val(at.setup, 1, 4) - 1; in ns87410_set_piomode() 81 at.recover = clamp_val(at.recover, 1, 12) - 1; in ns87410_set_piomode()
|
D | pata_ali.c | 181 t->setup = clamp_val(t->setup, 1, 8) & 7; in ali_program_modes() 182 t->act8b = clamp_val(t->act8b, 1, 8) & 7; in ali_program_modes() 183 t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; in ali_program_modes() 184 t->active = clamp_val(t->active, 1, 8) & 7; in ali_program_modes() 185 t->recover = clamp_val(t->recover, 1, 16) & 15; in ali_program_modes()
|
/linux-6.1.9/drivers/hwmon/ |
D | ina238.c | 227 regval = clamp_val(val, -163, 163); in ina238_write_in() 230 regval = clamp_val(regval, S16_MIN, S16_MAX); in ina238_write_in() 244 regval = clamp_val(val, 0, 102396); in ina238_write_in() 246 regval = clamp_val(regval, 0, S16_MAX); in ina238_write_in() 303 *val = clamp_val(power, 0, LONG_MAX); in ina238_read_power() 317 *val = clamp_val(power, 0, LONG_MAX); in ina238_read_power() 346 regval = clamp_val(val, 0, LONG_MAX); in ina238_write_power() 349 regval = clamp_val(regval >> 8, 0, U16_MAX); in ina238_write_power() 401 regval = clamp_val(regval, S16_MIN, S16_MAX) & 0xfff0; in ina238_write_temp()
|
D | amc6821.c | 287 val = clamp_val(val / 1000, -128, 127); in temp_store() 364 data->pwm1 = clamp_val(val , 0, 255); in pwm1_store() 518 ptemp[0] = clamp_val(val / 1000, 0, in temp_auto_point_temp_store() 520 ptemp[0] = clamp_val(ptemp[0], 0, in temp_auto_point_temp_store() 522 ptemp[0] = clamp_val(ptemp[0], 0, 63); in temp_auto_point_temp_store() 533 ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124); in temp_auto_point_temp_store() 535 ptemp[2] = clamp_val(ptemp[2], ptemp[1] + 1, 255); in temp_auto_point_temp_store() 538 ptemp[2] = clamp_val(val / 1000, ptemp[1]+1, 255); in temp_auto_point_temp_store() 567 data->pwm1_auto_point_pwm[1] = clamp_val(val, 0, 254); in pwm1_auto_point_pwm_store() 625 data->fan[ix] = (u16) clamp_val(val, 1, 0xFFFF); in fan_store()
|
D | ltc2947-core.c | 624 val = clamp_val(val, TEMP_MIN, TEMP_MAX); in ltc2947_write_temp() 639 val = clamp_val(val, TEMP_MIN, TEMP_MAX); in ltc2947_write_temp() 670 val = clamp_val(val, POWER_MIN, POWER_MAX); in ltc2947_write_power() 675 val = clamp_val(val, POWER_MIN, POWER_MAX); in ltc2947_write_power() 696 val = clamp_val(val, CURRENT_MIN, CURRENT_MAX); in ltc2947_write_curr() 701 val = clamp_val(val, CURRENT_MIN, CURRENT_MAX); in ltc2947_write_curr() 733 val = clamp_val(val, VDVCC_MIN, VDVCC_MAX); in ltc2947_write_in() 739 val = clamp_val(val, VOLTAGE_MIN, VOLTAGE_MAX); in ltc2947_write_in() 745 val = clamp_val(val, VDVCC_MIN, VDVCC_MAX); in ltc2947_write_in() 751 val = clamp_val(val, VOLTAGE_MIN, VOLTAGE_MAX); in ltc2947_write_in()
|
D | lm95245.c | 286 val = clamp_val(val / 1000, 0, 255); in lm95245_write_temp() 292 val = clamp_val(val / 1000, 0, channel ? 255 : 127); in lm95245_write_temp() 304 val = clamp_val(val, -1000000, 1000000); in lm95245_write_temp() 306 val = clamp_val(val, 0, 31); in lm95245_write_temp() 312 val = clamp_val(val, -128000, 127875); in lm95245_write_temp()
|
D | asc7621.c | 181 reqval = clamp_val(reqval, 0, 255); in store_u8() 214 reqval = clamp_val(reqval, 0, param->mask[0]); in store_bitmask() 264 (reqval <= 0 ? 0xffff : clamp_val(5400000 / reqval, 0, 0xfffe)); in store_fan16() 333 reqval = clamp_val(reqval, 0, 0xffff); in store_in8() 337 reqval = clamp_val(reqval, 0, 0xff); in store_in8() 366 reqval = clamp_val(reqval, -127000, 127000); in store_temp8() 422 reqval = clamp_val(reqval, -32000, 31750); in store_temp62() 458 temp = auto_point1 + asc7621_range_map[clamp_val(regval, 0, 15)]; in show_ap2_temp() 479 reqval = clamp_val(reqval, auto_point1 + 2000, auto_point1 + 80000); in store_ap2_temp() 513 return sprintf(buf, "%u\n", map[clamp_val(regval, 0, 15)]); in show_pwm_ac() [all …]
|
D | tmp401.c | 280 temp = clamp_val(temp, -64000, 191000); in tmp401_temp_to_register() 283 temp = clamp_val(temp, 0, 127000); in tmp401_temp_to_register() 379 val = clamp_val(val, -64000, 191000); in tmp401_temp_write() 381 val = clamp_val(val, 0, 127000); in tmp401_temp_write() 388 val = clamp_val(val, temp - 255000, temp); in tmp401_temp_write() 435 val = clamp_val(val, 125, 16000); in tmp401_set_convrate()
|
D | ina209.c | 164 return clamp_val(val, -320, 320) * 100; in ina209_to_reg() 176 return (DIV_ROUND_CLOSEST(clamp_val(val, 0, 32000), 4) << 3) in ina209_to_reg() 187 return (clamp_val(-val, 0, 255) << 8) | (old & 0xff); in ina209_to_reg() 196 return (clamp_val(val, 0, 255) << 8) | (old & 0xff); in ina209_to_reg() 526 clamp_val(40960000 / shunt, 1, 65535)); in ina209_init_client()
|
D | tmp464.c | 286 interval = clamp_val(interval, 125, 16000); in tmp464_set_convrate() 316 val = clamp_val(val, -256000, 256000); /* prevent overflow/underflow */ in tmp464_temp_write() 317 val = clamp_val(temp_from_reg(regval) - val, 0, 255000); in tmp464_temp_write() 322 val = temp_to_limit_reg(clamp_val(val, -255000, 255500)); in tmp464_temp_write() 326 val = temp_to_limit_reg(clamp_val(val, -255000, 255500)); in tmp464_temp_write() 330 val = temp_to_offset_reg(clamp_val(val, -128000, 127937)); in tmp464_temp_write()
|
D | tmp513.c | 257 regval = clamp_val(val, -max_val, max_val); in tmp51x_set_value() 265 val = clamp_val(DIV_ROUND_CLOSEST(val, 4), 0, max_val); in tmp51x_set_value() 269 regval = clamp_val(DIV_ROUND_CLOSEST(val, data->pwr_lsb_uw), 0, in tmp51x_set_value() 277 val = clamp_val(val, MIN_TEMP_LIMIT, MAX_TEMP_LIMIT); in tmp51x_set_value() 282 val = clamp_val(val, 0, MAX_TEMP_HYST); in tmp51x_set_value()
|
D | w83l786ng.c | 76 rpm = clamp_val(rpm, 1, 1000000); in FAN_TO_REG() 77 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); in FAN_TO_REG() 85 #define TEMP_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \ 95 #define IN_TO_REG(val) (clamp_val((((val) + 4) / 8), 0, 255)) 104 val = clamp_val(val, 1, 128) >> 1; in DIV_TO_REG() 515 val = clamp_val(val, 0, 255); in store_pwm() 600 tol_tmp = clamp_val(val, 0, 15); in store_tolerance()
|
D | vt8231.c | 139 return clamp_val(1310720 / (rpm * div), 1, 255); in FAN_TO_REG() 292 data->in_min[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); in in_min_store() 312 data->in_max[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); in in_max_store() 359 data->in_min[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, in in5_min_store() 379 data->in_max[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, in in5_max_store() 441 data->temp_max[0] = clamp_val((val + 500) / 1000, 0, 255); in temp1_max_store() 459 data->temp_min[0] = clamp_val((val + 500) / 1000, 0, 255); in temp1_max_hyst_store() 507 data->temp_max[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); in temp_max_store() 527 data->temp_min[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); in temp_min_store()
|
D | lm63.c | 117 #define TEMP8_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ 119 #define TEMP8U_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, \ 122 #define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ 124 #define TEMP11U_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), 0, \ 126 #define HYST_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \ 194 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127500), 500); in lut_temp_to_reg() 196 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127000), 1000); in lut_temp_to_reg() 398 val = clamp_val(val, 0, 255); in set_pwm1() 682 lm63_set_convrate(data, clamp_val(val, 0, 100000)); in update_interval_store()
|
D | lm75.h | 28 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); in LM75_TEMP_TO_REG()
|
/linux-6.1.9/drivers/hwmon/pmbus/ |
D | lm25066.c | 394 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 398 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 404 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 412 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 419 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 427 word = clamp_val(word, 1, LM25066_SAMPLES_FOR_AVG_MAX); in lm25066_write_word_data()
|
D | mp2888.c | 272 word = clamp_val(word, 0, GENMASK(7, 0)); in mp2888_write_word_data() 279 word = clamp_val(word, 0, GENMASK(9, 0)); in mp2888_write_word_data() 286 word = clamp_val(word, 0, GENMASK(9, 0)); in mp2888_write_word_data()
|
D | stpddc60.c | 58 return clamp_val(offset, 0, 7); in stpddc60_get_offset() 77 return clamp_val(m, 0, 0x3ff) | ((fixed << 11) & 0xf800); in stpddc60_adjust_linear()
|
/linux-6.1.9/drivers/gpu/drm/sti/ |
D | sti_gdp.c | 644 dst_w = clamp_val(new_plane_state->crtc_w, 0, mode->hdisplay - dst_x); in sti_gdp_atomic_check() 645 dst_h = clamp_val(new_plane_state->crtc_h, 0, mode->vdisplay - dst_y); in sti_gdp_atomic_check() 649 src_w = clamp_val(new_plane_state->src_w >> 16, 0, in sti_gdp_atomic_check() 651 src_h = clamp_val(new_plane_state->src_h >> 16, 0, in sti_gdp_atomic_check() 758 dst_w = clamp_val(newstate->crtc_w, 0, mode->hdisplay - dst_x); in sti_gdp_atomic_update() 759 dst_h = clamp_val(newstate->crtc_h, 0, mode->vdisplay - dst_y); in sti_gdp_atomic_update() 763 src_w = clamp_val(newstate->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); in sti_gdp_atomic_update() 764 src_h = clamp_val(newstate->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); in sti_gdp_atomic_update()
|
/linux-6.1.9/drivers/video/backlight/ |
D | mt6370-backlight.c | 150 prop_val = clamp_val(prop_val, in mt6370_init_backlight_properties() 171 ovp_uV = clamp_val(ovp_uV, MT6370_BL_OVP_MIN_UV, in mt6370_init_backlight_properties() 184 ocp_uA = clamp_val(ocp_uA, MT6370_BL_OCP_MIN_UA, in mt6370_init_backlight_properties()
|
/linux-6.1.9/fs/ksmbd/ |
D | smb2ops.c | 283 sz = clamp_val(sz, SMB3_MIN_IOSIZE, SMB3_MAX_IOSIZE); in init_smb2_max_read_size() 292 sz = clamp_val(sz, SMB3_MIN_IOSIZE, SMB3_MAX_IOSIZE); in init_smb2_max_write_size() 301 sz = clamp_val(sz, SMB3_MIN_IOSIZE, SMB3_MAX_IOSIZE); in init_smb2_max_trans_size()
|