mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
qcacld-3.0: Add device pointer in PLD PCIe APIs
Add device pointer in all PLD PCIe APIs in order to support numerous WLAN devices. Change-Id: Id9b2fb14ef3de715f6127ac2301d7ad87d493c14 CRs-fixed: 2134245
This commit is contained in:
parent
5ff417c273
commit
85761e64ca
3 changed files with 232 additions and 58 deletions
|
|
@ -469,18 +469,21 @@ int pld_get_fw_files_for_target(struct device *dev,
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_get_fw_files_for_target(pfw_files,
|
||||
target_type, target_version);
|
||||
ret = pld_pcie_get_fw_files_for_target(dev, pfw_files,
|
||||
target_type,
|
||||
target_version);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
case PLD_BUS_TYPE_SDIO:
|
||||
ret = pld_sdio_get_fw_files_for_target(pfw_files,
|
||||
target_type, target_version);
|
||||
target_type,
|
||||
target_version);
|
||||
break;
|
||||
case PLD_BUS_TYPE_USB:
|
||||
ret = pld_usb_get_fw_files_for_target(pfw_files,
|
||||
target_type, target_version);
|
||||
target_type,
|
||||
target_version);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
|
@ -554,7 +557,7 @@ int pld_wlan_pm_control(struct device *dev, bool vote)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_wlan_pm_control(vote);
|
||||
ret = pld_pcie_wlan_pm_control(dev, vote);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -581,7 +584,7 @@ void *pld_get_virt_ramdump_mem(struct device *dev, unsigned long *size)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
mem = pld_pcie_get_virt_ramdump_mem(size);
|
||||
mem = pld_pcie_get_virt_ramdump_mem(dev, size);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -609,7 +612,7 @@ void pld_device_crashed(struct device *dev)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_device_crashed();
|
||||
pld_pcie_device_crashed(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -659,7 +662,7 @@ void pld_intr_notify_q6(struct device *dev)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_intr_notify_q6();
|
||||
pld_pcie_intr_notify_q6(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -682,7 +685,7 @@ void pld_request_pm_qos(struct device *dev, u32 qos_val)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_request_pm_qos(qos_val);
|
||||
pld_pcie_request_pm_qos(dev, qos_val);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -709,7 +712,7 @@ void pld_remove_pm_qos(struct device *dev)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_remove_pm_qos();
|
||||
pld_pcie_remove_pm_qos(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -738,7 +741,7 @@ int pld_request_bus_bandwidth(struct device *dev, int bandwidth)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_request_bus_bandwidth(bandwidth);
|
||||
ret = pld_pcie_request_bus_bandwidth(dev, bandwidth);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -769,7 +772,7 @@ int pld_get_platform_cap(struct device *dev, struct pld_platform_cap *cap)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_get_platform_cap(cap);
|
||||
ret = pld_pcie_get_platform_cap(dev, cap);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -803,7 +806,7 @@ int pld_get_sha_hash(struct device *dev, const u8 *data,
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_get_sha_hash(data, data_len,
|
||||
ret = pld_pcie_get_sha_hash(dev, data, data_len,
|
||||
hash_idx, out);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
|
|
@ -830,7 +833,7 @@ void *pld_get_fw_ptr(struct device *dev)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ptr = pld_pcie_get_fw_ptr();
|
||||
ptr = pld_pcie_get_fw_ptr(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -857,7 +860,7 @@ int pld_auto_suspend(struct device *dev)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_auto_suspend();
|
||||
ret = pld_pcie_auto_suspend(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -884,7 +887,7 @@ int pld_auto_resume(struct device *dev)
|
|||
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_auto_resume();
|
||||
ret = pld_pcie_auto_resume(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -1051,7 +1054,7 @@ int pld_get_ce_id(struct device *dev, int irq)
|
|||
ret = pld_snoc_get_ce_id(dev, irq);
|
||||
break;
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
ret = pld_pcie_get_ce_id(irq);
|
||||
ret = pld_pcie_get_ce_id(dev, irq);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
|
@ -1095,7 +1098,7 @@ void pld_lock_pm_sem(struct device *dev)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_lock_pm_sem();
|
||||
pld_pcie_lock_pm_sem(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
@ -1119,7 +1122,7 @@ void pld_release_pm_sem(struct device *dev)
|
|||
{
|
||||
switch (pld_get_bus_type(dev)) {
|
||||
case PLD_BUS_TYPE_PCIE:
|
||||
pld_pcie_release_pm_sem();
|
||||
pld_pcie_release_pm_sem(dev);
|
||||
break;
|
||||
case PLD_BUS_TYPE_SNOC:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -529,11 +529,12 @@ void pld_pcie_unregister_driver(void)
|
|||
|
||||
/**
|
||||
* pld_pcie_get_ce_id() - Get CE number for the provided IRQ
|
||||
* @dev: device
|
||||
* @irq: IRQ number
|
||||
*
|
||||
* Return: CE number
|
||||
*/
|
||||
int pld_pcie_get_ce_id(int irq)
|
||||
int pld_pcie_get_ce_id(struct device *dev, int irq)
|
||||
{
|
||||
int ce_id = irq - 100;
|
||||
|
||||
|
|
@ -546,6 +547,7 @@ int pld_pcie_get_ce_id(int irq)
|
|||
#ifdef CONFIG_PLD_PCIE_CNSS
|
||||
/**
|
||||
* pld_pcie_wlan_enable() - Enable WLAN
|
||||
* @dev: device
|
||||
* @config: WLAN configuration data
|
||||
* @mode: WLAN mode
|
||||
* @host_version: host software version
|
||||
|
|
@ -591,6 +593,7 @@ int pld_pcie_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
|
|||
|
||||
/**
|
||||
* pld_pcie_wlan_disable() - Disable WLAN
|
||||
* @dev: device
|
||||
* @mode: WLAN mode
|
||||
*
|
||||
* This function disables WLAN FW. It passes WLAN mode to FW.
|
||||
|
|
@ -605,6 +608,7 @@ int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode)
|
|||
|
||||
/**
|
||||
* pld_pcie_get_fw_files_for_target() - Get FW file names
|
||||
* @dev: device
|
||||
* @pfw_files: buffer for FW file names
|
||||
* @target_type: target type
|
||||
* @target_version: target version
|
||||
|
|
@ -614,7 +618,9 @@ int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode)
|
|||
* Return: 0 for success
|
||||
* Non zero failure code for errors
|
||||
*/
|
||||
int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
||||
#ifdef CNSS_API_WITH_DEV
|
||||
int pld_pcie_get_fw_files_for_target(struct device *dev,
|
||||
struct pld_fw_files *pfw_files,
|
||||
u32 target_type, u32 target_version)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -625,9 +631,9 @@ int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
|||
|
||||
memset(pfw_files, 0, sizeof(*pfw_files));
|
||||
|
||||
ret = cnss_get_fw_files_for_target(&cnss_fw_files,
|
||||
ret = cnss_get_fw_files_for_target(dev, &cnss_fw_files,
|
||||
target_type, target_version);
|
||||
if (0 != ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
strlcpy(pfw_files->image_file, cnss_fw_files.image_file,
|
||||
|
|
@ -647,9 +653,46 @@ int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int pld_pcie_get_fw_files_for_target(struct device *dev,
|
||||
struct pld_fw_files *pfw_files,
|
||||
u32 target_type, u32 target_version)
|
||||
{
|
||||
int ret = 0;
|
||||
struct cnss_fw_files cnss_fw_files;
|
||||
|
||||
if (pfw_files == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
memset(pfw_files, 0, sizeof(*pfw_files));
|
||||
|
||||
ret = cnss_get_fw_files_for_target(&cnss_fw_files,
|
||||
target_type, target_version);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
strlcpy(pfw_files->image_file, cnss_fw_files.image_file,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->board_data, cnss_fw_files.board_data,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->otp_data, cnss_fw_files.otp_data,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->utf_file, cnss_fw_files.utf_file,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->utf_board_data, cnss_fw_files.utf_board_data,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->epping_file, cnss_fw_files.epping_file,
|
||||
PLD_MAX_FILE_NAME);
|
||||
strlcpy(pfw_files->evicted_data, cnss_fw_files.evicted_data,
|
||||
PLD_MAX_FILE_NAME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* pld_pcie_get_platform_cap() - Get platform capabilities
|
||||
* @dev: device
|
||||
* @cap: buffer to the capabilities
|
||||
*
|
||||
* Return capabilities to the buffer.
|
||||
|
|
@ -657,7 +700,24 @@ int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
|||
* Return: 0 for success
|
||||
* Non zero failure code for errors
|
||||
*/
|
||||
int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
|
||||
#ifdef CNSS_API_WITH_DEV
|
||||
int pld_pcie_get_platform_cap(struct device *dev, struct pld_platform_cap *cap)
|
||||
{
|
||||
int ret = 0;
|
||||
struct cnss_platform_cap cnss_cap;
|
||||
|
||||
if (cap == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
ret = cnss_get_platform_cap(dev, &cnss_cap);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
memcpy(cap, &cnss_cap, sizeof(*cap));
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int pld_pcie_get_platform_cap(struct device *dev, struct pld_platform_cap *cap)
|
||||
{
|
||||
int ret = 0;
|
||||
struct cnss_platform_cap cnss_cap;
|
||||
|
|
@ -666,15 +726,17 @@ int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
|
|||
return -ENODEV;
|
||||
|
||||
ret = cnss_get_platform_cap(&cnss_cap);
|
||||
if (0 != ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
memcpy(cap, &cnss_cap, sizeof(*cap));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* pld_pcie_get_soc_info() - Get SOC information
|
||||
* @dev: device
|
||||
* @info: buffer to SOC information
|
||||
*
|
||||
* Return SOC info to the buffer.
|
||||
|
|
|
|||
|
|
@ -43,14 +43,14 @@ static inline void pld_pcie_unregister_driver(void)
|
|||
{
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_ce_id(int irq)
|
||||
static inline int pld_pcie_get_ce_id(struct device *dev, int irq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int pld_pcie_register_driver(void);
|
||||
void pld_pcie_unregister_driver(void);
|
||||
int pld_pcie_get_ce_id(int irq);
|
||||
int pld_pcie_get_ce_id(struct device *dev, int irq);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PLD_PCIE_CNSS
|
||||
|
|
@ -61,6 +61,7 @@ static inline int pld_pcie_wlan_enable(struct device *dev,
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_wlan_disable(struct device *dev,
|
||||
enum pld_driver_mode mode)
|
||||
{
|
||||
|
|
@ -77,7 +78,8 @@ static inline int pld_pcie_set_fw_log_mode(struct device *dev, u8 fw_log_mode)
|
|||
{
|
||||
return cnss_set_fw_debug_mode(fw_log_mode);
|
||||
}
|
||||
static inline void pld_pcie_intr_notify_q6(void)
|
||||
|
||||
static inline void pld_pcie_intr_notify_q6(struct device *dev)
|
||||
{
|
||||
cnss_intr_notify_q6();
|
||||
}
|
||||
|
|
@ -86,7 +88,8 @@ static inline int pld_pcie_set_fw_log_mode(struct device *dev, u8 fw_log_mode)
|
|||
{
|
||||
return cnss_set_fw_log_mode(dev, fw_log_mode);
|
||||
}
|
||||
static inline void pld_pcie_intr_notify_q6(void)
|
||||
|
||||
static inline void pld_pcie_intr_notify_q6(struct device *dev)
|
||||
{
|
||||
}
|
||||
#else
|
||||
|
|
@ -94,128 +97,163 @@ static inline int pld_pcie_set_fw_log_mode(struct device *dev, u8 fw_log_mode)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void pld_pcie_intr_notify_q6(void)
|
||||
|
||||
static inline void pld_pcie_intr_notify_q6(struct device *dev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_CNSS_SECURE_FW))
|
||||
static inline int pld_pcie_get_sha_hash(const u8 *data,
|
||||
static inline int pld_pcie_get_sha_hash(struct device *dev, const u8 *data,
|
||||
u32 data_len, u8 *hash_idx, u8 *out)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void *pld_pcie_get_fw_ptr(void)
|
||||
|
||||
static inline void *pld_pcie_get_fw_ptr(struct device *dev)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
static inline int pld_pcie_get_sha_hash(const u8 *data,
|
||||
static inline int pld_pcie_get_sha_hash(struct device *dev, const u8 *data,
|
||||
u32 data_len, u8 *hash_idx, u8 *out)
|
||||
{
|
||||
return cnss_get_sha_hash(data, data_len, hash_idx, out);
|
||||
}
|
||||
static inline void *pld_pcie_get_fw_ptr(void)
|
||||
|
||||
static inline void *pld_pcie_get_fw_ptr(struct device *dev)
|
||||
{
|
||||
return cnss_get_fw_ptr();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_PCI_MSM))
|
||||
static inline int pld_pcie_wlan_pm_control(bool vote)
|
||||
static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline int pld_pcie_wlan_pm_control(bool vote)
|
||||
#ifdef CNSS_API_WITH_DEV
|
||||
static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote)
|
||||
{
|
||||
return cnss_wlan_pm_control(dev, vote);
|
||||
}
|
||||
#else
|
||||
static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote)
|
||||
{
|
||||
return cnss_wlan_pm_control(vote);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PLD_PCIE_CNSS
|
||||
static inline int
|
||||
pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
||||
pld_pcie_get_fw_files_for_target(struct device *dev,
|
||||
struct pld_fw_files *pfw_files,
|
||||
u32 target_type, u32 target_version)
|
||||
{
|
||||
pld_get_default_fw_files(pfw_files);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pld_pcie_link_down(struct device *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int pld_pcie_athdiag_read(struct device *dev, uint32_t offset,
|
||||
uint32_t memtype, uint32_t datalen,
|
||||
uint8_t *output)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_athdiag_write(struct device *dev, uint32_t offset,
|
||||
uint32_t memtype, uint32_t datalen,
|
||||
uint8_t *input)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void pld_pcie_schedule_recovery_work(struct device *dev,
|
||||
enum pld_recovery_reason reason)
|
||||
|
||||
static inline void
|
||||
pld_pcie_schedule_recovery_work(struct device *dev,
|
||||
enum pld_recovery_reason reason)
|
||||
{
|
||||
}
|
||||
static inline void *pld_pcie_get_virt_ramdump_mem(unsigned long *size)
|
||||
|
||||
static inline void *pld_pcie_get_virt_ramdump_mem(struct device *dev,
|
||||
unsigned long *size)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void pld_pcie_device_crashed(void)
|
||||
|
||||
static inline void pld_pcie_device_crashed(struct device *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void pld_pcie_device_self_recovery(struct device *dev,
|
||||
enum pld_recovery_reason reason)
|
||||
{
|
||||
}
|
||||
static inline void pld_pcie_request_pm_qos(u32 qos_val)
|
||||
|
||||
static inline void pld_pcie_request_pm_qos(struct device *dev, u32 qos_val)
|
||||
{
|
||||
}
|
||||
static inline void pld_pcie_remove_pm_qos(void)
|
||||
|
||||
static inline void pld_pcie_remove_pm_qos(struct device *dev)
|
||||
{
|
||||
}
|
||||
static inline int pld_pcie_request_bus_bandwidth(int bandwidth)
|
||||
|
||||
static inline int pld_pcie_request_bus_bandwidth(struct device *dev,
|
||||
int bandwidth)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
|
||||
|
||||
static inline int pld_pcie_get_platform_cap(struct device *dev,
|
||||
struct pld_platform_cap *cap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_soc_info(struct device *dev,
|
||||
struct pld_soc_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_auto_suspend(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int pld_pcie_auto_resume(void)
|
||||
|
||||
static inline int pld_pcie_auto_resume(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void pld_pcie_lock_pm_sem(void)
|
||||
|
||||
static inline void pld_pcie_lock_pm_sem(struct device *dev)
|
||||
{
|
||||
}
|
||||
static inline void pld_pcie_release_pm_sem(void)
|
||||
|
||||
static inline void pld_pcie_release_pm_sem(struct device *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int pld_pcie_power_on(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_power_off(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_force_assert_target(struct device *dev)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_user_msi_assignment(struct device *dev,
|
||||
char *user_name,
|
||||
int *num_vectors,
|
||||
|
|
@ -224,10 +262,12 @@ static inline int pld_pcie_get_user_msi_assignment(struct device *dev,
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pld_pcie_get_msi_address(struct device *dev,
|
||||
uint32_t *msi_addr_low,
|
||||
uint32_t *msi_addr_high)
|
||||
|
|
@ -235,9 +275,10 @@ static inline void pld_pcie_get_msi_address(struct device *dev,
|
|||
return;
|
||||
}
|
||||
#else
|
||||
int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
|
||||
int pld_pcie_get_fw_files_for_target(struct device *dev,
|
||||
struct pld_fw_files *pfw_files,
|
||||
u32 target_type, u32 target_version);
|
||||
int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);
|
||||
int pld_pcie_get_platform_cap(struct device *dev, struct pld_platform_cap *cap);
|
||||
int pld_pcie_get_soc_info(struct device *dev, struct pld_soc_info *info);
|
||||
void pld_pcie_schedule_recovery_work(struct device *dev,
|
||||
enum pld_recovery_reason reason);
|
||||
|
|
@ -248,66 +289,132 @@ static inline void pld_pcie_link_down(struct device *dev)
|
|||
{
|
||||
cnss_pci_link_down(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_athdiag_read(struct device *dev, uint32_t offset,
|
||||
uint32_t memtype, uint32_t datalen,
|
||||
uint8_t *output)
|
||||
{
|
||||
return cnss_athdiag_read(dev, offset, memtype, datalen, output);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_athdiag_write(struct device *dev, uint32_t offset,
|
||||
uint32_t memtype, uint32_t datalen,
|
||||
uint8_t *input)
|
||||
{
|
||||
return cnss_athdiag_write(dev, offset, memtype, datalen, input);
|
||||
}
|
||||
static inline void *pld_pcie_get_virt_ramdump_mem(unsigned long *size)
|
||||
|
||||
#ifdef CNSS_API_WITH_DEV
|
||||
static inline void *pld_pcie_get_virt_ramdump_mem(struct device *dev,
|
||||
unsigned long *size)
|
||||
{
|
||||
return cnss_get_virt_ramdump_mem(dev, size);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_device_crashed(struct device *dev)
|
||||
{
|
||||
cnss_device_crashed(dev);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_request_pm_qos(struct device *dev, u32 qos_val)
|
||||
{
|
||||
cnss_request_pm_qos(dev, qos_val);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_remove_pm_qos(struct device *dev)
|
||||
{
|
||||
cnss_remove_pm_qos(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_request_bus_bandwidth(struct device *dev,
|
||||
int bandwidth)
|
||||
{
|
||||
return cnss_request_bus_bandwidth(dev, bandwidth);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_auto_suspend(struct device *dev)
|
||||
{
|
||||
return cnss_auto_suspend(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_auto_resume(struct device *dev)
|
||||
{
|
||||
return cnss_auto_resume(dev);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_lock_pm_sem(struct device *dev)
|
||||
{
|
||||
cnss_lock_pm_sem(dev);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_release_pm_sem(struct device *dev)
|
||||
{
|
||||
cnss_release_pm_sem(dev);
|
||||
}
|
||||
#else
|
||||
static inline void *pld_pcie_get_virt_ramdump_mem(struct device *dev,
|
||||
unsigned long *size)
|
||||
{
|
||||
return cnss_get_virt_ramdump_mem(size);
|
||||
}
|
||||
static inline void pld_pcie_device_crashed(void)
|
||||
|
||||
static inline void pld_pcie_device_crashed(struct device *dev)
|
||||
{
|
||||
cnss_device_crashed();
|
||||
}
|
||||
static inline void pld_pcie_request_pm_qos(u32 qos_val)
|
||||
|
||||
static inline void pld_pcie_request_pm_qos(struct device *dev, u32 qos_val)
|
||||
{
|
||||
cnss_request_pm_qos(qos_val);
|
||||
}
|
||||
static inline void pld_pcie_remove_pm_qos(void)
|
||||
|
||||
static inline void pld_pcie_remove_pm_qos(struct device *dev)
|
||||
{
|
||||
cnss_remove_pm_qos();
|
||||
}
|
||||
static inline int pld_pcie_request_bus_bandwidth(int bandwidth)
|
||||
|
||||
static inline int pld_pcie_request_bus_bandwidth(struct device *dev,
|
||||
int bandwidth)
|
||||
{
|
||||
return cnss_request_bus_bandwidth(bandwidth);
|
||||
}
|
||||
static inline int pld_pcie_auto_suspend(void)
|
||||
|
||||
static inline int pld_pcie_auto_suspend(struct device *dev)
|
||||
{
|
||||
return cnss_auto_suspend();
|
||||
}
|
||||
static inline int pld_pcie_auto_resume(void)
|
||||
|
||||
static inline int pld_pcie_auto_resume(struct device *dev)
|
||||
{
|
||||
return cnss_auto_resume();
|
||||
}
|
||||
static inline void pld_pcie_lock_pm_sem(void)
|
||||
|
||||
static inline void pld_pcie_lock_pm_sem(struct device *dev)
|
||||
{
|
||||
cnss_lock_pm_sem();
|
||||
}
|
||||
static inline void pld_pcie_release_pm_sem(void)
|
||||
|
||||
static inline void pld_pcie_release_pm_sem(struct device *dev)
|
||||
{
|
||||
cnss_release_pm_sem();
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int pld_pcie_power_on(struct device *dev)
|
||||
{
|
||||
return cnss_power_up(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_power_off(struct device *dev)
|
||||
{
|
||||
return cnss_power_down(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_force_assert_target(struct device *dev)
|
||||
{
|
||||
return cnss_force_fw_assert(dev);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_user_msi_assignment(struct device *dev,
|
||||
char *user_name,
|
||||
int *num_vectors,
|
||||
|
|
@ -317,10 +424,12 @@ static inline int pld_pcie_get_user_msi_assignment(struct device *dev,
|
|||
return cnss_get_user_msi_assignment(dev, user_name, num_vectors,
|
||||
user_base_data, base_vector);
|
||||
}
|
||||
|
||||
static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector)
|
||||
{
|
||||
return cnss_get_msi_irq(dev, vector);
|
||||
}
|
||||
|
||||
static inline void pld_pcie_get_msi_address(struct device *dev,
|
||||
uint32_t *msi_addr_low,
|
||||
uint32_t *msi_addr_high)
|
||||
|
|
|
|||
Loading…
Reference in a new issue