diff options
author | Nishanth Menon <nm@ti.com> | 2011-02-14 12:29:03 +0530 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2011-11-30 15:27:06 -0800 |
commit | 0b21c45b4e940b5e04be97da4ce2f331aff9d0b4 (patch) | |
tree | 2bb7746c041a7ffc7e7b371836288d23cb0bda26 /arch/arm/mach-omap2/smartreflex.c | |
parent | d16236560b184558833eab092e8cf35cc8df3952 (diff) | |
download | kernel_samsung_tuna-0b21c45b4e940b5e04be97da4ce2f331aff9d0b4.zip kernel_samsung_tuna-0b21c45b4e940b5e04be97da4ce2f331aff9d0b4.tar.gz kernel_samsung_tuna-0b21c45b4e940b5e04be97da4ce2f331aff9d0b4.tar.bz2 |
OMAP3+: SR: introduce class init,deinit and priv data
Certain class drivers such as class 1.5 drivers, will need specific
notification that they have to be inited up or deinited independent
of smart reflex operation. They also may need private data to be
used for operations of their own, provide the same.
This allows the class driver to initialize it's internal data structures
on a need basis in preparation for the specific domain's autocomp usage.
The resultant operation is as follows:
when autocomp is set to 1 -> class drivers' init is called
The existing enable/disable is still used as before by the SmartReflex
core driver to enable disable the class operation.
When autocomp is set to 0 -> class drivers' deinit is called, signaling
the end of usage for that domain.
Change-Id: Ie6a4b163d52af4931a4506ed7a3a6b752173a674
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 3b28da9..823d334 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -220,6 +220,15 @@ static void sr_start_vddautocomp(struct omap_sr *sr) /* pause dvfs from interfereing with our operations */ mutex_lock(&omap_dvfs_lock); + + if (sr_class->init && + sr_class->init(sr->voltdm, sr_class->class_priv_data)) { + dev_err(&sr->pdev->dev, + "%s: SRClass initialization failed\n", __func__); + mutex_unlock(&omap_dvfs_lock); + return; + } + if (!sr_class->enable(sr->voltdm)) sr->autocomp_active = true; mutex_unlock(&omap_dvfs_lock); @@ -238,6 +247,13 @@ static void sr_stop_vddautocomp(struct omap_sr *sr) /* Pause dvfs from interfereing with our operations */ mutex_lock(&omap_dvfs_lock); sr_class->disable(sr->voltdm, 1); + if (sr_class->deinit && + sr_class->deinit(sr->voltdm, + sr_class->class_priv_data)) { + dev_err(&sr->pdev->dev, + "%s: SR[%d]Class deinitialization failed\n", + __func__, sr->srid); + } sr->autocomp_active = false; mutex_unlock(&omap_dvfs_lock); } |