提交 6c805734 编写于 作者: A Andrii Tseglytskyi 提交者: Kevin Hilman

PM / AVS: SmartReflex: use omap_sr * for minmax interfaces

SmartReflex driver interface is natively divided to two parts:

- external SmartReflex interface
- interface between SmartReflex driver and SmartReflex Class

Functions which belong to AVS class interface can use
struct omap_sr* instead of struct voltatedomain*, to provide a
direct connection between SR driver and SR class. This allows
us to optimize and not do additional lookups where none is
required.

sr_configure_minmax() is interface function between SR driver
and SR class. It is typically used by Class driver to
configure MINMAXAVG module inside SmartReflex module.
Now it takes struct omap_sr* as input parameter.
Signed-off-by: NAndrii Tseglytskyi <andrii.tseglytskyi@ti.com>
Acked-by: NNishanth Menon <nm@ti.com>
Signed-off-by: NKevin Hilman <khilman@linaro.org>
上级 3dfc35ff
...@@ -465,9 +465,9 @@ int sr_disable_errgen(struct omap_sr *sr) ...@@ -465,9 +465,9 @@ int sr_disable_errgen(struct omap_sr *sr)
} }
/** /**
* sr_configure_minmax() - Configures the smrtreflex to perform AVS using the * sr_configure_minmax() - Configures the SmartReflex to perform AVS using the
* minmaxavg module. * minmaxavg module.
* @voltdm: VDD pointer to which the SR module to be configured belongs to. * @sr: SR module to be configured.
* *
* This API is to be called from the smartreflex class driver to * This API is to be called from the smartreflex class driver to
* configure the minmaxavg module inside the smartreflex module. * configure the minmaxavg module inside the smartreflex module.
...@@ -476,16 +476,16 @@ int sr_disable_errgen(struct omap_sr *sr) ...@@ -476,16 +476,16 @@ int sr_disable_errgen(struct omap_sr *sr)
* SR CLASS 2 can choose between ERROR module and MINMAXAVG * SR CLASS 2 can choose between ERROR module and MINMAXAVG
* module. Returns 0 on success and error value in case of failure. * module. Returns 0 on success and error value in case of failure.
*/ */
int sr_configure_minmax(struct voltagedomain *voltdm) int sr_configure_minmax(struct omap_sr *sr)
{ {
u32 sr_config, sr_avgwt; u32 sr_config, sr_avgwt;
u32 senp_en = 0, senn_en = 0; u32 senp_en = 0, senn_en = 0;
u8 senp_shift, senn_shift; u8 senp_shift, senn_shift;
struct omap_sr *sr = _sr_lookup(voltdm);
if (IS_ERR(sr)) { if (!sr) {
pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); pr_warn("%s: NULL omap_sr from %pF\n", __func__,
return PTR_ERR(sr); (void *)_RET_IP_);
return -EINVAL;
} }
if (!sr->clk_length) if (!sr->clk_length)
......
...@@ -303,7 +303,7 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt); ...@@ -303,7 +303,7 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
void sr_disable(struct voltagedomain *voltdm); void sr_disable(struct voltagedomain *voltdm);
int sr_configure_errgen(struct omap_sr *sr); int sr_configure_errgen(struct omap_sr *sr);
int sr_disable_errgen(struct omap_sr *sr); int sr_disable_errgen(struct omap_sr *sr);
int sr_configure_minmax(struct voltagedomain *voltdm); int sr_configure_minmax(struct omap_sr *sr);
/* API to register the smartreflex class driver with the smartreflex driver */ /* API to register the smartreflex class driver with the smartreflex driver */
int sr_register_class(struct omap_sr_class_data *class_data); int sr_register_class(struct omap_sr_class_data *class_data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册