qcacld-3.0: Use sync method to awake device
Use sync wake when trying to awake device for register accessing. This can avoid device re-enter low power mode after device_wake asserted. Change-Id: I9ce421be0ecdf05a26388732cc8e15154c57a47a CRs-Fixed: 2703608
This commit is contained in:
parent
3951d21516
commit
299a322de1
@ -644,6 +644,16 @@ void *pld_get_fw_ptr(struct device *dev);
|
|||||||
int pld_auto_suspend(struct device *dev);
|
int pld_auto_suspend(struct device *dev);
|
||||||
int pld_auto_resume(struct device *dev);
|
int pld_auto_resume(struct device *dev);
|
||||||
int pld_force_wake_request(struct device *dev);
|
int pld_force_wake_request(struct device *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pld_force_wake_request_sync() - Request to awake MHI synchronously
|
||||||
|
* @dev: device
|
||||||
|
* @timeout_us: timeout in micro-sec request to wake
|
||||||
|
*
|
||||||
|
* Return: 0 for success
|
||||||
|
* Non zero failure code for errors
|
||||||
|
*/
|
||||||
|
int pld_force_wake_request_sync(struct device *dev, int timeout_us);
|
||||||
int pld_is_device_awake(struct device *dev);
|
int pld_is_device_awake(struct device *dev);
|
||||||
int pld_force_wake_release(struct device *dev);
|
int pld_force_wake_release(struct device *dev);
|
||||||
int pld_ce_request_irq(struct device *dev, unsigned int ce_id,
|
int pld_ce_request_irq(struct device *dev, unsigned int ce_id,
|
||||||
|
@ -1175,6 +1175,32 @@ int pld_force_wake_request(struct device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pld_force_wake_request_sync(struct device *dev, int timeout_us)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
enum pld_bus_type type = pld_get_bus_type(dev);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PLD_BUS_TYPE_PCIE:
|
||||||
|
ret = pld_pcie_force_wake_request_sync(dev, timeout_us);
|
||||||
|
break;
|
||||||
|
case PLD_BUS_TYPE_PCIE_FW_SIM:
|
||||||
|
case PLD_BUS_TYPE_IPCI_FW_SIM:
|
||||||
|
case PLD_BUS_TYPE_SNOC_FW_SIM:
|
||||||
|
case PLD_BUS_TYPE_SNOC:
|
||||||
|
case PLD_BUS_TYPE_SDIO:
|
||||||
|
case PLD_BUS_TYPE_USB:
|
||||||
|
case PLD_BUS_TYPE_IPCI:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pr_err("Invalid device type %d\n", type);
|
||||||
|
ret = -EINVAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pld_is_device_awake() - Check if it's ready to access MMIO registers
|
* pld_is_device_awake() - Check if it's ready to access MMIO registers
|
||||||
* @dev: device
|
* @dev: device
|
||||||
|
@ -274,6 +274,12 @@ static inline int pld_pcie_force_wake_request(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int pld_pcie_force_wake_request_sync(struct device *dev,
|
||||||
|
int timeout_us)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int pld_pcie_is_device_awake(struct device *dev)
|
static inline int pld_pcie_is_device_awake(struct device *dev)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -512,6 +518,12 @@ static inline int pld_pcie_force_wake_request(struct device *dev)
|
|||||||
return cnss_pci_force_wake_request(dev);
|
return cnss_pci_force_wake_request(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int pld_pcie_force_wake_request_sync(struct device *dev,
|
||||||
|
int timeout_us)
|
||||||
|
{
|
||||||
|
return cnss_pci_force_wake_request_sync(dev, timeout_us);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int pld_pcie_is_device_awake(struct device *dev)
|
static inline int pld_pcie_is_device_awake(struct device *dev)
|
||||||
{
|
{
|
||||||
return cnss_pci_is_device_awake(dev);
|
return cnss_pci_is_device_awake(dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user