diff mbox

[pm-wip/voltdm_nm,03/10] OMAP4: PM: VC: allow channels to use cmdra reg

Message ID 1307412972-25854-4-git-send-email-nm@ti.com (mailing list archive)
State Not Applicable
Delegated to: Kevin Hilman
Headers show

Commit Message

Nishanth Menon June 7, 2011, 2:16 a.m. UTC
if volt_reg and cmd_reg are the same from PMIC configuration,
we can use the cmd reg by using racen - this is valid for
voltage commands, however, in most cases, we'd like to retain
voltage reg configuration as well for vfsm commands going thru
from h/w.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/vc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Comments

Kevin Hilman June 9, 2011, 5:48 p.m. UTC | #1
Nishanth Menon <nm@ti.com> writes:

> if volt_reg and cmd_reg are the same from PMIC configuration,
> we can use the cmd reg by using racen - 

-ECONFUSED

If volt_reg and cmd_reg are the same then I understood RACEN to be a
don't care.  Zero means use volt_reg, 1 means use cmd_reg, but if
volt_reg == cmd_reg, then either way is the same result.

The way I understood (and coded) this is that the only time you need
RACEN set is precicesly the case when a cmd_reg is provided (and thus is
different from volt_reg.

What am I missing?

Or, stated differently, I guess I don't understand the use case for 
RAC != RACEN

Kevin

> this is valid for
> voltage commands, however, in most cases, we'd like to retain
> voltage reg configuration as well for vfsm commands going thru
> from h/w.
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  arch/arm/mach-omap2/vc.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
> index 0c0e416..6017c70 100644
> --- a/arch/arm/mach-omap2/vc.c
> +++ b/arch/arm/mach-omap2/vc.c
> @@ -337,9 +337,13 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
>  		voltdm->rmw(vc->smps_cmdra_mask,
>  			    vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask),
>  			    vc->common->smps_cmdra_reg);
> -		vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen;
> +		vc->cfg_channel |= vc_cfg_bits->rac;
>  	}
>  
> +	/* If voltage and cmd regs are same, we can use cmdra register */
> +	if (vc->volt_reg_addr == vc->cmd_reg_addr)
> +		vc->cfg_channel |= vc_cfg_bits->racen;
> +
>  	/* Set up the on, inactive, retention and off voltage */
>  	on_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->on_volt);
>  	onlp_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->onlp_volt);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 0c0e416..6017c70 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -337,9 +337,13 @@  void __init omap_vc_init_channel(struct voltagedomain *voltdm)
 		voltdm->rmw(vc->smps_cmdra_mask,
 			    vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask),
 			    vc->common->smps_cmdra_reg);
-		vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen;
+		vc->cfg_channel |= vc_cfg_bits->rac;
 	}
 
+	/* If voltage and cmd regs are same, we can use cmdra register */
+	if (vc->volt_reg_addr == vc->cmd_reg_addr)
+		vc->cfg_channel |= vc_cfg_bits->racen;
+
 	/* Set up the on, inactive, retention and off voltage */
 	on_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->on_volt);
 	onlp_vsel = voltdm->pmic->uv_to_vsel(voltdm->pmic->onlp_volt);