summaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-05-26 13:48:18 +0200
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 19:45:31 +0200
commite29a7d73f4277eb92aa64e17017dea33460828ef (patch)
tree0b8cfe6d145f41c43f86b475fff86627a305af1e /include/linux/mmc
parentb2bcc798bbb482b2909801280f3c4aff8cbbf5be (diff)
downloadop-kernel-dev-e29a7d73f4277eb92aa64e17017dea33460828ef.zip
op-kernel-dev-e29a7d73f4277eb92aa64e17017dea33460828ef.tar.gz
mmc: basic SDIO device model
Add the sdio bus type and basic device handling. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/card.h7
-rw-r--r--include/linux/mmc/sdio_func.h35
2 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 43480eb..9f5f744 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -56,6 +56,9 @@ struct sd_switch_caps {
};
struct mmc_host;
+struct sdio_func;
+
+#define SDIO_MAX_FUNCS 7
/*
* MMC device
@@ -73,6 +76,7 @@ struct mmc_card {
#define MMC_STATE_READONLY (1<<1) /* card is read-only */
#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */
#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
+
u32 raw_cid[4]; /* raw card CID */
u32 raw_csd[4]; /* raw card CSD */
u32 raw_scr[2]; /* raw card SCR */
@@ -81,6 +85,9 @@ struct mmc_card {
struct mmc_ext_csd ext_csd; /* mmc v4 extended card specific */
struct sd_scr scr; /* extra SD information */
struct sd_switch_caps sw_caps; /* switch (CMD6) caps */
+
+ unsigned int sdio_funcs; /* number of SDIO functions */
+ struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */
};
#define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC)
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
new file mode 100644
index 0000000..50c78db
--- /dev/null
+++ b/include/linux/mmc/sdio_func.h
@@ -0,0 +1,35 @@
+/*
+ * include/linux/mmc/sdio_func.h
+ *
+ * Copyright 2007 Pierre Ossman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+#ifndef MMC_SDIO_FUNC_H
+#define MMC_SDIO_FUNC_H
+
+struct mmc_card;
+
+/*
+ * SDIO function devices
+ */
+struct sdio_func {
+ struct mmc_card *card; /* the card this device belongs to */
+ struct device dev; /* the device */
+ unsigned int num; /* function number */
+ unsigned int state; /* function state */
+#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
+};
+
+#define sdio_func_present(f) ((f)->state & SDIO_STATE_PRESENT)
+
+#define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT)
+
+#define sdio_func_id(f) ((f)->dev.bus_id)
+
+#endif
+
OpenPOWER on IntegriCloud