Skip to content

Commit a3182ce

Browse files
danieldegrassedleach02
authored andcommitted
drivers: sdhc: add SD SPI mode host controller driver
Add SDHC driver implementing spi mode support for SD cards. This driver implements the standard SD host controller APIs, and sets the host property "is_spi" to indicate to the SD subsystem the card will be running in SPI mode. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent a18338b commit a3182ce

File tree

5 files changed

+791
-1
lines changed

5 files changed

+791
-1
lines changed

drivers/sdhc/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Copyright (c) 2022 NXP
1+
# Copyright 2022 NXP
22
# SPDX-License-Identifier: Apache-2.0
33
if (CONFIG_SDHC)
44

55
zephyr_library()
66
zephyr_library_sources_ifdef(CONFIG_IMX_USDHC imx_usdhc.c)
7+
zephyr_library_sources_ifdef(CONFIG_SPI_SDHC sdhc_spi.c)
78
endif()

drivers/sdhc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ menuconfig SDHC
99
if SDHC
1010

1111
source "drivers/sdhc/Kconfig.imx"
12+
source "drivers/sdhc/Kconfig.spi"
1213

1314
config SDHC_INIT_PRIORITY
1415
int "SDHC driver init priority"

drivers/sdhc/Kconfig.spi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2022, NXP
2+
# SPDX -License-Identifier: Apache-2.0
3+
4+
DT_COMPAT_ZEPHYR_MMC_SPI_SLOT := zephyr,sdhc-spi-slot
5+
6+
config SPI_SDHC
7+
bool "SD protocol over SPI bus"
8+
select SPI
9+
select SDHC_SUPPORTS_SPI_MODE
10+
default $(dt_compat_enabled,$(DT_COMPAT_ZEPHYR_MMC_SPI_SLOT))
11+
help
12+
Enable the SPI SD host controller driver

0 commit comments

Comments
 (0)