~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/fpga/fpga-bridge.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 #ifndef _LINUX_FPGA_BRIDGE_H
  4 #define _LINUX_FPGA_BRIDGE_H
  5 
  6 #include <linux/device.h>
  7 #include <linux/fpga/fpga-mgr.h>
  8 
  9 struct fpga_bridge;
 10 
 11 /**
 12  * struct fpga_bridge_ops - ops for low level FPGA bridge drivers
 13  * @enable_show: returns the FPGA bridge's status
 14  * @enable_set: set an FPGA bridge as enabled or disabled
 15  * @fpga_bridge_remove: set FPGA into a specific state during driver remove
 16  * @groups: optional attribute groups.
 17  */
 18 struct fpga_bridge_ops {
 19         int (*enable_show)(struct fpga_bridge *bridge);
 20         int (*enable_set)(struct fpga_bridge *bridge, bool enable);
 21         void (*fpga_bridge_remove)(struct fpga_bridge *bridge);
 22         const struct attribute_group **groups;
 23 };
 24 
 25 /**
 26  * struct fpga_bridge_info - collection of parameters an FPGA Bridge
 27  * @name: fpga bridge name
 28  * @br_ops: pointer to structure of fpga bridge ops
 29  * @priv: fpga bridge private data
 30  *
 31  * fpga_bridge_info contains parameters for the register function. These
 32  * are separated into an info structure because they some are optional
 33  * others could be added to in the future. The info structure facilitates
 34  * maintaining a stable API.
 35  */
 36 struct fpga_bridge_info {
 37         const char *name;
 38         const struct fpga_bridge_ops *br_ops;
 39         void *priv;
 40 };
 41 
 42 /**
 43  * struct fpga_bridge - FPGA bridge structure
 44  * @name: name of low level FPGA bridge
 45  * @dev: FPGA bridge device
 46  * @mutex: enforces exclusive reference to bridge
 47  * @br_ops: pointer to struct of FPGA bridge ops
 48  * @br_ops_owner: module containing the br_ops
 49  * @info: fpga image specific information
 50  * @node: FPGA bridge list node
 51  * @priv: low level driver private date
 52  */
 53 struct fpga_bridge {
 54         const char *name;
 55         struct device dev;
 56         struct mutex mutex; /* for exclusive reference to bridge */
 57         const struct fpga_bridge_ops *br_ops;
 58         struct module *br_ops_owner;
 59         struct fpga_image_info *info;
 60         struct list_head node;
 61         void *priv;
 62 };
 63 
 64 #define to_fpga_bridge(d) container_of(d, struct fpga_bridge, dev)
 65 
 66 struct fpga_bridge *of_fpga_bridge_get(struct device_node *node,
 67                                        struct fpga_image_info *info);
 68 struct fpga_bridge *fpga_bridge_get(struct device *dev,
 69                                     struct fpga_image_info *info);
 70 void fpga_bridge_put(struct fpga_bridge *bridge);
 71 int fpga_bridge_enable(struct fpga_bridge *bridge);
 72 int fpga_bridge_disable(struct fpga_bridge *bridge);
 73 
 74 int fpga_bridges_enable(struct list_head *bridge_list);
 75 int fpga_bridges_disable(struct list_head *bridge_list);
 76 void fpga_bridges_put(struct list_head *bridge_list);
 77 int fpga_bridge_get_to_list(struct device *dev,
 78                             struct fpga_image_info *info,
 79                             struct list_head *bridge_list);
 80 int of_fpga_bridge_get_to_list(struct device_node *np,
 81                                struct fpga_image_info *info,
 82                                struct list_head *bridge_list);
 83 
 84 #define fpga_bridge_register(parent, name, br_ops, priv) \
 85         __fpga_bridge_register(parent, name, br_ops, priv, THIS_MODULE)
 86 struct fpga_bridge *
 87 __fpga_bridge_register(struct device *parent, const char *name,
 88                        const struct fpga_bridge_ops *br_ops, void *priv,
 89                        struct module *owner);
 90 void fpga_bridge_unregister(struct fpga_bridge *br);
 91 
 92 #endif /* _LINUX_FPGA_BRIDGE_H */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php