linux-stable/drivers/cdx/controller/mcdi_functions.h
Nipun Gupta 48a6c7bced 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>
2023-03-29 12:26:32 +02:00

61 lines
1.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0
*
* Header file for MCDI FW interaction for CDX bus.
*
* Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
*/
#ifndef CDX_MCDI_FUNCTIONS_H
#define CDX_MCDI_FUNCTIONS_H
#include "mcdi.h"
#include "../cdx.h"
/**
* cdx_mcdi_get_num_buses - Get the total number of buses on
* the controller.
* @cdx: pointer to MCDI interface.
*
* Return: total number of buses available on the controller,
* <0 on failure
*/
int cdx_mcdi_get_num_buses(struct cdx_mcdi *cdx);
/**
* cdx_mcdi_get_num_devs - Get the total number of devices on
* a particular bus of the controller.
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
*
* Return: total number of devices available on the bus, <0 on failure
*/
int cdx_mcdi_get_num_devs(struct cdx_mcdi *cdx, int bus_num);
/**
* cdx_mcdi_get_dev_config - Get configuration for a particular
* bus_num:dev_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
* @dev_num: Device number.
* @dev_params: Pointer to cdx_dev_params, this is populated by this
* device with the configuration corresponding to the provided
* bus_num:dev_num.
*
* Return: 0 total number of devices available on the bus, <0 on failure
*/
int cdx_mcdi_get_dev_config(struct cdx_mcdi *cdx,
u8 bus_num, u8 dev_num,
struct cdx_dev_params *dev_params);
/**
* cdx_mcdi_reset_device - Reset cdx device represented by bus_num:dev_num
* @cdx: pointer to MCDI interface.
* @bus_num: Bus number.
* @dev_num: Device number.
*
* Return: 0 on success, <0 on failure
*/
int cdx_mcdi_reset_device(struct cdx_mcdi *cdx,
u8 bus_num, u8 dev_num);
#endif /* CDX_MCDI_FUNCTIONS_H */