From patchwork Fri Oct 9 01:03:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 7358471 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 AA3F99F32B for ; Fri, 9 Oct 2015 00:57:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D134E207D3 for ; Fri, 9 Oct 2015 00:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7331207B9 for ; Fri, 9 Oct 2015 00:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755740AbbJIA5a (ORCPT ); Thu, 8 Oct 2015 20:57:30 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:33940 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755024AbbJIA4r (ORCPT ); Thu, 8 Oct 2015 20:56:47 -0400 Received: by lbbwt4 with SMTP id wt4so64943686lbb.1 for ; Thu, 08 Oct 2015 17:56:45 -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=ewXUp4vIN6u5KVyI5KFaNk0Ix7nLr1xPfIX1tls276ZeUfv8GzwVFkpaO8w4zVfmA1 B3HdAiswe6JTvz7AlVUSHlFmP0zqnjD4JCbyfl+cer+V4UF2I+EvHU265ENm4OcwXpPu koQL9K5tM9TEvZpVr7tSHHFQD4MIXZd+Ryc94K/I7b0LIJboEzKPy3Yz2tBJ6/GWD6UD DUai37uUxbQP2k9lx5GGUxKgUA+G3Nwp602ePNYPJWjhzuKcXSVLTs08kqzPN4B7qIjr 7ZOvShnkSjZAL9JeLSf2RaXIIfp47Fq1SEadx0ilu2mimjr/xkKk95yV6g0YylJ6Vy/U IwFw== X-Gm-Message-State: ALoCoQlkWgwvZDlQiwgTK6ezifTIi2n2BoftymbCJoXBjcgIyZqrf7mqBZlO8IVm5BsvYw0F7dlr X-Received: by 10.112.141.228 with SMTP id rr4mr5104738lbb.48.1444352205675; Thu, 08 Oct 2015 17:56:45 -0700 (PDT) Received: from enkidu.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id og8sm7668933lbc.5.2015.10.08.17.56.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2015 17:56:45 -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 v2 4/5] mmc: sdhci: add init_card callback to sdhci Date: Fri, 9 Oct 2015 03:03:54 +0200 Message-Id: <1444352635-21965-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1444352635-21965-1-git-send-email-mw@semihalf.com> References: <1444352635-21965-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