Searched refs:clamp_val (Results 1 - 128 of 128) sorted by relevance

/linux-4.1.27/drivers/ata/
H A Dpata_cypress.c64 time_16 = clamp_val(t.recover - 1, 0, 15) | cy82c693_set_piomode()
65 (clamp_val(t.active - 1, 0, 15) << 4); cy82c693_set_piomode()
66 time_8 = clamp_val(t.act8b - 1, 0, 15) | cy82c693_set_piomode()
67 (clamp_val(t.rec8b - 1, 0, 15) << 4); cy82c693_set_piomode()
73 addr |= clamp_val(t.setup - 1, 0, 15); cy82c693_set_piomode()
83 addr |= (clamp_val(t.setup - 1, 0, 15) << 4); cy82c693_set_piomode()
H A Dpata_amd.c85 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(at.setup, 1, 4) - 1) << ((3 - dn) << 1)); timing_setup()
90 ((clamp_val(at.act8b, 1, 16) - 1) << 4) | (clamp_val(at.rec8b, 1, 16) - 1)); timing_setup()
94 ((clamp_val(at.active, 1, 16) - 1) << 4) | (clamp_val(at.recover, 1, 16) - 1)); timing_setup()
98 t = at.udma ? (0xc0 | (clamp_val(at.udma, 2, 5) - 2)) : 0x03; timing_setup()
102 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 2, 10)]) : 0x03; timing_setup()
106 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 10)]) : 0x03; timing_setup()
110 t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 15)]) : 0x03; timing_setup()
H A Dpata_ns87410.c92 at.active = clamp_val(at.active, 2, 16) - 2; ns87410_set_piomode()
93 at.setup = clamp_val(at.setup, 1, 4) - 1; ns87410_set_piomode()
94 at.recover = clamp_val(at.recover, 1, 12) - 1; ns87410_set_piomode()
H A Dpata_legacy.c369 active = clamp_val(t.active, 2, 15); ht6560a_set_piomode()
370 recover = clamp_val(t.recover, 4, 15); ht6560a_set_piomode()
403 active = clamp_val(t.active, 2, 15); ht6560b_set_piomode()
404 recover = clamp_val(t.recover, 2, 16) & 0x0F; ht6560b_set_piomode()
487 active = clamp_val(t.active, 2, 17) - 2; opti82c611a_set_piomode()
488 recover = clamp_val(t.recover, 1, 16) - 1; opti82c611a_set_piomode()
489 setup = clamp_val(t.setup, 1, 4) - 1; opti82c611a_set_piomode()
566 active = clamp_val(t.active, 2, 17) - 2; opti82c46x_set_piomode()
567 recover = clamp_val(t.recover, 1, 16) - 1; opti82c46x_set_piomode()
568 setup = clamp_val(t.setup, 1, 4) - 1; opti82c46x_set_piomode()
662 active = 8 - clamp_val(t.active, 1, 8); qdi65x0_set_piomode()
663 recovery = 18 - clamp_val(t.recover, 3, 18); qdi65x0_set_piomode()
665 active = 9 - clamp_val(t.active, 2, 9); qdi65x0_set_piomode()
666 recovery = 15 - clamp_val(t.recover, 0, 15); qdi65x0_set_piomode()
802 active = (clamp_val(t.active, 3, 17) - 1) & 0x0F; winbond_set_piomode()
803 recovery = (clamp_val(t.recover, 1, 15) + 1) & 0x0F; winbond_set_piomode()
814 reg |= (clamp_val(t.setup, 0, 3) << 6); winbond_set_piomode()
H A Dpata_via.c283 setup |= (clamp_val(t.setup, 1, 4) - 1) << shift; via_do_set_mode()
289 ((clamp_val(t.act8b, 1, 16) - 1) << 4) | (clamp_val(t.rec8b, 1, 16) - 1)); via_do_set_mode()
291 ((clamp_val(t.active, 1, 16) - 1) << 4) | (clamp_val(t.recover, 1, 16) - 1)); via_do_set_mode()
297 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 5) - 2)) : 0x03; via_do_set_mode()
300 ut = t.udma ? (0xe8 | (clamp_val(t.udma, 2, 9) - 2)) : 0x0f; via_do_set_mode()
303 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; via_do_set_mode()
306 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; via_do_set_mode()
H A Dpata_ali.c181 t->setup = clamp_val(t->setup, 1, 8) & 7; ali_program_modes()
182 t->act8b = clamp_val(t->act8b, 1, 8) & 7; ali_program_modes()
183 t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; ali_program_modes()
184 t->active = clamp_val(t->active, 1, 8) & 7; ali_program_modes()
185 t->recover = clamp_val(t->recover, 1, 16) & 15; ali_program_modes()
H A Dpata_ns87415.c68 clocking = 17 - clamp_val(t.active, 2, 17); ns87415_set_mode()
69 clocking |= (16 - clamp_val(t.recover, 1, 16)) << 4; ns87415_set_mode()
/linux-4.1.27/drivers/ide/
H A Dcy82c693.c105 time_16 = clamp_val(t.recover - 1, 0, 15) | cy82c693_set_pio_mode()
106 (clamp_val(t.active - 1, 0, 15) << 4); cy82c693_set_pio_mode()
107 time_8 = clamp_val(t.act8b - 1, 0, 15) | cy82c693_set_pio_mode()
108 (clamp_val(t.rec8b - 1, 0, 15) << 4); cy82c693_set_pio_mode()
120 addrCtrl |= clamp_val(t.setup - 1, 0, 15); cy82c693_set_pio_mode()
136 addrCtrl |= (clamp_val(t.setup - 1, 0, 15) << 4); cy82c693_set_pio_mode()
H A Damd74xx.c56 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); amd_set_speed()
60 ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); amd_set_speed()
63 ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); amd_set_speed()
66 case ATA_UDMA2: t = timing->udma ? (0xc0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; amd_set_speed()
67 case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 2, 10)]) : 0x03; break; amd_set_speed()
68 case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 10)]) : 0x03; break; amd_set_speed()
69 case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 15)]) : 0x03; break; amd_set_speed()
H A Dvia82cxxx.c134 t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); via_set_speed()
139 ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); via_set_speed()
142 ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); via_set_speed()
145 case ATA_UDMA2: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; via_set_speed()
146 case ATA_UDMA4: t = timing->udma ? (0xe8 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x0f; break; via_set_speed()
147 case ATA_UDMA5: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; via_set_speed()
148 case ATA_UDMA6: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; via_set_speed()
H A Dalim15x3.c82 t->setup = clamp_val(t->setup, 1, 8) & 7; ali_program_timings()
83 t->act8b = clamp_val(t->act8b, 1, 8) & 7; ali_program_timings()
84 t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; ali_program_timings()
85 t->active = clamp_val(t->active, 1, 8) & 7; ali_program_timings()
86 t->recover = clamp_val(t->recover, 1, 16) & 15; ali_program_timings()
/linux-4.1.27/drivers/hwmon/pmbus/
H A Dlm25066.c384 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); lm25066_write_word_data()
389 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); lm25066_write_word_data()
396 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); lm25066_write_word_data()
405 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); lm25066_write_word_data()
413 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); lm25066_write_word_data()
H A Dpmbus_core.c658 val = clamp_val(val, 500, 1600); pmbus_data2reg_vid()
/linux-4.1.27/fs/fscache/
H A Dmain.c110 clamp_val(nr_cpus, fscache_init()
120 clamp_val(fscache_object_max_active / 2, fscache_init()
/linux-4.1.27/drivers/hwmon/
H A Dlm75.h39 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); LM75_TEMP_TO_REG()
H A Damc6821.c305 val = clamp_val(val / 1000, -128, 127); set_temp()
390 data->pwm1 = clamp_val(val , 0, 255); set_pwm1()
553 ptemp[0] = clamp_val(val / 1000, 0, set_temp_auto_point_temp()
555 ptemp[0] = clamp_val(ptemp[0], 0, set_temp_auto_point_temp()
557 ptemp[0] = clamp_val(ptemp[0], 0, 63); set_temp_auto_point_temp()
568 ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124); set_temp_auto_point_temp()
570 ptemp[2] = clamp_val(ptemp[2], ptemp[1] + 1, 255); set_temp_auto_point_temp()
573 ptemp[2] = clamp_val(val / 1000, ptemp[1]+1, 255); set_temp_auto_point_temp()
604 data->pwm1_auto_point_pwm[1] = clamp_val(val, 0, 254); set_pwm1_auto_point_pwm()
668 data->fan[ix] = (u16) clamp_val(val, 1, 0xFFFF); set_fan()
H A Dasc7621.c194 reqval = clamp_val(reqval, 0, 255); store_u8()
227 reqval = clamp_val(reqval, 0, param->mask[0]); store_bitmask()
277 (reqval <= 0 ? 0xffff : clamp_val(5400000 / reqval, 0, 0xfffe)); store_fan16()
346 reqval = clamp_val(reqval, 0, 0xffff); store_in8()
350 reqval = clamp_val(reqval, 0, 0xff); store_in8()
379 reqval = clamp_val(reqval, -127000, 127000); store_temp8()
435 reqval = clamp_val(reqval, -32000, 31750); store_temp62()
471 temp = auto_point1 + asc7621_range_map[clamp_val(regval, 0, 15)]; show_ap2_temp()
492 reqval = clamp_val(reqval, auto_point1 + 2000, auto_point1 + 80000); store_ap2_temp()
526 return sprintf(buf, "%u\n", map[clamp_val(regval, 0, 15)]); show_pwm_ac()
666 regval = clamp_val(regval, 0, 15); show_pwm_freq()
714 regval = clamp_val(regval, 0, 7); show_pwm_ast()
762 regval = clamp_val(regval, 0, 7); show_temp_st()
H A Dina209.c167 return clamp_val(val, -320, 320) * 100; ina209_to_reg()
179 return (DIV_ROUND_CLOSEST(clamp_val(val, 0, 32000), 4) << 3) ina209_to_reg()
190 return (clamp_val(-val, 0, 255) << 8) | (old & 0xff); ina209_to_reg()
199 return (clamp_val(val, 0, 255) << 8) | (old & 0xff); ina209_to_reg()
550 clamp_val(40960000 / shunt, 1, 65535)); ina209_init_client()
H A Dtmp401.c194 temp = clamp_val(temp, -64000, 191000); tmp401_temp_to_register()
197 temp = clamp_val(temp, 0, 127000); tmp401_temp_to_register()
400 val = clamp_val(val, -64000, 191000); store_temp_crit_hyst()
402 val = clamp_val(val, 0, 127000); store_temp_crit_hyst()
406 val = clamp_val(val, temp - 255000, temp); store_temp_crit_hyst()
474 * Use clamp_val() to avoid overflows, and to ensure valid input set_update_interval()
477 val = clamp_val(val, 125, 16000); set_update_interval()
H A Dw83l786ng.c89 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
90 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
98 #define TEMP_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \
108 #define IN_TO_REG(val) (clamp_val((((val) + 4) / 8), 0, 255))
117 val = clamp_val(val, 1, 128) >> 1; DIV_TO_REG()
528 val = clamp_val(val, 0, 255); store_pwm()
613 tol_tmp = clamp_val(val, 0, 15); store_tolerance()
H A Dadt7470.c417 temp = clamp_val(temp, 0, 60000); set_auto_update_interval()
445 temp = clamp_val(temp, -1, 10); set_num_temp_sensors()
479 temp = clamp_val(temp, -128, 127); set_temp_min()
513 temp = clamp_val(temp, -128, 127); set_temp_max()
568 temp = clamp_val(temp, 1, 65534); set_fan_max()
605 temp = clamp_val(temp, 1, 65534); set_fan_min()
681 temp = clamp_val(temp, 0, 255); set_pwm()
713 temp = clamp_val(temp, 0, 255); set_pwm_max()
746 temp = clamp_val(temp, 0, 255); set_pwm_min()
790 temp = clamp_val(temp, -128, 127); set_pwm_tmin()
H A Dthmc50.c153 data->analog_out = clamp_val(tmp, 0, 255); set_analog_out()
206 data->temp_min[nr] = clamp_val(val / 1000, -128, 127); set_temp_min()
235 data->temp_max[nr] = clamp_val(val / 1000, -128, 127); set_temp_max()
H A Dlm63.c129 #define TEMP8_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
131 #define TEMP8U_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, \
134 #define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
136 #define TEMP11U_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), 0, \
138 #define HYST_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \
206 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127500), 500); lut_temp_to_reg()
208 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127000), 1000); lut_temp_to_reg()
410 val = clamp_val(val, 0, 255); set_pwm1()
694 lm63_set_convrate(data, clamp_val(val, 0, 100000)); set_update_interval()
H A Dvt8231.c150 return clamp_val(1310720 / (rpm * div), 1, 255); FAN_TO_REG()
239 data->in_min[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); set_in_min()
259 data->in_max[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); set_in_max()
305 data->in_min[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, set_in5_min()
324 data->in_max[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, set_in5_max()
383 data->temp_max[0] = clamp_val((val + 500) / 1000, 0, 255); set_temp0_max()
400 data->temp_min[0] = clamp_val((val + 500) / 1000, 0, 255); set_temp0_min()
447 data->temp_max[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); set_temp_max()
466 data->temp_min[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); set_temp_min()
H A Dw83792d.c238 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
239 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
247 #define TEMP1_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \
255 (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 : (val)) / 1000, 0, 0xff))
264 val = clamp_val(val, 1, 128) >> 1; DIV_TO_REG()
399 data->in_##reg[nr] = clamp_val(IN_TO_REG(nr, val) / 4, 0, 255); \
647 val = clamp_val(val, 0, 255) >> 4; store_pwm()
801 data->thermal_cruise[nr] = clamp_val(target_tmp, 0, 255); store_thermal_cruise()
839 tol_tmp = clamp_val(val, 0, 15); store_tolerance()
883 data->sf2_points[index][nr] = clamp_val(val, 0, 127); store_sf2_point()
925 data->sf2_levels[index][nr] = clamp_val((val * 15) / 100, 0, 15); store_sf2_level()
H A Dadm1031.c228 tmp = FAN_FROM_REG(clamp_val(reg, 0, 65535), div); FAN_TO_REG()
234 #define PWM_TO_REG(val) (clamp_val((val), 0, 255) >> 4)
431 val = clamp_val(val, 0, 127000); set_auto_temp_min()
461 val = clamp_val(val, 0, 127000); set_auto_temp_max()
743 val = clamp_val(val, -15000, 15000); set_temp_offset()
764 val = clamp_val(val, -55000, 127000); set_temp_min()
785 val = clamp_val(val, -55000, 127000); set_temp_max()
806 val = clamp_val(val, -55000, 127000); set_temp_crit()
H A Dw83795.c266 return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); fan_to_reg()
276 return clamp_val((val + 50) / 100, 0, 0xff); time_to_reg()
286 return clamp_val(val / 1000, min, max); temp_to_reg()
320 reg1 = clamp_val(DIV_ROUND_CLOSEST(base_clock, val), 1, 128); pwm_freq_to_reg()
890 val = clamp_val(val, 0, 0xff); store_pwm()
1127 tmp = clamp_val(tmp, 0, 0xff); store_temp_pwm_enable()
1178 val = fan_to_reg(clamp_val(val, 0, 0xfff)); store_fanin()
1184 val = clamp_val(val, 0, 0x3f); store_fanin()
1228 val = clamp_val(val, 0, 0x7f); store_temp_pwm()
1232 val = clamp_val(val, 0, 0x7f); store_temp_pwm()
1236 val = clamp_val(val, 0, 0x0f); store_temp_pwm()
1243 val = clamp_val(val, 0, 0x0f); store_temp_pwm()
1542 val = clamp_val(val, 0, 0x3FF); store_in()
1597 val = clamp_val(val, 0, 0xff); store_sf_setup()
H A Dgl518sm.c89 #define TEMP_TO_REG(val) clamp_val(((((val) < 0 ? \
99 rpmdiv = clamp_val(rpm, 1, 960000) * div; FAN_TO_REG()
100 return clamp_val((480000 + rpmdiv / 2) / rpmdiv, 1, 255); FAN_TO_REG()
104 #define IN_TO_REG(val) clamp_val((((val) + 9) / 19), 0, 255)
107 #define VDD_TO_REG(val) clamp_val((((val) * 4 + 47) / 95), 0, 255)
H A Dadt7462.c814 temp = clamp_val(temp, 0, 255); set_temp_min()
852 temp = clamp_val(temp, 0, 255); set_temp_max()
917 temp = clamp_val(temp, 0, 255); set_volt_max()
959 temp = clamp_val(temp, 0, 255); set_volt_min()
1049 temp = clamp_val(temp, 1, 255); set_fan_min()
1127 temp = clamp_val(temp, 0, 255); set_pwm()
1157 temp = clamp_val(temp, 0, 255); set_pwm_max()
1189 temp = clamp_val(temp, 0, 255); set_pwm_min()
1224 temp = clamp_val(temp, 0, 15); set_pwm_hyst()
1310 temp = clamp_val(temp, 0, 255); set_pwm_tmin()
H A Dadt7475.c204 val = clamp_val(val, -64000, 191000); temp2reg()
207 val = clamp_val(val, -128000, 127000); temp2reg()
243 return clamp_val((90000 * 60) / rpm, 1, 0xFFFF); rpm2tach()
274 return clamp_val(reg, 0, 1023) & (0xff << 2); volt2reg()
454 val = clamp_val(val, -63000, 127000); set_temp()
457 val = clamp_val(val, -63000, 64000); set_temp()
474 val = clamp_val(val, temp - 15000, temp); set_temp()
580 val = clamp_val(val, temp + autorange_table[0], set_point2()
704 data->pwm[sattr->nr][sattr->index] = clamp_val(val, 0, 0xFF); set_pwm()
H A Dadt7x10.c213 return DIV_ROUND_CLOSEST(clamp_val(temp, ADT7X10_TEMP_MIN, ADT7X10_TEMP_TO_REG()
310 hyst = clamp_val(hyst, ADT7X10_TEMP_MIN, ADT7X10_TEMP_MAX); adt7x10_set_t_hyst()
311 data->hyst = clamp_val(DIV_ROUND_CLOSEST(limit - hyst, 1000), adt7x10_set_t_hyst()
H A Demc6w201.c223 data->in[sf][nr] = clamp_val(val, 0, 255); set_in()
260 data->temp[sf][nr] = clamp_val(val, -127, 127); set_temp()
301 val = clamp_val(val, 0, 0xFFFE); set_fan()
H A Dabx500.c166 val = clamp_val(val, 0, DEFAULT_MAX_TEMP); set_min()
186 val = clamp_val(val, 0, DEFAULT_MAX_TEMP); set_max()
207 val = clamp_val(val, 0, DEFAULT_MAX_TEMP); set_max_hyst()
H A Demc2103.c254 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); set_temp_min()
276 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); set_temp_max()
397 rpm_target = clamp_val(rpm_target, 0, 16384); set_fan_target()
404 data->fan_target = clamp_val( set_fan_target()
H A Dg760a.c153 data->set_cnt = PWM_TO_CNT(clamp_val(val, 0, 255)); set_pwm()
H A Dgl520sm.c212 #define VDD_TO_REG(val) clamp_val((((val) * 4 + 47) / 95), 0, 255)
215 #define IN_TO_REG(val) clamp_val((((val) + 9) / 19), 0, 255)
353 clamp_val((480000 + ((val) << ((div)-1))) / ((val) << (div)), 1, 255))
517 #define TEMP_TO_REG(val) clamp_val(((((val) < 0 ? \
H A Dlm80.c75 #define IN_TO_REG(val) (clamp_val(((val) + 5) / 10, 0, 255))
82 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
83 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
90 #define TEMP_TO_REG(temp) (DIV_ROUND_CLOSEST(clamp_val((temp), \
H A Dlm95234.c313 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, index ? 255 : 127); set_tcrit2()
362 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 255); set_tcrit1()
404 val = clamp_val((int)data->tcrit1[index] - val, 0, 31); set_tcrit1_hyst()
443 val = clamp_val(DIV_ROUND_CLOSEST(val, 500), -128, 127); set_offset()
H A Dtmp103.c92 val = clamp_val(val, -55000, 127000); tmp103_set_temp()
H A Dads7828.c137 vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN, ads7828_probe()
H A Df71882fg.c1352 val = clamp_val(val, 23, 1500000); store_fan_full_speed()
1440 val = clamp_val(val, 0, 255); store_in_max()
1544 val = clamp_val(val, 0, 255); store_temp_max()
1591 val = clamp_val(val, data->temp_high[nr] - 15, data->temp_high[nr]); store_temp_max_hyst()
1628 val = clamp_val(val, 0, 255); store_temp_crit()
1755 val = clamp_val(val, 0, 255); store_pwm()
1806 val = clamp_val(val, 0, 255); store_simple_pwm()
1933 val = clamp_val(val, 0, 255); store_pwm_auto_point_pwm()
1992 val = clamp_val(val, data->pwm_auto_point_temp[nr][point] - 15, store_pwm_auto_point_temp_hyst()
2127 val = clamp_val(val, -128, 127); store_pwm_auto_point_temp()
2129 val = clamp_val(val, 0, 127); store_pwm_auto_point_temp()
H A Dlm77.c177 val = clamp_val(val, LM77_TEMP_MIN, LM77_TEMP_MAX); set_temp()
203 val = clamp_val(data->temp[t_crit] - val, LM77_TEMP_MIN, LM77_TEMP_MAX); set_temp_hyst()
H A Dlm92.c79 val = clamp_val(val, -60000, 160000); TEMP_TO_REG()
206 val = clamp_val(val, -120000, 220000); set_temp_hyst()
H A Dlm95245.c258 val = clamp_val(val, 0, (index == 6 ? 127 : 255)); set_limit()
297 hyst = clamp_val(hyst, 0, 31); set_crit_hyst()
H A Dmax1668.c219 data->temp_max[index] = clamp_val(temp/1000, -128, 127); set_temp_max()
245 data->temp_min[index] = clamp_val(temp/1000, -128, 127); set_temp_min()
H A Dw83791d.c223 #define IN_TO_REG(val) (clamp_val((((val) + 8) / 16), 0, 255))
230 rpm = clamp_val(rpm, 1, 1000000); fan_to_reg()
231 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); fan_to_reg()
252 #define TEMP23_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
256 #define TARGET_TEMP_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \
260 #define TOL_TEMP_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 15000), \
273 val = clamp_val(val, 1, 128) >> 1; div_to_reg()
747 data->pwm[nr] = clamp_val(val, 0, 255); store_pwm()
H A Df75375s.c362 data->pwm[nr] = clamp_val(val, 0, 255); set_pwm()
559 val = clamp_val(VOLT_TO_REG(val), 0, 0xff); set_in_max()
580 val = clamp_val(VOLT_TO_REG(val), 0, 0xff); set_in_min()
628 val = clamp_val(TEMP_TO_REG(val), 0, 127); set_temp_max()
649 val = clamp_val(TEMP_TO_REG(val), 0, 127); set_temp_max_hyst()
825 data->pwm[nr] = clamp_val(f75375s_pdata->pwm[nr], 0, 255); f75375_init()
H A Dvia686a.c138 return (u8) clamp_val((val * 21024 - 1205000) / 250000, 0, 255); IN_TO_REG()
140 return (u8) clamp_val((val * 15737 - 1205000) / 250000, 0, 255); IN_TO_REG()
142 return (u8) clamp_val((val * 10108 - 1205000) / 250000, 0, 255); IN_TO_REG()
144 return (u8) clamp_val((val * 41714 - 12050000) / 2500000, 0, IN_TO_REG()
175 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
176 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 255); FAN_TO_REG()
H A Dw83793.c194 return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); FAN_TO_REG()
204 return clamp_val((val + 50) / 100, 0, 0xff); TIME_TO_REG()
214 return clamp_val((val + (val < 0 ? -500 : 500)) / 1000, min, max); TEMP_TO_REG()
564 val = clamp_val(val, 0, 0xff) >> 2; store_pwm()
745 data->pwm_default |= clamp_val(val, 0, 0xff) >> 2; store_sf_setup()
844 val = clamp_val(val, 0, 255); store_sf_ctrl()
913 val = clamp_val(val, 0, 0xff) >> 2; store_sf2_pwm()
1009 val = clamp_val(val, 0, 255); store_in()
1011 val = clamp_val(val, 0, 0x3FF); store_in()
H A Dasb100.c117 unsigned nval = clamp_val(val, ASB100_IN_MIN, ASB100_IN_MAX); IN_TO_REG()
132 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
133 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
151 int ntemp = clamp_val(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX); TEMP_TO_REG()
167 pwm = clamp_val(pwm, 0, 255); ASB100_PWM_TO_REG()
H A Dvt1211.c161 #define IN_TO_REG(ix, val) (clamp_val((ix) == 5 ? \
176 #define TEMP_TO_REG(ix, val) clamp_val( \
186 clamp_val((1310720 / (val) / \
692 val = 135000 / clamp_val(val, 135000 >> 7, 135000); set_pwm()
851 data->pwm_auto_pwm[ix][ap] = clamp_val(val, 0, 255); set_pwm_auto_point_pwm()
H A Dlm93.c374 const long mv = clamp_val(val, LM93_IN_TO_REG()
388 result = clamp_val(result, LM93_IN_TO_REG()
414 uv_offset = clamp_val(uv_offset, 12500, 200000); LM93_IN_REL_TO_REG()
417 uv_offset = clamp_val(uv_offset, -400000, -25000); LM93_IN_REL_TO_REG()
440 int ntemp = clamp_val(temp, LM93_TEMP_MIN, LM93_TEMP_MAX); LM93_TEMP_TO_REG()
475 off = clamp_val(off, LM93_TEMP_OFFSET_MIN, LM93_TEMP_OFFSET_TO_REG()
623 rpm = clamp_val(rpm, 1, 1000000); LM93_FAN_TO_REG()
624 count = clamp_val((1350000 + rpm) / rpm, 1, 0x3ffe); LM93_FAN_TO_REG()
695 ramp = clamp_val(ramp, LM93_RAMP_MIN, LM93_RAMP_MAX); LM93_RAMP_TO_REG()
705 prochot = clamp_val(prochot, 0, 255); LM93_PROCHOT_TO_REG()
2059 data->block9[nr][LM93_PWM_CTL1] = clamp_val(val, 0, 255); store_pwm_auto_channels()
2404 clamp_val(val, 0, 15); store_prochot_override_duty_cycle()
H A Dnct7802.c150 limit = clamp_val(limit, 0, 0x1fff); nct7802_write_fan_min()
204 voltage = clamp_val(voltage, 0, 0x3ff); nct7802_write_voltage()
279 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); store_temp()
H A Dadm9240.c101 return clamp_val(SCALE(val, 192, nom_mv[n]), 0, 255); IN_TO_REG()
107 return clamp_val(SCALE(val, 1, 1000), -40, 127); TEMP_TO_REG()
125 return clamp_val(SCALE(val, 255, 1250), 0, 255); AOUT_TO_REG()
H A Djc42.c210 int ntemp = clamp_val(temp, jc42_temp_to_reg()
319 val = clamp_val(val, (data->extended ? JC42_TEMP_MIN_EXTENDED : set_temp_crit_hyst()
H A Dltc2945.c261 regval = clamp_val(regval, 0, 0xffffff); ltc2945_set_value()
267 regval = clamp_val(regval, 0, 0xfff) << 4; ltc2945_set_value()
H A Dmax6639.c77 #define TEMP_LIMIT_TO_REG(val) clamp_val((val) / 1000, 0, 255)
311 val = clamp_val(val, 0, 255); set_pwm()
H A Dw83627hf.c257 #define IN_TO_REG(val) (clamp_val((((val) + 8) / 16), 0, 255))
264 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
265 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
277 int ntemp = clamp_val(temp, TEMP_MIN, TEMP_MAX); TEMP_TO_REG()
289 #define PWM_TO_REG(val) (clamp_val((val), 0, 255))
344 val = clamp_val(val, 1, 128) >> 1; DIV_TO_REG()
615 clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); store_regs_in_min0()
644 clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); store_regs_in_max0()
H A Dadc128d818.c174 regval = clamp_val(DIV_ROUND_CLOSEST(val, 10), 0, 255); adc128_set_in()
212 regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); adc128_set_temp()
H A Dadm1021.c218 reg_val = clamp_val(temp, -128, 127); set_temp_max()
244 reg_val = clamp_val(temp, -128, 127); set_temp_min()
H A Dadm1026.c200 #define INS_TO_REG(n, val) (clamp_val(SCALE(val, adm1026_scaling[n], 192),\
210 clamp_val(1350000 / ((val) * (div)), \
218 #define TEMP_TO_REG(val) (clamp_val(((val) + ((val) < 0 ? -500 : 500)) \
221 #define OFFSET_TO_REG(val) (clamp_val(((val) + ((val) < 0 ? -500 : 500)) \
225 #define PWM_TO_REG(val) (clamp_val(val, 0, 255))
236 #define DAC_TO_REG(val) (clamp_val(((((val) * 255) + 500) / 2500), 0, 255))
704 new_min = clamp_val(new_min, 1, 254); fixup_fan_min()
1301 data->pwm1.auto_pwm_min = clamp_val(val, 0, 255); set_auto_pwm_min()
H A Dlm73.c79 value = clamp_val(temp / 250, LM73_TEMP_MIN, LM73_TEMP_MAX) << 5; set_temp()
H A Dmax6642.c241 data->temp_high[attr2->nr] = clamp_val(temp_to_reg(val), 0, 255); set_temp_max()
H A Dtmp102.c132 val = clamp_val(val, -256000, 255000); tmp102_set_temp()
H A Dad7414.c140 temp = clamp_val(temp, -40000, 85000); set_max_min()
H A Dw83781d.c162 #define IN_TO_REG(val) clamp_val(((val) + 8) / 16, 0, 255)
170 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
171 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
184 #define TEMP_TO_REG(val) clamp_val((val) / 1000, -127, 128)
198 val = clamp_val(val, 1, DIV_TO_REG()
445 data->vrm = clamp_val(val, 0, 255); store_vrm_reg()
732 data->pwm[nr] = clamp_val(val, 0, 255); store_pwm()
H A Dlm85.c139 clamp_val(SCALE(val, lm85_scaling[n], 192), 0, 255)
151 return clamp_val(5400000 / val, 1, 0xfffe); FAN_TO_REG()
158 DIV_ROUND_CLOSEST(clamp_val((val), -127000, 127000), 1000)
163 #define PWM_TO_REG(val) clamp_val(val, 0, 255)
246 #define HYST_TO_REG(val) clamp_val(((val) + 500) / 1000, 0, 15)
H A Dmax6650.c268 rpm = clamp_val(rpm, FAN_RPM_MIN, FAN_RPM_MAX); set_target()
336 pwm = clamp_val(pwm, 0, 255); set_pwm()
H A Dsmsc47m192.c80 return clamp_val(SCALE(val, 192, nom_mv[n]), 0, 255); IN_TO_REG()
89 return SCALE(clamp_val(val, -128000, 127000), 1, 1000); TEMP_TO_REG()
H A Dds1621.c149 temp = clamp_val(temp, DS1621_TEMP_MIN, DS1621_TEMP_MAX); DS1621_TEMP_TO_REG()
H A Dlm78.c88 unsigned long nval = clamp_val(val, 0, 4080); IN_TO_REG()
99 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
113 int nval = clamp_val(val, -128000, 127000) ; TEMP_TO_REG()
H A Dsis5595.c135 unsigned long nval = clamp_val(val, 0, 4080); IN_TO_REG()
146 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
164 int nval = clamp_val(val, -54120, 157530) ; TEMP_TO_REG()
H A Ddme1737.c282 return clamp_val((val * 192 + nominal / 2) / nominal, 0, 255); IN_TO_REG()
298 return clamp_val((val < 0 ? val - 500 : val + 500) / 1000, -128, 127); TEMP_TO_REG()
336 int hyst = clamp_val((val + 500) / 1000, 0, 15); TEMP_HYST_TO_REG()
353 return clamp_val(val / tpc, 0, 0xffff); FAN_TO_REG()
356 clamp_val(90000 * 60 / val, 0, 0xfffe); FAN_TO_REG()
1286 data->pwm[ix] = clamp_val(val, 0, 255); set_pwm()
1454 data->pwm_min[ix] = clamp_val(val, 0, 255); set_pwm()
H A Dw83627ehf.c357 return clamp_val((mode ? (msec + 50) / 100 : (msec + 200) / 400), step_time_to_reg()
417 return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); in_to_reg()
1269 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); store_temp_offset()
1437 val = clamp_val(val, 0, 255); store_pwm()
1516 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 127); store_target_temp()
1542 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 15); store_tolerance()
1641 val = clamp_val(val, 1, 255); \
H A Dit87.c487 return clamp_val(val, 0, 255); in_to_reg()
499 rpm = clamp_val(rpm, 1, 1000000); FAN_TO_REG()
500 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); FAN_TO_REG()
507 return clamp_val((1350000 + rpm) / (rpm * 2), 1, 0xfffe); FAN16_TO_REG()
516 #define TEMP_TO_REG(val) (clamp_val(((val) < 0 ? (((val) - 500) / 1000) : \
1108 val = clamp_val(val, 0, 1000000); set_pwm_freq()
H A Demc1403.c163 hyst = clamp_val(DIV_ROUND_CLOSEST(hyst, 1000), 0, 255); store_hyst()
H A Dlm75.c157 temp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); set_temp()
H A Dmax16065.c122 return clamp_val(DIV_ROUND_CLOSEST(mv * 256, range), 0, 255); MV_TO_LIMIT()
H A Dnct6775.c673 return clamp_val((mode ? (msec + 200) / 400 : step_time_to_reg()
739 return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); in_to_reg()
2029 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); store_temp_offset()
2255 val = clamp_val(val, minval[index], maxval[index]); store_pwm()
2515 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, store_target_temp()
2552 val = clamp_val(val, 0, 1350000U); store_target_speed()
2590 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, data->tolerance_mask); store_temp_tolerance()
2661 val = clamp_val(val, 0, data->speed_tolerance_limit); store_speed_tolerance()
2712 val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 255); store_weight_temp()
H A Dmax6697.c316 temp = clamp_val(temp, 0, data->type == max6581 ? 255 : 127); set_temp()
H A Dsmsc47m1.c365 data->fan_preload[nr] = clamp_val(tmp, 0, 191); set_fan_div()
H A Dfschmd.c382 v = clamp_val(v / 1000, -128, 127) + 128; store_temp_max()
544 v = clamp_val(v, 128, 255); store_pwm_auto_point1_pwm()
H A Dg762.c202 return clamp_val(((clk_freq * 30 * gear_mult) / (rpm * p * clk_div)), cnt_from_rpm()
H A Dnct6683.c495 return clamp_val(DIV_ROUND_CLOSEST(val, scale), 0, 127); in_to_reg()
H A Dlm90.c991 lm90_set_convrate(client, data, clamp_val(val, 0, 100000)); set_update_interval()
/linux-4.1.27/drivers/gpu/drm/sti/
H A Dsti_layer.c111 layer->dst_w = clamp_val(dest_w, 0, mode->crtc_hdisplay - dest_x); sti_layer_prepare()
112 layer->dst_h = clamp_val(dest_h, 0, mode->crtc_vdisplay - dest_y); sti_layer_prepare()
H A Dsti_gdp.c293 clamp_val(layer->src_h, 0, GAM_GDP_SIZE_MAX) << 16 | sti_gdp_prepare_layer()
294 clamp_val(layer->src_w, 0, GAM_GDP_SIZE_MAX); sti_gdp_prepare_layer()
/linux-4.1.27/drivers/media/platform/s5p-tv/
H A Dmixer_grp_layer.c225 src->full_width = clamp_val(src->full_width, mxr_graph_fix_geometry()
227 src->full_height = clamp_val(src->full_height, mxr_graph_fix_geometry()
/linux-4.1.27/drivers/power/
H A Dsmb347-charger.c440 ret = clamp_val(ret, 2400000, 3000000) - 2400000; smb347_set_voltage_limits()
454 ret = clamp_val(ret, 3500000, 4500000) - 3500000; smb347_set_voltage_limits()
476 val = clamp_val(val, 100, 130) - 100; smb347_set_temp_limits()
489 val = clamp_val(val, 0, 15); smb347_set_temp_limits()
506 val = clamp_val(val, 40, 55) - 40; smb347_set_temp_limits()
521 val = clamp_val(val, -5, 10) + 5; smb347_set_temp_limits()
538 val = clamp_val(val, 50, 65) - 50; smb347_set_temp_limits()
/linux-4.1.27/drivers/net/wireless/b43/
H A Dppr.c40 *rate = clamp_val(*rate + diff, 0, 127); ppr_for_each_entry()
H A Dphy_g.c399 tmp = clamp_val(tmp, -32, 31); b43_nrssi_hw_update()
416 tmp = clamp_val(tmp, 0, 0x3F); b43_nrssi_mem_update()
749 a = clamp_val(a, -31, 31); b43_calc_nrssi_threshold()
758 b = clamp_val(b, -31, 31); b43_calc_nrssi_threshold()
2072 * entries to -32 (see the clamp_val() in nrssi_hw_update()) b43_phy_initg()
2348 entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128); b43_tssi2dbm_entry()
2757 tmp = clamp_val(tmp, 0x00, 0x3F); b43_gphy_estimate_power_out()
2812 *_rfatt = clamp_val(rfatt, rf_min, rf_max); b43_put_attenuation_into_ranges()
2813 *_bbatt = clamp_val(bbatt, bb_min, bb_max); b43_put_attenuation_into_ranges()
2931 desired_pwr = clamp_val(desired_pwr, 0, max_pwr); b43_gphy_op_recalc_txpower()
H A Dphy_a.c74 tmp = clamp_val(tmp, 0x00, 0xFF);
H A Dlo.c204 pga = clamp_val(pga, 0, 15); lo_measure_txctl_values()
319 trsw_rx_gain = clamp_val(trsw_rx_gain, 0, 0x2D); lo_measure_gain_values()
H A Dphy_n.c1675 offset = clamp_val(offset, -32, 31); b43_nphy_scale_offset_rssi()
2923 bcap_val_11b[core] = clamp_val(bcap_val_11b[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
2924 scap_val_11b[core] = clamp_val(scap_val_11b[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
2925 bcap_val_11n_20[core] = clamp_val(bcap_val_11n_20[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
2926 scap_val_11n_20[core] = clamp_val(scap_val_11n_20[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
2927 bcap_val_11n_40[core] = clamp_val(bcap_val_11n_40[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
2928 scap_val_11n_40[core] = clamp_val(scap_val_11n_40[core], 0, 0x1f); b43_nphy_workarounds_rev7plus()
5763 cur_hpf = clamp_val(cur_hpf, 0, 10); b43_nphy_rev2_cal_rx_iq()
H A Dmain.c1454 noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
1455 noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
1456 noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
1457 noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
/linux-4.1.27/drivers/net/wireless/b43legacy/
H A Dradio.c360 tmp = clamp_val(tmp, -32, 31); b43legacy_nrssi_hw_update()
378 tmp = clamp_val(tmp, 0, 0x3F); b43legacy_nrssi_mem_update()
842 threshold = clamp_val(threshold, 0, 0x3E); b43legacy_calc_nrssi_threshold()
895 a = clamp_val(a, -31, 31); b43legacy_calc_nrssi_threshold()
904 b = clamp_val(b, -31, 31); b43legacy_calc_nrssi_threshold()
1889 txpower = clamp_val(txpower, 0, 63); b43legacy_radio_set_txpower_a()
H A Dphy.c1099 * entries to -32 (see the clamp_val() in nrssi_hw_update()) b43legacy_phy_initg()
1765 tmp = clamp_val(tmp, 0x00, 0x3F); b43legacy_phy_estimate_power_out()
1868 desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); b43legacy_phy_xmitpower()
1914 baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); b43legacy_phy_xmitpower()
1942 baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); b43legacy_phy_xmitpower()
1943 radio_attenuation = clamp_val(radio_attenuation, 0, 9); b43legacy_phy_xmitpower()
1988 entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), b43legacy_tssi2dbm_entry()
H A Dmain.c842 noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
843 noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
844 noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
845 noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); handle_irq_noise()
/linux-4.1.27/drivers/net/ethernet/oki-semi/pch_gbe/
H A Dpch_gbe_ethtool.c320 clamp_val(ring->rx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); pch_gbe_set_ringparam()
324 clamp_val(ring->tx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); pch_gbe_set_ringparam()
/linux-4.1.27/drivers/input/
H A Dff-memless.c278 clamp_val(effect->u.ramp.start_level + x, -0x80, 0x7f); ml_combine_effects()
280 clamp_val(effect->u.ramp.end_level + y, -0x80, 0x7f); ml_combine_effects()
/linux-4.1.27/fs/btrfs/
H A Dasync-thread.c210 new_max_active = clamp_val(new_max_active, 1, wq->max_active); thresh_exec_hook()
/linux-4.1.27/drivers/video/fbdev/
H A Dpxafb.c417 clamp_val(var->hsync_len, 1, 64); pxafb_adjust_timing()
418 clamp_val(var->vsync_len, 1, 64); pxafb_adjust_timing()
419 clamp_val(var->left_margin, 1, 255); pxafb_adjust_timing()
420 clamp_val(var->right_margin, 1, 255); pxafb_adjust_timing()
421 clamp_val(var->upper_margin, 1, 255); pxafb_adjust_timing()
422 clamp_val(var->lower_margin, 1, 255); pxafb_adjust_timing()
/linux-4.1.27/drivers/media/tuners/
H A Dm88rs6000t.c389 f3dB = clamp_val(f3dB, 6000U, 43000U); m88rs6000t_set_bb()
563 gain = clamp_val(gain, 1000U, 10500U); m88rs6000t_get_rf_strength()
/linux-4.1.27/arch/x86/mm/
H A Dinit.c438 u64 start = clamp_val(PFN_PHYS(start_pfn), r_start, r_end); init_range_memory_mapping()
439 u64 end = clamp_val(PFN_PHYS(end_pfn), r_start, r_end); init_range_memory_mapping()
/linux-4.1.27/drivers/char/
H A Di8k.c624 return sprintf(buf, "%d\n", clamp_val(status * i8k_pwm_mult, 0, 255)); i8k_hwmon_show_pwm()
638 val = clamp_val(DIV_ROUND_CLOSEST(val, i8k_pwm_mult), 0, i8k_fan_max); i8k_hwmon_set_pwm()
/linux-4.1.27/drivers/usb/gadget/udc/bdc/
H A Dbdc_cmd.c161 si = clamp_val(si, 1, 16) - 1; bdc_config_ep()
/linux-4.1.27/drivers/watchdog/
H A Dts72xx_wdt.c109 new_timeout = clamp_val(new_timeout, 1, 8); timeout_to_regval()
/linux-4.1.27/kernel/power/
H A Dswap.c597 nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); save_image_lzo()
1088 nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); load_image_lzo()
1163 read_pages = clamp_val(read_pages, LZO_MIN_RD_PAGES, LZO_MAX_RD_PAGES); load_image_lzo()
/linux-4.1.27/drivers/net/dsa/
H A Dmv88e6352.c270 temp = clamp_val(DIV_ROUND_CLOSEST(temp, 5) + 5, 0, 0x1f); mv88e6352_set_temp_limit()
/linux-4.1.27/drivers/thermal/
H A Dx86_pkg_temp_thermal.c414 thres_count = clamp_val(thres_count, 0, MAX_NUMBER_OF_TRIPS); pkg_temp_thermal_device_add()
/linux-4.1.27/drivers/input/mouse/
H A Dbcm5974.c535 abs_p = clamp_val(256 * p / cfg->p.max, 0, 255); report_synaptics_data()
536 abs_w = clamp_val(16 * w / cfg->w.max, 0, 15); report_synaptics_data()
H A Dcyapa.c532 sleep_time = clamp_val(sleep_time, 20, 1000); cyapa_sleep_time_to_pwr_cmd()
H A Dsynaptics.c927 nsemi = clamp_val(num_fingers, 0, 2); synaptics_report_mt_data()
/linux-4.1.27/include/linux/
H A Dkernel.h785 * clamp_val - return a value clamped to a given range using val's type
795 #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) macro
/linux-4.1.27/drivers/media/pci/pt3/
H A Dpt3.c785 pt3->num_bufs = clamp_val(num_bufs, MIN_DATA_BUFS, MAX_DATA_BUFS); pt3_probe()
/linux-4.1.27/drivers/media/dvb-frontends/
H A Drtl2830.c529 u16tmp = clamp_val(-4 * tmp + 32767, 0x0000, 0xffff); rtl2830_stat_work()
/linux-4.1.27/drivers/acpi/apei/
H A Derst.c522 new_size = clamp_val(new_size, ERST_RECORD_ID_CACHE_SIZE_MIN, __erst_record_id_cache_add_one()
/linux-4.1.27/drivers/platform/x86/
H A Deeepc-laptop.c990 value = clamp_val(value, 0, 255); eeepc_lmsensors_to_pwm()
H A Dasus-laptop.c459 return clamp_val((short)val, -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP); pega_acc_axis()
/linux-4.1.27/net/dccp/ccids/
H A Dccid2.c125 clamp_val(val, DCCPF_SEQ_WMIN, ccid2_change_l_seq_window()
/linux-4.1.27/drivers/usb/host/
H A Dxhci-mem.c1215 interval = clamp_val(ep->desc.bInterval, 1, 16) - 1; xhci_parse_exponent_interval()
1246 interval = clamp_val(interval, min_exponent, max_exponent); xhci_microframes_to_exponent()
/linux-4.1.27/drivers/firewire/
H A Dsbp2.c1094 tgt->mgt_orb_timeout = clamp_val(timeout, 5000, 40000); sbp2_clamp_management_orb_timeout()
/linux-4.1.27/drivers/media/platform/s5p-jpeg/
H A Djpeg-core.c1437 scale_factor = clamp_val(scale_factor, 1, 8); exynos3250_jpeg_try_downscale()
/linux-4.1.27/drivers/target/sbp/
H A Dsbp_target.c479 login_response_len = clamp_val( sbp_management_request_login()
/linux-4.1.27/drivers/net/ethernet/amd/xgbe/
H A Dxgbe-drv.c264 rx_buf_size = clamp_val(rx_buf_size, XGBE_RX_MIN_BUF_SIZE, PAGE_SIZE); xgbe_calc_rx_buf_size()
/linux-4.1.27/drivers/hid/
H A Dwacom_wac.c367 rw = clamp_val(rw, 0, 31); wacom_graphire_irq()
/linux-4.1.27/kernel/
H A Dworkqueue.c3843 return clamp_val(max_active, 1, lim); wq_clamp_max_active()
/linux-4.1.27/kernel/sched/
H A Dcore.c3164 nice = clamp_val(nice, MIN_NICE, MAX_NICE); SYSCALL_DEFINE1()

Completed in 2832 milliseconds