phy62xx:support MTDIOC_ERASESTATE

Signed-off-by: 田昕 <tianxin7@xiaomi.com>
This commit is contained in:
田昕 2022-09-16 17:43:56 +08:00 committed by Xiang Xiao
parent a7b3217c37
commit 521f870965
1 changed files with 14 additions and 0 deletions

View File

@ -43,6 +43,12 @@
#include <nuttx/fs/ioctl.h>
#include <nuttx/mtd/mtd.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define MTD_ERASED_STATE (0xff)
/****************************************************************************
* Private Types
****************************************************************************/
@ -312,6 +318,14 @@ static int pplus_fls_ioctl(struct mtd_dev_s *dev,
break;
}
case MTDIOC_ERASESTATE:
{
uint8_t *result = (uint8_t *)arg;
*result = MTD_ERASED_STATE;
ret = OK;
}
break;
default:
ret = -ENOTTY; /* Bad/unsupported command */
break;