Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d217a615 authored by Pavan Anamula's avatar Pavan Anamula
Browse files

mmc: host: add support to allow SANITIZE operation



SANITIZE is an operation performed by the storage device and its purpose
is to delete its unmap memory regions.
This change adds support for the SANITIZE capability.

Change-Id: I58b647fb576c694aaa16c1e827d0784d4a5b4456
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent 0600f6c1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -567,7 +567,8 @@ static int ioctl_do_sanitize(struct mmc_card *card)
{
	int err;

	if (!mmc_can_sanitize(card)) {
	if (!mmc_can_sanitize(card) &&
			(card->host->caps2 & MMC_CAP2_SANITIZE)) {
		pr_warn("%s: %s - SANITIZE is not supported\n",
				mmc_hostname(card->host), __func__);
		err = -EOPNOTSUPP;
+1 −0
Original line number Diff line number Diff line
@@ -3345,6 +3345,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
	msm_host->mmc->caps2 |= MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE;
	msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING;
	msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE;
	msm_host->mmc->caps2 |= MMC_CAP2_SANITIZE;

	if (msm_host->pdata->nonremovable)
		msm_host->mmc->caps |= MMC_CAP_NONREMOVABLE;
+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ struct mmc_host {
#define MMC_CAP2_HS400_POST_TUNING	(1 << 21)
#define MMC_CAP2_NONHOTPLUG	(1 << 25)	/*Don't support hotplug*/
#define MMC_CAP2_CMD_QUEUE	(1 << 26)	/* support eMMC command queue */

#define MMC_CAP2_SANITIZE       (1 << 27)               /* Support Sanitize */
	mmc_pm_flag_t		pm_caps;	/* supported pm features */

#ifdef CONFIG_MMC_CLKGATE