From: pdeschrijver@nvidia.com (Peter De Schrijver)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V5 1/3] clk: tegra: add Tegra specific clocks
Date: Thu, 17 Jan 2013 11:45:53 +0200 [thread overview]
Message-ID: <20130117094553.GD4118@tbergstrom-lnx.Nvidia.com> (raw)
In-Reply-To: <1358369575-7325-1-git-send-email-swarren@wwwdotorg.org>
> +static struct clk *_tegra_clk_register_pll(const char *name,
> + const char *parent_name, void __iomem *clk_base,
> + void __iomem *pmc, unsigned long flags,
> + unsigned long fixed_rate,
> + struct tegra_clk_pll_params *pll_params, u8 pll_flags,
> + struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock,
> + bool plle)
> +{
> + struct tegra_clk_pll *pll;
> + struct clk *clk;
> + struct clk_init_data init;
> +
> + pll = kzalloc(sizeof(*pll), GFP_KERNEL);
> + if (!pll)
> + return ERR_PTR(-ENOMEM);
> +
> + init.name = name;
> + init.ops = plle ? &tegra_clk_plle_ops : &tegra_clk_pll_ops;
> + init.flags = flags;
> + init.parent_names = (parent_name ? &parent_name : NULL);
> + init.num_parents = (parent_name ? 1 : 0);
> +
> + pll->clk_base = clk_base;
> + pll->pmc = pmc;
> +
> + pll->freq_table = freq_table;
> + pll->params = pll_params;
> + pll->fixed_rate = fixed_rate;
> + pll->flags = pll_flags;
> + pll->lock = lock;
> +
> + pll->divp_shift = PLL_BASE_DIVP_SHIFT;
> + pll->divp_width = PLL_BASE_DIVP_WIDTH;
> + pll->divn_shift = PLL_BASE_DIVN_SHIFT;
> + pll->divn_width = PLL_BASE_DIVN_WIDTH;
> + pll->divm_shift = PLL_BASE_DIVM_SHIFT;
> + pll->divm_width = PLL_BASE_DIVM_WIDTH;
> +
> + /* Data in .init is copied by clk_register(), so stack variable OK */
> + pll->hw.init = &init;
> +
> + clk = clk_register(NULL, &pll->hw);
> + if (IS_ERR(clk))
> + kfree(pll);
> +
> + return clk;
> +}
> +
> +struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
> + void __iomem *clk_base, void __iomem *pmc,
> + unsigned long flags, unsigned long fixed_rate,
> + struct tegra_clk_pll_params *pll_params, u8 pll_flags,
> + struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
> +{
> + return _tegra_clk_register_pll(name, parent_name, clk_base, pmc,
> + flags, fixed_rate, pll_params, pll_flags, freq_table,
> + lock, false);
> +}
> +
> +struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
> + void __iomem *clk_base, void __iomem *pmc,
> + unsigned long flags, unsigned long fixed_rate,
> + struct tegra_clk_pll_params *pll_params, u8 pll_flags,
> + struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
> +{
> + return _tegra_clk_register_pll(name, parent_name, clk_base, pmc,
> + flags, fixed_rate, pll_params, pll_flags, freq_table,
> + lock, true);
> +}
For Tegra114 I will need to introduce more new PLL types. So instead of using
a boolean plle, maybe just pass a pointer to the relevant struct clk_ops? This
will make extension for Tegra114 easier.
Cheers,
Peter.
next prev parent reply other threads:[~2013-01-17 9:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 20:52 [PATCH V5 1/3] clk: tegra: add Tegra specific clocks Stephen Warren
2013-01-16 20:52 ` [PATCH V5 2/3] clk: tegra: add clock support for Tegra20 Stephen Warren
2013-01-16 20:52 ` [PATCH V5 3/3] clk: tegra: add clock support for Tegra30 Stephen Warren
2013-01-17 9:45 ` Peter De Schrijver [this message]
2013-01-17 15:53 ` [PATCH V5 1/3] clk: tegra: add Tegra specific clocks Peter De Schrijver
2013-01-17 21:53 ` Stephen Warren
2013-01-22 21:24 ` Mike Turquette
2013-01-22 22:16 ` 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=20130117094553.GD4118@tbergstrom-lnx.Nvidia.com \
--to=pdeschrijver@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;
as well as URLs for NNTP newsgroup(s).