From patchwork Wed Nov 25 11:28:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 7698121 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7E89C05CA for ; Wed, 25 Nov 2015 11:29:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED8ED208AD for ; Wed, 25 Nov 2015 11:29:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05C33208E3 for ; Wed, 25 Nov 2015 11:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbbKYL3W (ORCPT ); Wed, 25 Nov 2015 06:29:22 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36761 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752556AbbKYL3W (ORCPT ); Wed, 25 Nov 2015 06:29:22 -0500 Received: by wmww144 with SMTP id w144so175952114wmw.1 for ; Wed, 25 Nov 2015 03:29:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FaOjIeIokXFVwM24YqhX67fHZLD+cK+BB9sjNkgmtc4=; b=UdJZ/DJPNnMSAV9ajWzaMNNL+keh0uu8PAvHJuMY8fQPHEAIw8JdHIh8QHcK5pX4KT PW6ncPcCl2ndDlC6rIhzapdInkU7Ptc3FH8kh4U5Y5FsEsUjfpf8bzhK4E633Y0Rhj6F G8L+k3K6DifzHay4/zIsTMx57VJEgtuWs/aPXRKLI6hlnh1UABWf3rclXPEbvBNZ1rn1 KHiDXZE3dj0UHbQRVKrwr7O6MN+odWwc/wimOsb26j/xlj4wGCqAva+b6s67Rw9R0jaI sLCtZuvsvYYtbz4s/teyhbCORN+PFaQt9E3cWfE60TF2bLbST3k5ldRAq6r10cJWnM6M Kj6w== X-Received: by 10.28.227.212 with SMTP id a203mr3819795wmh.68.1448450960908; Wed, 25 Nov 2015 03:29:20 -0800 (PST) Received: from localhost.localdomain ([212.91.95.170]) by smtp.gmail.com with ESMTPSA id d66sm3047237wma.21.2015.11.25.03.29.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 03:29:20 -0800 (PST) From: Carlo Caione To: ulf.hansson@linaro.org, hdegoede@redhat.com, linux-mmc@vger.kernel.org, drake@endlessm.com Cc: Carlo Caione Subject: [PATCH 3/3] mmc: core: Introduce MMC_CAP2_NO_SDIO cap Date: Wed, 25 Nov 2015 12:28:47 +0100 Message-Id: <1448450927-13682-4-git-send-email-carlo@caione.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1448450927-13682-1-git-send-email-carlo@caione.org> References: <1448450927-13682-1-git-send-email-carlo@caione.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Carlo Caione This patch introduce a new MMC_CAP2_NO_SDIO cap used to tell the mmc core to not send SDIO specific commands. Signed-off-by: Carlo Caione --- drivers/mmc/core/core.c | 7 +++++++ include/linux/mmc/host.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 2e8b24d..90b028e 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -204,6 +204,13 @@ static void __mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) return; } + /* We do not support SDIO commands */ + if (mmc_is_io_op(mrq->cmd->opcode) && host->caps2 & MMC_CAP2_NO_SDIO) { + mrq->cmd->error = -EINVAL; + mmc_request_done(host, mrq); + return; + } + /* * For sdio rw commands we must wait for card busy otherwise some * sdio devices won't work properly. diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 8673ffe..cf6d0bb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -289,6 +289,7 @@ struct mmc_host { #define MMC_CAP2_HSX00_1_2V (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V) #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17) #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */ +#define MMC_CAP2_NO_SDIO (1 << 19) /* Do not send SDIO commands during initialization */ mmc_pm_flag_t pm_caps; /* supported pm features */