public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] tegra20: add clock_set_pllout function
Date: Mon, 20 Aug 2012 12:19:54 -0600	[thread overview]
Message-ID: <50327FCA.1060304@wwwdotorg.org> (raw)
In-Reply-To: <1345392496-28739-3-git-send-email-dev@lynxeye.de>

On 08/19/2012 10:08 AM, Lucas Stach wrote:
> Common practice on Tegra 2 boards is to use the pllp_out4 FO
> to generate the ULPI reference clock. For this to work we have
> to override the default hardware generated output divider.
> 
> This function adds a clean way to do so.

> diff --git a/arch/arm/cpu/tegra20-common/clock.c b/arch/arm/cpu/tegra20-common/clock.c

> +int clock_set_pllout(enum clock_id clkid, enum pll_out_id pllout, unsigned rate)
> +{
> +	struct clk_pll *pll = get_pll(clkid);
> +	int data = 0, div = 0, offset = 0;
> +
> +	if (!clock_id_is_pll(clkid))
> +		return -1;

If you're going to error-check; you may as well limit the range of
pllout too; not all PLLs have 4 outputs.

Other than that, I think this seems OK.

  reply	other threads:[~2012-08-20 18:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-19 16:08 [U-Boot] [PATCH 0/3] Tegra 2 USB ULPI series Lucas Stach
2012-08-19 16:08 ` [U-Boot] [PATCH 1/3] tegra20: complete periph_id enum Lucas Stach
2012-08-20 18:12   ` Stephen Warren
2012-08-21 19:04   ` Simon Glass
2012-08-19 16:08 ` [U-Boot] [PATCH 2/3] tegra20: add clock_set_pllout function Lucas Stach
2012-08-20 18:19   ` Stephen Warren [this message]
2012-08-19 16:08 ` [U-Boot] [PATCH 3/3] tegra20: add USB ULPI init code Lucas Stach
2012-08-20 12:07   ` Igor Grinberg
2012-08-20 12:41     ` Lucas Stach
2012-08-20 18:27       ` Stephen Warren
2012-08-21  7:59         ` Igor Grinberg
2012-08-21  7:54       ` Igor Grinberg
2012-08-20 18:25   ` Stephen Warren
2012-08-20 12:27 ` [U-Boot] [PATCH 0/3] Tegra 2 USB ULPI series Igor Grinberg
2012-08-20 12:43   ` Lucas Stach
2012-08-20 18:09 ` Stephen Warren
2012-08-20 19:59   ` Lucas Stach
2012-08-22 16:06     ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50327FCA.1060304@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox