Message ID | 20220531105137.110050-1-krzysztof.kozlowski@linaro.org |
---|---|
Headers | show |
Series | soc/arm64: qcom: Add initial version of bwmon | expand |
On 31/05/2022 12:51, Krzysztof Kozlowski wrote: > + window = mult_frac(bwmon->sample_ms, HW_TIMER_HZ, MSEC_PER_SEC); > + /* Maximum sampling window: 0xfffff */ > + writel_relaxed(window, bwmon->base + BWMON_SAMPLE_WINDOW); > + > + bwmon_set_threshold(bwmon, BWMON_THRESHOLD_HIGH, > + data->default_highbw_kbps); > + bwmon_set_threshold(bwmon, BWMON_THRESHOLD_MED, > + data->default_medbw_kbps); > + bwmon_set_threshold(bwmon, BWMON_THRESHOLD_LOW, > + data->default_lowbw_kbps); > + > + thres_count = data->zone3_thres_count << BWMON_THRESHOLD_COUNT_ZONE3_SHIFT | > + BWMON_THRESHOLD_COUNT_ZONE2_DEFAULT << BWMON_THRESHOLD_COUNT_ZONE2_SHIFT | > + data->zone1_thres_count << BWMON_THRESHOLD_COUNT_ZONE1_SHIFT | > + BWMON_THRESHOLD_COUNT_ZONE0_DEFAULT; > + writel_relaxed(thres_count, bwmon->base + BWMON_THRESHOLD_COUNT); > + writel_relaxed(BWMON_ZONE_ACTIONS_DEFAULT, > + bwmon->base + BWMON_ZONE_ACTIONS); > + > + /* Write barriers in bwmon_clear() */ > + irq_enable = BIT(BWMON_IRQ_ENABLE_ZONE1_SHIFT) | > + BIT(BWMON_IRQ_ENABLE_ZONE3_SHIFT); Unusued variable, I will send a v4. Best regards, Krzysztof