Files
android_kernel_samsung_sm86…/bt_modules.bzl
Franklin Abreu Bueno 176b51aefa bt-kernel: Additional bazel configuration
- add support to copy *.ko to out dir
- enable conditional compilation with config flags
- enable CONFIG_BT_HW_SECURE_DISABLE with dependency on securemsm-kernel
- re-enable compilation of bt_fm_slim with new headers
- add fallthrough attribute btfm_slim_hw_interface.c
- move BTFMSLIM_DEV_NAME to btfm_slim.h
- add target.bzl file to define specific targets

Change-Id: I7f7920870d81125f95b020ef33df77df3f937682
Signed-off-by: Franklin Abreu Bueno <quic_fabreu@quicinc.com>
2023-04-08 20:36:07 -07:00

104 řádky
2.9 KiB
Python

PWR_PATH = "pwr"
SLIMBUS_PATH = "slimbus"
FMRTC_PATH = "rtc6226"
# This dictionary holds all the BT modules included in the bt-kernel
bt_modules = {}
def register_bt_modules(name, path = None, config_opt = None, srcs = [], config_srcs = {}, deps = [], config_deps = {}):
"""
Register modules
Args:
name: Name of the module (which will be used to generate the name of the .ko file)
path: Path in which the source files can be found
config_opt: Config name used in Kconfig (not needed currently)
srcs: source files and local headers
config_srcs: source files and local headers that depend on a config define being enabled.
deps: a list of dependent targets
config_deps: a list of dependent targets that depend on a config define being enabled.
"""
processed_config_srcs = {}
processed_config_deps = {}
for config_src_name in config_srcs:
config_src = config_srcs[config_src_name]
if type(config_src) == "list":
processed_config_srcs[config_src_name] = {True: config_src}
else:
processed_config_srcs[config_src_name] = config_src
for config_deps_name in config_deps:
config_dep = config_deps[config_deps_name]
if type(config_dep) == "list":
processed_config_deps[config_deps_name] = {True: config_dep}
else:
processed_config_deps[config_deps_name] = config_dep
module = struct(
name = name,
path = path,
srcs = srcs,
config_srcs = processed_config_srcs,
config_opt = config_opt,
deps = deps,
config_deps = processed_config_deps,
)
bt_modules[name] = module
# --- BT Modules ---
register_bt_modules(
name = "btpower",
path = PWR_PATH,
config_opt = "CONFIG_MSM_BT_POWER",
srcs = ["btpower.c"],
config_deps = {
"CONFIG_BT_HW_SECURE_DISABLE": [
"//vendor/qcom/opensource/securemsm-kernel:%b_smcinvoke_dlkm",
]
},
)
register_bt_modules(
name = "bt_fm_slim",
path = SLIMBUS_PATH,
# config_opt = "CONFIG_BTFM_SLIM",
srcs = [
"btfm_slim.c",
"btfm_slim.h",
"btfm_slim_slave.c",
"btfm_slim_slave.h",
"btfm_slim_codec.c",
],
deps = [":%b_btpower"],
)
# Not enabled/compiling until btfmcodec is enabled
register_bt_modules(
name = "btfm_slim_codec",
path = SLIMBUS_PATH,
# config_opt = "CONFIG_SLIM_BTFM_CODEC",
srcs = [
"btfm_slim.c",
"btfm_slim.h",
"btfm_slim_slave.c",
"btfm_slim_slave.h",
"btfm_slim_hw_interface.c",
"btfm_slim_hw_interface.h",
],
deps = [":%b_btpower", ":btfmcodec_headers"],
)
register_bt_modules(
name = "radio-i2c-rtc6226-qca",
path = FMRTC_PATH,
config_opt = "CONFIG_I2C_RTC6226_QCA",
srcs = [
"radio-rtc6226-common.c",
"radio-rtc6226-i2c.c",
"radio-rtc6226.h",
],
)