From: sivaramn@nvidia.com (Sivaram Nair)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/9] clk: tegra: Add tegra specific clocks
Date: Mon, 14 Jan 2013 09:28:55 +0200 [thread overview]
Message-ID: <20130114072855.GB17884@sivaramn-lnx> (raw)
In-Reply-To: <1357890387-23245-3-git-send-email-pgaikwad@nvidia.com>
On Fri, Jan 11, 2013 at 08:46:20AM +0100, Prashant Gaikwad wrote:
> +static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
> + unsigned long rate)
> +{
> + struct tegra_clk_pll *pll = to_clk_pll(hw);
> + unsigned long flags = 0;
> + u32 divp, val, old_base;
> + int state;
> +
> + divp = __ffs(cfg->p);
> +
> + if (pll->flags & TEGRA_PLLU)
> + divp ^= 1;
> +
> + if (pll->lock)
> + spin_lock_irqsave(pll->lock, flags);
> +
> + old_base = val = pll_readl_base(pll);
> + val &= ~((divm_mask(pll) << pll->divm_shift) |
> + (divn_mask(pll) << pll->divn_shift) |
> + (divp_mask(pll) << pll->divp_shift));
> + val |= ((cfg->m << pll->divm_shift) |
> + (cfg->n << pll->divn_shift) |
> + (divp << pll->divp_shift));
> + if (val == old_base) {
> + if (pll->lock)
> + spin_unlock_irqrestore(pll->lock, flags);
> + return 0;
> + }
> +
> + state = clk_pll_is_enabled(hw);
> +
> + if (state) {
> + if (pll->lock)
> + spin_unlock_irqrestore(pll->lock, flags);
> +
> + clk_pll_disable(hw);
> + val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
> +
> + if (pll->lock)
> + spin_lock_irqsave(pll->lock, flags);
Instead of doing spin_unlock, disable and spin_lock, can't we use
_clk_pll_disable here, without the locks?
regards,
Sivaram
next prev parent reply other threads:[~2013-01-14 7:28 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 7:46 [PATCH v4 0/9] Migrate Tegra to common clock framework Prashant Gaikwad
2013-01-11 7:46 ` [PATCH v4 1/9] ARM: tegra: Add function to read chipid Prashant Gaikwad
2013-01-11 7:46 ` [PATCH v4 2/9] clk: tegra: Add tegra specific clocks Prashant Gaikwad
2013-01-11 11:48 ` Hiroshi Doyu
2013-01-11 21:35 ` Stephen Warren
2013-01-16 8:19 ` Hiroshi Doyu
2013-01-16 18:04 ` Stephen Warren
2013-01-14 7:28 ` Sivaram Nair [this message]
2013-01-16 12:31 ` Hiroshi Doyu
2013-01-16 18:44 ` Stephen Warren
2013-01-16 15:12 ` Hiroshi Doyu
2013-01-16 20:11 ` Stephen Warren
2013-01-17 5:03 ` Hiroshi Doyu
2013-01-17 16:35 ` Stephen Warren
2013-01-11 7:46 ` [PATCH v4 3/9] arm: tegra: Move tegra_cpu_car.h to linux/clk/tegra.h Prashant Gaikwad
2013-01-11 7:46 ` [PATCH v4 4/9] ARM: tegra: Define Tegra20 CAR binding Prashant Gaikwad
2013-01-11 7:46 ` [PATCH v4 5/9] ARM: Tegra: Define Tegra30 " Prashant Gaikwad
2013-01-16 11:28 ` Hiroshi Doyu
2013-01-16 17:30 ` Stephen Warren
2013-01-11 7:46 ` [PATCH v4 6/9] clk: tegra: add clock support for tegra20 Prashant Gaikwad
2013-01-11 20:54 ` Stephen Warren
2013-01-11 7:46 ` [PATCH v4 7/9] clk: tegra: add clock support for tegra30 Prashant Gaikwad
2013-01-11 12:17 ` Hiroshi Doyu
2013-01-11 21:40 ` Stephen Warren
2013-01-14 5:33 ` Hiroshi Doyu
2013-01-11 7:46 ` [PATCH v4 8/9] arm: tegra: Migrate to new clock code Prashant Gaikwad
2013-01-11 7:48 ` [PATCH v4 9/9] arm: tegra: Remove legacy " Prashant Gaikwad
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=20130114072855.GB17884@sivaramn-lnx \
--to=sivaramn@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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