Home
last modified time | relevance | path

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

12345

/linux/drivers/ata/
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()
H A Dpata_ns87415.c68 clocking = 17 - clamp_val(t.active, 2, 17); in ns87415_set_mode()
69 clocking |= (16 - clamp_val(t.recover, 1, 16)) << 4; in ns87415_set_mode()
/linux/drivers/hwmon/pmbus/
H A Dlm25066.c396 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
400 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
406 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
414 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
421 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data()
429 word = clamp_val(word, 1, LM25066_SAMPLES_FOR_AVG_MAX); in lm25066_write_word_data()
H A Dmax20830.c65 ret = clamp_val(temp, 0, 0xFFFF); in max20830_read_word_data()
/linux/drivers/hwmon/
H A Dltc2947-core.c604 val = clamp_val(val, TEMP_MIN, TEMP_MAX); in ltc2947_write_temp()
619 val = clamp_val(val, TEMP_MIN, TEMP_MAX); in ltc2947_write_temp()
650 val = clamp_val(val, POWER_MIN, POWER_MAX); in ltc2947_write_power()
655 val = clamp_val(val, POWER_MIN, POWER_MAX); in ltc2947_write_power()
676 val = clamp_val(val, CURRENT_MIN, CURRENT_MAX); in ltc2947_write_curr()
681 val = clamp_val(val, CURRENT_MIN, CURRENT_MAX); in ltc2947_write_curr()
713 val = clamp_val(val, VDVCC_MIN, VDVCC_MAX); in ltc2947_write_in()
719 val = clamp_val(val, VOLTAGE_MIN, VOLTAGE_MAX); in ltc2947_write_in()
725 val = clamp_val(val, VDVCC_MIN, VDVCC_MAX); in ltc2947_write_in()
731 val = clamp_val(val, VOLTAGE_MIN, VOLTAGE_MAX); in ltc2947_write_in()
H A Dlm63.c120 #define TEMP8_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
122 #define TEMP8U_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, \
125 #define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
127 #define TEMP11U_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), 0, \
129 #define HYST_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \
197 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127500), 500); in lut_temp_to_reg()
199 return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127000), 1000); in lut_temp_to_reg()
408 val = clamp_val(val, 0, 255); in set_pwm1()
497 pfr_fast = clamp_val(DIV_ROUND_CLOSEST((unsigned long)LM63_PWM_BASE_FAST_HZ, val), in pwm1_freq_store()
499 pfr_slow = clamp_val(DIV_ROUND_CLOSEST((unsigned long)LM63_PWM_BASE_SLOW_HZ, val), in pwm1_freq_store()
[all …]
H A Dlm75.h28 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); in LM75_TEMP_TO_REG()
H A Dadt7470.c533 temp = clamp_val(temp, 500, 60000); in auto_update_interval_store()
564 temp = clamp_val(temp, -1, 10); in num_temp_sensors_store()
607 val = clamp_val(val, -128000, 127000); in adt7470_temp_write()
707 val = clamp_val(val, 1, 65534); in adt7470_fan_write()
858 val = clamp_val(val, 0, ADT7470_PWM_MAX); in adt7470_pwm_write()
1045 temp = clamp_val(temp, 0, ADT7470_PWM_MAX); in pwm_max_store()
1080 temp = clamp_val(temp, 0, ADT7470_PWM_MAX); in pwm_min_store()
1128 temp = clamp_val(temp, -128000, 127000); in pwm_tmin_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()
H A Dadt7475.c240 val = clamp_val(val, -64000, 191000); in temp2reg()
243 val = clamp_val(val, -128000, 127000); in temp2reg()
279 return clamp_val((90000 * 60) / rpm, 1, 0xFFFF); in rpm2tach()
312 return clamp_val(reg, 0, 1023) & (0xff << 2); in volt2reg()
479 val = clamp_val(val, -63000, 127000); in temp_store()
482 val = clamp_val(val, -63000, 64000); in temp_store()
499 val = clamp_val(val, temp - 15000, temp); in temp_store()
690 val = clamp_val(val, temp + autorange_table[0], in point2_store()
826 data->pwm[sattr->nr][sattr->index] = clamp_val(val, 0, 0xFF); in pwm_store()
991 idx = clamp_val(data->range[sattr->index] & 0xf, 0, in pwmfreq_show()
H A Dw83793.c181 return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); in FAN_TO_REG()
191 return clamp_val((val + 50) / 100, 0, 0xff); in TIME_TO_REG()
201 return clamp_val((val + (val < 0 ? -500 : 500)) / 1000, min, max); in TEMP_TO_REG()
549 val = clamp_val(val, 0, 0xff) >> 2; in store_pwm()
730 data->pwm_default |= clamp_val(val, 0, 0xff) >> 2; in store_sf_setup()
829 val = clamp_val(val, 0, 255); in store_sf_ctrl()
898 val = clamp_val(val, 0, 0xff) >> 2; in store_sf2_pwm()
994 val = clamp_val(val, 0, 255); in store_in()
996 val = clamp_val(val, 0, 0x3FF); in store_in()
H A Dmc33xs2410_hwmon.c109 val = clamp_val(val, -40000, 215000); in mc33xs2410_hwmon_write()
H A Dw83627hf.c250 #define IN_TO_REG(val) (clamp_val((((val) + 8) / 16), 0, 255))
257 rpm = clamp_val(rpm, 1, 1000000); in FAN_TO_REG()
258 return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); in FAN_TO_REG()
270 int ntemp = clamp_val(temp, TEMP_MIN, TEMP_MAX); in TEMP_TO_REG()
282 #define PWM_TO_REG(val) (clamp_val((val), 0, 255))
337 val = clamp_val(val, 1, 128) >> 1; in DIV_TO_REG()
856 clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); in in0_min_store()
895 clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); in in0_max_store()
H A Dads7828.c143 vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN, in ads7828_probe()
/linux/drivers/video/backlight/
H A Dmt6370-backlight.c149 prop_val = clamp_val(prop_val, in mt6370_init_backlight_properties()
170 ovp_uV = clamp_val(ovp_uV, MT6370_BL_OVP_MIN_UV, in mt6370_init_backlight_properties()
183 ocp_uA = clamp_val(ocp_uA, MT6370_BL_OCP_MIN_UA, in mt6370_init_backlight_properties()
/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()
/linux/drivers/media/i2c/
H A Dt4ka3.c377 width = clamp_val(ALIGN(format->format.width, 2), in t4ka3_set_pad_format()
379 height = clamp_val(ALIGN(format->format.height, 2), in t4ka3_set_pad_format()
670 rect.left = clamp_val(ALIGN(sel->r.left, 2), in t4ka3_set_selection()
672 rect.top = clamp_val(ALIGN(sel->r.top, 2), in t4ka3_set_selection()
674 rect.width = clamp_val(ALIGN(sel->r.width, 2), T4KA3_MIN_CROP_WIDTH, in t4ka3_set_selection()
676 rect.height = clamp_val(ALIGN(sel->r.height, 2), T4KA3_MIN_CROP_HEIGHT, in t4ka3_set_selection()
H A Dov2680.c655 width = clamp_val(ALIGN(format->format.width, 2), in ov2680_set_fmt()
657 height = clamp_val(ALIGN(format->format.height, 2), in ov2680_set_fmt()
752 rect.left = clamp_val(ALIGN(sel->r.left, 2), in ov2680_set_selection()
754 rect.top = clamp_val(ALIGN(sel->r.top, 2), in ov2680_set_selection()
756 rect.width = clamp_val(ALIGN(sel->r.width, 2), in ov2680_set_selection()
758 rect.height = clamp_val(ALIGN(sel->r.height, 2), in ov2680_set_selection()
/linux/drivers/misc/amd-sbi/
H A Drmi-hwmon.c68 val = clamp_val(val, SBRMI_PWR_MIN, data->pwr_limit_max); in sbrmi_write()
/linux/drivers/thermal/spacemit/
H A Dk1_tsensor.c159 low = clamp_val(low / 1000 + TEMPERATURE_OFFSET, TEMPERATURE_OFFSET, in k1_tsensor_set_trips()
161 high = clamp_val(high / 1000 + TEMPERATURE_OFFSET, TEMPERATURE_OFFSET, in k1_tsensor_set_trips()
/linux/drivers/usb/mtu3/
H A Dmtu3_gadget.c81 interval = clamp_val(interval, 1, 16); in mtu3_ep_enable()
93 interval = clamp_val(interval, 1, 16); in mtu3_ep_enable()
99 interval = clamp_val(desc->bInterval, 1, 16); in mtu3_ep_enable()
101 interval = clamp_val(desc->bInterval, 1, 255); in mtu3_ep_enable()
/linux/drivers/memory/
H A Dstm32-fmc2-ebi.c736 val = clamp_val(setup, 1, FMC2_BXTR_ADDSET_MAX); in stm32_fmc2_ebi_set_address_setup()
756 val = clamp_val(setup, 1, FMC2_BXTR_ADDHLD_MAX); in stm32_fmc2_ebi_set_address_hold()
774 val = clamp_val(setup, 1, FMC2_BXTR_DATAST_MAX); in stm32_fmc2_ebi_set_data_setup()
826 val = setup ? clamp_val(setup - 1, 1, FMC2_BTR_CLKDIV_MAX) : 1; in stm32_fmc2_ebi_set_clk_period()
845 val = setup ? clamp_val(setup - 1, 1, FMC2_CFGR_CLKDIV_MAX) : 1; in stm32_fmc2_ebi_mp25_set_clk_period()
849 val = setup ? clamp_val(setup - 1, 1, FMC2_BTR_CLKDIV_MAX) : 1; in stm32_fmc2_ebi_mp25_set_clk_period()

12345