summaryrefslogtreecommitdiffstats
path: root/include/linux/cdx
diff options
context:
space:
mode:
authorAbhijit Gangurde <abhijit.gangurde@amd.com>2023-10-17 21:35:03 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-27 13:23:24 +0200
commite3cfd49cb9491ac1cc233a4b9e098688b4ab281d (patch)
tree15029eab27a1d6205226fa16d723222bb7363d84 /include/linux/cdx
parentce558a391d80b9f47a462107977e8e81fe2f2962 (diff)
downloadlinux-stable-e3cfd49cb9491ac1cc233a4b9e098688b4ab281d.tar.gz
linux-stable-e3cfd49cb9491ac1cc233a4b9e098688b4ab281d.tar.bz2
linux-stable-e3cfd49cb9491ac1cc233a4b9e098688b4ab281d.zip
cdx: add support for bus enable and disable
CDX bus needs to be disabled before updating/writing devices in the FPGA. Once the devices are written, the bus shall be rescanned. This change provides sysfs entry to enable/disable the CDX bus. Co-developed-by: Nipun Gupta <nipun.gupta@amd.com> Signed-off-by: Nipun Gupta <nipun.gupta@amd.com> Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com> Link: https://lore.kernel.org/r/20231017160505.10640-6-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/cdx')
-rw-r--r--include/linux/cdx/cdx_bus.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/cdx/cdx_bus.h b/include/linux/cdx/cdx_bus.h
index b5e4b7e05666..18e95076d1d5 100644
--- a/include/linux/cdx/cdx_bus.h
+++ b/include/linux/cdx/cdx_bus.h
@@ -28,6 +28,10 @@ struct cdx_device_config {
u8 type;
};
+typedef int (*cdx_bus_enable_cb)(struct cdx_controller *cdx, u8 bus_num);
+
+typedef int (*cdx_bus_disable_cb)(struct cdx_controller *cdx, u8 bus_num);
+
typedef int (*cdx_scan_cb)(struct cdx_controller *cdx);
typedef int (*cdx_dev_configure_cb)(struct cdx_controller *cdx,
@@ -49,11 +53,15 @@ typedef int (*cdx_dev_configure_cb)(struct cdx_controller *cdx,
/**
* struct cdx_ops - Callbacks supported by CDX controller.
+ * @bus_enable: enable bus on the controller
+ * @bus_disable: disable bus on the controller
* @scan: scan the devices on the controller
* @dev_configure: configuration like reset, master_enable,
* msi_config etc for a CDX device
*/
struct cdx_ops {
+ cdx_bus_enable_cb bus_enable;
+ cdx_bus_disable_cb bus_disable;
cdx_scan_cb scan;
cdx_dev_configure_cb dev_configure;
};
@@ -89,6 +97,7 @@ struct cdx_controller {
* @flags: CDX device flags
* @req_id: Requestor ID associated with CDX device
* @is_bus: Is this bus device
+ * @enabled: is this bus enabled
* @driver_override: driver name to force a match; do not set directly,
* because core frees it; use driver_set_override() to
* set or clear it.
@@ -106,6 +115,7 @@ struct cdx_device {
u16 flags;
u32 req_id;
bool is_bus;
+ bool enabled;
const char *driver_override;
};