summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-06-16 15:54:55 +0200
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 20:51:27 +0200
commit3b38bea0d976513970f947806b08b9faca418e7a (patch)
treef542a7e3dfe206be4de9f7ca6ebc23d25a196731 /include
parent26074962e8f547b96614dbe248748ba2a1996ca3 (diff)
downloadlinux-3b38bea0d976513970f947806b08b9faca418e7a.tar.gz
linux-3b38bea0d976513970f947806b08b9faca418e7a.tar.bz2
linux-3b38bea0d976513970f947806b08b9faca418e7a.zip
sdio: add device id table and matching
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/sdio_func.h30
-rw-r--r--include/linux/mod_devicetable.h11
2 files changed, 40 insertions, 1 deletions
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 2f2b3c854415..8106d399c414 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -12,6 +12,9 @@
#ifndef MMC_SDIO_FUNC_H
#define MMC_SDIO_FUNC_H
+#include <linux/device.h>
+#include <linux/mod_devicetable.h>
+
struct mmc_card;
/*
@@ -58,13 +61,38 @@ struct sdio_func {
*/
struct sdio_driver {
char *name;
+ const struct sdio_device_id *id_table;
- int (*probe)(struct sdio_func *);
+ int (*probe)(struct sdio_func *, const struct sdio_device_id *);
void (*remove)(struct sdio_func *);
struct device_driver drv;
};
+/**
+ * SDIO_DEVICE - macro used to describe a specific SDIO device
+ * @vend: the 16 bit manufacturer code
+ * @dev: the 16 bit function id
+ *
+ * This macro is used to create a struct sdio_device_id that matches a
+ * specific device. The class field will be set to SDIO_ANY_ID.
+ */
+#define SDIO_DEVICE(vend,dev) \
+ .class = SDIO_ANY_ID, \
+ .vendor = (vend), .device = (dev)
+
+/**
+ * SDIO_DEVICE_CLASS - macro used to describe a specific SDIO device class
+ * @dev_class: the 8 bit standard interface code
+ *
+ * This macro is used to create a struct sdio_device_id that matches a
+ * specific standard SDIO function type. The vendor and device fields will
+ * be set to SDIO_ANY_ID.
+ */
+#define SDIO_DEVICE_CLASS(dev_class) \
+ .class = (dev_class), \
+ .vendor = SDIO_ANY_ID, .device = SDIO_ANY_ID
+
extern int sdio_register_driver(struct sdio_driver *);
extern void sdio_unregister_driver(struct sdio_driver *);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 4dc5fa8be781..e47e5951058b 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -340,4 +340,15 @@ struct parisc_device_id {
#define PA_HVERSION_ANY_ID 0xffff
#define PA_SVERSION_ANY_ID 0xffffffff
+/* SDIO */
+
+#define SDIO_ANY_ID (~0)
+
+struct sdio_device_id {
+ __u8 class; /* Standard interface or SDIO_ANY_ID */
+ __u16 vendor; /* Vendor or SDIO_ANY_ID */
+ __u16 device; /* Device ID or SDIO_ANY_ID */
+ kernel_ulong_t driver_data; /* Data private to the driver */
+};
+
#endif /* LINUX_MOD_DEVICETABLE_H */