drivers: lora: Prepare Kconfig for additional radios

Add a new configuration option, LORA_SX12XX, that is shared for all of
the LoRaMAC-node-based radio drivers. By default, the appropriate
driver for the LoRa radio in the device tree is included is included
in the build.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
This commit is contained in:
Andreas Sandberg 2020-05-05 21:50:44 +01:00 committed by Anas Nashif
commit ba330ec765
5 changed files with 38 additions and 17 deletions

View file

@ -31,6 +31,6 @@ config LORA_INIT_PRIORITY
help
System initialization priority for LoRa drivers.
source "drivers/lora/Kconfig.sx1276"
source "drivers/lora/Kconfig.sx12xx"
endif # LORA

View file

@ -1,14 +0,0 @@
#
# Copyright (c) 2019 Manivannan Sadhasivam
#
# SPDX-License-Identifier: Apache-2.0
#
config LORA_SX1276
bool "Semtech SX1276 driver"
select HAS_SEMTECH_RADIO_DRIVERS
select HAS_SEMTECH_LORAMAC
select HAS_SEMTECH_SX1276
depends on SPI
help
Enable LoRa driver for Semtech SX1276.

View file

@ -0,0 +1,35 @@
#
# Copyright (c) 2019 Manivannan Sadhasivam
#
# SPDX-License-Identifier: Apache-2.0
#
DT_COMPAT_SEMTECH_SX1276 := semtech,sx1276
menuconfig LORA_SX12XX
bool "Semtech SX-series driver"
select HAS_SEMTECH_RADIO_DRIVERS
select HAS_SEMTECH_LORAMAC
depends on SPI
help
Enable LoRa driver for Semtech SX12xx.
if LORA_SX12XX
choice
prompt "LoRa Radio chipset"
default LORA_SX1276 if $(dt_compat_enabled,$(DT_COMPAT_SEMTECH_SX1276))
help
Select the LoRa modem used on your board. The default value
is discovered from the device tree and should be correct for
most users.
config LORA_SX1276
bool "Semtech SX1276 driver"
select HAS_SEMTECH_SX1276
help
Enable LoRa driver for Semtech SX1276.
endchoice
endif

View file

@ -2,5 +2,5 @@ CONFIG_LOG=y
CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_LORA=y
CONFIG_LORA_SX1276=y
CONFIG_LORA_SX12XX=y
CONFIG_PRINTK=y

View file

@ -2,5 +2,5 @@ CONFIG_LOG=y
CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_LORA=y
CONFIG_LORA_SX1276=y
CONFIG_LORA_SX12XX=y
CONFIG_PRINTK=y