diff options
author | lokilee73 <changjoo.lee@samsung.com> | 2018-12-11 15:21:34 +0900 |
---|---|---|
committer | lokilee73 <changjoo.lee@samsung.com> | 2018-12-11 15:25:41 +0900 |
commit | abb7714c765b4b7684d1242c9dab0963cdf3f92f (patch) | |
tree | 976203c3151b4aac0b49a39c1dbe45a02f89570f | |
parent | 53f2c8a6bfa77a2bb17181c76873427a98891617 (diff) | |
download | libdevice-node-abb7714c765b4b7684d1242c9dab0963cdf3f92f.tar.gz libdevice-node-abb7714c765b4b7684d1242c9dab0963cdf3f92f.tar.bz2 libdevice-node-abb7714c765b4b7684d1242c9dab0963cdf3f92f.zip |
Change thermal information structure to get temp and adc
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>
-rwxr-xr-x[-rw-r--r--] | hw/thermal.h | 19 | ||||
-rwxr-xr-x | unittest/device_haltests.cpp | 8 |
2 files changed, 7 insertions, 20 deletions
diff --git a/hw/thermal.h b/hw/thermal.h index 8262a38..08dd056 100644..100755 --- a/hw/thermal.h +++ b/hw/thermal.h @@ -32,22 +32,9 @@ */ #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); diff --git a/unittest/device_haltests.cpp b/unittest/device_haltests.cpp index 71d189f..9a7dea1 100755 --- a/unittest/device_haltests.cpp +++ b/unittest/device_haltests.cpp @@ -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) |