From patchwork Thu Oct 15 16:25:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 7408081 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 42BC2BEEA4 for ; Thu, 15 Oct 2015 16:21:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 591E7204E7 for ; Thu, 15 Oct 2015 16:21:04 +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 6A534204A9 for ; Thu, 15 Oct 2015 16:21:03 +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 1ZmlFQ-0007jg-Vl; Thu, 15 Oct 2015 16:19:20 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmlEO-00066L-Ey for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2015 16:18:20 +0000 Received: by lbbwb3 with SMTP id wb3so13272891lbb.1 for ; Thu, 15 Oct 2015 09:17:54 -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=mOZVTZ6IRsMBrQHlhxBylNqFfN5p3o38zzVxUGNsC8k=; b=hMs7Hbyo5+3ZNSF85JB4d+w0d5GW2UKo3SnCYHPgiOD/5q1o/VU3tnFJEiSnAXf0Rz HlpTrQmBTt2yTbHXglBpjnplfhrDdkbZ/LOQk+dmSakUXi2sibR8nU07zJV4uJ7RVud0 bMg7E6mezeHNvwo0rvi0A+mxWwGhdiVxIPqtaU7lbyG30sXvMeNMHGMUlQDXsCxEGesC dcxDzeF4tzScmsoarF2ACUHty5Cm29nJB7dxbGxFOyJsLbro7sCQEoRdScneSSRia8vm S0GXlPktZcXMmF3NKfD8RgYzCjsY4kGW+7FoQ9YdizO68kD5+wsSuH67eL9z5QZuq9HA zb7w== X-Gm-Message-State: ALoCoQkCMlMAWpA69ZF//My/Ur8TxZk0T7YvB0ez8wRTjfWIwtNYKyorCKIwdz0p2ns+DuXrvJ3A X-Received: by 10.112.169.98 with SMTP id ad2mr4992622lbc.2.1444925874557; Thu, 15 Oct 2015 09:17:54 -0700 (PDT) Received: from enkidu.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id r137sm2185323lfe.34.2015.10.15.09.17.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 09:17:53 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org Subject: [PATCH v3 4/5] mmc: sdhci: add init_card callback to sdhci Date: Thu, 15 Oct 2015 18:25:45 +0200 Message-Id: <1444926346-29763-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1444926346-29763-1-git-send-email-mw@semihalf.com> References: <1444926346-29763-1-git-send-email-mw@semihalf.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151015_091816_952101_01656085 X-CRM114-Status: GOOD ( 13.14 ) 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, jszhang@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 fbc7efd..0739749 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2199,6 +2199,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, @@ -2214,6 +2222,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 9d4aa31..12f4115 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -549,6 +549,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