summaryrefslogtreecommitdiff
authorTellen Yu <tellen.yu@amlogic.com>2017-07-25 10:51:37 (GMT)
committer Tellen Yu <tellen.yu@amlogic.com>2017-07-25 10:53:33 (GMT)
commit64063c936dbb3c521222babed7ccaf86064acc1c (patch)
treefafb72864d73e6d2fb5d4822f73c9430ecd772fe
parent02f31d9bdd32d45a65475988836918120fb2ebce (diff)
downloadpower-64063c936dbb3c521222babed7ccaf86064acc1c.zip
power-64063c936dbb3c521222babed7ccaf86064acc1c.tar.gz
power-64063c936dbb3c521222babed7ccaf86064acc1c.tar.bz2
HIDL: add power hal [1/2]
PD# NONE add power hal for vts Change-Id: Ic34b08e4f5ecbd1747f08e8f078af5f22b229d97
Diffstat
-rw-r--r--Android.mk7
-rw-r--r--[-rwxr-xr-x]power.cpp (renamed from power.c)53
2 files changed, 48 insertions, 12 deletions
diff --git a/Android.mk b/Android.mk
index ff3b454..d78f8b0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,10 +16,15 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo OK),OK)
+LOCAL_PROPRIETARY_MODULE := true
+endif
+
LOCAL_MODULE := power.amlogic
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := power.c
+LOCAL_SRC_FILES := power.cpp
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_SHARED_LIBRARY)
diff --git a/power.c b/power.cpp
index d224a83..5df3f9b 100755..100644
--- a/power.c
+++ b/power.cpp
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include <errno.h>
#include <string.h>
#include <sys/types.h>
@@ -31,16 +32,17 @@ struct private_power_module {
int fp;
};
-static void power_init(struct power_module *module)
-{
+namespace android {
+namespace amlogic {
+
+static void init (struct power_module *module) {
}
-static void power_set_interactive(struct power_module *module, int on)
-{
+static void setInteractive (struct power_module *module, int on) {
+ ALOGI("setInteractive");
}
-static void power_hint(struct power_module *module, power_hint_t hint,
- void *data) {
+static void powerHint(struct power_module *module, power_hint_t hint, void *data) {
struct private_power_module *pm = (struct private_power_module *) module;
@@ -72,6 +74,31 @@ static void power_hint(struct power_module *module, power_hint_t hint,
}
}
+/*
+static void setFeature (struct power_module *module, feature_t feature, int state) {
+
+}
+
+static int getPlatformLowPowerStats (struct power_module *module,
+ power_state_platform_sleep_state_t *list) {
+
+ ALOGI("getPlatformLowPowerStats");
+ return 0;
+}
+
+static ssize_t geNumberOfPlatformModes (struct power_module *module) {
+ return 0;
+}
+
+static int getVoterList (struct power_module *module, size_t *voter) {
+ return 0;
+}
+*/
+
+} // namespace amlogic
+} // namespace android
+
+
static struct hw_module_methods_t power_module_methods = {
.open = NULL,
};
@@ -83,13 +110,17 @@ struct private_power_module HAL_MODULE_INFO_SYM = {
.module_api_version = POWER_MODULE_API_VERSION_0_2,
.hal_api_version = HARDWARE_HAL_API_VERSION,
.id = POWER_HARDWARE_MODULE_ID,
- .name = "Default Power HAL",
- .author = "The Android Open Source Project",
+ .name = "AML Power HAL",
+ .author = "aml",
.methods = &power_module_methods,
},
- .init = power_init,
- .setInteractive = power_set_interactive,
- .powerHint = power_hint,
+ .init = android::amlogic::init,
+ .setInteractive = android::amlogic::setInteractive,
+ .powerHint = android::amlogic::powerHint,
+ //.setFeature = android::amlogic::setFeature,
+ //.get_platform_low_power_stats = android::amlogic::getPlatformLowPowerStats,
+ //.get_number_of_platform_modes = android::amlogic::geNumberOfPlatformModes,
+ //.get_voter_list = android::amlogic::getVoterList,
},
.fp = -1,
};