Merged in alinjerpelea/nuttx (pull request #911)
configs: spresense: remove SPI MMC/SD & add ADC * configs: spresense: remove SPI MMC/SD support SPI MMC/SD is not used on spresense board. A commit will follow to add support for custom boards Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * configs: spresense: enable ADC support enable ADC support for spresense board Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
2dd9f085ce
commit
2fcee80799
@ -103,6 +103,9 @@
|
|||||||
#ifdef CONFIG_PWM
|
#ifdef CONFIG_PWM
|
||||||
#include "cxd56_pwm.h"
|
#include "cxd56_pwm.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_CXD56_ADC
|
||||||
|
#include <arch/chip/adc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "spresense.h"
|
#include "spresense.h"
|
||||||
|
|
||||||
@ -272,6 +275,14 @@ int cxd56_bringup(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_CXD56_ADC
|
||||||
|
ret = cxd56_adcinitialize();
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
_err("ERROR: Failed to initialze adc. \n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_USERLED_LOWER
|
#ifdef CONFIG_USERLED_LOWER
|
||||||
ret = userled_lower_initialize("/dev/userleds");
|
ret = userled_lower_initialize("/dev/userleds");
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -300,7 +311,7 @@ int cxd56_bringup(void)
|
|||||||
cxd56_gpio_write(PIN_SDIO_DATA2, false);
|
cxd56_gpio_write(PIN_SDIO_DATA2, false);
|
||||||
cxd56_gpio_write(PIN_SDIO_DATA3, false);
|
cxd56_gpio_write(PIN_SDIO_DATA3, false);
|
||||||
|
|
||||||
#if defined(CONFIG_CXD56_SDIO) && !defined(CONFIG_CXD56_SPISD)
|
#if defined(CONFIG_CXD56_SDIO)
|
||||||
ret = board_sdcard_initialize();
|
ret = board_sdcard_initialize();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -308,17 +319,6 @@ int cxd56_bringup(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CXD56_SPISD
|
|
||||||
/* Mount the SPI-based MMC/SD block driver */
|
|
||||||
|
|
||||||
ret = board_spisd_initialize(0, 4);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
ferr("ERROR: Failed to initialize SPI device to MMC/SD: %d\n",
|
|
||||||
ret);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_CPUFREQ_RELEASE_LOCK
|
#ifdef CONFIG_CPUFREQ_RELEASE_LOCK
|
||||||
/* Enable dynamic clock control and CPU clock down for power saving */
|
/* Enable dynamic clock control and CPU clock down for power saving */
|
||||||
|
|
||||||
|
@ -137,26 +137,6 @@ void cxd56_spi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
|||||||
|
|
||||||
uint8_t cxd56_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
uint8_t cxd56_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||||
{
|
{
|
||||||
# ifdef CONFIG_CXD56_SPISD
|
|
||||||
if (devid == SPIDEV_MMCSD(0))
|
|
||||||
{
|
|
||||||
static bool initialized = false;
|
|
||||||
if (initialized == false)
|
|
||||||
{
|
|
||||||
/* Input enable */
|
|
||||||
|
|
||||||
cxd56_gpio_config(MMCSD_DETECT, true);
|
|
||||||
|
|
||||||
initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MMCSD_DETECT is mapping to SD Card detect pin
|
|
||||||
* MMCSD_DETECT = 0: Inserted
|
|
||||||
* MMCSD_DETECT = 1: Removed
|
|
||||||
*/
|
|
||||||
return cxd56_gpio_read(MMCSD_DETECT) ? 0 : SPI_STATUS_PRESENT;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user