Home
last modified time | relevance | path

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

1234567

/linux/drivers/ata/
H A Dpata_via.c282 setup |= (clamp_val(t.setup, 1, 4) - 1) << shift; in via_do_set_mode()
288 ((clamp_val(t.act8b, 1, 16) - 1) << 4) | (clamp_val(t.rec8b, 1, 16) - 1)); in via_do_set_mode()
290 ((clamp_val(t.active, 1, 16) - 1) << 4) | (clamp_val(t.recover, 1, 16) - 1)); in via_do_set_mode()
296 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 5) - 2)) : 0x03; in via_do_set_mode()
299 ut = t.udma ? (0xe8 | (clamp_val(t.udma, 2, 9) - 2)) : 0x0f; in via_do_set_mode()
302 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; in via_do_set_mode()
305 ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; in via_do_set_mode()
H A 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()
H A 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()
H A 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/drivers/hwmon/
H A Dtmp401.c278 temp = clamp_val(temp, -64000, 191000); in tmp401_temp_to_register()
281 temp = clamp_val(temp, 0, 127000); in tmp401_temp_to_register()
369 val = clamp_val(val, -64000, 191000); in tmp401_temp_write()
371 val = clamp_val(val, 0, 127000); in tmp401_temp_write()
378 val = clamp_val(val, temp - 255000, temp); in tmp401_temp_write()
424 val = clamp_val(val, 125, 16000); in tmp401_set_convrate()
H A 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 …]
H A Dtmp513.c269 regval = clamp_val(val, -max_val, max_val); in tmp51x_set_value()
277 val = clamp_val(DIV_ROUND_CLOSEST(val, 4), 0, max_val); in tmp51x_set_value()
281 regval = clamp_val(DIV_ROUND_CLOSEST(val, data->pwr_lsb_uw), 0, in tmp51x_set_value()
289 val = clamp_val(val, MIN_TEMP_LIMIT, MAX_TEMP_LIMIT); in tmp51x_set_value()
294 val = clamp_val(val, 0, MAX_TEMP_HYST); in tmp51x_set_value()
H A 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()
406 val = clamp_val(val, 0, 255); in set_pwm1()
703 lm63_set_convrate(data, clamp_val(val, 0, 100000)); in update_interval_store()
H A Dlm75.h28 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); in LM75_TEMP_TO_REG()
H A Dadm1031.c215 tmp = FAN_FROM_REG(clamp_val(reg, 0, 65535), div); in FAN_TO_REG()
221 #define PWM_TO_REG(val) (clamp_val((val), 0, 255) >> 4)
415 val = clamp_val(val, 0, 127000); in auto_temp_min_store()
445 val = clamp_val(val, 0, 127000); in auto_temp_max_store()
719 val = clamp_val(val, -15000, 15000); in temp_offset_store()
741 val = clamp_val(val, -55000, 127000); in temp_min_store()
763 val = clamp_val(val, -55000, 127000); in temp_max_store()
785 val = clamp_val(val, -55000, 127000); in temp_crit_store()
H A Dadt7470.c494 temp = clamp_val(temp, 0, 60000); in auto_update_interval_store()
525 temp = clamp_val(temp, -1, 10); in num_temp_sensors_store()
568 val = clamp_val(val, -128000, 127000); in adt7470_temp_write()
669 val = clamp_val(val, 1, 65534); in adt7470_fan_write()
814 val = clamp_val(val, 0, 255); in adt7470_pwm_write()
872 temp = clamp_val(temp, 0, 255); in pwm_max_store()
907 temp = clamp_val(temp, 0, 255); in pwm_min_store()
955 temp = clamp_val(temp, -128000, 127000); in pwm_tmin_store()
H A Dw83795.c253 return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); in fan_to_reg()
263 return clamp_val((val + 50) / 100, 0, 0xff); in time_to_reg()
273 return clamp_val(val / 1000, min, max); in temp_to_reg()
307 reg1 = clamp_val(DIV_ROUND_CLOSEST(base_clock, val), 1, 128); in pwm_freq_to_reg()
877 val = clamp_val(val, 0, 0xff); in store_pwm()
1114 tmp = clamp_val(tmp, 0, 0xff); in store_temp_pwm_enable()
1165 val = fan_to_reg(clamp_val(val, 0, 0xfff)); in store_fanin()
1171 val = clamp_val(val, 0, 0x3f); in store_fanin()
1215 val = clamp_val(val, 0, 0x7f); in store_temp_pwm()
1219 val = clamp_val(val, 0, 0x7f); in store_temp_pwm()
[all …]
H A Dw83773g.c129 val = clamp_val(val, -127825, 127825); in set_offset()
167 val = clamp_val(val, 62, 16000) * 10; in set_update_interval()
H A Dw83792d.c225 rpm = clamp_val(rpm, 1, 1000000); in FAN_TO_REG()
226 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); in FAN_TO_REG()
234 #define TEMP1_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \
242 (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 : (val)) / 1000, 0, 0xff))
251 val = clamp_val(val, 1, 128) >> 1; in DIV_TO_REG()
379 data->in_##reg[nr] = clamp_val(IN_TO_REG(nr, val) / 4, 0, 255); \
627 val = clamp_val(val, 0, 255) >> 4; in store_pwm()
781 data->thermal_cruise[nr] = clamp_val(target_tmp, 0, 255); in store_thermal_cruise()
819 tol_tmp = clamp_val(val, 0, 15); in store_tolerance()
863 data->sf2_points[index][nr] = clamp_val(val, 0, 127); in store_sf2_point()
[all …]
H A Dgl518sm.c76 #define TEMP_CLAMP(val) clamp_val(val, -119000, 136000)
85 rpmdiv = clamp_val(rpm, 1, 960000) * div; in FAN_TO_REG()
86 return clamp_val((480000 + rpmdiv / 2) / rpmdiv, 1, 255); in FAN_TO_REG()
90 #define IN_CLAMP(val) clamp_val(val, 0, 255 * 19)
94 #define VDD_CLAMP(val) clamp_val(val, 0, 255 * 95 / 4)
H A Df75375s.c322 data->pwm[nr] = clamp_val(val, 0, 255); in set_pwm()
519 val = clamp_val(VOLT_TO_REG(val), 0, 0xff); in set_in_max()
540 val = clamp_val(VOLT_TO_REG(val), 0, 0xff); in set_in_min()
588 val = clamp_val(TEMP_TO_REG(val), 0, 127); in set_temp_max()
609 val = clamp_val(TEMP_TO_REG(val), 0, 127); in set_temp_max_hyst()
785 data->pwm[nr] = clamp_val(f75375s_pdata->pwm[nr], 0, 255); in f75375_init()
H A Dthmc50.c140 data->analog_out = clamp_val(tmp, 0, 255); in analog_out_store()
194 data->temp_min[nr] = clamp_val(val / 1000, -128, 127); in temp_min_store()
224 data->temp_max[nr] = clamp_val(val / 1000, -128, 127); in temp_max_store()
H A Dltc2945.c179 val = clamp_val(val, 0, U32_MAX); in ltc2945_val_to_reg()
277 regval = clamp_val(regval, 0, 0xffffff); in ltc2945_value_store()
283 regval = clamp_val(regval, 0, 0xfff) << 4; in ltc2945_value_store()
H A Dadt7462.c802 temp = clamp_val(temp, -64000, 191000); in temp_min_store()
838 temp = clamp_val(temp, -64000, 191000); in temp_max_store()
899 temp = clamp_val(temp, 0, 255 * x / 1000); in volt_max_store()
939 temp = clamp_val(temp, 0, 255 * x / 1000); in volt_min_store()
1027 temp = clamp_val(temp, 1, 255); in fan_min_store()
1103 temp = clamp_val(temp, 0, 255); in pwm_store()
1131 temp = clamp_val(temp, 0, 255); in pwm_max_store()
1161 temp = clamp_val(temp, 0, 255); in pwm_min_store()
1193 temp = clamp_val(temp, 0, 15000); in pwm_hyst_store()
1275 temp = clamp_val(temp, -64000, 191000); in pwm_tmin_store()
/linux/drivers/video/backlight/
H A Dmt6370-backlight.c150 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/drivers/hwmon/pmbus/
H A Dmp2888.c272 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()
H A Dstpddc60.c58 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/drivers/net/ethernet/qualcomm/emac/
H A Demac-ethtool.c162 clamp_val(ring->tx_pending, EMAC_MIN_TX_DESCS, EMAC_MAX_TX_DESCS); in emac_set_ringparam()
165 clamp_val(ring->rx_pending, EMAC_MIN_RX_DESCS, EMAC_MAX_RX_DESCS); in emac_set_ringparam()
/linux/drivers/gpu/drm/sti/
H A Dsti_vid.c146 int dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); in sti_vid_commit()
147 int dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); in sti_vid_commit()
/linux/drivers/input/
H A Dmousedev.c292 client->pos_x = clamp_val(client->pos_x, 0, xres); in mousedev_notify_readers()
295 client->pos_y = clamp_val(client->pos_y, 0, yres); in mousedev_notify_readers()
576 dx = clamp_val(p->dx, -127, 127); in mousedev_packet()
579 dy = clamp_val(p->dy, -127, 127); in mousedev_packet()
590 dz = clamp_val(p->dz, -7, 7); in mousedev_packet()
598 dz = clamp_val(p->dz, -127, 127); in mousedev_packet()

1234567