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: 7333001 Return-Path: X-Original-To: patchwork-linux-arm@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 1955DBEEA4 for ; Tue, 6 Oct 2015 01:19:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F05E20687 for ; Tue, 6 Oct 2015 01:19:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4116C20692 for ; Tue, 6 Oct 2015 01:19:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjGsX-0004BE-Fu; Tue, 06 Oct 2015 01:17:17 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjGrn-0003by-DU for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2015 01:16:32 +0000 Received: by lbbwt4 with SMTP id wt4so29928205lbb.1 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=D/luOhFvf/qjcsvfYiUQtfdwQ/Sb2D/+xxhvgb8kev8C98BKATruv0Vy2WRSR+WPVK 9PE+sE5neWLxrFYczDrj0/KTDZ93AUf0m/0cM7CINZIu35O9xPBvjmu4ArgC3HuXyP41 ch0eFYIGeEIiYd+n+N9GrpHm7+0nzligwrfUIu0wcL3ve1a8ruUw69uKjcQv6sqe0Ygv pWx9YkruYQ5wEP+51OlWZP+eT7O7b4TTl9jNOwQZGn/xXCWEoh1AKnRtnpONtNMBaOxw eE7K/6Z+BgcY9fOPRWhJr/ngmUCZQCs21UPJQEbOlyrd6xhgVsjByc+QFwlBqu7dmxqv 675A== X-Gm-Message-State: ALoCoQkZ3lcoOdD0Kau0svRH+RuhCVo6WkwPkyWPR0t/kkpJnm6fV07jW5AaMHWifOysWD/R7fuz 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151005_181631_793944_C343D1F0 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, ulf.hansson@linaro.org, jason@lakedaemon.net, tawfik@marvell.com, jaz@semihalf.com, nadavh@marvell.com, alior@marvell.com, gregory.clement@free-electrons.com, mw@semihalf.com, sebastian.hesselbarth@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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