]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Linux Plug and Play Support | |
3 | * Copyright by Adam Belay <ambx1@neo.rr.com> | |
1f32ca31 BH |
4 | * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. |
5 | * Bjorn Helgaas <bjorn.helgaas@hp.com> | |
1da177e4 LT |
6 | */ |
7 | ||
8 | #ifndef _LINUX_PNP_H | |
9 | #define _LINUX_PNP_H | |
10 | ||
1da177e4 LT |
11 | #include <linux/device.h> |
12 | #include <linux/list.h> | |
13 | #include <linux/errno.h> | |
14 | #include <linux/mod_devicetable.h> | |
15 | ||
1da177e4 LT |
16 | #define PNP_NAME_LEN 50 |
17 | ||
18 | struct pnp_protocol; | |
19 | struct pnp_dev; | |
20 | ||
1da177e4 LT |
21 | /* |
22 | * Resource Management | |
23 | */ | |
ef3d7714 | 24 | #ifdef CONFIG_PNP |
b563cf59 RH |
25 | struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type, |
26 | unsigned int num); | |
ef3d7714 | 27 | #else |
b563cf59 RH |
28 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, |
29 | unsigned long type, unsigned int num) | |
ef3d7714 DM |
30 | { |
31 | return NULL; | |
32 | } | |
33 | #endif | |
1da177e4 | 34 | |
13575e81 BH |
35 | static inline int pnp_resource_valid(struct resource *res) |
36 | { | |
aee3ad81 BH |
37 | if (res) |
38 | return 1; | |
39 | return 0; | |
40 | } | |
41 | ||
42 | static inline int pnp_resource_enabled(struct resource *res) | |
43 | { | |
44 | if (res && !(res->flags & IORESOURCE_DISABLED)) | |
13575e81 BH |
45 | return 1; |
46 | return 0; | |
47 | } | |
48 | ||
49 | static inline resource_size_t pnp_resource_len(struct resource *res) | |
50 | { | |
51 | if (res->start == 0 && res->end == 0) | |
52 | return 0; | |
53 | return res->end - res->start + 1; | |
54 | } | |
55 | ||
56 | ||
57 | static inline resource_size_t pnp_port_start(struct pnp_dev *dev, | |
58 | unsigned int bar) | |
59 | { | |
20bfdbba BH |
60 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); |
61 | ||
62 | if (pnp_resource_valid(res)) | |
63 | return res->start; | |
64 | return 0; | |
13575e81 BH |
65 | } |
66 | ||
67 | static inline resource_size_t pnp_port_end(struct pnp_dev *dev, | |
68 | unsigned int bar) | |
69 | { | |
20bfdbba BH |
70 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); |
71 | ||
72 | if (pnp_resource_valid(res)) | |
73 | return res->end; | |
74 | return 0; | |
13575e81 BH |
75 | } |
76 | ||
77 | static inline unsigned long pnp_port_flags(struct pnp_dev *dev, | |
78 | unsigned int bar) | |
79 | { | |
20bfdbba BH |
80 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); |
81 | ||
82 | if (pnp_resource_valid(res)) | |
83 | return res->flags; | |
aee3ad81 | 84 | return IORESOURCE_IO | IORESOURCE_AUTO; |
13575e81 BH |
85 | } |
86 | ||
87 | static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar) | |
88 | { | |
89 | return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_IO, bar)); | |
90 | } | |
91 | ||
92 | static inline resource_size_t pnp_port_len(struct pnp_dev *dev, | |
93 | unsigned int bar) | |
94 | { | |
20bfdbba BH |
95 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); |
96 | ||
97 | if (pnp_resource_valid(res)) | |
98 | return pnp_resource_len(res); | |
99 | return 0; | |
13575e81 BH |
100 | } |
101 | ||
102 | ||
103 | static inline resource_size_t pnp_mem_start(struct pnp_dev *dev, | |
104 | unsigned int bar) | |
105 | { | |
20bfdbba BH |
106 | struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); |
107 | ||
108 | if (pnp_resource_valid(res)) | |
109 | return res->start; | |
110 | return 0; | |
13575e81 BH |
111 | } |
112 | ||
113 | static inline resource_size_t pnp_mem_end(struct pnp_dev *dev, | |
114 | unsigned int bar) | |
115 | { | |
20bfdbba BH |
116 | struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); |
117 | ||
118 | if (pnp_resource_valid(res)) | |
119 | return res->end; | |
120 | return 0; | |
13575e81 BH |
121 | } |
122 | ||
123 | static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar) | |
124 | { | |
20bfdbba BH |
125 | struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); |
126 | ||
127 | if (pnp_resource_valid(res)) | |
128 | return res->flags; | |
aee3ad81 | 129 | return IORESOURCE_MEM | IORESOURCE_AUTO; |
13575e81 BH |
130 | } |
131 | ||
132 | static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar) | |
133 | { | |
134 | return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_MEM, bar)); | |
135 | } | |
136 | ||
137 | static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, | |
138 | unsigned int bar) | |
139 | { | |
20bfdbba BH |
140 | struct resource *res = pnp_get_resource(dev, IORESOURCE_MEM, bar); |
141 | ||
142 | if (pnp_resource_valid(res)) | |
143 | return pnp_resource_len(res); | |
144 | return 0; | |
13575e81 BH |
145 | } |
146 | ||
147 | ||
148 | static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) | |
149 | { | |
20bfdbba BH |
150 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); |
151 | ||
152 | if (pnp_resource_valid(res)) | |
153 | return res->start; | |
154 | return -1; | |
13575e81 BH |
155 | } |
156 | ||
157 | static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar) | |
158 | { | |
20bfdbba BH |
159 | struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); |
160 | ||
161 | if (pnp_resource_valid(res)) | |
162 | return res->flags; | |
aee3ad81 | 163 | return IORESOURCE_IRQ | IORESOURCE_AUTO; |
13575e81 BH |
164 | } |
165 | ||
166 | static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar) | |
167 | { | |
168 | return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_IRQ, bar)); | |
169 | } | |
170 | ||
171 | ||
172 | static inline resource_size_t pnp_dma(struct pnp_dev *dev, unsigned int bar) | |
173 | { | |
20bfdbba BH |
174 | struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar); |
175 | ||
176 | if (pnp_resource_valid(res)) | |
177 | return res->start; | |
178 | return -1; | |
13575e81 BH |
179 | } |
180 | ||
181 | static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar) | |
182 | { | |
20bfdbba BH |
183 | struct resource *res = pnp_get_resource(dev, IORESOURCE_DMA, bar); |
184 | ||
185 | if (pnp_resource_valid(res)) | |
186 | return res->flags; | |
aee3ad81 | 187 | return IORESOURCE_DMA | IORESOURCE_AUTO; |
13575e81 BH |
188 | } |
189 | ||
190 | static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar) | |
191 | { | |
192 | return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_DMA, bar)); | |
193 | } | |
1da177e4 | 194 | |
1da177e4 | 195 | |
1da177e4 | 196 | /* |
fd3f8984 | 197 | * Device Management |
1da177e4 LT |
198 | */ |
199 | ||
200 | struct pnp_card { | |
07d4e9af BH |
201 | struct device dev; /* Driver Model device interface */ |
202 | unsigned char number; /* used as an index, must be unique */ | |
1da177e4 LT |
203 | struct list_head global_list; /* node in global list of cards */ |
204 | struct list_head protocol_list; /* node in protocol's list of cards */ | |
205 | struct list_head devices; /* devices attached to the card */ | |
206 | ||
9dd78466 | 207 | struct pnp_protocol *protocol; |
07d4e9af | 208 | struct pnp_id *id; /* contains supported EISA IDs */ |
1da177e4 LT |
209 | |
210 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ | |
07d4e9af | 211 | unsigned char pnpver; /* Plug & Play version */ |
9dd78466 | 212 | unsigned char productver; /* product version */ |
07d4e9af BH |
213 | unsigned int serial; /* serial number */ |
214 | unsigned char checksum; /* if zero - checksum passed */ | |
1da177e4 LT |
215 | struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ |
216 | }; | |
217 | ||
218 | #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list) | |
219 | #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list) | |
220 | #define to_pnp_card(n) container_of(n, struct pnp_card, dev) | |
221 | #define pnp_for_each_card(card) \ | |
222 | for((card) = global_to_pnp_card(pnp_cards.next); \ | |
223 | (card) != global_to_pnp_card(&pnp_cards); \ | |
224 | (card) = global_to_pnp_card((card)->global_list.next)) | |
225 | ||
226 | struct pnp_card_link { | |
9dd78466 BH |
227 | struct pnp_card *card; |
228 | struct pnp_card_driver *driver; | |
229 | void *driver_data; | |
4c98cfef | 230 | pm_message_t pm_state; |
1da177e4 LT |
231 | }; |
232 | ||
9dd78466 | 233 | static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard) |
1da177e4 LT |
234 | { |
235 | return pcard->driver_data; | |
236 | } | |
237 | ||
9dd78466 | 238 | static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data) |
1da177e4 LT |
239 | { |
240 | pcard->driver_data = data; | |
241 | } | |
242 | ||
243 | struct pnp_dev { | |
07d4e9af | 244 | struct device dev; /* Driver Model device interface */ |
2e17c550 | 245 | u64 dma_mask; |
544451a1 | 246 | unsigned int number; /* used as an index, must be unique */ |
1da177e4 LT |
247 | int status; |
248 | ||
249 | struct list_head global_list; /* node in global list of devices */ | |
250 | struct list_head protocol_list; /* node in list of device's protocol */ | |
251 | struct list_head card_list; /* node in card's list of devices */ | |
252 | struct list_head rdev_list; /* node in cards list of requested devices */ | |
253 | ||
9dd78466 BH |
254 | struct pnp_protocol *protocol; |
255 | struct pnp_card *card; /* card the device is attached to, none if NULL */ | |
256 | struct pnp_driver *driver; | |
257 | struct pnp_card_link *card_link; | |
1da177e4 | 258 | |
07d4e9af | 259 | struct pnp_id *id; /* supported EISA IDs */ |
1da177e4 LT |
260 | |
261 | int active; | |
262 | int capabilities; | |
1f32ca31 | 263 | unsigned int num_dependent_sets; |
aee3ad81 | 264 | struct list_head resources; |
1f32ca31 | 265 | struct list_head options; |
1da177e4 LT |
266 | |
267 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ | |
07d4e9af | 268 | int flags; /* used by protocols */ |
1da177e4 LT |
269 | struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ |
270 | void *data; | |
271 | }; | |
272 | ||
273 | #define global_to_pnp_dev(n) list_entry(n, struct pnp_dev, global_list) | |
274 | #define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list) | |
275 | #define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list) | |
276 | #define to_pnp_dev(n) container_of(n, struct pnp_dev, dev) | |
277 | #define pnp_for_each_dev(dev) \ | |
278 | for((dev) = global_to_pnp_dev(pnp_global.next); \ | |
279 | (dev) != global_to_pnp_dev(&pnp_global); \ | |
280 | (dev) = global_to_pnp_dev((dev)->global_list.next)) | |
281 | #define card_for_each_dev(card,dev) \ | |
282 | for((dev) = card_to_pnp_dev((card)->devices.next); \ | |
283 | (dev) != card_to_pnp_dev(&(card)->devices); \ | |
284 | (dev) = card_to_pnp_dev((dev)->card_list.next)) | |
285 | #define pnp_dev_name(dev) (dev)->name | |
286 | ||
9dd78466 | 287 | static inline void *pnp_get_drvdata(struct pnp_dev *pdev) |
1da177e4 LT |
288 | { |
289 | return dev_get_drvdata(&pdev->dev); | |
290 | } | |
291 | ||
9dd78466 | 292 | static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data) |
1da177e4 LT |
293 | { |
294 | dev_set_drvdata(&pdev->dev, data); | |
295 | } | |
296 | ||
297 | struct pnp_fixup { | |
298 | char id[7]; | |
9dd78466 | 299 | void (*quirk_function) (struct pnp_dev * dev); /* fixup function */ |
1da177e4 LT |
300 | }; |
301 | ||
302 | /* config parameters */ | |
303 | #define PNP_CONFIG_NORMAL 0x0001 | |
304 | #define PNP_CONFIG_FORCE 0x0002 /* disables validity checking */ | |
305 | ||
306 | /* capabilities */ | |
307 | #define PNP_READ 0x0001 | |
308 | #define PNP_WRITE 0x0002 | |
309 | #define PNP_DISABLE 0x0004 | |
310 | #define PNP_CONFIGURABLE 0x0008 | |
311 | #define PNP_REMOVABLE 0x0010 | |
312 | ||
402b310c | 313 | #define pnp_can_read(dev) (((dev)->protocol->get) && \ |
1da177e4 | 314 | ((dev)->capabilities & PNP_READ)) |
402b310c | 315 | #define pnp_can_write(dev) (((dev)->protocol->set) && \ |
1da177e4 | 316 | ((dev)->capabilities & PNP_WRITE)) |
402b310c | 317 | #define pnp_can_disable(dev) (((dev)->protocol->disable) && \ |
1da177e4 LT |
318 | ((dev)->capabilities & PNP_DISABLE)) |
319 | #define pnp_can_configure(dev) ((!(dev)->active) && \ | |
320 | ((dev)->capabilities & PNP_CONFIGURABLE)) | |
321 | ||
322 | #ifdef CONFIG_ISAPNP | |
323 | extern struct pnp_protocol isapnp_protocol; | |
324 | #define pnp_device_is_isapnp(dev) ((dev)->protocol == (&isapnp_protocol)) | |
325 | #else | |
326 | #define pnp_device_is_isapnp(dev) 0 | |
327 | #endif | |
b3bd86e2 | 328 | extern struct mutex pnp_res_mutex; |
1da177e4 LT |
329 | |
330 | #ifdef CONFIG_PNPBIOS | |
331 | extern struct pnp_protocol pnpbios_protocol; | |
332 | #define pnp_device_is_pnpbios(dev) ((dev)->protocol == (&pnpbios_protocol)) | |
333 | #else | |
334 | #define pnp_device_is_pnpbios(dev) 0 | |
335 | #endif | |
336 | ||
1da177e4 LT |
337 | /* status */ |
338 | #define PNP_READY 0x0000 | |
339 | #define PNP_ATTACHED 0x0001 | |
340 | #define PNP_BUSY 0x0002 | |
341 | #define PNP_FAULTY 0x0004 | |
342 | ||
343 | /* isapnp specific macros */ | |
344 | ||
345 | #define isapnp_card_number(dev) ((dev)->card ? (dev)->card->number : -1) | |
346 | #define isapnp_csn_number(dev) ((dev)->number) | |
347 | ||
348 | /* | |
349 | * Driver Management | |
350 | */ | |
351 | ||
352 | struct pnp_id { | |
353 | char id[PNP_ID_LEN]; | |
9dd78466 | 354 | struct pnp_id *next; |
1da177e4 LT |
355 | }; |
356 | ||
357 | struct pnp_driver { | |
9dd78466 | 358 | char *name; |
1da177e4 LT |
359 | const struct pnp_device_id *id_table; |
360 | unsigned int flags; | |
07d4e9af BH |
361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); |
362 | void (*remove) (struct pnp_dev *dev); | |
363 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); | |
364 | int (*resume) (struct pnp_dev *dev); | |
1da177e4 LT |
365 | struct device_driver driver; |
366 | }; | |
367 | ||
368 | #define to_pnp_driver(drv) container_of(drv, struct pnp_driver, driver) | |
369 | ||
370 | struct pnp_card_driver { | |
371 | struct list_head global_list; | |
9dd78466 | 372 | char *name; |
1da177e4 LT |
373 | const struct pnp_card_device_id *id_table; |
374 | unsigned int flags; | |
07d4e9af BH |
375 | int (*probe) (struct pnp_card_link *card, |
376 | const struct pnp_card_device_id *card_id); | |
377 | void (*remove) (struct pnp_card_link *card); | |
378 | int (*suspend) (struct pnp_card_link *card, pm_message_t state); | |
379 | int (*resume) (struct pnp_card_link *card); | |
1da177e4 LT |
380 | struct pnp_driver link; |
381 | }; | |
382 | ||
383 | #define to_pnp_card_driver(drv) container_of(drv, struct pnp_card_driver, link) | |
384 | ||
385 | /* pnp driver flags */ | |
386 | #define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ | |
387 | #define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ | |
388 | ||
1da177e4 LT |
389 | /* |
390 | * Protocol Management | |
391 | */ | |
392 | ||
393 | struct pnp_protocol { | |
9dd78466 BH |
394 | struct list_head protocol_list; |
395 | char *name; | |
1da177e4 LT |
396 | |
397 | /* resource control functions */ | |
59284cb4 BH |
398 | int (*get) (struct pnp_dev *dev); |
399 | int (*set) (struct pnp_dev *dev); | |
07d4e9af | 400 | int (*disable) (struct pnp_dev *dev); |
1da177e4 | 401 | |
fc30e68e | 402 | /* protocol specific suspend/resume */ |
9dd78466 BH |
403 | int (*suspend) (struct pnp_dev * dev, pm_message_t state); |
404 | int (*resume) (struct pnp_dev * dev); | |
fc30e68e | 405 | |
1da177e4 | 406 | /* used by pnp layer only (look but don't touch) */ |
9dd78466 BH |
407 | unsigned char number; /* protocol number */ |
408 | struct device dev; /* link to driver model */ | |
409 | struct list_head cards; | |
410 | struct list_head devices; | |
1da177e4 LT |
411 | }; |
412 | ||
413 | #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) | |
414 | #define protocol_for_each_card(protocol,card) \ | |
415 | for((card) = protocol_to_pnp_card((protocol)->cards.next); \ | |
416 | (card) != protocol_to_pnp_card(&(protocol)->cards); \ | |
417 | (card) = protocol_to_pnp_card((card)->protocol_list.next)) | |
418 | #define protocol_for_each_dev(protocol,dev) \ | |
419 | for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \ | |
420 | (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ | |
421 | (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) | |
422 | ||
cbcdc1de DB |
423 | extern struct bus_type pnp_bus_type; |
424 | ||
1da177e4 LT |
425 | #if defined(CONFIG_PNP) |
426 | ||
427 | /* device management */ | |
1da177e4 LT |
428 | int pnp_device_attach(struct pnp_dev *pnp_dev); |
429 | void pnp_device_detach(struct pnp_dev *pnp_dev); | |
430 | extern struct list_head pnp_global; | |
8f81dd14 | 431 | extern int pnp_platform_devices; |
1da177e4 LT |
432 | |
433 | /* multidevice card support */ | |
9dd78466 BH |
434 | struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, |
435 | const char *id, struct pnp_dev *from); | |
436 | void pnp_release_card_device(struct pnp_dev *dev); | |
437 | int pnp_register_card_driver(struct pnp_card_driver *drv); | |
438 | void pnp_unregister_card_driver(struct pnp_card_driver *drv); | |
1da177e4 LT |
439 | extern struct list_head pnp_cards; |
440 | ||
441 | /* resource management */ | |
57fd51a8 BH |
442 | int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t base, |
443 | resource_size_t size); | |
1da177e4 | 444 | int pnp_auto_config_dev(struct pnp_dev *dev); |
68094e32 PO |
445 | int pnp_start_dev(struct pnp_dev *dev); |
446 | int pnp_stop_dev(struct pnp_dev *dev); | |
1da177e4 LT |
447 | int pnp_activate_dev(struct pnp_dev *dev); |
448 | int pnp_disable_dev(struct pnp_dev *dev); | |
1da177e4 LT |
449 | |
450 | /* protocol helpers */ | |
9dd78466 BH |
451 | int pnp_is_active(struct pnp_dev *dev); |
452 | int compare_pnp_id(struct pnp_id *pos, const char *id); | |
1da177e4 LT |
453 | int pnp_register_driver(struct pnp_driver *drv); |
454 | void pnp_unregister_driver(struct pnp_driver *drv); | |
455 | ||
456 | #else | |
457 | ||
458 | /* device management */ | |
07d4e9af BH |
459 | static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } |
460 | static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { } | |
9dd78466 | 461 | |
8f81dd14 | 462 | #define pnp_platform_devices 0 |
1da177e4 LT |
463 | |
464 | /* multidevice card support */ | |
07d4e9af BH |
465 | static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; } |
466 | static inline void pnp_release_card_device(struct pnp_dev *dev) { } | |
467 | static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; } | |
468 | static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { } | |
1da177e4 LT |
469 | |
470 | /* resource management */ | |
57fd51a8 BH |
471 | static inline int pnp_possible_config(struct pnp_dev *dev, int type, |
472 | resource_size_t base, | |
473 | resource_size_t size) { return 0; } | |
07d4e9af | 474 | static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } |
07d4e9af BH |
475 | static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } |
476 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | |
477 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | |
478 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | |
1da177e4 LT |
479 | |
480 | /* protocol helpers */ | |
07d4e9af BH |
481 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } |
482 | static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; } | |
07d4e9af BH |
483 | static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } |
484 | static inline void pnp_unregister_driver(struct pnp_driver *drv) { } | |
1da177e4 LT |
485 | |
486 | #endif /* CONFIG_PNP */ | |
487 | ||
1da177e4 | 488 | #endif /* _LINUX_PNP_H */ |