aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tifm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tifm.h')
-rw-r--r--include/linux/tifm.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
index dfb8052eee5e..3deb0a6c1370 100644
--- a/include/linux/tifm.h
+++ b/include/linux/tifm.h
@@ -17,7 +17,7 @@
17#include <linux/wait.h> 17#include <linux/wait.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/scatterlist.h> 20#include <linux/kthread.h>
21 21
22/* Host registers (relative to pci base address): */ 22/* Host registers (relative to pci base address): */
23enum { 23enum {
@@ -62,11 +62,10 @@ enum {
62 62
63 63
64#define TIFM_IRQ_ENABLE 0x80000000 64#define TIFM_IRQ_ENABLE 0x80000000
65#define TIFM_IRQ_SOCKMASK 0x00000001 65#define TIFM_IRQ_SOCKMASK(x) (x)
66#define TIFM_IRQ_CARDMASK 0x00000100 66#define TIFM_IRQ_CARDMASK(x) ((x) << 8)
67#define TIFM_IRQ_FIFOMASK 0x00010000 67#define TIFM_IRQ_FIFOMASK(x) ((x) << 16)
68#define TIFM_IRQ_SETALL 0xffffffff 68#define TIFM_IRQ_SETALL 0xffffffff
69#define TIFM_IRQ_SETALLSOCK 0x0000000f
70 69
71#define TIFM_CTRL_LED 0x00000040 70#define TIFM_CTRL_LED 0x00000040
72#define TIFM_CTRL_FAST_CLK 0x00000100 71#define TIFM_CTRL_FAST_CLK 0x00000100
@@ -89,10 +88,9 @@ struct tifm_dev {
89 char __iomem *addr; 88 char __iomem *addr;
90 spinlock_t lock; 89 spinlock_t lock;
91 tifm_media_id media_id; 90 tifm_media_id media_id;
92 char wq_name[KOBJ_NAME_LEN]; 91 unsigned int socket_id;
93 struct workqueue_struct *wq;
94 92
95 unsigned int (*signal_irq)(struct tifm_dev *sock, 93 void (*signal_irq)(struct tifm_dev *sock,
96 unsigned int sock_irq_status); 94 unsigned int sock_irq_status);
97 95
98 struct tifm_driver *drv; 96 struct tifm_driver *drv;
@@ -103,24 +101,23 @@ struct tifm_driver {
103 tifm_media_id *id_table; 101 tifm_media_id *id_table;
104 int (*probe)(struct tifm_dev *dev); 102 int (*probe)(struct tifm_dev *dev);
105 void (*remove)(struct tifm_dev *dev); 103 void (*remove)(struct tifm_dev *dev);
104 int (*suspend)(struct tifm_dev *dev,
105 pm_message_t state);
106 int (*resume)(struct tifm_dev *dev);
106 107
107 struct device_driver driver; 108 struct device_driver driver;
108}; 109};
109 110
110struct tifm_adapter { 111struct tifm_adapter {
111 char __iomem *addr; 112 char __iomem *addr;
112 unsigned int irq_status;
113 unsigned int insert_mask;
114 unsigned int remove_mask;
115 spinlock_t lock; 113 spinlock_t lock;
114 unsigned int irq_status;
115 unsigned int socket_change_set;
116 wait_queue_head_t change_set_notify;
116 unsigned int id; 117 unsigned int id;
117 unsigned int max_sockets; 118 unsigned int num_sockets;
118 char wq_name[KOBJ_NAME_LEN];
119 unsigned int inhibit_new_cards;
120 struct workqueue_struct *wq;
121 struct work_struct media_inserter;
122 struct work_struct media_remover;
123 struct tifm_dev **sockets; 119 struct tifm_dev **sockets;
120 struct task_struct *media_switcher;
124 struct class_device cdev; 121 struct class_device cdev;
125 struct device *dev; 122 struct device *dev;
126 123
@@ -130,9 +127,9 @@ struct tifm_adapter {
130struct tifm_adapter *tifm_alloc_adapter(void); 127struct tifm_adapter *tifm_alloc_adapter(void);
131void tifm_free_device(struct device *dev); 128void tifm_free_device(struct device *dev);
132void tifm_free_adapter(struct tifm_adapter *fm); 129void tifm_free_adapter(struct tifm_adapter *fm);
133int tifm_add_adapter(struct tifm_adapter *fm); 130int tifm_add_adapter(struct tifm_adapter *fm, int (*mediathreadfn)(void *data));
134void tifm_remove_adapter(struct tifm_adapter *fm); 131void tifm_remove_adapter(struct tifm_adapter *fm);
135struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id); 132struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm);
136int tifm_register_driver(struct tifm_driver *drv); 133int tifm_register_driver(struct tifm_driver *drv);
137void tifm_unregister_driver(struct tifm_driver *drv); 134void tifm_unregister_driver(struct tifm_driver *drv);
138void tifm_eject(struct tifm_dev *sock); 135void tifm_eject(struct tifm_dev *sock);