Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sdmmc Provide a method for attachments to specify ca...
details: https://anonhg.NetBSD.org/src/rev/519fd12d5d46
branches: trunk
changeset: 780365:519fd12d5d46
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Jul 21 16:14:05 2012 +0000
description:
Provide a method for attachments to specify capabilites.
diffstat:
sys/dev/sdmmc/sdhc.c | 14 +++++++++-----
sys/dev/sdmmc/sdhcvar.h | 5 ++++-
2 files changed, 13 insertions(+), 6 deletions(-)
diffs (55 lines):
diff -r c3e150c1e692 -r 519fd12d5d46 sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c Sat Jul 21 14:52:40 2012 +0000
+++ b/sys/dev/sdmmc/sdhc.c Sat Jul 21 16:14:05 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdhc.c,v 1.23 2012/07/20 02:04:13 matt Exp $ */
+/* $NetBSD: sdhc.c,v 1.24 2012/07/21 16:14:05 skrll Exp $ */
/* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */
/*
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.23 2012/07/20 02:04:13 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.24 2012/07/21 16:14:05 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -292,9 +292,13 @@
(void)sdhc_host_reset(hp);
/* Determine host capabilities. */
- mutex_enter(&hp->host_mtx);
- caps = HREAD4(hp, SDHC_CAPABILITIES);
- mutex_exit(&hp->host_mtx);
+ if (ISSET(sc->sc_flags, SDHC_FLAG_HOSTCAPS)) {
+ caps = sc->sc_caps;
+ } else {
+ mutex_enter(&hp->host_mtx);
+ caps = HREAD4(hp, SDHC_CAPABILITIES);
+ mutex_exit(&hp->host_mtx);
+ }
/* Use DMA if the host system and the controller support it. */
if (ISSET(sc->sc_flags, SDHC_FLAG_FORCE_DMA)
diff -r c3e150c1e692 -r 519fd12d5d46 sys/dev/sdmmc/sdhcvar.h
--- a/sys/dev/sdmmc/sdhcvar.h Sat Jul 21 14:52:40 2012 +0000
+++ b/sys/dev/sdmmc/sdhcvar.h Sat Jul 21 16:14:05 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdhcvar.h,v 1.7 2012/07/12 03:05:49 matt Exp $ */
+/* $NetBSD: sdhcvar.h,v 1.8 2012/07/21 16:14:05 skrll Exp $ */
/* $OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $ */
/*
@@ -44,7 +44,10 @@
#define SDHC_FLAG_8BIT_MODE 0x0040 /* MMC 8bit mode is supported */
#define SDHC_FLAG_HAVE_CGM 0x0080 /* Netlogic XLP */
#define SDHC_FLAG_NO_LED_ON 0x0100 /* LED_ON unsupported in HOST_CTL */
+#define SDHC_FLAG_HOSTCAPS 0x0200 /* No device provided capabilities */
+
uint32_t sc_clkbase;
+ uint32_t sc_caps;/* attachment provided capabilities */
};
/* Host controller functions called by the attachment driver. */
Home |
Main Index |
Thread Index |
Old Index