1*e01b6f76SAndroid Build Coastguard Worker /*
2*e01b6f76SAndroid Build Coastguard Worker * Copyright (C) 2012 The Android Open Source Project
3*e01b6f76SAndroid Build Coastguard Worker *
4*e01b6f76SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*e01b6f76SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*e01b6f76SAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*e01b6f76SAndroid Build Coastguard Worker *
8*e01b6f76SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
9*e01b6f76SAndroid Build Coastguard Worker *
10*e01b6f76SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*e01b6f76SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*e01b6f76SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*e01b6f76SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*e01b6f76SAndroid Build Coastguard Worker * limitations under the License.
15*e01b6f76SAndroid Build Coastguard Worker */
16*e01b6f76SAndroid Build Coastguard Worker #include <errno.h>
17*e01b6f76SAndroid Build Coastguard Worker #include <string.h>
18*e01b6f76SAndroid Build Coastguard Worker #include <sys/types.h>
19*e01b6f76SAndroid Build Coastguard Worker #include <sys/stat.h>
20*e01b6f76SAndroid Build Coastguard Worker #include <fcntl.h>
21*e01b6f76SAndroid Build Coastguard Worker
22*e01b6f76SAndroid Build Coastguard Worker #define LOG_TAG "Legacy PowerHAL"
23*e01b6f76SAndroid Build Coastguard Worker #include <utils/Log.h>
24*e01b6f76SAndroid Build Coastguard Worker
25*e01b6f76SAndroid Build Coastguard Worker #include <hardware/hardware.h>
26*e01b6f76SAndroid Build Coastguard Worker #include <hardware/power.h>
27*e01b6f76SAndroid Build Coastguard Worker
28*e01b6f76SAndroid Build Coastguard Worker // We only support clang and g++.
29*e01b6f76SAndroid Build Coastguard Worker #define UNUSED_ARGUMENT __attribute((unused))
30*e01b6f76SAndroid Build Coastguard Worker
power_init(struct power_module * module UNUSED_ARGUMENT)31*e01b6f76SAndroid Build Coastguard Worker static void power_init(struct power_module *module UNUSED_ARGUMENT)
32*e01b6f76SAndroid Build Coastguard Worker {
33*e01b6f76SAndroid Build Coastguard Worker }
34*e01b6f76SAndroid Build Coastguard Worker
power_set_interactive(struct power_module * module UNUSED_ARGUMENT,int on UNUSED_ARGUMENT)35*e01b6f76SAndroid Build Coastguard Worker static void power_set_interactive(struct power_module *module UNUSED_ARGUMENT,
36*e01b6f76SAndroid Build Coastguard Worker int on UNUSED_ARGUMENT)
37*e01b6f76SAndroid Build Coastguard Worker {
38*e01b6f76SAndroid Build Coastguard Worker }
39*e01b6f76SAndroid Build Coastguard Worker
power_hint(struct power_module * module UNUSED_ARGUMENT,power_hint_t hint,void * data UNUSED_ARGUMENT)40*e01b6f76SAndroid Build Coastguard Worker static void power_hint(struct power_module *module UNUSED_ARGUMENT,
41*e01b6f76SAndroid Build Coastguard Worker power_hint_t hint,
42*e01b6f76SAndroid Build Coastguard Worker void *data UNUSED_ARGUMENT) {
43*e01b6f76SAndroid Build Coastguard Worker switch (hint) {
44*e01b6f76SAndroid Build Coastguard Worker default:
45*e01b6f76SAndroid Build Coastguard Worker break;
46*e01b6f76SAndroid Build Coastguard Worker }
47*e01b6f76SAndroid Build Coastguard Worker }
48*e01b6f76SAndroid Build Coastguard Worker
49*e01b6f76SAndroid Build Coastguard Worker static struct hw_module_methods_t power_module_methods = {
50*e01b6f76SAndroid Build Coastguard Worker .open = NULL,
51*e01b6f76SAndroid Build Coastguard Worker };
52*e01b6f76SAndroid Build Coastguard Worker
53*e01b6f76SAndroid Build Coastguard Worker struct power_module HAL_MODULE_INFO_SYM = {
54*e01b6f76SAndroid Build Coastguard Worker .common = {
55*e01b6f76SAndroid Build Coastguard Worker .tag = HARDWARE_MODULE_TAG,
56*e01b6f76SAndroid Build Coastguard Worker .module_api_version = POWER_MODULE_API_VERSION_0_2,
57*e01b6f76SAndroid Build Coastguard Worker .hal_api_version = HARDWARE_HAL_API_VERSION,
58*e01b6f76SAndroid Build Coastguard Worker .id = POWER_HARDWARE_MODULE_ID,
59*e01b6f76SAndroid Build Coastguard Worker .name = "Default Power HAL",
60*e01b6f76SAndroid Build Coastguard Worker .author = "The Android Open Source Project",
61*e01b6f76SAndroid Build Coastguard Worker .methods = &power_module_methods,
62*e01b6f76SAndroid Build Coastguard Worker },
63*e01b6f76SAndroid Build Coastguard Worker
64*e01b6f76SAndroid Build Coastguard Worker .init = power_init,
65*e01b6f76SAndroid Build Coastguard Worker .setInteractive = power_set_interactive,
66*e01b6f76SAndroid Build Coastguard Worker .powerHint = power_hint,
67*e01b6f76SAndroid Build Coastguard Worker };
68