Home
last modified time | relevance | path

Searched refs:clamp_val (Results 1 – 25 of 198) sorted by relevance

12345678

/Linux-v5.10/drivers/ata/
Dpata_cypress.c65 time_16 = clamp_val(t.recover - 1, 0, 15) | in cy82c693_set_piomode()
66 (clamp_val(t.active - 1, 0, 15) << 4); in cy82c693_set_piomode()
67 time_8 = clamp_val(t.act8b - 1, 0, 15) | in cy82c693_set_piomode()
68 (clamp_val(t.rec8b - 1, 0, 15) << 4); in cy82c693_set_piomode()
74 addr |= clamp_val(t.setup - 1, 0, 15); in cy82c693_set_piomode()
84 addr |= (clamp_val(t.setup - 1, 0, 15) << 4); in cy82c693_set_piomode()
Dpata_legacy.c356 active = clamp_val(t.active, 2, 15); in ht6560a_set_piomode()
357 recover = clamp_val(t.recover, 4, 15); in ht6560a_set_piomode()
390 active = clamp_val(t.active, 2, 15); in ht6560b_set_piomode()
391 recover = clamp_val(t.recover, 2, 16) & 0x0F; in ht6560b_set_piomode()
474 active = clamp_val(t.active, 2, 17) - 2; in opti82c611a_set_piomode()
475 recover = clamp_val(t.recover, 1, 16) - 1; in opti82c611a_set_piomode()
476 setup = clamp_val(t.setup, 1, 4) - 1; in opti82c611a_set_piomode()
553 active = clamp_val(t.active, 2, 17) - 2; in opti82c46x_set_piomode()
554 recover = clamp_val(t.recover, 1, 16) - 1; in opti82c46x_set_piomode()
555 setup = clamp_val(t.setup, 1, 4) - 1; in opti82c46x_set_piomode()
[all …]
Dpata_amd.c86 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()
Dpata_via.c284 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()
Dpata_ns87410.c79 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()
Dpata_ali.c181 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-v5.10/drivers/ide/
Damd74xx.c52 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); in amd_set_speed()
56 ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); in amd_set_speed()
59 ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); in amd_set_speed()
62 case ATA_UDMA2: t = timing->udma ? (0xc0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; in amd_set_speed()
63 …case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 2, 10)]) : 0x03; b… in amd_set_speed()
64 …case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 10)]) : 0x03; b… in amd_set_speed()
65 …case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 15)]) : 0x03; b… in amd_set_speed()
Dcy82c693.c106 time_16 = clamp_val(t.recover - 1, 0, 15) | in cy82c693_set_pio_mode()
107 (clamp_val(t.active - 1, 0, 15) << 4); in cy82c693_set_pio_mode()
108 time_8 = clamp_val(t.act8b - 1, 0, 15) | in cy82c693_set_pio_mode()
109 (clamp_val(t.rec8b - 1, 0, 15) << 4); in cy82c693_set_pio_mode()
121 addrCtrl |= clamp_val(t.setup - 1, 0, 15); in cy82c693_set_pio_mode()
137 addrCtrl |= (clamp_val(t.setup - 1, 0, 15) << 4); in cy82c693_set_pio_mode()
Dvia82cxxx.c130 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); in via_set_speed()
135 ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); in via_set_speed()
138 ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); in via_set_speed()
141 case ATA_UDMA2: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; in via_set_speed()
142 case ATA_UDMA4: t = timing->udma ? (0xe8 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x0f; break; in via_set_speed()
143 case ATA_UDMA5: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; in via_set_speed()
144 case ATA_UDMA6: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; in via_set_speed()
Dalim15x3.c82 t->setup = clamp_val(t->setup, 1, 8) & 7; in ali_program_timings()
83 t->act8b = clamp_val(t->act8b, 1, 8) & 7; in ali_program_timings()
84 t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; in ali_program_timings()
85 t->active = clamp_val(t->active, 1, 8) & 7; in ali_program_timings()
86 t->recover = clamp_val(t->recover, 1, 16) & 15; in ali_program_timings()
/Linux-v5.10/drivers/hwmon/pmbus/
Dlm25066.c372 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
377 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
384 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
393 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
401 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
410 word = clamp_val(word, 1, LM25066_SAMPLES_FOR_AVG_MAX); in lm25066_write_word_data()
/Linux-v5.10/drivers/hwmon/
Damc6821.c287 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()
Dlm95245.c286 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()
Dltc2947-core.c624 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()
Dasc7621.c181 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 …]
Dina209.c164 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()
Dtmp401.c169 temp = clamp_val(temp, -64000, 191000); in tmp401_temp_to_register()
172 temp = clamp_val(temp, 0, 127000); in tmp401_temp_to_register()
373 val = clamp_val(val, -64000, 191000); in temp_crit_hyst_store()
375 val = clamp_val(val, 0, 127000); in temp_crit_hyst_store()
379 val = clamp_val(val, temp - 255000, temp); in temp_crit_hyst_store()
451 val = clamp_val(val, 125, 16000); in update_interval_store()
Dtmp513.c257 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()
Dw83l786ng.c76 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()
Dvt8231.c137 return clamp_val(1310720 / (rpm * div), 1, 255); in FAN_TO_REG()
226 data->in_min[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); in in_min_store()
246 data->in_max[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); in in_max_store()
293 data->in_min[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, in in5_min_store()
313 data->in_max[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, in in5_max_store()
375 data->temp_max[0] = clamp_val((val + 500) / 1000, 0, 255); in temp1_max_store()
393 data->temp_min[0] = clamp_val((val + 500) / 1000, 0, 255); in temp1_max_hyst_store()
441 data->temp_max[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); in temp_max_store()
461 data->temp_min[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); in temp_min_store()
Dlm75.h27 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); in LM75_TEMP_TO_REG()
Dlm63.c117 #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()
/Linux-v5.10/fs/fscache/
Dmain.c106 clamp_val(nr_cpus, in fscache_init()
116 clamp_val(fscache_object_max_active / 2, in fscache_init()
/Linux-v5.10/drivers/gpu/drm/sti/
Dsti_gdp.c640 dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); in sti_gdp_atomic_check()
641 dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); in sti_gdp_atomic_check()
645 src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); in sti_gdp_atomic_check()
646 src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); in sti_gdp_atomic_check()
749 dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); in sti_gdp_atomic_update()
750 dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); in sti_gdp_atomic_update()
754 src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); in sti_gdp_atomic_update()
755 src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); in sti_gdp_atomic_update()
/Linux-v5.10/drivers/gpu/drm/ingenic/
Dingenic-ipu.c123 weight = clamp_val(weight, 0, 512); in jz4760_set_coefs()
152 w0 = clamp_val(w0, -1024, 1023); in jz4760_set_coefs()
153 w1 = clamp_val(w1, -1024, 1023); in jz4760_set_coefs()
154 w2 = clamp_val(w2, -1024, 1023); in jz4760_set_coefs()
155 w3 = clamp_val(w3, -1024, 1023); in jz4760_set_coefs()
175 weight = clamp_val(weight, 0, 512); in jz4725b_set_coefs()

12345678