From patchwork Tue Dec 2 23:42:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5425301 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A60CEBEEA8 for ; Tue, 2 Dec 2014 23:44:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D967D2028D for ; Tue, 2 Dec 2014 23:44:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F07B2034B for ; Tue, 2 Dec 2014 23:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933405AbaLBXok (ORCPT ); Tue, 2 Dec 2014 18:44:40 -0500 Received: from mail-ie0-f178.google.com ([209.85.223.178]:60550 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933267AbaLBXnE (ORCPT ); Tue, 2 Dec 2014 18:43:04 -0500 Received: by mail-ie0-f178.google.com with SMTP id tp5so12763669ieb.9 for ; Tue, 02 Dec 2014 15:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=osypGb1RS0MX5p6ZC1DOMDs7/77FZp0iG4nCVtDb9BU=; b=NgPOZOEhUPeTqWTGUvBdMaKX2aiyAhLpHR/ZbjE/QZLXp8rY5amueRnjmbTqxVRImA 5Nv4B8UQh30fF58OJ1aOeX9TzYEqpKfMAUPz9XtrgOtJMUUFzqqwEZ1IjzGFUTp4Q4U5 eIvZifZg1Il0scJ62mwRZ7eI6ZPy2O+aR+gio= 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=osypGb1RS0MX5p6ZC1DOMDs7/77FZp0iG4nCVtDb9BU=; b=OMWNLS3wjW/Whf9WIEUBAsDtiDxKdda/flfs6+6M7qx6gxRjUK3OrKb5k32Ro/0BFk 1tSSgN+96RHUmDN3wDb0QroB1EFFFOjmpU68miw5cvqUwCat9JrizDXnvd3yfB+aXowl Qpfozp4LDE3wGeXu1TfwOT4v5Or8nVa3vCVA6U5APMncFOfnH/IOWpcXgHBD4UcttuEE RvBeq2IbM5gtmi40nYW1S9DuWfkF/3FFEY/AZMKeAexncLRsj9oLwI+u9ZZfh21tqOWl YENN4yl48rrMlGBKhtXToBPUQMuFpHE5cLPqwppOlqMkiyKaiqnJV5UPgyALN00zwWKb C3ww== X-Gm-Message-State: ALoCoQn8/k4ReOTKcTxySKUK439ZkQkli2bj3FOEZlIdbhMvvLMn/e4DRCclnoK1sxpTdKg1DOvp X-Received: by 10.107.135.163 with SMTP id r35mr1964599ioi.25.1417563783664; Tue, 02 Dec 2014 15:43:03 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id u33sm11856530ioi.6.2014.12.02.15.43.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Dec 2014 15:43:03 -0800 (PST) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Cc: Alim Akhtar , Sonny Rao , Andrew Bresticker , Heiko Stuebner , Doug Anderson , chris@printf.net, gsoutade@neotion.com, hsweeten@visionengravers.com, joe@perches.com, wsa@the-dreams.de, s.hauer@pengutronix.de, axel.lin@ingics.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/4] mmc: core: Support the optional init_card() callback for MMC and SD Date: Tue, 2 Dec 2014 15:42:45 -0800 Message-Id: <1417563767-32181-3-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1417563767-32181-1-git-send-email-dianders@chromium.org> References: <1417563767-32181-1-git-send-email-dianders@chromium.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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 In (3fcb027 ARM: MXC: mxcmmc: work around a bug in the SDHC busy line handling) the optional init_card() callback was added. According to the original change it was "for now only called from mmc_sdio_init_card()". This callback really ought to be called from the SD and MMC init functions as well. One current user of this callback (mxcmci_init_card) will not work as expected if you insert an SDIO card, then eject it and put a normal SD card in. Specifically the normal SD card will not get to run with 4-bit data. I'd like to use the init_card() callback to handle a similar quirk on dw_mmc when using SDIO Interrupts (the "low power" feature of the card needs to be disabled), so that will add a second user of the function. Signed-off-by: Doug Anderson Reviewed-by: Grant Grundler --- Changes in v5: - Split fixup to pandora_wl1251_init_card() into its own patch. Changes in v3: - Add fixup to pandora_wl1251_init_card(). Changes in v2: - mmc core change new for this version. drivers/mmc/core/mmc.c | 6 ++++++ drivers/mmc/core/sd.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 02ad792..4a21d66 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1297,6 +1297,12 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, } /* + * Call the optional HC's init_card function to handle quirks. + */ + if (host->ops->init_card) + host->ops->init_card(host, card); + + /* * For native busses: set card RCA and quit open drain mode. */ if (!mmc_host_is_spi(host)) { diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index d90a6de..29fccdc 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -933,6 +933,12 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, } /* + * Call the optional HC's init_card function to handle quirks. + */ + if (host->ops->init_card) + host->ops->init_card(host, card); + + /* * For native busses: get card RCA and quit open drain mode. */ if (!mmc_host_is_spi(host)) { @@ -1271,4 +1277,3 @@ err: return err; } -