blob: 226dd9cbeaf752b344dd2e540804b2dbd603d04c [file] [log] [blame]
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -07001# Copyright (C) 2017 The Android Open Source Project
dianlujitao5ec37732018-01-18 21:24:30 +08002# Copyright (C) 2017-2018 The LineageOS Project
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -07003#
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
Rashed Abdel-Tawab0705be02017-11-03 12:15:23 -070016ifeq ($(call my-dir),$(call project-path-for,qcom-power))
17
Anurag Singh9cec85b2012-09-04 21:46:24 -070018LOCAL_PATH := $(call my-dir)
19
Anurag Singh51c43542012-12-11 12:09:28 -080020ifeq ($(call is-vendor-board-platform,QCOM),true)
Anh Nguyen9501d922012-11-14 04:20:15 -080021
Anurag Singh9cec85b2012-09-04 21:46:24 -070022include $(CLEAR_VARS)
23
Shashank Mittal7c7b0472014-05-19 18:03:21 -070024LOCAL_MODULE_RELATIVE_PATH := hw
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -070025LOCAL_SHARED_LIBRARIES := \
26 liblog \
27 libcutils \
28 libdl \
29 libxml2 \
30 libhidlbase \
31 libhidltransport \
32 libhardware \
Vinay Verma9e84f102018-09-14 11:25:46 +053033 libhwbinder \
Rashed Abdel-Tawab067a9072017-12-30 00:41:49 +020034 libutils
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -070035
36LOCAL_SRC_FILES := \
37 service.cpp \
38 Power.cpp \
39 power-helper.c \
40 metadata-parser.c \
41 utils.c \
42 list.c \
Michael Bestasa966c4c2018-06-09 16:02:34 +030043 hint-data.c
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -070044
Ananth Raghavan Subramaniane432dbf2017-03-24 16:30:12 -070045LOCAL_C_INCLUDES := external/libxml2/include \
46 external/icu/icu4c/source/common
Anurag Singh057806b2013-04-16 16:53:45 -070047
Michael Bestas593b9d02018-03-26 01:00:20 +030048LOCAL_CFLAGS += -Wall -Wextra -Werror
49
Christopher R. Palmer047cb662016-04-07 06:13:45 -040050ifneq ($(BOARD_POWER_CUSTOM_BOARD_LIB),)
51 LOCAL_WHOLE_STATIC_LIBRARIES += $(BOARD_POWER_CUSTOM_BOARD_LIB)
52else
53
Anurag Singh057806b2013-04-16 16:53:45 -070054# Include target-specific files.
Zhao Wei Liewfbb85212015-11-17 17:45:03 +080055ifeq ($(call is-board-platform-in-list, msm8960), true)
56LOCAL_SRC_FILES += power-8960.c
57endif
58
Anurag Singh057806b2013-04-16 16:53:45 -070059ifeq ($(call is-board-platform-in-list, msm8974), true)
60LOCAL_SRC_FILES += power-8974.c
61endif
62
Vince Leung699c1bc2013-08-14 17:40:36 -070063ifeq ($(call is-board-platform-in-list, msm8226), true)
64LOCAL_SRC_FILES += power-8226.c
65endif
66
67ifeq ($(call is-board-platform-in-list, msm8610), true)
68LOCAL_SRC_FILES += power-8610.c
69endif
70
Dilip Gudlurf18fc4c2014-01-15 14:24:45 -080071ifeq ($(call is-board-platform-in-list, apq8084), true)
72LOCAL_SRC_FILES += power-8084.c
73endif
74
Dilip Gudlurcf3644b2014-11-02 17:25:52 -080075ifeq ($(call is-board-platform-in-list, msm8994), true)
76LOCAL_SRC_FILES += power-8994.c
77endif
78
Dilip Gudlure9f9c982015-01-28 15:17:45 -080079ifeq ($(call is-board-platform-in-list, msm8992), true)
80LOCAL_SRC_FILES += power-8992.c
81endif
82
Dilip Gudlur4edd2c32015-07-01 14:13:43 -070083ifeq ($(call is-board-platform-in-list, msm8996), true)
84LOCAL_SRC_FILES += power-8996.c
85endif
86
Sravan Kumar Ambapuram58be2332016-01-07 14:47:37 +053087ifeq ($(call is-board-platform-in-list,msm8937), true)
BeYkeRYkt535cc212018-12-23 22:55:35 +090088LOCAL_SRC_FILES += power-8937.c
Sravan Kumar Ambapuram58be2332016-01-07 14:47:37 +053089endif
90
Nikhil Kumar Kansalb40c1362015-05-05 16:10:43 +053091ifeq ($(call is-board-platform-in-list,msm8952), true)
92LOCAL_SRC_FILES += power-8952.c
93endif
94
Manish Kumar43c1ca62016-03-11 01:26:25 +053095ifeq ($(call is-board-platform-in-list,msm8953), true)
96LOCAL_SRC_FILES += power-8953.c
Sravan Kumar Ambapurameea8e562016-02-28 15:09:37 +053097endif
98
Venkataraman Nerellapalli808f1e62017-05-04 11:02:14 +053099ifeq ($(call is-board-platform-in-list,msm8998 apq8098_latv), true)
Ananth Raghavan Subramaniane432dbf2017-03-24 16:30:12 -0700100LOCAL_SRC_FILES += power-8998.c
101endif
102
Vara Prasad A V S G9b7a7582017-04-07 17:32:37 +0530103ifeq ($(call is-board-platform-in-list,sdm660), true)
104LOCAL_SRC_FILES += power-660.c
105endif
106
Ananth Raghavan Subramanianf976fa02017-05-18 20:46:03 -0700107ifeq ($(call is-board-platform-in-list,sdm845), true)
108LOCAL_SRC_FILES += power-845.c
109endif
110
vaibhav bhallaacdf9322015-02-23 11:57:38 +0530111ifeq ($(call is-board-platform-in-list, msm8909), true)
112LOCAL_SRC_FILES += power-8909.c
113endif
114
vaibhav bhallaeef51ad2015-02-23 20:11:59 +0530115ifeq ($(call is-board-platform-in-list,msm8916), true)
116LOCAL_SRC_FILES += power-8916.c
117endif
118
Christopher R. Palmer047cb662016-04-07 06:13:45 -0400119endif # End of board specific list
120
Keith Mok72201a02015-11-13 09:46:14 -0800121ifneq ($(TARGET_POWER_SET_FEATURE_LIB),)
122 LOCAL_STATIC_LIBRARIES += $(TARGET_POWER_SET_FEATURE_LIB)
123endif
124
Vince Leung68574662013-07-16 16:47:00 -0700125ifeq ($(TARGET_USES_INTERACTION_BOOST),true)
126 LOCAL_CFLAGS += -DINTERACTION_BOOST
127endif
128
Steve Kondika0e04952014-03-27 22:00:00 -0700129ifneq ($(TARGET_POWERHAL_SET_INTERACTIVE_EXT),)
130LOCAL_CFLAGS += -DSET_INTERACTIVE_EXT
131LOCAL_SRC_FILES += ../../../$(TARGET_POWERHAL_SET_INTERACTIVE_EXT)
132endif
133
Steve Kondikcd8bfdc2015-10-19 14:43:39 -0700134ifneq ($(TARGET_TAP_TO_WAKE_NODE),)
135 LOCAL_CFLAGS += -DTAP_TO_WAKE_NODE=\"$(TARGET_TAP_TO_WAKE_NODE)\"
136endif
137
Rashed Abdel-Tawab067a9072017-12-30 00:41:49 +0200138ifeq ($(TARGET_HAS_LEGACY_POWER_STATS),true)
139 LOCAL_CFLAGS += -DLEGACY_STATS
140endif
141
Michael Bestas64de35f2018-07-03 21:29:54 +0300142ifeq ($(TARGET_HAS_NO_POWER_STATS),true)
143 LOCAL_CFLAGS += -DNO_STATS
144endif
145
Ethan Chen1db0a652018-03-01 00:59:30 -0800146ifneq ($(TARGET_RPM_STAT),)
147 LOCAL_CFLAGS += -DRPM_STAT=\"$(TARGET_RPM_STAT)\"
148endif
149
150ifneq ($(TARGET_RPM_MASTER_STAT),)
151 LOCAL_CFLAGS += -DRPM_MASTER_STAT=\"$(TARGET_RPM_MASTER_STAT)\"
152endif
153
154ifneq ($(TARGET_RPM_SYSTEM_STAT),)
155 LOCAL_CFLAGS += -DRPM_SYSTEM_STAT=\"$(TARGET_RPM_SYSTEM_STAT)\"
156endif
157
Rashed Abdel-Tawab067a9072017-12-30 00:41:49 +0200158ifneq ($(TARGET_WLAN_POWER_STAT),)
159 LOCAL_CFLAGS += -DWLAN_POWER_STAT=\"$(TARGET_WLAN_POWER_STAT)\"
160endif
161
Rashed Abdel-Tawabbd767ce2018-09-17 12:14:16 -0700162ifeq ($(TARGET_HAS_NO_WLAN_STATS),true)
163LOCAL_CFLAGS += -DNO_WLAN_STATS
164endif
Vinay Verma9e84f102018-09-14 11:25:46 +0530165
166ifeq ($(TARGET_ARCH),arm)
167LOCAL_CFLAGS += -DARCH_ARM_32
168endif
169
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -0700170LOCAL_MODULE := android.hardware.power@1.1-service-qti
171LOCAL_INIT_RC := android.hardware.power@1.1-service-qti.rc
Rashed Abdel-Tawabbd767ce2018-09-17 12:14:16 -0700172LOCAL_SHARED_LIBRARIES += android.hardware.power@1.1 vendor.lineage.power@1.0
Anurag Singh9cec85b2012-09-04 21:46:24 -0700173LOCAL_MODULE_TAGS := optional
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -0700174LOCAL_MODULE_OWNER := qcom
Vara Prasad A V S G52f71332017-06-11 06:13:17 +0530175LOCAL_VENDOR_MODULE := true
Rashed Abdel-Tawab9c14c9f2017-12-26 23:11:03 +0200176LOCAL_HEADER_LIBRARIES := libhardware_headers
Rashed Abdel-Tawab00b21852017-11-03 12:44:16 -0700177include $(BUILD_EXECUTABLE)
Anurag Singh51c43542012-12-11 12:09:28 -0800178
Anh Nguyen9501d922012-11-14 04:20:15 -0800179endif
Rashed Abdel-Tawab0705be02017-11-03 12:15:23 -0700180
181endif