From patchwork Fri Mar 7 09:25:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffen Trumtrar X-Patchwork-Id: 3788871 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 464319F35F for ; Fri, 7 Mar 2014 09:26:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 425E7201D3 for ; Fri, 7 Mar 2014 09:26:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55B1420272 for ; Fri, 7 Mar 2014 09:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbaCGJ0A (ORCPT ); Fri, 7 Mar 2014 04:26:00 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:44571 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbaCGJZ5 (ORCPT ); Fri, 7 Mar 2014 04:25:57 -0500 Received: from unicorn.hi.pengutronix.de ([2001:6f8:1178:2:a61f:72ff:fe69:16d]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WLr2S-0000ge-0S; Fri, 07 Mar 2014 10:25:56 +0100 Received: from str by unicorn.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1WLr2V-0006cO-8T; Fri, 07 Mar 2014 10:25:59 +0100 From: Steffen Trumtrar To: linux-mmc@vger.kernel.org Cc: Chris Ball , Dong Aisheng , Steffen Trumtrar Subject: [RFC 1/2] sdhci: add init_card callback Date: Fri, 7 Mar 2014 10:25:48 +0100 Message-Id: <1394184350-25214-1-git-send-email-s.trumtrar@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:a61f:72ff:fe69:16d X-SA-Exim-Mail-From: str@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org 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 Currently host drivers using the sdhci-pltfm code can not configure the host based on the type of card inserted. The sdio driver e.g. calls the card_init callback, so the host can now know what card is used and configure itself accordingly. Provide a callback for users of the sdhci-pltfm code to use this callback function. Signed-off-by: Steffen Trumtrar --- 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 9ddef47..20bf40b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2106,6 +2106,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->card_type_init) + host->ops->card_type_init(host, card); +} + static const struct mmc_host_ops sdhci_ops = { .request = sdhci_request, .set_ios = sdhci_set_ios, @@ -2117,6 +2125,7 @@ static const struct mmc_host_ops sdhci_ops = { .execute_tuning = sdhci_execute_tuning, .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 0a3ed01..331a285 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -296,6 +296,7 @@ struct sdhci_ops { void (*adma_workaround)(struct sdhci_host *host, u32 intmask); void (*platform_init)(struct sdhci_host *host); void (*card_event)(struct sdhci_host *host); + void (*card_type_init)(struct sdhci_host *host, struct mmc_card *card); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS