PM / devfreq: devbw: Add suspend/resume APIs

Absence of traffic is guaranteed when the device sitting behind a devbw
device is suspended. In such cases, it is a waste of power to make non-zero
bandwidth votes or to scale the devbw device. So, provide APIs to
suspend/resume the devbw device as needed.

Change-Id: Id58072aec7a9710eb917f248d9b9bd08d3a1ec6a
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
This commit is contained in:
Saravana Kannan 2014-08-07 20:04:45 -07:00 committed by David Keitel
parent d30f7c6607
commit 6be4cb0755
2 changed files with 27 additions and 5 deletions

View file

@ -214,11 +214,6 @@ int devfreq_add_devbw(struct device *dev)
return 0; return 0;
} }
static int devfreq_devbw_probe(struct platform_device *pdev)
{
return devfreq_add_devbw(&pdev->dev);
}
int devfreq_remove_devbw(struct device *dev) int devfreq_remove_devbw(struct device *dev)
{ {
struct dev_data *d = dev_get_drvdata(dev); struct dev_data *d = dev_get_drvdata(dev);
@ -227,6 +222,23 @@ int devfreq_remove_devbw(struct device *dev)
return 0; return 0;
} }
int devfreq_suspend_devbw(struct device *dev)
{
struct dev_data *d = dev_get_drvdata(dev);
return devfreq_suspend_device(d->df);
}
int devfreq_resume_devbw(struct device *dev)
{
struct dev_data *d = dev_get_drvdata(dev);
return devfreq_resume_device(d->df);
}
static int devfreq_devbw_probe(struct platform_device *pdev)
{
return devfreq_add_devbw(&pdev->dev);
}
static int devfreq_devbw_remove(struct platform_device *pdev) static int devfreq_devbw_remove(struct platform_device *pdev)
{ {
return devfreq_remove_devbw(&pdev->dev); return devfreq_remove_devbw(&pdev->dev);

View file

@ -19,6 +19,8 @@
#ifdef CONFIG_MSM_DEVFREQ_DEVBW #ifdef CONFIG_MSM_DEVFREQ_DEVBW
int devfreq_add_devbw(struct device *dev); int devfreq_add_devbw(struct device *dev);
int devfreq_remove_devbw(struct device *dev); int devfreq_remove_devbw(struct device *dev);
int devfreq_suspend_devbw(struct device *dev);
int devfreq_resume_devbw(struct device *dev);
#else #else
static inline int devfreq_add_devbw(struct device *dev) static inline int devfreq_add_devbw(struct device *dev)
{ {
@ -28,6 +30,14 @@ static inline int devfreq_remove_devbw(struct device *dev)
{ {
return 0; return 0;
} }
static inline int devfreq_suspend_devbw(struct device *dev)
{
return 0;
}
static inline int devfreq_resume_devbw(struct device *dev)
{
return 0;
}
#endif #endif
#endif /* _DEVFREQ_DEVBW_H */ #endif /* _DEVFREQ_DEVBW_H */