qcacld-3.0: Define PLD APIs for idle shutdown and restart

Define PLD APIs for idle shutdown and restart such that platform
driver can serialize PSOC idle shutdown and restart with driver
load/unload and SSR shutdown/reinit.

Change-Id: I4e772343fbccb099b9af104ac978dcdb650a567a
CRs-Fixed: 2431405
This commit is contained in:
Rajeev Kumar 2019-04-08 10:31:41 -07:00 committed by nshrivas
parent 88e5800271
commit e01118e85f
2 changed files with 68 additions and 0 deletions

View File

@ -304,6 +304,10 @@ enum pld_recovery_reason {
* struct pld_driver_ops - driver callback functions
* @probe: required operation, will be called when device is detected
* @remove: required operation, will be called when device is removed
* @idle_shutdown: required operation, will be called when device is doing
* idle shutdown after interface inactivity timer has fired
* @idle_restart: required operation, will be called when device is doing
* idle restart after idle shutdown
* @shutdown: optional operation, will be called during SSR
* @reinit: optional operation, will be called during SSR
* @crash_shutdown: optional operation, will be called when a crash is
@ -331,6 +335,10 @@ struct pld_driver_ops {
void *bdev, void *id);
void (*remove)(struct device *dev,
enum pld_bus_type bus_type);
void (*idle_shutdown)(struct device *dev,
enum pld_bus_type bus_type);
void (*idle_restart)(struct device *dev,
enum pld_bus_type bus_type);
void (*shutdown)(struct device *dev,
enum pld_bus_type bus_type);
int (*reinit)(struct device *dev,
@ -625,6 +633,26 @@ int pld_is_fw_rejuvenate(struct device *dev);
*/
bool pld_have_platform_driver_support(struct device *dev);
/**
* pld_idle_shutdown - request idle shutdown callback from platform driver
* @dev: pointer to struct dev
* @shutdown_cb: pointer to hdd psoc idle shutdown callback handler
*
* Return: none
*/
void pld_idle_shutdown(struct device *dev,
void (*shutdown_cb)(struct device *dev));
/**
* pld_idle_restart - request idle restart callback from platform driver
* @dev: pointer to struct dev
* @restart_cb: pointer to hdd psoc idle restart callback handler
*
* Return: none
*/
void pld_idle_restart(struct device *dev,
void (*restart_cb)(struct device *dev));
#if defined(CONFIG_WCNSS_MEM_PRE_ALLOC) && defined(FEATURE_SKB_PRE_ALLOC)
/**

View File

@ -1776,3 +1776,43 @@ void pld_block_shutdown(struct device *dev, bool status)
break;
}
}
void pld_idle_shutdown(struct device *dev,
void (*shutdown_cb)(struct device *dev))
{
enum pld_bus_type type;
if (!shutdown_cb)
return;
type = pld_get_bus_type(dev);
switch (type) {
case PLD_BUS_TYPE_SNOC:
shutdown_cb(dev);
break;
case PLD_BUS_TYPE_PCIE:
break;
default:
break;
}
}
void pld_idle_restart(struct device *dev,
void (*restart_cb)(struct device *dev))
{
enum pld_bus_type type;
if (!restart_cb)
return;
type = pld_get_bus_type(dev);
switch (type) {
case PLD_BUS_TYPE_SNOC:
restart_cb(dev);
break;
case PLD_BUS_TYPE_PCIE:
break;
default:
break;
}
}