]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/tifm.h
tifm: use bus methods to handle probe/remove instead of driver ones.
[linux-2.6-omap-h63xx.git] / include / linux / tifm.h
index eaf9e1f48780470c7efbf5f940d604445e2f6a06..ee1056396b959e2c1a97ec8a275112db792d4685 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/wait.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <linux/scatterlist.h>
+#include <linux/kthread.h>
 
 /* Host registers (relative to pci base address): */
 enum {
@@ -60,13 +60,6 @@ enum {
        SOCK_MS_SYSTEM                 = 0x190,
        SOCK_FIFO_ACCESS               = 0x200 };
 
-
-#define TIFM_IRQ_ENABLE           0x80000000
-#define TIFM_IRQ_SOCKMASK(x)      (x)
-#define TIFM_IRQ_CARDMASK(x)      ((x) << 8)
-#define TIFM_IRQ_FIFOMASK(x)      ((x) << 16)
-#define TIFM_IRQ_SETALL           0xffffffff
-
 #define TIFM_CTRL_LED             0x00000040
 #define TIFM_CTRL_FAST_CLK        0x00000100
 
@@ -90,10 +83,9 @@ struct tifm_dev {
        tifm_media_id           media_id;
        unsigned int            socket_id;
 
-       void                    (*signal_irq)(struct tifm_dev *sock,
-                                             unsigned int sock_irq_status);
+       void          (*card_event)(struct tifm_dev *sock);
+       void          (*data_event)(struct tifm_dev *sock);
 
-       struct tifm_driver      *drv;
        struct device           dev;
 };
 
@@ -101,6 +93,9 @@ struct tifm_driver {
        tifm_media_id        *id_table;
        int                  (*probe)(struct tifm_dev *dev);
        void                 (*remove)(struct tifm_dev *dev);
+       int                  (*suspend)(struct tifm_dev *dev,
+                                        pm_message_t state);
+       int                  (*resume)(struct tifm_dev *dev);
 
        struct device_driver driver;
 };
@@ -110,13 +105,11 @@ struct tifm_adapter {
        spinlock_t              lock;
        unsigned int            irq_status;
        unsigned int            socket_change_set;
+       wait_queue_head_t       change_set_notify;
        unsigned int            id;
        unsigned int            num_sockets;
        struct tifm_dev         **sockets;
-       char                    wq_name[KOBJ_NAME_LEN];
-       unsigned int            inhibit_new_cards;
-       struct workqueue_struct *wq;
-       struct work_struct      media_switcher;
+       struct task_struct      *media_switcher;
        struct class_device     cdev;
        struct device           *dev;
 
@@ -126,7 +119,7 @@ struct tifm_adapter {
 struct tifm_adapter *tifm_alloc_adapter(void);
 void tifm_free_device(struct device *dev);
 void tifm_free_adapter(struct tifm_adapter *fm);
-int tifm_add_adapter(struct tifm_adapter *fm);
+int tifm_add_adapter(struct tifm_adapter *fm, int (*mediathreadfn)(void *data));
 void tifm_remove_adapter(struct tifm_adapter *fm);
 struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm);
 int tifm_register_driver(struct tifm_driver *drv);