Change thermal information structure to get temp and adc 46/195146/2
authorlokilee73 <changjoo.lee@samsung.com>
Tue, 11 Dec 2018 06:21:34 +0000 (15:21 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Tue, 11 Dec 2018 06:25:41 +0000 (15:25 +0900)
Thermal state should be decided on deviced side.
So, device HAL has only to supply temp and adc.

Change-Id: I199a3a5b475cbba5eb8cfa672eba5f29f46725e3
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
hw/thermal.h [changed mode: 0644->0755]
unittest/device_haltests.cpp

old mode 100644 (file)
new mode 100755 (executable)
index 8262a38..08dd056
  */
 #define THERMAL_HARDWARE_DEVICE_VERSION        MAKE_VERSION(0,1)
 
-typedef enum _thermal_state {
-       THERMAL_STATE_LOW,
-       THERMAL_STATE_NORMAL,
-       THERMAL_STATE_HIGH,
-} thermal_state_e;
-
-typedef enum _thermal_level {
-       THERMAL_LEVEL_NORMAL = 1001,
-       THERMAL_LEVEL_WARNING,
-       THERMAL_LEVEL_CRITICAL,
-       THERMAL_LEVEL_POWEROFF,
-} thermal_level_e;
-
 struct thermal_info {
-       thermal_state_e state;
-       thermal_level_e level;
+       int temp;
+       int adc;
 };
 
 typedef void (*ThermalUpdated)(struct thermal_info *info, void *data);
@@ -56,7 +43,7 @@ struct thermal_device {
        struct hw_common common;
 
        /* Get thermal state */
-       int (*get_state)(struct thermal_info *info);
+       int (*get_info)(struct thermal_info *info);
 
        /* Register thermal event */
        int (*register_changed_event)(ThermalUpdated updated_cb, void *data);
index 71d189f..9a7dea1 100755 (executable)
@@ -763,12 +763,12 @@ TEST_F(THERMALHalTest, GetStateP)
        struct thermal_info thermal;
        int ret;
 
-       if (!thermal_dev || !thermal_dev->get_state) {
-               cout << "There is no function for get_state" << endl;
+       if (!thermal_dev || !thermal_dev->get_info) {
+               cout << "There is no function for get_info" << endl;
                return;
        }
-       ret = thermal_dev->get_state(&thermal);
-       EXPECT_EQ(ret, 0) << "Fail to get_state (" << ret << ")";
+       ret = thermal_dev->get_info(&thermal);
+       EXPECT_EQ(ret, 0) << "Fail to get_info (" << ret << ")";
 }
 
 static void thermal_updated_cb(struct thermal_info *info, void *data)