bus-sh.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * include/asm-sh/bus-sh.h
  3. *
  4. * Copyright (C) 2004 Paul Mundt
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef __ASM_SH_BUS_SH_H
  11. #define __ASM_SH_BUS_SH_H
  12. extern struct bus_type sh_bus_types[];
  13. struct sh_dev {
  14. struct device dev;
  15. char *name;
  16. unsigned int dev_id;
  17. unsigned int bus_id;
  18. struct resource res;
  19. void *mapbase;
  20. unsigned int irq[6];
  21. u64 *dma_mask;
  22. };
  23. #define to_sh_dev(d) container_of((d), struct sh_dev, dev)
  24. #define sh_get_drvdata(d) dev_get_drvdata(&(d)->dev)
  25. #define sh_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
  26. struct sh_driver {
  27. struct device_driver drv;
  28. unsigned int dev_id;
  29. unsigned int bus_id;
  30. int (*probe)(struct sh_dev *);
  31. int (*remove)(struct sh_dev *);
  32. int (*suspend)(struct sh_dev *, pm_message_t);
  33. int (*resume)(struct sh_dev *);
  34. };
  35. #define to_sh_driver(d) container_of((d), struct sh_driver, drv)
  36. #define sh_name(d) ((d)->dev.driver->name)
  37. /*
  38. * Device ID numbers for bus types
  39. */
  40. enum {
  41. SH_DEV_ID_USB_OHCI,
  42. };
  43. #define SH_NR_BUSES 1
  44. #define SH_BUS_NAME_VIRT "shbus"
  45. enum {
  46. SH_BUS_VIRT,
  47. };
  48. /* arch/sh/kernel/cpu/bus.c */
  49. extern int sh_device_register(struct sh_dev *dev);
  50. extern void sh_device_unregister(struct sh_dev *dev);
  51. extern int sh_driver_register(struct sh_driver *drv);
  52. extern void sh_driver_unregister(struct sh_driver *drv);
  53. #endif /* __ASM_SH_BUS_SH_H */