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: 7407951 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 E4B799F443 for ; Thu, 15 Oct 2015 16:18:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11E4020664 for ; Thu, 15 Oct 2015 16:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E49EC2081E for ; Thu, 15 Oct 2015 16:18:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805AbbJOQR7 (ORCPT ); Thu, 15 Oct 2015 12:17:59 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33688 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753727AbbJOQRz (ORCPT ); Thu, 15 Oct 2015 12:17:55 -0400 Received: by lbbpp2 with SMTP id pp2so46254439lbb.0 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=KGpX4ZV682FrH1xAZdUTiWi86zhn6TR5Nr9SlegqD5pfKyoUwVX89ikdd000i0Kp55 71FpDlH/3/v+eqMgypN15IPiDWUN8qkJL6RdxJcF0yCixcOS8eZ5EuC3Y/dVGJLE0AS2 yrh2TyW2IT7LchmPXmew5WIxmUoOYbe9cJbskMUQCtAtAslOjziF+KnhPmAlyZdmYVtH 6Go+PLB3YQoTO1AJvH7wi3zkYlktBUyWjNoDjVf4i9YIoenm2cEbmQN+Jx3ANPeTpBNa Sqfu9Y98t8mofqmeqeLhZB34AFs7B1Gwb8q41Topn0ZoeAwRWWN+n2w760I7jibUHwxY myjQ== X-Gm-Message-State: ALoCoQl3uZFvo9zUOsM9yVx5omDQs/KUHTpFMa+zi9C1pp8sW2/nZiJeYQihz/55XwsISzxH+PKa 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 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, jszhang@marvell.com 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> 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 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