diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.h | 6 |
2 files changed, 22 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); } diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 5809141..dd5b21e 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -177,6 +177,8 @@ struct omap_smartreflex_dev_attr { * * @enable: API to enable a particular class smaartreflex. * @disable: API to disable a particular class smartreflex. + * @init: API to do class specific initialization (optional) + * @deinit: API to do class specific deinitialization (optional) * @configure: API to configure a particular class smartreflex. * @notify: API to notify the class driver about an event in SR. * Not needed for class3. @@ -184,14 +186,18 @@ struct omap_smartreflex_dev_attr { * @class_type: specify which smartreflex class. * Can be used by the SR driver to take any class * based decisions. + * @class_priv_data: Class specific private data (optional) */ struct omap_sr_class_data { int (*enable)(struct voltagedomain *voltdm); int (*disable)(struct voltagedomain *voltdm, int is_volt_reset); + int (*init)(struct voltagedomain *voltdm, void *class_priv_data); + int (*deinit)(struct voltagedomain *voltdm, void *class_priv_data); int (*configure)(struct voltagedomain *voltdm); int (*notify)(struct voltagedomain *voltdm, u32 status); u8 notify_flags; u8 class_type; + void *class_priv_data; }; /** |