diff options
Diffstat (limited to 'include/linux/fpga/fpga-bridge.h')
| -rw-r--r-- | include/linux/fpga/fpga-bridge.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/fpga/fpga-bridge.h b/include/linux/fpga/fpga-bridge.h index aa66c87c120b..3694821a6d2d 100644 --- a/include/linux/fpga/fpga-bridge.h +++ b/include/linux/fpga/fpga-bridge.h | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #include <linux/device.h> | ||
| 3 | #include <linux/fpga/fpga-mgr.h> | ||
| 4 | 2 | ||
| 5 | #ifndef _LINUX_FPGA_BRIDGE_H | 3 | #ifndef _LINUX_FPGA_BRIDGE_H |
| 6 | #define _LINUX_FPGA_BRIDGE_H | 4 | #define _LINUX_FPGA_BRIDGE_H |
| 7 | 5 | ||
| 6 | #include <linux/device.h> | ||
| 7 | #include <linux/fpga/fpga-mgr.h> | ||
| 8 | |||
| 8 | struct fpga_bridge; | 9 | struct fpga_bridge; |
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| @@ -12,11 +13,13 @@ struct fpga_bridge; | |||
| 12 | * @enable_show: returns the FPGA bridge's status | 13 | * @enable_show: returns the FPGA bridge's status |
| 13 | * @enable_set: set a FPGA bridge as enabled or disabled | 14 | * @enable_set: set a FPGA bridge as enabled or disabled |
| 14 | * @fpga_bridge_remove: set FPGA into a specific state during driver remove | 15 | * @fpga_bridge_remove: set FPGA into a specific state during driver remove |
| 16 | * @groups: optional attribute groups. | ||
| 15 | */ | 17 | */ |
| 16 | struct fpga_bridge_ops { | 18 | struct fpga_bridge_ops { |
| 17 | int (*enable_show)(struct fpga_bridge *bridge); | 19 | int (*enable_show)(struct fpga_bridge *bridge); |
| 18 | int (*enable_set)(struct fpga_bridge *bridge, bool enable); | 20 | int (*enable_set)(struct fpga_bridge *bridge, bool enable); |
| 19 | void (*fpga_bridge_remove)(struct fpga_bridge *bridge); | 21 | void (*fpga_bridge_remove)(struct fpga_bridge *bridge); |
| 22 | const struct attribute_group **groups; | ||
| 20 | }; | 23 | }; |
| 21 | 24 | ||
| 22 | /** | 25 | /** |
| @@ -43,6 +46,8 @@ struct fpga_bridge { | |||
| 43 | 46 | ||
| 44 | struct fpga_bridge *of_fpga_bridge_get(struct device_node *node, | 47 | struct fpga_bridge *of_fpga_bridge_get(struct device_node *node, |
| 45 | struct fpga_image_info *info); | 48 | struct fpga_image_info *info); |
| 49 | struct fpga_bridge *fpga_bridge_get(struct device *dev, | ||
| 50 | struct fpga_image_info *info); | ||
| 46 | void fpga_bridge_put(struct fpga_bridge *bridge); | 51 | void fpga_bridge_put(struct fpga_bridge *bridge); |
| 47 | int fpga_bridge_enable(struct fpga_bridge *bridge); | 52 | int fpga_bridge_enable(struct fpga_bridge *bridge); |
| 48 | int fpga_bridge_disable(struct fpga_bridge *bridge); | 53 | int fpga_bridge_disable(struct fpga_bridge *bridge); |
| @@ -50,9 +55,12 @@ int fpga_bridge_disable(struct fpga_bridge *bridge); | |||
| 50 | int fpga_bridges_enable(struct list_head *bridge_list); | 55 | int fpga_bridges_enable(struct list_head *bridge_list); |
| 51 | int fpga_bridges_disable(struct list_head *bridge_list); | 56 | int fpga_bridges_disable(struct list_head *bridge_list); |
| 52 | void fpga_bridges_put(struct list_head *bridge_list); | 57 | void fpga_bridges_put(struct list_head *bridge_list); |
| 53 | int fpga_bridge_get_to_list(struct device_node *np, | 58 | int fpga_bridge_get_to_list(struct device *dev, |
| 54 | struct fpga_image_info *info, | 59 | struct fpga_image_info *info, |
| 55 | struct list_head *bridge_list); | 60 | struct list_head *bridge_list); |
| 61 | int of_fpga_bridge_get_to_list(struct device_node *np, | ||
| 62 | struct fpga_image_info *info, | ||
| 63 | struct list_head *bridge_list); | ||
| 56 | 64 | ||
| 57 | int fpga_bridge_register(struct device *dev, const char *name, | 65 | int fpga_bridge_register(struct device *dev, const char *name, |
| 58 | const struct fpga_bridge_ops *br_ops, void *priv); | 66 | const struct fpga_bridge_ops *br_ops, void *priv); |
