From patchwork Tue Jun 21 13:12:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 70555 Delivered-To: patches@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2011167qgy; Tue, 21 Jun 2016 06:13:12 -0700 (PDT) X-Received: by 10.25.138.11 with SMTP id m11mr5249908lfd.46.1466514791930; Tue, 21 Jun 2016 06:13:11 -0700 (PDT) Return-Path: Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id bm7si27654022lbb.119.2016.06.21.06.13.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 06:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x236.google.com with SMTP id f6so23245195lfg.0 for ; Tue, 21 Jun 2016 06:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iPQNT5m/lIDSlhuAh9AuNwbNPnJGgvBlqAGwoAoVcFA=; b=FcIb7fachdZxq7b8/XAHEeDKIpMje5PBZYGQ1NUr2A+EdA3OpmOgNYLh3DhFjURBSb EhBdf35H7W+07VJRPgEXYjpXk1exC7S9Axc9TiJvM7gr1HLWMfbI5omh/GRcS3p3C0O+ e5UBAfEwvFDR9yCOcXfYKmEb4DQ/AzrMlP8yM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iPQNT5m/lIDSlhuAh9AuNwbNPnJGgvBlqAGwoAoVcFA=; b=kysVCVy9ZuyFrgZ6ScKu2/OGnKHgEpuJuo/ACBcLO6s+1kwSZE8SKJdA5RTmynWrf6 2Yhb+Kj9ccjAyh6LTjNogrbdfS8ycqU8pCvsrbUJhSOUBip6cPgBZ2PTJ9FaEJob4gZG uq8Lho0YO2HcPjQLI/6Z2Khz3VgOnyty5tzXyoywiOPXNH08rFrBp2msjJo6O3+6FPti KqRotaxsJrkCcz7zsUbI/gcAulExNFTlg5Biz3lCRNLFt5qstzadnLY0WfjbG5X4fnTe 48THou23s76SIDo5/MHtEmSrijzZiBhci64pC/EMClfT3u/8Vo8PdeA9fZLQJLyk5ULp kTmA== X-Gm-Message-State: ALyK8tIIBaRdV+fPfUyH5LO9iI2QosO5PmhdfnajhOQZISUXRHiNZf70xQn5Ksv3DMVgWLnCuQE= X-Received: by 10.25.86.79 with SMTP id k76mr3314564lfb.135.1466514791191; Tue, 21 Jun 2016 06:13:11 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id ze5sm4978244lbb.8.2016.06.21.06.13.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2016 06:13:09 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Kuninori Morimoto , Geert Uytterhoeven , Nguyen Viet Dung , Magnus Damm , Simon Horman , Baolin Wang Subject: [PATCH 2/5] mmc: sh_mmcif: Enable MMC_CAP2_NO_SD and MMC_CAP2_NO_SDIO Date: Tue, 21 Jun 2016 15:12:47 +0200 Message-Id: <1466514770-9462-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466514770-9462-1-git-send-email-ulf.hansson@linaro.org> References: <1466514770-9462-1-git-send-email-ulf.hansson@linaro.org> Enable the capabilities which tells the mmc core to prevent sending SD and SDIO commands during card initialization. In this way, we can also remove the validation of non-supported commands in the ->request() callback. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sh_mmcif.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index dd64b86..4d6c59f 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1009,22 +1009,6 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq) host->state = STATE_REQUEST; spin_unlock_irqrestore(&host->lock, flags); - switch (mrq->cmd->opcode) { - /* MMCIF does not support SD/SDIO command */ - case MMC_SLEEP_AWAKE: /* = SD_IO_SEND_OP_COND (5) */ - case MMC_SEND_EXT_CSD: /* = SD_SEND_IF_COND (8) */ - if ((mrq->cmd->flags & MMC_CMD_MASK) != MMC_CMD_BCR) - break; - case MMC_APP_CMD: - case SD_IO_RW_DIRECT: - host->state = STATE_IDLE; - mrq->cmd->error = -ETIMEDOUT; - mmc_request_done(mmc, mrq); - return; - default: - break; - } - host->mrq = mrq; sh_mmcif_start_cmd(host, mrq); @@ -1488,6 +1472,8 @@ static int sh_mmcif_probe(struct platform_device *pdev) sh_mmcif_init_ocr(host); mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; + mmc->caps2 |= MMC_CAP2_NO_SD | MMC_CAP2_NO_SDIO; + if (pd && pd->caps) mmc->caps |= pd->caps; mmc->max_segs = 32;