Home
last modified time | relevance | path

Searched refs:avg (Results 1 – 25 of 43) sorted by relevance

12

/drivers/mfd/
Dpcf50633-adc.c27 int avg; member
54 static void adc_setup(struct pcf50633 *pcf, int channel, int avg) in adc_setup() argument
63 pcf50633_reg_write(pcf, PCF50633_REG_ADCC1, channel | avg | in adc_setup()
77 adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg); in trigger_next_adc_job_if_any()
116 int pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg) in pcf50633_adc_sync_read() argument
123 ret = pcf50633_adc_async_read(pcf, mux, avg, in pcf50633_adc_sync_read()
134 int pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg, in pcf50633_adc_async_read() argument
147 req->avg = avg; in pcf50633_adc_async_read()
/drivers/iio/humidity/
Dhts221_core.c173 const struct hts221_avg *avg = &hts221_avg_list[type]; in hts221_update_avg() local
177 if (avg->avg_avl[i] == val) in hts221_update_avg()
183 data = ((i << __ffs(avg->mask)) & avg->mask); in hts221_update_avg()
184 err = regmap_update_bits(hw->regmap, avg->addr, in hts221_update_avg()
185 avg->mask, data); in hts221_update_avg()
214 const struct hts221_avg *avg = &hts221_avg_list[HTS221_SENSOR_H]; in hts221_sysfs_rh_oversampling_avail() local
218 for (i = 0; i < ARRAY_SIZE(avg->avg_avl); i++) in hts221_sysfs_rh_oversampling_avail()
220 avg->avg_avl[i]); in hts221_sysfs_rh_oversampling_avail()
231 const struct hts221_avg *avg = &hts221_avg_list[HTS221_SENSOR_T]; in hts221_sysfs_temp_oversampling_avail() local
235 for (i = 0; i < ARRAY_SIZE(avg->avg_avl); i++) in hts221_sysfs_temp_oversampling_avail()
[all …]
/drivers/hwmon/pmbus/
Dadm1275.c497 u32 avg; in adm1275_probe() local
762 "adi,power-sample-average", &avg) == 0) { in adm1275_probe()
763 if (!avg || avg > ADM1275_SAMPLES_AVG_MAX || in adm1275_probe()
764 BIT(__fls(avg)) != avg) { in adm1275_probe()
770 ilog2(avg)); in adm1275_probe()
780 "adi,volt-curr-sample-average", &avg) == 0) { in adm1275_probe()
781 if (!avg || avg > ADM1275_SAMPLES_AVG_MAX || in adm1275_probe()
782 BIT(__fls(avg)) != avg) { in adm1275_probe()
788 ilog2(avg)); in adm1275_probe()
/drivers/cpuidle/governors/
Dmenu.c173 unsigned int min, max, thresh, avg; in get_typical_interval() local
206 avg = sum >> INTERVAL_SHIFT; in get_typical_interval()
208 avg = div_u64(sum, divisor); in get_typical_interval()
215 int64_t diff = (int64_t)value - avg; in get_typical_interval()
237 if ((((u64)avg*avg > variance*36) && (divisor * 4 >= INTERVALS * 3)) in get_typical_interval()
239 return avg; in get_typical_interval()
/drivers/power/supply/
Dab8500_fg.c107 int avg; member
383 struct ab8500_fg_avg_cap *avg = &di->avg_cap; in ab8500_fg_add_cap_sample() local
386 avg->sum += sample - avg->samples[avg->pos]; in ab8500_fg_add_cap_sample()
387 avg->samples[avg->pos] = sample; in ab8500_fg_add_cap_sample()
388 avg->time_stamps[avg->pos] = now; in ab8500_fg_add_cap_sample()
389 avg->pos++; in ab8500_fg_add_cap_sample()
391 if (avg->pos == NBR_AVG_SAMPLES) in ab8500_fg_add_cap_sample()
392 avg->pos = 0; in ab8500_fg_add_cap_sample()
394 if (avg->nbr_samples < NBR_AVG_SAMPLES) in ab8500_fg_add_cap_sample()
395 avg->nbr_samples++; in ab8500_fg_add_cap_sample()
[all …]
Dcw2015_battery.c309 u32 avg = 0; in cw_get_voltage() local
316 avg += reg_val; in cw_get_voltage()
318 avg /= CW2015_AVERAGING_SAMPLES; in cw_get_voltage()
325 voltage_mv = avg * 312 / 1024; in cw_get_voltage()
/drivers/clk/bcm/
Dclk-bcm53573-ilp.c50 int avg; in bcm53573_ilp_recalc_rate() local
87 avg = sum / num; in bcm53573_ilp_recalc_rate()
89 return parent_rate * 4 / avg; in bcm53573_ilp_recalc_rate()
/drivers/platform/x86/
Dintel_ips.c626 int avg; in cpu_exceeded() local
630 avg = cpu ? ips->ctv2_avg_temp : ips->ctv1_avg_temp; in cpu_exceeded()
631 if (avg > (ips->limits->core_temp_limit * 100)) in cpu_exceeded()
818 u16 avg; in calc_avg_temp() local
825 avg = (u16)total; in calc_avg_temp()
827 return avg; in calc_avg_temp()
891 static u16 update_average_temp(u16 avg, u16 val) in update_average_temp() argument
897 (((temp_decay_factor - 1) * avg) / temp_decay_factor); in update_average_temp()
902 static u16 update_average_power(u32 avg, u32 val) in update_average_power() argument
907 (((power_decay_factor - 1) * avg) / power_decay_factor); in update_average_power()
[all …]
/drivers/thermal/intel/
Dtherm_throt.c242 unsigned int i, avg, this_cpu = smp_processor_id(); in throttle_active_work() local
280 avg = 0; in throttle_active_work()
282 avg += state->temp_samples[i]; in throttle_active_work()
284 avg /= ARRAY_SIZE(state->temp_samples); in throttle_active_work()
286 if (state->average > avg) { in throttle_active_work()
294 state->average = avg; in throttle_active_work()
/drivers/net/wireless/ralink/rt2x00/
Drt2x00link.c27 unsigned long avg; in rt2x00link_get_avg_rssi() local
29 avg = ewma_rssi_read(ewma); in rt2x00link_get_avg_rssi()
30 if (avg) in rt2x00link_get_avg_rssi()
31 return -avg; in rt2x00link_get_avg_rssi()
/drivers/iio/adc/
Dtwl4030-madc.c112 u8 avg; member
284 .avg = TWL4030_MADC_RTAVERAGE_LSB,
289 .avg = TWL4030_MADC_SW1AVERAGE_LSB,
295 .avg = TWL4030_MADC_SW2AVERAGE_LSB,
639 method->avg); in twl4030_madc_conversion()
643 method->avg); in twl4030_madc_conversion()
Dina2xx-adc.c99 * c->avg)
144 int avg; member
205 *val = chip->avg; in ina2xx_read_raw()
299 chip->avg = ina226_avg_tab[bits]; in ina226_set_average()
842 1000000 / sampling_us, chip->avg); in ina2xx_buffer_enable()
1010 chip->avg = 1; in ina2xx_probe()
/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/
Dphy_lcn.c3949 s16 avg = 0; in wlc_lcnphy_tempsense_new() local
3964 avg = (s16) (tempsenseval1 - 512); in wlc_lcnphy_tempsense_new()
3966 avg = (s16) tempsenseval1; in wlc_lcnphy_tempsense_new()
3969 avg += (s16) (tempsenseval2 - 512); in wlc_lcnphy_tempsense_new()
3971 avg += (s16) tempsenseval2; in wlc_lcnphy_tempsense_new()
3973 avg /= 2; in wlc_lcnphy_tempsense_new()
3985 return avg; in wlc_lcnphy_tempsense_new()
3991 s32 avg = 0; in wlc_lcnphy_tempsense() local
4008 avg = (int)(tempsenseval1 - 512); in wlc_lcnphy_tempsense()
4010 avg = (int)tempsenseval1; in wlc_lcnphy_tempsense()
[all …]
/drivers/hwmon/
Dina2xx.c157 int avg = ina226_avg_tab[INA226_READ_AVG(config)]; in ina226_reg_to_interval() local
163 return DIV_ROUND_CLOSEST(avg * INA226_TOTAL_CONV_TIME_DEFAULT, 1000); in ina226_reg_to_interval()
172 int avg, avg_bits; in ina226_interval_to_reg() local
174 avg = DIV_ROUND_CLOSEST(interval * 1000, in ina226_interval_to_reg()
176 avg_bits = find_closest(avg, ina226_avg_tab, in ina226_interval_to_reg()
/drivers/media/platform/qcom/venus/
Dpm_helpers.c176 static void mbs_to_bw(struct venus_inst *inst, u32 mbs, u32 *avg, u32 *peak) in mbs_to_bw() argument
182 *avg = 0; in mbs_to_bw()
206 *avg = bw_tbl[i].avg_10bit; in mbs_to_bw()
209 *avg = bw_tbl[i].avg; in mbs_to_bw()
218 u32 mbs_per_sec, avg, peak, total_avg = 0, total_peak = 0; in load_scale_bw() local
222 mbs_to_bw(inst, mbs_per_sec, &avg, &peak); in load_scale_bw()
223 total_avg += avg; in load_scale_bw()
/drivers/devfreq/
Dtegra30-devfreq.c257 u32 avg; in tegra_devfreq_update_avg_wmark() local
259 avg = min(dev->avg_count, U32_MAX - band); in tegra_devfreq_update_avg_wmark()
260 device_writel(dev, avg + band, ACTMON_DEV_AVG_UPPER_WMARK); in tegra_devfreq_update_avg_wmark()
262 avg = max(dev->avg_count, band); in tegra_devfreq_update_avg_wmark()
263 device_writel(dev, avg - band, ACTMON_DEV_AVG_LOWER_WMARK); in tegra_devfreq_update_avg_wmark()
/drivers/usb/cdns3/
Dcdnsp-debug.h547 u16 maxp, avg; in cdnsp_decode_ep_context() local
566 avg = EP_AVG_TRB_LENGTH(tx_info); in cdnsp_decode_ep_context()
581 ret += snprintf(str + ret, size - ret, "avg trb len %d", avg); in cdnsp_decode_ep_context()
/drivers/gpu/drm/i915/gem/
Di915_gem_shrinker.c306 unsigned long avg = 2 * count / num_objects; in i915_gem_shrinker_count() local
309 max((i915->mm.shrinker.batch + avg) >> 1, in i915_gem_shrinker_count()
/drivers/gpu/drm/i915/gt/
Dintel_context_types.h132 struct ewma_runtime avg; member
Dintel_context.h310 return mul_u32_u32(ewma_runtime_read(&ce->runtime.avg), period); in intel_context_get_avg_runtime_ns()
/drivers/parisc/
Dccio-dma.c1041 unsigned long avg = 0, min, max; in ccio_proc_info() local
1065 avg += ioc->avg_search[j]; in ccio_proc_info()
1071 avg /= CCIO_SEARCH_SAMPLE; in ccio_proc_info()
1073 min, avg, max); in ccio_proc_info()
Dsba_iommu.c1783 unsigned long avg = 0, min, max; in sba_proc_info() local
1817 avg += ioc->avg_search[i]; in sba_proc_info()
1821 avg /= SBA_SEARCH_SAMPLE; in sba_proc_info()
1823 min, avg, max); in sba_proc_info()
/drivers/staging/greybus/
Dloopback.c152 u64 avg, rem; \
157 avg = stats->sum + count / 2000000; /* round closest */ \
158 rem = do_div(avg, count); \
161 return sprintf(buf, "%llu.%06u\n", avg, (u32)rem); \
/drivers/opp/
Ddebugfs.c73 &opp->bandwidth[i].avg); in opp_debug_create_bw()
Dcore.c811 u32 avg, peak; in _set_opp_bw() local
819 avg = 0; in _set_opp_bw()
822 avg = opp->bandwidth[i].avg; in _set_opp_bw()
825 ret = icc_set_bw(opp_table->paths[i], avg, peak); in _set_opp_bw()

12