diff options
| -rw-r--r-- | arch/arm/mach-omap2/smartreflex-class3.c | 4 | ||||
| -rw-r--r-- | drivers/power/avs/smartreflex.c | 26 | ||||
| -rw-r--r-- | include/linux/power/smartreflex.h | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c index aee3c8940a30..6c26dc15815c 100644 --- a/arch/arm/mach-omap2/smartreflex-class3.c +++ b/arch/arm/mach-omap2/smartreflex-class3.c | |||
| @@ -31,7 +31,7 @@ static int sr_class3_enable(struct omap_sr *sr) | |||
| 31 | 31 | ||
| 32 | static int sr_class3_disable(struct omap_sr *sr, int is_volt_reset) | 32 | static int sr_class3_disable(struct omap_sr *sr, int is_volt_reset) |
| 33 | { | 33 | { |
| 34 | sr_disable_errgen(sr->voltdm); | 34 | sr_disable_errgen(sr); |
| 35 | omap_vp_disable(sr->voltdm); | 35 | omap_vp_disable(sr->voltdm); |
| 36 | sr_disable(sr->voltdm); | 36 | sr_disable(sr->voltdm); |
| 37 | if (is_volt_reset) | 37 | if (is_volt_reset) |
| @@ -42,7 +42,7 @@ static int sr_class3_disable(struct omap_sr *sr, int is_volt_reset) | |||
| 42 | 42 | ||
| 43 | static int sr_class3_configure(struct omap_sr *sr) | 43 | static int sr_class3_configure(struct omap_sr *sr) |
| 44 | { | 44 | { |
| 45 | return sr_configure_errgen(sr->voltdm); | 45 | return sr_configure_errgen(sr); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /* SR class3 structure */ | 48 | /* SR class3 structure */ |
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 002005ee48d2..fccb62743d19 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c | |||
| @@ -342,9 +342,9 @@ static struct omap_sr_nvalue_table *sr_retrieve_nvalue_row( | |||
| 342 | /* Public Functions */ | 342 | /* Public Functions */ |
| 343 | 343 | ||
| 344 | /** | 344 | /** |
| 345 | * sr_configure_errgen() - Configures the smrtreflex to perform AVS using the | 345 | * sr_configure_errgen() - Configures the SmartReflex to perform AVS using the |
| 346 | * error generator module. | 346 | * error generator module. |
| 347 | * @voltdm: VDD pointer to which the SR module to be configured belongs to. | 347 | * @sr: SR module to be configured. |
| 348 | * | 348 | * |
| 349 | * This API is to be called from the smartreflex class driver to | 349 | * This API is to be called from the smartreflex class driver to |
| 350 | * configure the error generator module inside the smartreflex module. | 350 | * configure the error generator module inside the smartreflex module. |
| @@ -353,17 +353,17 @@ static struct omap_sr_nvalue_table *sr_retrieve_nvalue_row( | |||
| 353 | * SR CLASS 2 can choose between ERROR module and MINMAXAVG | 353 | * SR CLASS 2 can choose between ERROR module and MINMAXAVG |
| 354 | * module. Returns 0 on success and error value in case of failure. | 354 | * module. Returns 0 on success and error value in case of failure. |
| 355 | */ | 355 | */ |
| 356 | int sr_configure_errgen(struct voltagedomain *voltdm) | 356 | int sr_configure_errgen(struct omap_sr *sr) |
| 357 | { | 357 | { |
| 358 | u32 sr_config, sr_errconfig, errconfig_offs; | 358 | u32 sr_config, sr_errconfig, errconfig_offs; |
| 359 | u32 vpboundint_en, vpboundint_st; | 359 | u32 vpboundint_en, vpboundint_st; |
| 360 | u32 senp_en = 0, senn_en = 0; | 360 | u32 senp_en = 0, senn_en = 0; |
| 361 | u8 senp_shift, senn_shift; | 361 | u8 senp_shift, senn_shift; |
| 362 | struct omap_sr *sr = _sr_lookup(voltdm); | ||
| 363 | 362 | ||
| 364 | if (IS_ERR(sr)) { | 363 | if (!sr) { |
| 365 | pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); | 364 | pr_warn("%s: NULL omap_sr from %pF\n", __func__, |
| 366 | return PTR_ERR(sr); | 365 | (void *)_RET_IP_); |
| 366 | return -EINVAL; | ||
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | if (!sr->clk_length) | 369 | if (!sr->clk_length) |
| @@ -415,22 +415,22 @@ int sr_configure_errgen(struct voltagedomain *voltdm) | |||
| 415 | 415 | ||
| 416 | /** | 416 | /** |
| 417 | * sr_disable_errgen() - Disables SmartReflex AVS module's errgen component | 417 | * sr_disable_errgen() - Disables SmartReflex AVS module's errgen component |
| 418 | * @voltdm: VDD pointer to which the SR module to be configured belongs to. | 418 | * @sr: SR module to be configured. |
| 419 | * | 419 | * |
| 420 | * This API is to be called from the smartreflex class driver to | 420 | * This API is to be called from the smartreflex class driver to |
| 421 | * disable the error generator module inside the smartreflex module. | 421 | * disable the error generator module inside the smartreflex module. |
| 422 | * | 422 | * |
| 423 | * Returns 0 on success and error value in case of failure. | 423 | * Returns 0 on success and error value in case of failure. |
| 424 | */ | 424 | */ |
| 425 | int sr_disable_errgen(struct voltagedomain *voltdm) | 425 | int sr_disable_errgen(struct omap_sr *sr) |
| 426 | { | 426 | { |
| 427 | u32 errconfig_offs; | 427 | u32 errconfig_offs; |
| 428 | u32 vpboundint_en, vpboundint_st; | 428 | u32 vpboundint_en, vpboundint_st; |
| 429 | struct omap_sr *sr = _sr_lookup(voltdm); | ||
| 430 | 429 | ||
| 431 | if (IS_ERR(sr)) { | 430 | if (!sr) { |
| 432 | pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); | 431 | pr_warn("%s: NULL omap_sr from %pF\n", __func__, |
| 433 | return PTR_ERR(sr); | 432 | (void *)_RET_IP_); |
| 433 | return -EINVAL; | ||
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | switch (sr->ip_type) { | 436 | switch (sr->ip_type) { |
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index c0f44c2b006d..9c3b9ad17095 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h | |||
| @@ -301,8 +301,8 @@ void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); | |||
| 301 | /* Smartreflex driver hooks to be called from Smartreflex class driver */ | 301 | /* Smartreflex driver hooks to be called from Smartreflex class driver */ |
| 302 | int sr_enable(struct voltagedomain *voltdm, unsigned long volt); | 302 | int sr_enable(struct voltagedomain *voltdm, unsigned long volt); |
| 303 | void sr_disable(struct voltagedomain *voltdm); | 303 | void sr_disable(struct voltagedomain *voltdm); |
| 304 | int sr_configure_errgen(struct voltagedomain *voltdm); | 304 | int sr_configure_errgen(struct omap_sr *sr); |
| 305 | int sr_disable_errgen(struct voltagedomain *voltdm); | 305 | int sr_disable_errgen(struct omap_sr *sr); |
| 306 | int sr_configure_minmax(struct voltagedomain *voltdm); | 306 | int sr_configure_minmax(struct voltagedomain *voltdm); |
| 307 | 307 | ||
| 308 | /* API to register the smartreflex class driver with the smartreflex driver */ | 308 | /* API to register the smartreflex class driver with the smartreflex driver */ |
