linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: tegra: PCIe: Provide 3.3V supply voltage
@ 2012-02-17 15:44 Thierry Reding
       [not found] ` <1329493468-7741-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2012-02-17 15:44 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA

The PCIe reference clock needs a 3.3V supply voltage to work properly.

Signed-off-by: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
---
This patch is based on next-20120217. Note that PCIe works without this
patch when the Linux kernel is booted with a combination of QuickBoot
and U-Boot because either apparently sets LD0 to 3.3V. This is not the
case when booting from mainline U-Boot, so it must be set explicitly.

 arch/arm/mach-tegra/board-harmony-pcie.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index 33c4fed..d521cf4 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -45,6 +45,10 @@ static int __init harmony_pcie_init(void)
 	if (IS_ERR_OR_NULL(regulator))
 		goto err_reg;
 
+	err = regulator_set_voltage(regulator, 3300000, 3300000);
+	if (err < 0)
+		goto err_put;
+
 	regulator_enable(regulator);
 
 	err = tegra_pcie_init(true, true);
@@ -55,6 +59,7 @@ static int __init harmony_pcie_init(void)
 
 err_pcie:
 	regulator_disable(regulator);
+err_put:
 	regulator_put(regulator);
 err_reg:
 	gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO);
-- 
1.7.9.1

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

* Re: [PATCH] ARM: tegra: PCIe: Provide 3.3V supply voltage
       [not found] ` <1329493468-7741-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
@ 2012-02-17 16:39   ` Mark Brown
       [not found]     ` <20120217163931.GB961-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2012-02-17 16:39 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Fri, Feb 17, 2012 at 04:44:28PM +0100, Thierry Reding wrote:

> +	err = regulator_set_voltage(regulator, 3300000, 3300000);
> +	if (err < 0)
> +		goto err_put;
> +

This is a bit weird, why is this not just set by constraints?

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

* Re: [PATCH] ARM: tegra: PCIe: Provide 3.3V supply voltage
       [not found]     ` <20120217163931.GB961-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2012-02-17 19:16       ` Thierry Reding
       [not found]         ` <20120217191605.GA11127-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2012-02-17 19:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

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

* Mark Brown wrote:
> On Fri, Feb 17, 2012 at 04:44:28PM +0100, Thierry Reding wrote:
> 
> > +	err = regulator_set_voltage(regulator, 3300000, 3300000);
> > +	if (err < 0)
> > +		goto err_put;
> > +
> 
> This is a bit weird, why is this not just set by constraints?

I guess because I didn't know any better. I don't have access to the hardware
right now, so it'll have to wait until Monday. I'll follow up with a patch
after I've verified that setting via constraints works.

Thierry

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

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

* Re: [PATCH] ARM: tegra: PCIe: Provide 3.3V supply voltage
       [not found]         ` <20120217191605.GA11127-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
@ 2012-02-17 19:25           ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-02-17 19:25 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

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

On Fri, Feb 17, 2012 at 08:16:05PM +0100, Thierry Reding wrote:
> * Mark Brown wrote:

> > This is a bit weird, why is this not just set by constraints?

> I guess because I didn't know any better. I don't have access to the hardware
> right now, so it'll have to wait until Monday. I'll follow up with a patch
> after I've verified that setting via constraints works.

OK.  In general the expected idiom is that drivers will only use
set_voltage() if they actually need to change the voltage at runtime, if
they just need a single fixed voltage then the expectation is that
either the board will boot in the correct configuration or the setup
will be done by constraints.  This replaces code with data (which is
generally a good thing) and avoids issues with things like error
handling when working with fixed voltage regulators.

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

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

end of thread, other threads:[~2012-02-17 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 15:44 [PATCH] ARM: tegra: PCIe: Provide 3.3V supply voltage Thierry Reding
     [not found] ` <1329493468-7741-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-02-17 16:39   ` Mark Brown
     [not found]     ` <20120217163931.GB961-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-17 19:16       ` Thierry Reding
     [not found]         ` <20120217191605.GA11127-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-02-17 19:25           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).