Home
last modified time | relevance | path

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

123

/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/
H A Dlm75.h28 int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); in LM75_TEMP_TO_REG()
H A Dmc33xs2410_hwmon.c109 val = clamp_val(val, -40000, 215000); in mc33xs2410_hwmon_write()
H A Dsch5627.c235 return clamp_val(limit, 0, U8_MAX); in sch5627_temp_limit_to_reg()
247 return clamp_val(pulses, 1, U16_MAX - 1); in sch5627_rpm_to_reg()
/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/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/misc/amd-sbi/
H A Drmi-hwmon.c68 val = clamp_val(val, SBRMI_PWR_MIN, data->pwr_limit_max); in sbrmi_write()
/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/phy/mediatek/
H A Dphy-mtk-mipi-dsi.c147 mipi_tx->mipitx_drive = clamp_val(mipi_tx->mipitx_drive, 3000, in mtk_mipi_tx_probe()
/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()
/linux/drivers/net/ethernet/oki-semi/pch_gbe/
H A Dpch_gbe_ethtool.c336 clamp_val(ring->rx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); in pch_gbe_set_ringparam()
340 clamp_val(ring->tx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); in pch_gbe_set_ringparam()
/linux/sound/soc/sdca/
H A Dsdca_regmap.c194 return clamp_val(control->nbits / BITS_PER_BYTE, sizeof(u8), sizeof(u32)); in sdca_regmap_mbq_size()
/linux/drivers/net/wireless/broadcom/b43legacy/
H A Dradio.c343 tmp = clamp_val(tmp, -32, 31); in b43legacy_nrssi_hw_update()
361 tmp = clamp_val(tmp, 0, 0x3F); in b43legacy_nrssi_mem_update()
825 threshold = clamp_val(threshold, 0, 0x3E); in b43legacy_calc_nrssi_threshold()
878 a = clamp_val(a, -31, 31); in b43legacy_calc_nrssi_threshold()
887 b = clamp_val(b, -31, 31); in b43legacy_calc_nrssi_threshold()
1855 txpower = clamp_val(txpower, 0, 63); in b43legacy_radio_set_txpower_a()
H A Dphy.c1740 tmp = clamp_val(tmp, 0x00, 0x3F); in b43legacy_phy_estimate_power_out()
1843 desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); in b43legacy_phy_xmitpower()
1889 baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); in b43legacy_phy_xmitpower()
1917 baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); in b43legacy_phy_xmitpower()
1918 radio_attenuation = clamp_val(radio_attenuation, 0, 9); in b43legacy_phy_xmitpower()
1963 entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), in b43legacy_tssi2dbm_entry()
/linux/drivers/net/wireless/broadcom/b43/
H A Dppr.c31 *rate = clamp_val(*rate + diff, 0, 127); in b43_ppr_add()
H A Dphy_g.c387 tmp = clamp_val(tmp, -32, 31); in b43_nrssi_hw_update()
404 tmp = clamp_val(tmp, 0, 0x3F); in b43_nrssi_mem_update()
737 a = clamp_val(a, -31, 31); in b43_calc_nrssi_threshold()
746 b = clamp_val(b, -31, 31); in b43_calc_nrssi_threshold()
2350 entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128); in b43_tssi2dbm_entry()
2759 tmp = clamp_val(tmp, 0x00, 0x3F); in b43_gphy_estimate_power_out()
2814 *_rfatt = clamp_val(rfatt, rf_min, rf_max); in b43_put_attenuation_into_ranges()
2815 *_bbatt = clamp_val(bbatt, bb_min, bb_max); in b43_put_attenuation_into_ranges()
2933 desired_pwr = clamp_val(desired_pwr, 0, max_pwr); in b43_gphy_op_recalc_txpower()
/linux/drivers/nvme/host/
H A Dhwmon.c47 threshold |= clamp_val(temp, 0, NVME_TEMP_THRESH_MASK); in nvme_set_temp_thresh()
/linux/net/ipv4/
H A Dinetpeer.c80 inet_peer_threshold = clamp_val(nr_entries, 4096, 65536 + 128); in inet_initpeers()
/linux/fs/btrfs/
H A Dasync-thread.c197 new_current_active = clamp_val(new_current_active, 1, wq->limit_active); in thresh_exec_hook()
/linux/drivers/net/phy/
H A Dbcm54140.c316 val = clamp_val(val, BCM54140_HWMON_TO_TEMP(mask), in bcm54140_hwmon_write_temp()
341 val = clamp_val(val, 0, BCM54140_HWMON_TO_IN(channel, mask)); in bcm54140_hwmon_write_in()
/linux/include/linux/
H A Dminmax.h231 #define clamp_val(val, lo, hi) __careful_clamp(typeof(val), val, lo, hi) macro

123