blob: 15d7ba2f17ccec6b998294bc2b683d8d9dd9c160 [file] [log] [blame]
Todd Poynorc82792c2012-01-10 00:32:42 -08001/*
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
Greg Kaiser854bf682016-08-08 09:57:07 -070028// We only support clang and g++.
29#define UNUSED_ARGUMENT __attribute((unused))
30
31static void power_init(struct power_module *module UNUSED_ARGUMENT)
Todd Poynorc82792c2012-01-10 00:32:42 -080032{
Todd Poynorc82792c2012-01-10 00:32:42 -080033}
34
Greg Kaiser854bf682016-08-08 09:57:07 -070035static void power_set_interactive(struct power_module *module UNUSED_ARGUMENT,
36 int on UNUSED_ARGUMENT)
Todd Poynorc82792c2012-01-10 00:32:42 -080037{
Todd Poynorc82792c2012-01-10 00:32:42 -080038}
39
Greg Kaiser854bf682016-08-08 09:57:07 -070040static void power_hint(struct power_module *module UNUSED_ARGUMENT,
41 power_hint_t hint,
42 void *data UNUSED_ARGUMENT) {
Todd Poynor2f143fb2012-04-24 13:39:15 -070043 switch (hint) {
44 default:
45 break;
46 }
47}
Todd Poynorc82792c2012-01-10 00:32:42 -080048
49static struct hw_module_methods_t power_module_methods = {
50 .open = NULL,
51};
52
53struct power_module HAL_MODULE_INFO_SYM = {
54 .common = {
55 .tag = HARDWARE_MODULE_TAG,
Mathias Agopian5cb1de82012-04-26 19:49:40 -070056 .module_api_version = POWER_MODULE_API_VERSION_0_2,
57 .hal_api_version = HARDWARE_HAL_API_VERSION,
Todd Poynorc82792c2012-01-10 00:32:42 -080058 .id = POWER_HARDWARE_MODULE_ID,
59 .name = "Default Power HAL",
60 .author = "The Android Open Source Project",
61 .methods = &power_module_methods,
62 },
63
64 .init = power_init,
65 .setInteractive = power_set_interactive,
Todd Poynor2f143fb2012-04-24 13:39:15 -070066 .powerHint = power_hint,
Todd Poynorc82792c2012-01-10 00:32:42 -080067};