hafm: deliver zero pb when frequency is equal to or above threshold
authorChoonghoon Park <choong.park@samsung.com>
Fri, 15 Jun 2018 09:24:16 +0000 (18:24 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:40 +0000 (14:59 +0900)
This zero value notifies hwboost plugin that
the plugin have to use the power budget it stored recently.

Change-Id: I8157aa07de4ed6306c68fb7daecd8b9608c31f74

drivers/soc/samsung/exynos-hafm.c
drivers/soc/samsung/exynos-hiu.h

index 02401b22f3a2b3692fd0cb14f3a77ead980f2b83..88d9f0f83bcd32e73f6b53325d1b5419696e309f 100644 (file)
@@ -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) {
index 89dfab10c8fede3862b694cf122b1c9639a1dd06..04304b306c7d37bc7366093154eda0fca69486f5 100644 (file)
@@ -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;