soc: rockchip: power-domain: export qos save and restore

Change-Id: I89af4462f561fa06ace7761e20cf522b5954aaed
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This commit is contained in:
Finley Xiao
2018-01-05 16:43:14 +08:00
committed by Tao Huang
parent 0b54bf037b
commit bce1425f50

View File

@@ -268,6 +268,52 @@ static int rockchip_pmu_restore_qos(struct rockchip_pm_domain *pd)
return 0;
}
int rockchip_save_qos(struct device *dev)
{
struct generic_pm_domain *genpd;
struct rockchip_pm_domain *pd;
int ret;
if (IS_ERR_OR_NULL(dev))
return -EINVAL;
if (IS_ERR_OR_NULL(dev->pm_domain))
return -EINVAL;
genpd = pd_to_genpd(dev->pm_domain);
pd = to_rockchip_pd(genpd);
mutex_lock(&pd->pmu->mutex);
ret = rockchip_pmu_save_qos(pd);
mutex_unlock(&pd->pmu->mutex);
return ret;
}
EXPORT_SYMBOL(rockchip_save_qos);
int rockchip_restore_qos(struct device *dev)
{
struct generic_pm_domain *genpd;
struct rockchip_pm_domain *pd;
int ret;
if (IS_ERR_OR_NULL(dev))
return -EINVAL;
if (IS_ERR_OR_NULL(dev->pm_domain))
return -EINVAL;
genpd = pd_to_genpd(dev->pm_domain);
pd = to_rockchip_pd(genpd);
mutex_lock(&pd->pmu->mutex);
ret = rockchip_pmu_restore_qos(pd);
mutex_unlock(&pd->pmu->mutex);
return ret;
}
EXPORT_SYMBOL(rockchip_restore_qos);
static bool rockchip_pmu_domain_is_on(struct rockchip_pm_domain *pd)
{
struct rockchip_pmu *pmu = pd->pmu;