parisc-device.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include <linux/device.h>
  2. struct parisc_device {
  3. struct resource 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 char *parisc_pathname(struct parisc_device *d)
  35. {
  36. return d->dev.bus_id;
  37. }
  38. static inline void
  39. parisc_set_drvdata(struct parisc_device *d, void *p)
  40. {
  41. dev_set_drvdata(&d->dev, p);
  42. }
  43. static inline void *
  44. parisc_get_drvdata(struct parisc_device *d)
  45. {
  46. return dev_get_drvdata(&d->dev);
  47. }
  48. extern struct bus_type parisc_bus_type;