From: Marcin Wojtas <mw@semihalf.com>
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 [thread overview]
Message-ID: <1444926346-29763-5-git-send-email-mw@semihalf.com> (raw)
In-Reply-To: <1444926346-29763-1-git-send-email-mw@semihalf.com>
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 <mw@semihalf.com>
---
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
--
1.8.3.1
next prev parent reply other threads:[~2015-10-15 16:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 16:25 [PATCH v3 0/5] Armada 38x SDHCI driver improvements Marcin Wojtas
2015-10-15 16:25 ` [PATCH v3 1/5] mmc: sdhci-pxav3: enable proper resuming on Armada 38x SoC Marcin Wojtas
2015-10-22 13:29 ` Ulf Hansson
2015-10-22 13:38 ` Marcin Wojtas
2015-10-15 16:25 ` [PATCH v3 2/5] mmc: sdhci-pxav3: enable usage of DAT3 pin as HW card detect Marcin Wojtas
2015-10-22 13:29 ` Ulf Hansson
2015-10-23 13:43 ` Marcin Wojtas
2015-10-15 16:25 ` [PATCH v3 3/5] ARM: mvebu: set SW polling as SDHCI card detection on A388-GP Marcin Wojtas
2015-10-16 17:19 ` Gregory CLEMENT
2015-10-15 16:25 ` Marcin Wojtas [this message]
2015-10-15 16:25 ` [PATCH v3 5/5] mmc: sdhci-pxav3: enable modifying MMC_CARD bit during card initialization Marcin Wojtas
2015-10-21 11:59 ` [PATCH v3 0/5] Armada 38x SDHCI driver improvements Marcin Wojtas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444926346-29763-5-git-send-email-mw@semihalf.com \
--to=mw@semihalf.com \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=jaz@semihalf.com \
--cc=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=nadavh@marvell.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=tawfik@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®