fpga-region.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _FPGA_REGION_H
  2. #define _FPGA_REGION_H
  3. #include <linux/device.h>
  4. #include <linux/fpga/fpga-mgr.h>
  5. #include <linux/fpga/fpga-bridge.h>
  6. /**
  7. * struct fpga_region - FPGA Region structure
  8. * @dev: FPGA Region device
  9. * @mutex: enforces exclusive reference to region
  10. * @bridge_list: list of FPGA bridges specified in region
  11. * @mgr: FPGA manager
  12. * @info: FPGA image info
  13. * @priv: private data
  14. * @get_bridges: optional function to get bridges to a list
  15. * @groups: optional attribute groups.
  16. */
  17. struct fpga_region {
  18. struct device dev;
  19. struct mutex mutex; /* for exclusive reference to region */
  20. struct list_head bridge_list;
  21. struct fpga_manager *mgr;
  22. struct fpga_image_info *info;
  23. void *priv;
  24. int (*get_bridges)(struct fpga_region *region);
  25. const struct attribute_group **groups;
  26. };
  27. #define to_fpga_region(d) container_of(d, struct fpga_region, dev)
  28. struct fpga_region *fpga_region_class_find(
  29. struct device *start, const void *data,
  30. int (*match)(struct device *, const void *));
  31. int fpga_region_program_fpga(struct fpga_region *region);
  32. int fpga_region_register(struct device *dev, struct fpga_region *region);
  33. int fpga_region_unregister(struct fpga_region *region);
  34. #endif /* _FPGA_REGION_H */