configs/imxrt1050-evk/src: Previous committed implemented atypical SPI-based MMC/SD card support conditioned on CONFIG_MMCSD. This is, of course, incorrect and interferes with the implementation of correct MMC/SD card support using the correct SDIO-based peripheral. This commit renames that atypical support to *mmcsd_spi* and conditions using that atypical support on CONFIG_MMCSD_SPI with should then not interfere with the correct MMC/SD suppor that can be conditioned on CONFIG_MMCSD_SDIO.

This commit is contained in:
Gregory Nutt 2018-10-31 17:41:41 -06:00
parent f5ed6bf672
commit efbeac79e8
4 changed files with 36 additions and 30 deletions

View File

@ -66,8 +66,8 @@ ifeq ($(CONFIG_IMXRT_LPSPI),y)
CSRCS += imxrt_spi.c
endif
ifeq ($(CONFIG_MMCSD),y)
CSRCS += imxrt_mmcsd.c
ifeq ($(CONFIG_MMCSD_SPI),y)
CSRCS += imxrt_mmcsd_spi.c
endif
include $(TOPDIR)/configs/Board.mk

View File

@ -157,17 +157,6 @@
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: imxrt_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the imxrt1050-evk
* board.
*
****************************************************************************/
void weak_function imxrt_spidev_initialize(void);
/****************************************************************************
* Name: imxrt_bringup
*
@ -180,6 +169,28 @@ void weak_function imxrt_spidev_initialize(void);
int imxrt_bringup(void);
#endif
/****************************************************************************
* Name: imxrt_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the i.MXRT1050 EVK.
*
****************************************************************************/
void imxrt_spidev_initialize(void);
/*****************************************************************************
* Name: imxrt_mmcsd_spi_initialize
*
* Description:
* Initialize SPI-based SD card and card detect thread.
*
****************************************************************************/
#ifdef CONFIG_MMCSD_SPI
int imxrt_mmcsd_spi_initialize(int minor)
#endif
/****************************************************************************
* Name: imxrt_autoled_initialize
*
@ -198,17 +209,5 @@ int imxrt_bringup(void);
void imxrt_autoled_initialize(void);
#endif
/****************************************************************************
* Name: imxrt_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the i.MXRT1050 EVK.
*
****************************************************************************/
#ifdef CONFIG_IMXRT_HAVE_SPI
void imxrt_spidev_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIGS_IMXRT1050_EVK_SRC_IMXRT1050_EVK_H */

View File

@ -126,10 +126,12 @@ int imxrt_bringup(void)
imxrt_i2c_register(1);
#endif
#ifdef CONFIG_MMCSD
#ifdef CONFIG_MMCSD_SPI
/* Initialize SPI-based MMC/SD card support */
imxrt_spidev_initialize();
ret = imxrt_mmcsd_initialize(MMCSD_MINOR);
ret = imxrt_mmcsd_spi_initialize(MMCSD_MINOR);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to initialize SD slot %d: %d\n", ret);

View File

@ -1,5 +1,5 @@
/*****************************************************************************
* configs/imxrt/src/imxrt_mmcsd.c
* configs/imxrt/src/imxrt_mmcsd_spi.c
*
* Copyright (C) 2018 Greg Nutt. All rights reserved.
* Author: ivan Ucherdzhiev <ivanucherdjiev@gmail.com>
@ -49,6 +49,8 @@
#include "chip.h"
#include "imxrt_lpspi.h"
#ifdef CONFIG_MMCSD_SPI
/*****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -97,13 +99,14 @@ int imxrt_lpspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
#endif
/*****************************************************************************
* Name: imxrt_mmcsd_initialize
* Name: imxrt_mmcsd_spi_initialize
*
* Description:
* Initialize SPI-based SD card and card detect thread.
*
****************************************************************************/
int imxrt_mmcsd_initialize(int minor)
int imxrt_mmcsd_spi_initialize(int minor)
{
struct spi_dev_s *spi;
int rv;
@ -128,3 +131,5 @@ int imxrt_mmcsd_initialize(int minor)
spiinfo("INFO: mmcsd card has been initialized successfully\n");
return OK;
}
#endif /* CONFIG_MMCSD_SPI */