[COMMON] exynos: DVFS Manager: Parse policy use data from DT.
authorJaejoon Yoo <joonyj7.yoo@samsung.com>
Thu, 11 Aug 2016 07:16:37 +0000 (16:16 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:22:36 +0000 (17:22 +0900)
Change-Id: Ibd874c4582b2f6b80adcafd3dae176623db64b0f
Signed-off-by: Jaejoon Yoo <joonyj7.yoo@samsung.com>
drivers/soc/samsung/exynos-dm.c
include/soc/samsung/exynos-dm.h

index 654a7da3ed456f953f280bccbb7fb00576cbd1b6..9dd149911b79142397238a2bbb20b0fae289ff01 100644 (file)
@@ -304,6 +304,7 @@ static int exynos_dm_parse_dt(struct device_node *np, struct exynos_dm_device *d
        for_each_child_of_node(np, child_np) {
                int index;
                const char *available;
+               const char *policy_use;
 
                if (of_property_read_u32(child_np, "dm-index", &index))
                        return -ENODEV;
@@ -326,6 +327,13 @@ static int exynos_dm_parse_dt(struct device_node *np, struct exynos_dm_device *d
                } else {
                        dm->dm_data[index].available = false;
                }
+
+               if (of_property_read_string(child_np, "policy_use", &policy_use)) {
+                       dev_info(dm->dev, "This doesn't need to send policy to ACPM\n");
+               } else {
+                       if (!strcmp(policy_use, "true"))
+                               dm->dm_data[index].policy_use = true;
+               }
        }
 
        return ret;
@@ -626,7 +634,7 @@ int policy_update_call_to_DM(enum exynos_dm_type dm_type, u32 min_freq, u32 max_
        constraint_checker_max(get_max_constraint_list(dm), max_freq);
 
        /*Send policy to FVP*/
-       if (dm_type == DM_MIF || dm_type == DM_INT) {
+       if (dm->policy_use) {
                ret = acpm_ipc_request_channel(exynos_dm->dev->of_node, NULL, &ch_num, &size);
                if (ret) {
                        dev_err(exynos_dm->dev,
@@ -636,10 +644,9 @@ int policy_update_call_to_DM(enum exynos_dm_type dm_type, u32 min_freq, u32 max_
                config.cmd = cmd;
                config.response = true;
                config.indirection = false;
-               config.cmd[0] = 0x0B040000;
+               config.cmd[0] = dm_type;
                config.cmd[1] = max_freq;
                config.cmd[2] = POLICY_REQ;
-               config.cmd[3] = dm_type;
 
                ret = acpm_ipc_send_data(ch_num, &config);
                if (ret) {
index 70f6c33659a59c1c9aeebd6d1df9a37afca0249f..170e4a54489b2a909719c7aaf26ef02416e916ab 100644 (file)
@@ -84,6 +84,7 @@ struct exynos_dm_constraint {
 
 struct exynos_dm_data {
        bool                            available;              /* use for DVFS domain available */
+       bool                            policy_use;
 
        enum exynos_dm_type             dm_type;
        enum exynos_dvfs_type           dvfs_type;