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