Skip to content

Commit

Permalink
soc: arm: atmel_sam: samv71: Fix SPI build dependency
Browse files Browse the repository at this point in the history
The SAM spi driver depends on GPIO driver to work. It seems that this
dependency chain it is not handled. This select GPIO driver when SPI
driver is enabled. It rework GPIO and SPI Kconfig to select driver by
devicetree and drop entries at Kconfig.defconfig.series file.

Fixes zephyrproject-rtos#41525

Signed-off-by: Gerson Fernando Budke <[email protected]>
  • Loading branch information
nandojve authored and nashif committed Jan 18, 2022
1 parent 35c4e94 commit 58936e7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
9 changes: 7 additions & 2 deletions drivers/gpio/Kconfig.sam
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
# Copyright (c) 2020 Gerson Fernando Budke <[email protected]>
# SPDX-License-Identifier: Apache-2.0

# Workaround for not being able to have commas in macro arguments
DT_COMPAT_ATMEL_SAM_GPIO := atmel,sam-gpio

config GPIO_SAM
bool "Atmel SAM GPIO (PORT) driver"
default y
default y if $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_GPIO))
depends on SOC_FAMILY_SAM && !SOC_SERIES_SAM4L
depends on GPIO
help
Enable support for the Atmel SAM 'PORT' GPIO controllers.

config GPIO_SAM4L
bool "Atmel SAM4L GPIO (PORT) driver"
default y
default y if $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_GPIO))
depends on SOC_SERIES_SAM4L
depends on GPIO
help
Enable support for the Atmel SAM4L 'PORT' GPIO controllers.
7 changes: 6 additions & 1 deletion drivers/spi/Kconfig.sam
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
# Copyright (c) 2018 qianfan Zhao
# SPDX-License-Identifier: Apache-2.0

# Workaround for not being able to have commas in macro arguments
DT_COMPAT_ATMEL_SAM_SPI := atmel,sam-spi

config SPI_SAM
bool "Atmel SAM series SPI driver"
default y
default $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_SPI))
depends on SOC_FAMILY_SAM
depends on SPI
select GPIO
help
Enable support for the SAM SPI driver.
8 changes: 0 additions & 8 deletions soc/arm/atmel_sam/samv71/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ config DMA_SAM_XDMAC
default y
depends on DMA

config GPIO_SAM
default y
depends on GPIO

config ADC_SAM_AFEC
default y
depends on ADC
Expand All @@ -62,10 +58,6 @@ config I2S_SAM_SSC
default y
depends on I2S

config SPI_SAM
default y
depends on SPI

config USB_DC_SAM_USBHS
default y
depends on USB_DEVICE_DRIVER
Expand Down
1 change: 0 additions & 1 deletion tests/drivers/spi/spi_loopback/boards/sam_v71_xult.conf

This file was deleted.

1 change: 0 additions & 1 deletion tests/drivers/spi/spi_loopback/boards/sam_v71b_xult.conf

This file was deleted.

0 comments on commit 58936e7

Please sign in to comment.