]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mmc/sdio_func.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6-omap-h63xx.git] / include / linux / mmc / sdio_func.h
index 8106d399c4147f5e9b5bdd5a8a6997e67730cc5f..451bdfc858306089f65b4f10b5f9e3b1a159da25 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  include/linux/mmc/sdio_func.h
  *
- *  Copyright 2007 Pierre Ossman
+ *  Copyright 2007-2008 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
@@ -16,6 +16,9 @@
 #include <linux/mod_devicetable.h>
 
 struct mmc_card;
+struct sdio_func;
+
+typedef void (sdio_irq_handler_t)(struct sdio_func *);
 
 /*
  * SDIO function CIS tuple (unknown to the core)
@@ -33,17 +36,26 @@ struct sdio_func_tuple {
 struct sdio_func {
        struct mmc_card         *card;          /* the card this device belongs to */
        struct device           dev;            /* the device */
+       sdio_irq_handler_t      *irq_handler;   /* IRQ callback */
        unsigned int            num;            /* function number */
 
        unsigned char           class;          /* standard interface class */
        unsigned short          vendor;         /* vendor id */
        unsigned short          device;         /* device id */
 
-       unsigned short          blksize;        /* maximum block size */
+       unsigned                max_blksize;    /* maximum block size */
+       unsigned                cur_blksize;    /* current block size */
+
+       unsigned                enable_timeout; /* max enable timeout in msec */
 
        unsigned int            state;          /* function state */
 #define SDIO_STATE_PRESENT     (1<<0)          /* present in sysfs */
 
+       u8                      tmpbuf[4];      /* DMA:able scratch buffer */
+
+       unsigned                num_info;       /* number of info strings */
+       const char              **info;         /* info strings */
+
        struct sdio_func_tuple *tuples;
 };
 
@@ -51,7 +63,7 @@ struct sdio_func {
 
 #define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT)
 
-#define sdio_func_id(f)                ((f)->dev.bus_id)
+#define sdio_func_id(f)                (dev_name(&(f)->dev))
 
 #define sdio_get_drvdata(f)    dev_get_drvdata(&(f)->dev)
 #define sdio_set_drvdata(f,d)  dev_set_drvdata(&(f)->dev, d)
@@ -105,10 +117,37 @@ extern void sdio_release_host(struct sdio_func *func);
 extern int sdio_enable_func(struct sdio_func *func);
 extern int sdio_disable_func(struct sdio_func *func);
 
-extern unsigned char sdio_readb(struct sdio_func *func,
+extern int sdio_set_block_size(struct sdio_func *func, unsigned blksz);
+
+extern int sdio_claim_irq(struct sdio_func *func, sdio_irq_handler_t *handler);
+extern int sdio_release_irq(struct sdio_func *func);
+
+extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz);
+
+extern u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret);
+extern u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret);
+extern u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret);
+
+extern int sdio_memcpy_fromio(struct sdio_func *func, void *dst,
+       unsigned int addr, int count);
+extern int sdio_readsb(struct sdio_func *func, void *dst,
+       unsigned int addr, int count);
+
+extern void sdio_writeb(struct sdio_func *func, u8 b,
+       unsigned int addr, int *err_ret);
+extern void sdio_writew(struct sdio_func *func, u16 b,
        unsigned int addr, int *err_ret);
+extern void sdio_writel(struct sdio_func *func, u32 b,
+       unsigned int addr, int *err_ret);
+
+extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr,
+       void *src, int count);
+extern int sdio_writesb(struct sdio_func *func, unsigned int addr,
+       void *src, int count);
 
-extern void sdio_writeb(struct sdio_func *func, unsigned char b,
+extern unsigned char sdio_f0_readb(struct sdio_func *func,
+       unsigned int addr, int *err_ret);
+extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
        unsigned int addr, int *err_ret);
 
 #endif