blob: 8c8a3249f96cb016baa64fcf25b8896f87e80d53 [file] [log] [blame]
Alan Tull59460a92017-11-15 14:20:21 -06001#ifndef _FPGA_REGION_H
2#define _FPGA_REGION_H
3
4#include <linux/device.h>
5#include <linux/fpga/fpga-mgr.h>
6#include <linux/fpga/fpga-bridge.h>
7
8/**
9 * struct fpga_region - FPGA Region structure
10 * @dev: FPGA Region device
11 * @mutex: enforces exclusive reference to region
12 * @bridge_list: list of FPGA bridges specified in region
13 * @mgr: FPGA manager
14 * @info: FPGA image info
Alan Tull52a3a7c2017-11-15 14:20:23 -060015 * @priv: private data
16 * @get_bridges: optional function to get bridges to a list
Alan Tull59460a92017-11-15 14:20:21 -060017 */
18struct fpga_region {
19 struct device dev;
20 struct mutex mutex; /* for exclusive reference to region */
21 struct list_head bridge_list;
22 struct fpga_manager *mgr;
23 struct fpga_image_info *info;
Alan Tull52a3a7c2017-11-15 14:20:23 -060024 void *priv;
25 int (*get_bridges)(struct fpga_region *region);
Alan Tull59460a92017-11-15 14:20:21 -060026};
27
28#define to_fpga_region(d) container_of(d, struct fpga_region, dev)
29
30int fpga_region_program_fpga(struct fpga_region *region);
31
Alan Tull52a3a7c2017-11-15 14:20:23 -060032int fpga_region_register(struct device *dev, struct fpga_region *region);
33int fpga_region_unregister(struct fpga_region *region);
34
Alan Tull59460a92017-11-15 14:20:21 -060035#endif /* _FPGA_REGION_H */