bt-kernel: Add support for Bazel build system

- kernel modules can now be built using Bazel/kleaf for pineapple.
- Added macro that makes it easy to register new modules

Change-Id: If19f9663135342bc36f543b1598231d133c1748f
This commit is contained in:
Franklin Abreu Bueno
2022-11-11 09:49:52 -08:00
부모 a4d571f1da
커밋 d261d4757e
3개의 변경된 파일125개의 추가작업 그리고 0개의 파일을 삭제

59
bt_modules.bzl Normal file
파일 보기

@@ -0,0 +1,59 @@
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 = {}, 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
deps: a list of dependent targets
"""
module = struct(
name = name,
path = path,
srcs = srcs,
config_opt = config_opt,
deps = deps
)
bt_modules[name] = module
# --- BT Modules ---
register_bt_modules(
name = "btpower",
path = PWR_PATH,
config_opt = "CONFIG_MSM_BT_PWR",
srcs = ["btpower.c"]
)
register_bt_modules(
name = "bt_fm_slim",
path = SLIMBUS_PATH,
config_opt = "CONFIG_BTFM_SLIM",
srcs = [
"btfm_slim.c",
"btfm_slim.h",
"btfm_slim_codec.c",
"btfm_slim_slave.c",
"btfm_slim_slave.h",
],
deps = [":%b_btpower"]
)
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",
]
)