mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] regulator: ti-abb: misc fixes
@ 2013-09-27 13:25 Nishanth Menon
  2013-09-27 13:25 ` [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address Nishanth Menon
  2013-09-27 13:25 ` [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override Nishanth Menon
  0 siblings, 2 replies; 5+ messages in thread
From: Nishanth Menon @ 2013-09-27 13:25 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Nishanth Menon

The following are a couple of fixes for ti-abb regulator based on
updated I documentation and tests.


Based on v3.12-rc2 tag. These fixes could be punted to 3.13-rc1 as the
current OMAP support in master is not ready for use yet.

Nishanth Menon (2):
  regulator: ti-abb: skip optional parameter for ldo-address
  regulator: ti-abb: Fix bias voltage glitch in transition to bypass
    mode with ldo voltage override

 drivers/regulator/ti-abb-regulator.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

-- 
1.7.9.5

Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address
  2013-09-27 13:25 [PATCH 0/2] regulator: ti-abb: misc fixes Nishanth Menon
@ 2013-09-27 13:25 ` Nishanth Menon
  2013-09-27 14:02   ` Mark Brown
  2013-09-27 13:25 ` [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override Nishanth Menon
  1 sibling, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2013-09-27 13:25 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Nishanth Menon

On platforms like OMAP4460, LDO override is never used. Even though
efuse determines the ABB bias mode to operate at, ABB voltage is
preconfigured in internal efuse registers without the need for
LDO override for bias voltage. So skip optional parameter if
property is not present.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/regulator/ti-abb-regulator.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index d8e3e12..1e02805 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -765,6 +765,11 @@ static int ti_abb_probe(struct platform_device *pdev)
 
 	pname = "ldo-address";
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname);
+	if (!res) {
+		dev_dbg(dev, "Missing '%s' IO resource\n", pname);
+		ret = -ENODEV;
+		goto skip_opt;
+	}
 	abb->ldo_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(abb->ldo_base)) {
 		ret = PTR_ERR(abb->ldo_base);
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override
  2013-09-27 13:25 [PATCH 0/2] regulator: ti-abb: misc fixes Nishanth Menon
  2013-09-27 13:25 ` [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address Nishanth Menon
@ 2013-09-27 13:25 ` Nishanth Menon
  2013-09-27 14:01   ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2013-09-27 13:25 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Nishanth Menon

As documented in Application Note SWPA117 v2.1(NDA), LDO override has a
requirement that when switching from Bias active + override active
mode(FBB/RBB) to Bypass(nominal) mode, LDO reset must be performed
*after* LDO transitions to Bypass(nominal) mode.

The same rule in reverse applies when switching from a ABB bypass mode
to ABB enabled - LDO override *must* be performed prior to transition to
required ABB mode, if we do not do that, the same glitch takes place.

Currently while transitioning to ABB bypass, we reset the LDO overide
prior to the transition which causes a few milliseconds where ABB LDO
voltage could go all the way to 800mV(based on SoC process node),
during this period, the delta voltage between VDD rail and VBB rail
could cause the system to improperly function.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/regulator/ti-abb-regulator.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index 1e02805..b951a84 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -279,8 +279,12 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb,
 	ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg,
 		   abb->base);
 
-	/* program LDO VBB vset override if needed */
-	if (abb->ldo_base)
+	/*
+	 * program LDO VBB vset override if needed for !bypass mode
+	 * XXX: Do not switch sequence - for !bypass, LDO override reset *must*
+	 * be performed *before* switch to bias mode else VBB glitches.
+	 */
+	if (abb->ldo_base && info->opp_sel != TI_ABB_NOMINAL_OPP)
 		ti_abb_program_ldovbb(dev, abb, info);
 
 	/* Initiate ABB ldo change */
@@ -295,6 +299,14 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb,
 	if (ret)
 		goto out;
 
+	/*
+	 * Reset LDO VBB vset override bypass mode
+	 * XXX: Do not switch sequence - for bypass, LDO override reset *must*
+	 * be performed *after* switch to bypass else VBB glitches.
+	 */
+	if (abb->ldo_base && info->opp_sel == TI_ABB_NOMINAL_OPP)
+		ti_abb_program_ldovbb(dev, abb, info);
+
 out:
 	return ret;
 }
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override
  2013-09-27 13:25 ` [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override Nishanth Menon
@ 2013-09-27 14:01   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-09-27 14:01 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

On Fri, Sep 27, 2013 at 08:25:14AM -0500, Nishanth Menon wrote:
> As documented in Application Note SWPA117 v2.1(NDA), LDO override has a
> requirement that when switching from Bias active + override active
> mode(FBB/RBB) to Bypass(nominal) mode, LDO reset must be performed
> *after* LDO transitions to Bypass(nominal) mode.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address
  2013-09-27 13:25 ` [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address Nishanth Menon
@ 2013-09-27 14:02   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-09-27 14:02 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

On Fri, Sep 27, 2013 at 08:25:13AM -0500, Nishanth Menon wrote:
> On platforms like OMAP4460, LDO override is never used. Even though
> efuse determines the ABB bias mode to operate at, ABB voltage is
> preconfigured in internal efuse registers without the need for
> LDO override for bias voltage. So skip optional parameter if
> property is not present.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-27 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-27 13:25 [PATCH 0/2] regulator: ti-abb: misc fixes Nishanth Menon
2013-09-27 13:25 ` [PATCH 1/2] regulator: ti-abb: skip optional parameter for ldo-address Nishanth Menon
2013-09-27 14:02   ` Mark Brown
2013-09-27 13:25 ` [PATCH 2/2] regulator: ti-abb: Fix bias voltage glitch in transition to bypass mode with ldo voltage override Nishanth Menon
2013-09-27 14:01   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome