6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
#ifndef _LINUX_UWB_UMC_H_
#define _LINUX_UWB_UMC_H_
#include <linux/device.h>
#include <linux/pci.h>
#define UMC_CAP_ID_WHCI_RC 0x00 /* radio controller */
#define UMC_CAP_ID_WHCI_WUSB_HC 0x01 /* WUSB host controller */
struct umc_dev {
u16 version;
u8 cap_id;
u8 bar;
struct resource resource;
unsigned irq;
struct device dev;
};
#define to_umc_dev(d) container_of(d, struct umc_dev, dev)
struct umc_driver {
char *name;
u8 cap_id;
int (*match)(struct umc_driver *, struct umc_dev *);
const void *match_data;
int (*probe)(struct umc_dev *);
void (*remove)(struct umc_dev *);
int (*suspend)(struct umc_dev *, pm_message_t state);
int (*resume)(struct umc_dev *);
int (*pre_reset)(struct umc_dev *);
int (*post_reset)(struct umc_dev *);
struct device_driver driver;
};
#define to_umc_driver(d) container_of(d, struct umc_driver, driver)
extern struct bus_type umc_bus_type;
struct umc_dev *umc_device_create(struct device *parent, int n);
int __must_check umc_device_register(struct umc_dev *umc);
void umc_device_unregister(struct umc_dev *umc);
int __must_check __umc_driver_register(struct umc_driver *umc_drv,
struct module *mod,
const char *mod_name);
#define umc_driver_register(umc_drv) \
__umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME)
void umc_driver_unregister(struct umc_driver *umc_drv);
int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc);
static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev)
{
struct pci_dev *pci_dev = NULL;
if (dev_is_pci(umc_dev->dev.parent))
pci_dev = to_pci_dev(umc_dev->dev.parent);
return pci_dev;
}
static inline struct umc_dev *umc_dev_get(struct umc_dev *umc_dev)
{
get_device(&umc_dev->dev);
return umc_dev;
}
static inline void umc_dev_put(struct umc_dev *umc_dev)
{
put_device(&umc_dev->dev);
}
static inline void umc_set_drvdata(struct umc_dev *umc_dev, void *data)
{
dev_set_drvdata(&umc_dev->dev, data);
}
static inline void *umc_get_drvdata(struct umc_dev *umc_dev)
{
return dev_get_drvdata(&umc_dev->dev);
}
int umc_controller_reset(struct umc_dev *umc);
#endif /* #ifndef _LINUX_UWB_UMC_H_ */
|