aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fpga/fpga-bridge.h
diff options
context:
space:
mode:
authorAlan Tull <atull@kernel.org>2017-11-15 15:20:11 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 10:30:36 -0500
commit9c1c4b2753fea36a072e78a5efc82fca0d13b455 (patch)
treedfac82fbde45ad1a5fd62aef49b82bf995509d14 /include/linux/fpga/fpga-bridge.h
parent4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff)
fpga: bridge: support getting bridge from device
Add two functions for getting the FPGA bridge from the device rather than device tree node. This is to enable writing code that will support using FPGA bridges without device tree. Rename one old function to make it clear that it is device tree-ish. This leaves us with 3 functions for getting a bridge: * fpga_bridge_get Get the bridge given the device. * fpga_bridges_get_to_list Given the device, get the bridge and add it to a list. * of_fpga_bridges_get_to_list Renamed from priviously existing fpga_bridges_get_to_list. Given the device node, get the bridge and add it to a list. 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-bridge.h')
-rw-r--r--include/linux/fpga/fpga-bridge.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/fpga/fpga-bridge.h b/include/linux/fpga/fpga-bridge.h
index aa66c87c120b..6ca41f8f949f 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
8struct fpga_bridge; 9struct fpga_bridge;
9 10
10/** 11/**
@@ -43,6 +44,8 @@ struct fpga_bridge {
43 44
44struct fpga_bridge *of_fpga_bridge_get(struct device_node *node, 45struct fpga_bridge *of_fpga_bridge_get(struct device_node *node,
45 struct fpga_image_info *info); 46 struct fpga_image_info *info);
47struct fpga_bridge *fpga_bridge_get(struct device *dev,
48 struct fpga_image_info *info);
46void fpga_bridge_put(struct fpga_bridge *bridge); 49void fpga_bridge_put(struct fpga_bridge *bridge);
47int fpga_bridge_enable(struct fpga_bridge *bridge); 50int fpga_bridge_enable(struct fpga_bridge *bridge);
48int fpga_bridge_disable(struct fpga_bridge *bridge); 51int fpga_bridge_disable(struct fpga_bridge *bridge);
@@ -50,9 +53,12 @@ int fpga_bridge_disable(struct fpga_bridge *bridge);
50int fpga_bridges_enable(struct list_head *bridge_list); 53int fpga_bridges_enable(struct list_head *bridge_list);
51int fpga_bridges_disable(struct list_head *bridge_list); 54int fpga_bridges_disable(struct list_head *bridge_list);
52void fpga_bridges_put(struct list_head *bridge_list); 55void fpga_bridges_put(struct list_head *bridge_list);
53int fpga_bridge_get_to_list(struct device_node *np, 56int fpga_bridge_get_to_list(struct device *dev,
54 struct fpga_image_info *info, 57 struct fpga_image_info *info,
55 struct list_head *bridge_list); 58 struct list_head *bridge_list);
59int of_fpga_bridge_get_to_list(struct device_node *np,
60 struct fpga_image_info *info,
61 struct list_head *bridge_list);
56 62
57int fpga_bridge_register(struct device *dev, const char *name, 63int fpga_bridge_register(struct device *dev, const char *name,
58 const struct fpga_bridge_ops *br_ops, void *priv); 64 const struct fpga_bridge_ops *br_ops, void *priv);