diff options
author | Alan Tull <atull@kernel.org> | 2017-11-15 15:20:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 10:30:38 -0500 |
commit | 52a3a7ccce07e73323fc1bae9eb0b0b63375391c (patch) | |
tree | 6796ce652e7ad0c399ba3cd3cd1bb2f5034fa089 /include/linux/fpga/fpga-region.h | |
parent | 3b49537f8084af15ccaac542eaf317e01c6869e6 (diff) |
fpga: region: add register/unregister functions
Another step in separating common code from device tree specific
code for FPGA regions.
* add FPGA region register/unregister functions.
* add the register/unregister functions to the header
* use devm_kzalloc to alloc the region.
* add a method for getting bridges to the region struct
* add priv to the region struct
* use region->info in of_fpga_region_get_bridges
Signed-off-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fpga/fpga-region.h')
-rw-r--r-- | include/linux/fpga/fpga-region.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/fpga/fpga-region.h b/include/linux/fpga/fpga-region.h index 8a355171406b..8c8a3249f96c 100644 --- a/include/linux/fpga/fpga-region.h +++ b/include/linux/fpga/fpga-region.h | |||
@@ -12,6 +12,8 @@ | |||
12 | * @bridge_list: list of FPGA bridges specified in region | 12 | * @bridge_list: list of FPGA bridges specified in region |
13 | * @mgr: FPGA manager | 13 | * @mgr: FPGA manager |
14 | * @info: FPGA image info | 14 | * @info: FPGA image info |
15 | * @priv: private data | ||
16 | * @get_bridges: optional function to get bridges to a list | ||
15 | */ | 17 | */ |
16 | struct fpga_region { | 18 | struct fpga_region { |
17 | struct device dev; | 19 | struct device dev; |
@@ -19,10 +21,15 @@ struct fpga_region { | |||
19 | struct list_head bridge_list; | 21 | struct list_head bridge_list; |
20 | struct fpga_manager *mgr; | 22 | struct fpga_manager *mgr; |
21 | struct fpga_image_info *info; | 23 | struct fpga_image_info *info; |
24 | void *priv; | ||
25 | int (*get_bridges)(struct fpga_region *region); | ||
22 | }; | 26 | }; |
23 | 27 | ||
24 | #define to_fpga_region(d) container_of(d, struct fpga_region, dev) | 28 | #define to_fpga_region(d) container_of(d, struct fpga_region, dev) |
25 | 29 | ||
26 | int fpga_region_program_fpga(struct fpga_region *region); | 30 | int fpga_region_program_fpga(struct fpga_region *region); |
27 | 31 | ||
32 | int fpga_region_register(struct device *dev, struct fpga_region *region); | ||
33 | int fpga_region_unregister(struct fpga_region *region); | ||
34 | |||
28 | #endif /* _FPGA_REGION_H */ | 35 | #endif /* _FPGA_REGION_H */ |