From patchwork Tue Jan 4 21:10:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 451811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p04LB1Z8026668 for ; Tue, 4 Jan 2011 21:11:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751583Ab1ADVKv (ORCPT ); Tue, 4 Jan 2011 16:10:51 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59865 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547Ab1ADVKu (ORCPT ); Tue, 4 Jan 2011 16:10:50 -0500 Received: by mail-ey0-f174.google.com with SMTP id 27so6488007eye.19 for ; Tue, 04 Jan 2011 13:10:50 -0800 (PST) Received: by 10.213.35.209 with SMTP id q17mr6805660ebd.97.1294175449850; Tue, 04 Jan 2011 13:10:49 -0800 (PST) Received: from localhost.localdomain (93-172-227-56.bb.netvision.net.il [93.172.227.56]) by mx.google.com with ESMTPS id t50sm15979763eeh.6.2011.01.04.13.10.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 13:10:49 -0800 (PST) From: Ohad Ben-Cohen To: Cc: Chris Ball , Ohad Ben-Cohen Subject: [PATCH 4/4] mmc: add MMC_QUIRK_NONSTD_FUNC_IF Date: Tue, 4 Jan 2011 23:10:16 +0200 Message-Id: <1294175416-12358-4-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1294175416-12358-1-git-send-email-ohad@wizery.com> References: <1294175416-12358-1-git-send-email-ohad@wizery.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 04 Jan 2011 21:11:03 +0000 (UTC) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 2118df2..bee7641 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "core.h" #include "bus.h" @@ -31,6 +32,11 @@ static int sdio_read_fbr(struct sdio_func *func) int ret; unsigned char data; + if (mmc_card_nonstd_func_interface(func->card)) { + func->class = SDIO_CLASS_NONE; + return 0; + } + ret = mmc_io_rw_direct(func->card, 0, 0, SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data); if (ret) diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 3a3c079..40441df 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -121,6 +121,7 @@ struct mmc_card { #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ /* (missing CIA registers) */ #define MMC_QUIRK_DISABLE_CD (1<<3) /* disconnect CD/DAT[3] resistor */ +#define MMC_QUIRK_NONSTD_FUNC_IF (1<<4) /* SDIO card has nonstd function interfaces */ unsigned int erase_size; /* erase size in sectors */ unsigned int erase_shift; /* if erase unit is power 2 */ @@ -179,6 +180,11 @@ static inline int mmc_card_disable_cd(const struct mmc_card *c) return c->quirks & MMC_QUIRK_DISABLE_CD; } +static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) +{ + return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; +} + #define mmc_card_name(c) ((c)->cid.prod_name) #define mmc_card_id(c) (dev_name(&(c)->dev))