From: Choonghoon Park Date: Fri, 15 Jun 2018 09:24:16 +0000 (+0900) Subject: hafm: deliver zero pb when frequency is equal to or above threshold X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a1ff3bf0ac7f4a87c5ccb837a43d16cdb030369b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git hafm: deliver zero pb when frequency is equal to or above threshold This zero value notifies hwboost plugin that the plugin have to use the power budget it stored recently. Change-Id: I8157aa07de4ed6306c68fb7daecd8b9608c31f74 --- diff --git a/drivers/soc/samsung/exynos-hafm.c b/drivers/soc/samsung/exynos-hafm.c index 02401b22f3a2..88d9f0f83bcd 100644 --- a/drivers/soc/samsung/exynos-hafm.c +++ b/drivers/soc/samsung/exynos-hafm.c @@ -49,7 +49,15 @@ static unsigned int hiu_get_freq_level(unsigned int freq) static unsigned int hiu_get_power_budget(unsigned int freq) { - return data->sw_pbl; + if (unlikely(!data->pb_delivered)) { + data->pb_delivered = true; + return data->sw_pbl; + } + + if (freq >= data->boost_threshold) + return 0; + else + return data->sw_pbl; } static void hiu_update_reg(int offset, int mask, int shift, unsigned int val) @@ -558,6 +566,7 @@ static int exynos_hiu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data); data->base = ioremap(GCU_BASE, SZ_4K); + data->pb_delivered = false; ret = hiu_dt_parsing(dn); if (ret) { diff --git a/drivers/soc/samsung/exynos-hiu.h b/drivers/soc/samsung/exynos-hiu.h index 89dfab10c8fe..04304b306c7d 100644 --- a/drivers/soc/samsung/exynos-hiu.h +++ b/drivers/soc/samsung/exynos-hiu.h @@ -127,7 +127,7 @@ struct exynos_hiu_data { bool pc_enabled; bool tb_enabled; bool hwidvfs_done; - bool boosting_activated; + bool pb_delivered; int operation_mode;