bus-sh.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. u64 coherent_dma_mask;
  23. };
  24. #define to_sh_dev(d) container_of((d), struct sh_dev, dev)
  25. #define sh_get_drvdata(d) dev_get_drvdata(&(d)->dev)
  26. #define sh_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
  27. struct sh_driver {
  28. struct device_driver drv;
  29. unsigned int dev_id;
  30. unsigned int bus_id;
  31. int (*probe)(struct sh_dev *);
  32. int (*remove)(struct sh_dev *);
  33. int (*suspend)(struct sh_dev *, pm_message_t);
  34. int (*resume)(struct sh_dev *);
  35. };
  36. #define to_sh_driver(d) container_of((d), struct sh_driver, drv)
  37. #define sh_name(d) ((d)->dev.driver->name)
  38. /*
  39. * Device ID numbers for bus types
  40. */
  41. enum {
  42. SH_DEV_ID_USB_OHCI,
  43. };
  44. #define SH_NR_BUSES 1
  45. #define SH_BUS_NAME_VIRT "shbus"
  46. enum {
  47. SH_BUS_VIRT,
  48. };
  49. /* arch/sh/kernel/cpu/bus.c */
  50. extern int sh_device_register(struct sh_dev *dev);
  51. extern void sh_device_unregister(struct sh_dev *dev);
  52. extern int sh_driver_register(struct sh_driver *drv);
  53. extern void sh_driver_unregister(struct sh_driver *drv);
  54. #endif /* __ASM_SH_BUS_SH_H */