parisc-device.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <linux/device.h>
  2. struct parisc_device {
  3. unsigned long hpa; /* Hard Physical Address */
  4. struct parisc_device_id id;
  5. struct parisc_driver *driver; /* Driver for this device */
  6. char name[80]; /* The hardware description */
  7. int irq;
  8. int aux_irq; /* Some devices have a second IRQ */
  9. char hw_path; /* The module number on this bus */
  10. unsigned int num_addrs; /* some devices have additional address ranges. */
  11. unsigned long *addr; /* which will be stored here */
  12. #ifdef __LP64__
  13. /* parms for pdc_pat_cell_module() call */
  14. unsigned long pcell_loc; /* Physical Cell location */
  15. unsigned long mod_index; /* PAT specific - Misc Module info */
  16. /* generic info returned from pdc_pat_cell_module() */
  17. unsigned long mod_info; /* PAT specific - Misc Module info */
  18. unsigned long pmod_loc; /* physical Module location */
  19. #endif
  20. u64 dma_mask; /* DMA mask for I/O */
  21. struct device dev;
  22. };
  23. struct parisc_driver {
  24. struct parisc_driver *next;
  25. char *name;
  26. const struct parisc_device_id *id_table;
  27. int (*probe) (struct parisc_device *dev); /* New device discovered */
  28. int (*remove) (struct parisc_device *dev);
  29. struct device_driver drv;
  30. };
  31. #define to_parisc_device(d) container_of(d, struct parisc_device, dev)
  32. #define to_parisc_driver(d) container_of(d, struct parisc_driver, drv)
  33. #define parisc_parent(d) to_parisc_device(d->dev.parent)
  34. static inline void
  35. parisc_set_drvdata(struct parisc_device *d, void *p)
  36. {
  37. dev_set_drvdata(&d->dev, p);
  38. }
  39. static inline void *
  40. parisc_get_drvdata(struct parisc_device *d)
  41. {
  42. return dev_get_drvdata(&d->dev);
  43. }
  44. extern struct bus_type parisc_bus_type;