superhyway.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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 */