From patchwork Tue Oct 6 01:22:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 7332911 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A1899F302 for ; Tue, 6 Oct 2015 01:18:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD83920687 for ; Tue, 6 Oct 2015 01:18:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C17CC20692 for ; Tue, 6 Oct 2015 01:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950AbbJFBQX (ORCPT ); Mon, 5 Oct 2015 21:16:23 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:33440 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbbJFBQK (ORCPT ); Mon, 5 Oct 2015 21:16:10 -0400 Received: by lbos8 with SMTP id s8so67586941lbo.0 for ; Mon, 05 Oct 2015 18:16:09 -0700 (PDT) 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=m//4fe08uo6ovk43t3BxQA7M88uUgzSkwJGEkS5F28k=; b=g/CZf8d/90YM4A5934l4Git7k0IZgKvY1LMvSQSvtHX7559dTYoqO1vXq2mkv/84M2 aljb9fHorBtiO4nRpsL2y3rGAhgZmxSAUsrG4X58yYR3Hls9fx/TufygI7iwclbwNQJD zfAWdYFyw6WYoYUIim9+OZAAYhc53A7WnUrR2WAAx0eYc+AqtSGGQ17HqvkQWZXoLsO9 PbK9k/uF4BAz+gc1iXKhrXjzRIBeOXT9bbXAZjaTckRjxoGtxsVk6cLJHBYJDYLiXp33 HVwtQ5TwWRa3QtnJ2QP5amabj7pN7gHd+SN/Ih8e+QPu/yqk3YYtZ2XHY3xLUWkT2zUW we6A== X-Gm-Message-State: ALoCoQkDnwCe8geA3yrohdAfdLjc00S/ao2pLpetyl1hJKxPMEAM6eilGYVc5y5acVT0Z2KH9Wx5 X-Received: by 10.112.163.131 with SMTP id yi3mr13133199lbb.36.1444094169420; Mon, 05 Oct 2015 18:16:09 -0700 (PDT) Received: from enkidu.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id x1sm4694780lbb.32.2015.10.05.18.16.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 18:16:08 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, sebastian.hesselbarth@gmail.com, andrew@lunn.ch, jason@lakedaemon.net, thomas.petazzoni@free-electrons.com, gregory.clement@free-electrons.com, nadavh@marvell.com, alior@marvell.com, tawfik@marvell.com, mw@semihalf.com, jaz@semihalf.com Subject: [PATCH 7/8] mmc: sdhci: add init_card callback to sdhci Date: Tue, 6 Oct 2015 03:22:41 +0200 Message-Id: <1444094562-31165-8-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1444094562-31165-1-git-send-email-mw@semihalf.com> References: <1444094562-31165-1-git-send-email-mw@semihalf.com> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Some sdhci hosts may require handling quirks during card initialization at the time when its type is already known. Hence a new callback (init_card) is added in sdhci_ops. Signed-off-by: Marcin Wojtas --- drivers/mmc/host/sdhci.c | 9 +++++++++ drivers/mmc/host/sdhci.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index cfed695..a1c308d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2200,6 +2200,14 @@ static void sdhci_card_event(struct mmc_host *mmc) spin_unlock_irqrestore(&host->lock, flags); } +static void sdhci_init_card(struct mmc_host *mmc, struct mmc_card *card) +{ + struct sdhci_host *host = mmc_priv(mmc); + + if (host->ops->init_card) + host->ops->init_card(host, card); +} + static const struct mmc_host_ops sdhci_ops = { .request = sdhci_request, .post_req = sdhci_post_req, @@ -2215,6 +2223,7 @@ static const struct mmc_host_ops sdhci_ops = { .select_drive_strength = sdhci_select_drive_strength, .card_event = sdhci_card_event, .card_busy = sdhci_card_busy, + .init_card = sdhci_init_card, }; /*****************************************************************************\ diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index c751b78..365c860 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -547,6 +547,7 @@ struct sdhci_ops { struct mmc_card *card, unsigned int max_dtr, int host_drv, int card_drv, int *drv_type); + void (*init_card)(struct sdhci_host *host, struct mmc_card *card); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS