boards/spresense: remove BOARDIOC_SDCARD_SETNOTIFYCB ioctl

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2023-01-26 01:59:06 +02:00 committed by Xiang Xiao
parent 1c84fc9cd9
commit af55d894f9
15 changed files with 22 additions and 108 deletions

View File

@ -26,6 +26,7 @@ CONFIG_BUILTIN=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
@ -36,6 +37,7 @@ CONFIG_DEBUG_SYMBOLS=y
CONFIG_DRIVERS_AUDIO=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -60,7 +62,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -26,6 +26,7 @@ CONFIG_CXD56_CISIF=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C2=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
@ -36,6 +37,7 @@ CONFIG_DEBUG_SYMBOLS=y
CONFIG_DRIVERS_VIDEO=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -60,7 +62,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -28,6 +28,7 @@ CONFIG_CXD56_CISIF=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C2=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
@ -39,6 +40,8 @@ CONFIG_EXAMPLES_CAMERA=y
CONFIG_EXAMPLES_CAMERA_OUTPUT_LCD=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_AUTOMOUNTER_DRIVER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -71,7 +74,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -33,6 +33,7 @@ CONFIG_COMPOSITE_VENDORSTR="Sony"
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
@ -48,6 +49,7 @@ CONFIG_EXAMPLES_NXLINES_BPP=16
CONFIG_EXAMPLES_NX_BPP=16
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -79,7 +81,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -31,6 +31,7 @@ CONFIG_COMPOSITE_VENDORSTR="Sony"
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
@ -39,6 +40,7 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -67,7 +69,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -35,6 +35,7 @@ CONFIG_CXD56_PWM1=y
CONFIG_CXD56_PWM2=y
CONFIG_CXD56_PWM3=y
CONFIG_CXD56_PWM=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
@ -46,6 +47,7 @@ CONFIG_DEBUG_SYMBOLS=y
CONFIG_DRIVERS_VIDEO=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -70,7 +72,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -31,7 +31,6 @@ CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_AUTOMOUNTER_DRIVER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y

View File

@ -32,6 +32,7 @@ CONFIG_CXD56_AUDIO_BUFFER_SIZE=2048
CONFIG_CXD56_AUDIO_NUM_BUFFERS=64
CONFIG_CXD56_AUDIO_WORKER_STACKSIZE=1024
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
@ -50,6 +51,7 @@ CONFIG_EXAMPLES_TCPBLASTER_TARGET2=y
CONFIG_EXAMPLES_WEBSERVER=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
@ -128,7 +130,6 @@ CONFIG_RTC_DRIVER=y
CONFIG_RTC_FREQUENCY=32768
CONFIG_RTC_HIRES=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SENDFILE_BUFSIZE=1024
CONFIG_SMARTFS_ALIGNED_ACCESS=y

View File

@ -24,6 +24,7 @@ CONFIG_BUILTIN=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
@ -33,6 +34,7 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
@ -57,7 +59,6 @@ CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30

View File

@ -34,6 +34,7 @@ CONFIG_CXD56_AUDIO_WORKER_STACKSIZE=1024
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_DMAC_SPI5_RX=y
CONFIG_CXD56_DMAC_SPI5_TX=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
@ -63,6 +64,7 @@ CONFIG_EXAMPLES_UDPBLASTER=y
CONFIG_EXAMPLES_WEBSERVER=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y

View File

@ -36,6 +36,7 @@ CONFIG_CXD56_AUDIO_WORKER_STACKSIZE=1024
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_DMAC_SPI5_RX=y
CONFIG_CXD56_DMAC_SPI5_TX=y
CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
@ -66,6 +67,7 @@ CONFIG_EXAMPLES_UDPBLASTER=y
CONFIG_EXAMPLES_WEBSERVER=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y

View File

@ -267,10 +267,6 @@ enum board_power_device
#define BOARDIOC_USBDEV_SETNOTIFYSIG (BOARDIOC_USER+0x0001)
/* Set callback function pointer for notify SDCard state change *************/
#define BOARDIOC_SDCARD_SETNOTIFYCB (BOARDIOC_USER+0x0002)
/* Altair modem device pin definitions **************************************/
#define ALT1250_SLAVE_REQ PIN_SPI2_SCK

View File

@ -145,18 +145,6 @@ bool board_sdcard_inserted(int slotno);
# define board_sdcard_inserted(slotno) true
#endif
/****************************************************************************
* Name: board_sdcard_set_state_cb
*
* Description:
* Register callback function to notify state change of card slot.
* This function is called by board_ioctl()
* as BOARDIOC_SDCARD_SETNOTIFYCB command.
*
****************************************************************************/
int board_sdcard_set_state_cb(uintptr_t cb);
#undef EXTERN
#if defined(__cplusplus)
}

View File

@ -93,21 +93,6 @@ int board_ioctl(unsigned int cmd, uintptr_t arg)
break;
#endif
#ifdef CONFIG_CXD56_SDIO
/* CMD: BOARDIOC_SDCARD_SETNOTIFYCB
* DESCRIPTION: Set a callback function pointer to SDCard driver
* to notify when card status is changed.
* ARG: Callback function.
* CONFIGURATION: CONFIG_BOARDCTL & CONFIG_CXD56_SDIO
* DEPENDENCIES: Board logic must provide board_app_initialization
*/
case BOARDIOC_SDCARD_SETNOTIFYCB:
{
ret = board_sdcard_set_state_cb(arg);
}
break;
#endif
default:
break;
}

View File

@ -72,7 +72,6 @@ struct cxd56_sdhci_state_s
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
bool inserted; /* TRUE: card is inserted */
#endif
void (*cb)(bool); /* Callback function pointer to application */
};
/****************************************************************************
@ -148,33 +147,7 @@ static void board_sdcard_enable(void *arg)
cxd56_sdhci_mediachange(g_sdhci.sdhci);
#ifndef CONFIG_CXD56_SDCARD_AUTOMOUNT
if (nx_stat("/dev/mmcsd0", &stat_sdio, 1) == 0)
{
if (S_ISBLK(stat_sdio.st_mode))
{
ret = nx_mount("/dev/mmcsd0", "/mnt/sd0", "vfat", 0, NULL);
if (ret == 0)
{
finfo(
"Successfully mount a SDCARD via the MMC/SD driver\n");
}
else
{
_err("ERROR: Failed to mount the SDCARD. %d\n", ret);
cxd56_sdio_resetstatus(g_sdhci.sdhci);
goto release_frequency_lock;
}
}
}
/* Callback to application to notice card is inserted */
if (g_sdhci.cb != NULL)
{
g_sdhci.cb(true);
}
#else
#ifdef CONFIG_CXD56_SDCARD_AUTOMOUNT
/* Let the automounter know about the insertion event */
board_automount_event(0, board_sdcard_inserted(0));
@ -202,25 +175,6 @@ static void board_sdcard_disable(void *arg)
{
if (g_sdhci.initialized)
{
#ifndef CONFIG_CXD56_SDCARD_AUTOMOUNT
int ret;
/* un-mount */
ret = nx_umount2("/mnt/sd0", 0);
if (ret < 0)
{
ferr("ERROR: Failed to unmount the SD Card: %d\n", ret);
}
/* Callback to application to notice card is ejected */
if (g_sdhci.cb != NULL)
{
g_sdhci.cb(false);
}
#endif /* CONFIG_CXD56_SDCARD_AUTOMOUNT */
/* Report the new state to the SDIO driver */
cxd56_sdhci_mediachange(g_sdhci.sdhci);
@ -527,24 +481,3 @@ bool board_sdcard_inserted(int slotno)
return !removed;
}
#endif
/****************************************************************************
* Name: board_sdcard_set_state_cb
*
* Description:
* Register callback function to notify state change of card slot.
* This function is called by board_ioctl()
* as BOARDIOC_SDCARD_SETNOTIFYCB command.
*
****************************************************************************/
int board_sdcard_set_state_cb(uintptr_t cb)
{
if (g_sdhci.cb != NULL && cb != 0)
{
return -EBUSY;
}
g_sdhci.cb = (void (*)(bool))cb;
return OK;
}