[PATCH] sdhci: Add pre and post reset processing for chip specific= reset
philip (none)
philip at philip-laptop.
Sat Dec 11 19:58:59 EST 2010
Marvell pxa controllers have private registers that need to be
touched before and after a reset is done. Implement hooks
to allow this to happen.
Signed-off-by: philip <philip at philip-laptop.(none)>
---
drivers/mmc/host/sdhci.c | 6 ++++++
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d5febe5..f439881 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -157,6 +157,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mas=
k)
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
ier =3D sdhci_readl(host, SDHCI_INT_ENABLE);
=20
+ if (host->ops->platform_reset_enter)
+ host->ops->platform_reset_enter(host, mask);
+
sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET);
=20
if (mask & SDHCI_RESET_ALL)
@@ -177,6 +180,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mas=
k)
mdelay(1);
}
=20
+ if (host->ops->platform_reset_exit)
+ host->ops->platform_reset_exit(host, mask);
+
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
}
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 6e0969e..9dd7bc1 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -222,6 +222,8 @@ struct sdhci_ops {
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
u8 power_mode);
unsigned int (*get_ro)(struct sdhci_host *host);
+ void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
+ void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
};
=20
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
--=20
1.6.0.4
--_002_C8F2F5E1E72D4679AB8F748CBE736262marvellcom_
Content-Type: application/octet-stream;
name="0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch"
Content-Description: 0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch
Content-Disposition: attachment;
filename="0007-sdhci-Add-pre-and-post-reset-processing-for-chip-sp.patch";
size=1911; creation-date="Tue, 21 Dec 2010 23:08:36 GMT";
modification-date="Tue, 21 Dec 2010 23:08:36 GMT"
Content-Transfer-Encoding: base64
RnJvbSA0OTk4ODhkZjFhNTI0OTFjMjAxMDc3YzhhMGY4MzEwYjcwNTgzMjkwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBwaGlsaXAgPHBoaWxpcEBwaGlsaXAtbGFwdG9wLihub25lKT4K
RGF0ZTogU2F0LCAxMSBEZWMgMjAxMCAxNjo1ODo1OSAtMDgwMApTdWJqZWN0OiBbUEFUQ0hdIHNk
aGNpOiBBZGQgcHJlIGFuZCBwb3N0IHJlc2V0IHByb2Nlc3NpbmcgZm9yIGNoaXAgc3BlY2lmaWMg
cmVzZXQKCk1hcnZlbGwgcHhhIGNvbnRyb2xsZXJzIGhhdmUgcHJpdmF0ZSByZWdpc3RlcnMgdGhh
dCBuZWVkIHRvIGJlCnRvdWNoZWQgYmVmb3JlIGFuZCBhZnRlciBhIHJlc2V0IGlzIGRvbmUuICBJ
bXBsZW1lbnQgaG9va3MKdG8gYWxsb3cgdGhpcyB0byBoYXBwZW4uCgpTaWduZWQtb2ZmLWJ5OiBw
aGlsaXAgPHBoaWxpcEBwaGlsaXAtbGFwdG9wLihub25lKT4KLS0tCiBkcml2ZXJzL21tYy9ob3N0
L3NkaGNpLmMgfCAgICA2ICsrKysrKwogZHJpdmVycy9tbWMvaG9zdC9zZGhjaS5oIHwgICAgMiAr
KwogMiBmaWxlcyBjaGFuZ2VkLCA4IGluc2VydGlvbnMoKyksIDAgZGVsZXRpb25zKC0pCgpkaWZm
IC0tZ2l0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