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.h69
1 files changed, 35 insertions, 34 deletions
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
index 7ccad0795466..2a196982601f 100644
--- a/include/linux/tifm.h
+++ b/include/linux/tifm.h
@@ -14,16 +14,16 @@
14 14
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/wait.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/pci.h> 18#include <linux/pci.h>
20#include <linux/kthread.h> 19#include <linux/workqueue.h>
21 20
22/* Host registers (relative to pci base address): */ 21/* Host registers (relative to pci base address): */
23enum { 22enum {
24 FM_SET_INTERRUPT_ENABLE = 0x008, 23 FM_SET_INTERRUPT_ENABLE = 0x008,
25 FM_CLEAR_INTERRUPT_ENABLE = 0x00c, 24 FM_CLEAR_INTERRUPT_ENABLE = 0x00c,
26 FM_INTERRUPT_STATUS = 0x014 }; 25 FM_INTERRUPT_STATUS = 0x014
26};
27 27
28/* Socket registers (relative to socket base address): */ 28/* Socket registers (relative to socket base address): */
29enum { 29enum {
@@ -58,7 +58,8 @@ enum {
58 SOCK_MS_DATA = 0x188, 58 SOCK_MS_DATA = 0x188,
59 SOCK_MS_STATUS = 0x18c, 59 SOCK_MS_STATUS = 0x18c,
60 SOCK_MS_SYSTEM = 0x190, 60 SOCK_MS_SYSTEM = 0x190,
61 SOCK_FIFO_ACCESS = 0x200 }; 61 SOCK_FIFO_ACCESS = 0x200
62};
62 63
63#define TIFM_CTRL_LED 0x00000040 64#define TIFM_CTRL_LED 0x00000040
64#define TIFM_CTRL_FAST_CLK 0x00000100 65#define TIFM_CTRL_FAST_CLK 0x00000100
@@ -66,14 +67,14 @@ enum {
66#define TIFM_SOCK_STATE_OCCUPIED 0x00000008 67#define TIFM_SOCK_STATE_OCCUPIED 0x00000008
67#define TIFM_SOCK_STATE_POWERED 0x00000080 68#define TIFM_SOCK_STATE_POWERED 0x00000080
68 69
69#define TIFM_FIFO_ENABLE 0x00000001 /* Meaning of this constant is unverified */ 70#define TIFM_FIFO_ENABLE 0x00000001
70#define TIFM_FIFO_READY 0x00000001 /* Meaning of this constant is unverified */ 71#define TIFM_FIFO_READY 0x00000001
71#define TIFM_FIFO_INT_SETALL 0x0000ffff 72#define TIFM_FIFO_INT_SETALL 0x0000ffff
72#define TIFM_FIFO_INTMASK 0x00000005 /* Meaning of this constant is unverified */ 73#define TIFM_FIFO_INTMASK 0x00000005
73 74
74#define TIFM_DMA_RESET 0x00000002 /* Meaning of this constant is unverified */ 75#define TIFM_DMA_RESET 0x00000002
75#define TIFM_DMA_TX 0x00008000 /* Meaning of this constant is unverified */ 76#define TIFM_DMA_TX 0x00008000
76#define TIFM_DMA_EN 0x00000001 /* Meaning of this constant is unverified */ 77#define TIFM_DMA_EN 0x00000001
77#define TIFM_DMA_TSIZE 0x0000007f 78#define TIFM_DMA_TSIZE 0x0000007f
78 79
79#define TIFM_TYPE_XD 1 80#define TIFM_TYPE_XD 1
@@ -86,44 +87,44 @@ struct tifm_device_id {
86 87
87struct tifm_driver; 88struct tifm_driver;
88struct tifm_dev { 89struct tifm_dev {
89 char __iomem *addr; 90 char __iomem *addr;
90 spinlock_t lock; 91 spinlock_t lock;
91 unsigned char type; 92 unsigned char type;
92 unsigned int socket_id; 93 unsigned int socket_id;
93 94
94 void (*card_event)(struct tifm_dev *sock); 95 void (*card_event)(struct tifm_dev *sock);
95 void (*data_event)(struct tifm_dev *sock); 96 void (*data_event)(struct tifm_dev *sock);
96 97
97 struct device dev; 98 struct device dev;
98}; 99};
99 100
100struct tifm_driver { 101struct tifm_driver {
101 struct tifm_device_id *id_table; 102 struct tifm_device_id *id_table;
102 int (*probe)(struct tifm_dev *dev); 103 int (*probe)(struct tifm_dev *dev);
103 void (*remove)(struct tifm_dev *dev); 104 void (*remove)(struct tifm_dev *dev);
104 int (*suspend)(struct tifm_dev *dev, 105 int (*suspend)(struct tifm_dev *dev,
105 pm_message_t state); 106 pm_message_t state);
106 int (*resume)(struct tifm_dev *dev); 107 int (*resume)(struct tifm_dev *dev);
107 108
108 struct device_driver driver; 109 struct device_driver driver;
109}; 110};
110 111
111struct tifm_adapter { 112struct tifm_adapter {
112 char __iomem *addr; 113 char __iomem *addr;
113 spinlock_t lock; 114 spinlock_t lock;
114 unsigned int irq_status; 115 unsigned int irq_status;
115 unsigned int socket_change_set; 116 unsigned int socket_change_set;
116 unsigned int id; 117 unsigned int id;
117 unsigned int num_sockets; 118 unsigned int num_sockets;
118 struct completion *finish_me; 119 struct completion *finish_me;
119 120
120 struct work_struct media_switcher; 121 struct work_struct media_switcher;
121 struct class_device cdev; 122 struct class_device cdev;
122 123
123 void (*eject)(struct tifm_adapter *fm, 124 void (*eject)(struct tifm_adapter *fm,
124 struct tifm_dev *sock); 125 struct tifm_dev *sock);
125 126
126 struct tifm_dev *sockets[0]; 127 struct tifm_dev *sockets[0];
127}; 128};
128 129
129struct tifm_adapter *tifm_alloc_adapter(unsigned int num_sockets, 130struct tifm_adapter *tifm_alloc_adapter(unsigned int num_sockets,
@@ -147,7 +148,7 @@ void tifm_queue_work(struct work_struct *work);
147 148
148static inline void *tifm_get_drvdata(struct tifm_dev *dev) 149static inline void *tifm_get_drvdata(struct tifm_dev *dev)
149{ 150{
150 return dev_get_drvdata(&dev->dev); 151 return dev_get_drvdata(&dev->dev);
151} 152}
152 153
153static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data) 154static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data)