superhyway.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * include/linux/superhyway.h
  3. *
  4. * SuperHyway Bus definitions
  5. *
  6. * Copyright (C) 2004, 2005 Paul Mundt <lethal@linux-sh.org>
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #ifndef __LINUX_SUPERHYWAY_H
  13. #define __LINUX_SUPERHYWAY_H
  14. #include <linux/device.h>
  15. /*
  16. * SuperHyway IDs
  17. */
  18. #define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183
  19. struct vcr_info {
  20. u8 perr_flags; /* P-port Error flags */
  21. u8 merr_flags; /* Module Error flags */
  22. u16 mod_vers; /* Module Version */
  23. u16 mod_id; /* Module ID */
  24. u8 bot_mb; /* Bottom Memory block */
  25. u8 top_mb; /* Top Memory block */
  26. };
  27. struct superhyway_device_id {
  28. unsigned int id;
  29. unsigned long driver_data;
  30. };
  31. struct superhyway_device;
  32. extern struct bus_type superhyway_bus_type;
  33. struct superhyway_driver {
  34. char *name;
  35. const struct superhyway_device_id *id_table;
  36. struct device_driver drv;
  37. int (*probe)(struct superhyway_device *dev, const struct superhyway_device_id *id);
  38. void (*remove)(struct superhyway_device *dev);
  39. };
  40. #define to_superhyway_driver(d) container_of((d), struct superhyway_driver, drv)
  41. struct superhyway_device {
  42. char name[32];
  43. struct device dev;
  44. struct superhyway_device_id id;
  45. struct superhyway_driver *drv;
  46. struct resource resource;
  47. struct vcr_info vcr;
  48. };
  49. #define to_superhyway_device(d) container_of((d), struct superhyway_device, dev)
  50. #define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev)
  51. #define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
  52. extern int superhyway_scan_bus(void);
  53. /* drivers/sh/superhyway/superhyway.c */
  54. int superhyway_register_driver(struct superhyway_driver *);
  55. void superhyway_unregister_driver(struct superhyway_driver *);
  56. int superhyway_add_device(unsigned int, unsigned long, unsigned long long);
  57. /* drivers/sh/superhyway/superhyway-sysfs.c */
  58. extern struct device_attribute superhyway_dev_attrs[];
  59. #endif /* __LINUX_SUPERHYWAY_H */