mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
cdx: add device attributes
Create sysfs entry for CDX devices. Sysfs entries provided in each of the CDX device detected by the CDX controller - vendor id - device id - remove - reset of the device. - driver override Signed-off-by: Puneet Gupta <puneet.gupta@amd.com> Signed-off-by: Nipun Gupta <nipun.gupta@amd.com> Signed-off-by: Tarak Reddy <tarak.reddy@amd.com> Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com> Tested-by: Nikhil Agarwal <nikhil.agarwal@amd.com> Link: https://lore.kernel.org/r/20230313132636.31850-8-nipun.gupta@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2a226927d9
commit
48a6c7bced
@@ -45,6 +45,23 @@ void cdx_rpmsg_pre_remove(struct cdx_controller *cdx)
|
||||
cdx_mcdi_wait_for_quiescence(cdx->priv, MCDI_RPC_TIMEOUT);
|
||||
}
|
||||
|
||||
static int cdx_configure_device(struct cdx_controller *cdx,
|
||||
u8 bus_num, u8 dev_num,
|
||||
struct cdx_device_config *dev_config)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
switch (dev_config->type) {
|
||||
case CDX_DEV_RESET_CONF:
|
||||
ret = cdx_mcdi_reset_device(cdx->priv, bus_num, dev_num);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cdx_scan_devices(struct cdx_controller *cdx)
|
||||
{
|
||||
struct cdx_mcdi *cdx_mcdi = cdx->priv;
|
||||
@@ -104,6 +121,7 @@ static int cdx_scan_devices(struct cdx_controller *cdx)
|
||||
|
||||
static struct cdx_ops cdx_ops = {
|
||||
.scan = cdx_scan_devices,
|
||||
.dev_configure = cdx_configure_device,
|
||||
};
|
||||
|
||||
static int xlnx_cdx_probe(struct platform_device *pdev)
|
||||
|
||||
Reference in New Issue
Block a user