diff options
| author | Abhijit Gangurde <[email protected]> | 2023-10-17 16:05:03 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-10-27 11:23:24 +0000 |
| commit | e3cfd49cb9491ac1cc233a4b9e098688b4ab281d (patch) | |
| tree | 15029eab27a1d6205226fa16d723222bb7363d84 /drivers/cdx/controller/cdx_controller.c | |
| parent | cdx: Register cdx bus as a device on cdx subsystem (diff) | |
| download | kernel-e3cfd49cb9491ac1cc233a4b9e098688b4ab281d.tar.gz kernel-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 <[email protected]>
Signed-off-by: Nipun Gupta <[email protected]>
Signed-off-by: Abhijit Gangurde <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/cdx/controller/cdx_controller.c')
| -rw-r--r-- | drivers/cdx/controller/cdx_controller.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c index b4e0d6b40339..f2a691efd1f1 100644 --- a/drivers/cdx/controller/cdx_controller.c +++ b/drivers/cdx/controller/cdx_controller.c @@ -33,6 +33,16 @@ static const struct cdx_mcdi_ops mcdi_ops = { .mcdi_request = cdx_mcdi_request, }; +static int cdx_bus_enable(struct cdx_controller *cdx, u8 bus_num) +{ + return cdx_mcdi_bus_enable(cdx->priv, bus_num); +} + +static int cdx_bus_disable(struct cdx_controller *cdx, u8 bus_num) +{ + return cdx_mcdi_bus_disable(cdx->priv, bus_num); +} + void cdx_rpmsg_post_probe(struct cdx_controller *cdx) { /* Register CDX controller with CDX bus driver */ @@ -128,6 +138,8 @@ static int cdx_scan_devices(struct cdx_controller *cdx) } static struct cdx_ops cdx_ops = { + .bus_enable = cdx_bus_enable, + .bus_disable = cdx_bus_disable, .scan = cdx_scan_devices, .dev_configure = cdx_configure_device, }; |
