hal: Add new struct pass_resource_nonstandard for nonstandard device 75/136375/3
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 26 Jun 2017 08:21:20 +0000 (17:21 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 4 Jul 2017 08:25:41 +0000 (17:25 +0900)
This patch adds new 'struct pass_resource_nonstandard' in order to
support the nonstandard devices except for cpu/bus/gpu.

This patch just adds the following function in order to support
the backwards compatibility. This function will be removed
after finding the proper method.
- int (*set_pmqos_data)(char *res_name, void*) : Set PMQoS's data to HAL.

Change-Id: Ia0310c43226b0ab000c9470784e9d55ec507d119
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal/hal.h

index 4d41cc6..864cedd 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
+#include <stdbool.h>
 
 #define BUFF_MAX       255
 
 #define PASS_RESOURCE_CPU_ID           1
 #define PASS_RESOURCE_BUS_ID           2
 #define PASS_RESOURCE_GPU_ID           3
+#define PASS_RESOURCE_NONSTANDARD_ID   99
 
 #define PASS_RESOURCE_CPU_NAME         "cpu"
 #define PASS_RESOURCE_BUS_NAME         "bus"
 #define PASS_RESOURCE_GPU_NAME         "gpu"
+#define PASS_RESOURCE_NONSTANDARD_NAME "nonstandard"
 
 /**
  * Define the common structure
@@ -70,10 +73,12 @@ struct pass_resource_common;
  *             - PASS_RESOURCE_CPU_ID
  *             - PASS_RESOURCE_BUS_ID
  *             - PASS_RESOURCE_GPU_ID
+ *             - PASS_RESOURCE_NONSTANDARD_ID
  * @name       : device name, can have the following value.
  *             - PASS_RESOURCE_CPU_NAME
  *             - PASS_RESOURCE_BUS_NAME
  *             - PASS_RESOURCE_GPU_NAME
+ *             - PASS_RESOURCE_NONSTANDARD_NAME
  * @author     : author name
  * @dso                : module's dso
  * @resourced[]        : reserved for future use
@@ -193,6 +198,30 @@ struct pass_resource_gpu {
        struct pass_resource_tmu_ops tmu;
 };
 
+/*
+ * Define the resource structure for nonstandard H/W.
+ *
+ * Following function is Deprecated. (Not recommended for use)
+ * @set_pmqos_data : function to bypass the scenario data to HAL.
+ *
+ * This structure indicates the nonstandard H/W which doesn't have
+ * the official supported framework (e.g., cpufreq, devfreq and so on)
+ * in Linux Kernel. But, the specific device might be controlled
+ * according to PMQoS scenario or other cases.
+ */
+struct pass_resource_nonstandard {
+       struct pass_resource_common common;
+
+       /*
+        * NOTE: It is not propper method. But PASS must need to keep
+        * the backwards compatibility, set the PMQoS's data from
+        * platform to hal. So, It is not recommended to use it.
+        *
+        * This function will be removed after finding the proper method.
+        */
+       int (*set_pmqos_data)(char *res_name, void *data);
+};
+
 int pass_get_hal_info(const char *id, const struct pass_resource_info **info);
 
 /**