Home | History | Annotate | Download | only in linux

Lines Matching refs:dev

32 #define pnp_port_start(dev,bar)   ((dev)->res.port_resource[(bar)].start)
33 #define pnp_port_end(dev,bar) ((dev)->res.port_resource[(bar)].end)
34 #define pnp_port_flags(dev,bar) ((dev)->res.port_resource[(bar)].flags)
35 #define pnp_port_valid(dev,bar) \
36 ((pnp_port_flags((dev),(bar)) & (IORESOURCE_IO | IORESOURCE_UNSET)) \
38 #define pnp_port_len(dev,bar) \
39 ((pnp_port_start((dev),(bar)) == 0 && \
40 pnp_port_end((dev),(bar)) == \
41 pnp_port_start((dev),(bar))) ? 0 : \
43 (pnp_port_end((dev),(bar)) - \
44 pnp_port_start((dev),(bar)) + 1))
46 #define pnp_mem_start(dev,bar) ((dev)->res.mem_resource[(bar)].start)
47 #define pnp_mem_end(dev,bar) ((dev)->res.mem_resource[(bar)].end)
48 #define pnp_mem_flags(dev,bar) ((dev)->res.mem_resource[(bar)].flags)
49 #define pnp_mem_valid(dev,bar) \
50 ((pnp_mem_flags((dev),(bar)) & (IORESOURCE_MEM | IORESOURCE_UNSET)) \
52 #define pnp_mem_len(dev,bar) \
53 ((pnp_mem_start((dev),(bar)) == 0 && \
54 pnp_mem_end((dev),(bar)) == \
55 pnp_mem_start((dev),(bar))) ? 0 : \
57 (pnp_mem_end((dev),(bar)) - \
58 pnp_mem_start((dev),(bar)) + 1))
60 #define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
61 #define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
62 #define pnp_irq_valid(dev,bar) \
63 ((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
66 #define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
67 #define pnp_dma_flags(dev,bar) ((dev)->res.dma_resource[(bar)].flags)
68 #define pnp_dma_valid(dev,bar) \
69 ((pnp_dma_flags((dev),(bar)) & (IORESOURCE_DMA | IORESOURCE_UNSET)) \
136 struct device dev; /* Driver Model device interface */
155 #define to_pnp_card(n) container_of(n, struct pnp_card, dev)
179 struct device dev; /* Driver Model device interface */
211 #define to_pnp_dev(n) container_of(n, struct pnp_dev, dev)
212 #define pnp_for_each_dev(dev) \
213 for((dev) = global_to_pnp_dev(pnp_global.next); \
214 (dev) != global_to_pnp_dev(&pnp_global); \
215 (dev) = global_to_pnp_dev((dev)->global_list.next))
216 #define card_for_each_dev(card,dev) \
217 for((dev) = card_to_pnp_dev((card)->devices.next); \
218 (dev) != card_to_pnp_dev(&(card)->devices); \
219 (dev) = card_to_pnp_dev((dev)->card_list.next))
220 #define pnp_dev_name(dev) (dev)->name
224 return dev_get_drvdata(&pdev->dev);
229 dev_set_drvdata(&pdev->dev, data);
234 void (*quirk_function)(struct pnp_dev *dev); /* fixup function */
248 #define pnp_can_read(dev) (((dev)->protocol) && ((dev)->protocol->get) && \
249 ((dev)->capabilities & PNP_READ))
250 #define pnp_can_write(dev) (((dev)->protocol) && ((dev)->protocol->set) && \
251 ((dev)->capabilities & PNP_WRITE))
252 #define pnp_can_disable(dev) (((dev)->protocol) && ((dev)->protocol->disable) && \
253 ((dev)->capabilities & PNP_DISABLE))
254 #define pnp_can_configure(dev) ((!(dev)->active) && \
255 ((dev)->capabilities & PNP_CONFIGURABLE))
259 #define pnp_device_is_isapnp(dev) ((dev)->protocol == (&isapnp_protocol))
261 #define pnp_device_is_isapnp(dev) 0
266 #define pnp_device_is_pnpbios(dev) ((dev)->protocol == (&pnpbios_protocol))
268 #define pnp_device_is_pnpbios(dev) 0
280 #define isapnp_card_number(dev) ((dev)->card ? (dev)->card->number : -1)
281 #define isapnp_csn_number(dev) ((dev)->number)
296 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
297 void (*remove) (struct pnp_dev *dev);
298 int (*suspend) (struct pnp_dev *dev, pm_message_t state);
299 int (*resume) (struct pnp_dev *dev);
333 int (*get)(struct pnp_dev *dev, struct pnp_resource_table *res);
334 int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res);
335 int (*disable)(struct pnp_dev *dev);
339 struct device dev; /* link to driver model */
349 #define protocol_for_each_dev(protocol,dev) \
350 for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \
351 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
352 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
360 int pnp_add_device(struct pnp_dev *dev);
368 int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
369 void pnp_remove_card_device(struct pnp_dev *dev);
372 void pnp_release_card_device(struct pnp_dev * dev);
378 struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev);
379 struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority);
385 int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode);
386 int pnp_auto_config_dev(struct pnp_dev *dev);
387 int pnp_validate_config(struct pnp_dev *dev);
388 int pnp_start_dev(struct pnp_dev *dev);
389 int pnp_stop_dev(struct pnp_dev *dev);
390 int pnp_activate_dev(struct pnp_dev *dev);
391 int pnp_disable_dev(struct pnp_dev *dev);
396 int pnp_is_active(struct pnp_dev * dev);
398 int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
407 static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
408 static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
415 static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; }
416 static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; }
419 static inline void pnp_release_card_device(struct pnp_dev * dev) { ; }
424 static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; }
425 static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; }
431 static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
432 static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
433 static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; }
434 static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
435 static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
436 static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
437 static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
443 static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
445 dev) { return -ENODEV; }