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