1 /* SPDX-License-Identifier: GPL-2.0
3 * Header file for MCDI FW interaction for CDX bus.
5 * Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
8 #ifndef CDX_MCDI_FUNCTIONS_H
9 #define CDX_MCDI_FUNCTIONS_H
15 * cdx_mcdi_get_num_buses - Get the total number of buses on
17 * @cdx: pointer to MCDI interface.
19 * Return: total number of buses available on the controller,
22 int cdx_mcdi_get_num_buses(struct cdx_mcdi *cdx);
25 * cdx_mcdi_get_num_devs - Get the total number of devices on
26 * a particular bus of the controller.
27 * @cdx: pointer to MCDI interface.
28 * @bus_num: Bus number.
30 * Return: total number of devices available on the bus, <0 on failure
32 int cdx_mcdi_get_num_devs(struct cdx_mcdi *cdx, int bus_num);
35 * cdx_mcdi_get_dev_config - Get configuration for a particular
37 * @cdx: pointer to MCDI interface.
38 * @bus_num: Bus number.
39 * @dev_num: Device number.
40 * @dev_params: Pointer to cdx_dev_params, this is populated by this
41 * device with the configuration corresponding to the provided
44 * Return: 0 total number of devices available on the bus, <0 on failure
46 int cdx_mcdi_get_dev_config(struct cdx_mcdi *cdx,
47 u8 bus_num, u8 dev_num,
48 struct cdx_dev_params *dev_params);
51 * cdx_mcdi_reset_device - Reset cdx device represented by bus_num:dev_num
52 * @cdx: pointer to MCDI interface.
53 * @bus_num: Bus number.
54 * @dev_num: Device number.
56 * Return: 0 on success, <0 on failure
58 int cdx_mcdi_reset_device(struct cdx_mcdi *cdx,
59 u8 bus_num, u8 dev_num);
61 #endif /* CDX_MCDI_FUNCTIONS_H */