public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 7/7] clk: samsung: Add EPLL and VPLL freq table for exynos5250 SoC
Date: Wed, 19 Jun 2013 19:13:32 +0200	[thread overview]
Message-ID: <5316963.ksEAAU3W6C@flatron> (raw)
In-Reply-To: <1370870659-10929-8-git-send-email-yadi.brar@samsung.com>

On Monday 10 of June 2013 18:54:19 Yadwinder Singh Brar wrote:
> Adds the EPLL and VPLL freq table for exynos5250 SoC.
> 
> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
> ---
>  drivers/clk/samsung/clk-exynos5250.c |   42
> ++++++++++++++++++++++++++++++++- drivers/clk/samsung/clk.h           
> |    2 +
>  2 files changed, 42 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos5250.c
> b/drivers/clk/samsung/clk-exynos5250.c index 6881810..13e293e 100644
> --- a/drivers/clk/samsung/clk-exynos5250.c
> +++ b/drivers/clk/samsung/clk-exynos5250.c
> @@ -493,6 +493,29 @@ static __initdata struct of_device_id
> ext_clk_match[] = { { },
>  };
> 
> +static __initdata struct samsung_pll_rate_table vpll_24mhz_tbl[] = {
> +	/* sorted in descending order */
> +	/* PLL_36XX_RATE(rate, m, p, s, k) */
> +	PLL_36XX_RATE(266000000, 266, 3, 3, 0),
> +	/* Not in UM, but need for eDP on snow */
> +	PLL_36XX_RATE(70500000, 94, 2, 4, 0),
> +	{ },
> +};
> +
> +static __initdata struct samsung_pll_rate_table epll_24mhz_tbl[] = {
> +	/* sorted in descending order */
> +	/* PLL_36XX_RATE(rate, m, p, s, k) */
> +	PLL_36XX_RATE(192000000, 64, 2, 2, 0),
> +	PLL_36XX_RATE(180633600, 90, 3, 2, 20762),
> +	PLL_36XX_RATE(180000000, 90, 3, 2, 0),
> +	PLL_36XX_RATE(73728000, 98, 2, 4, 19923),
> +	PLL_36XX_RATE(67737600, 90, 2, 4, 20762),
> +	PLL_36XX_RATE(49152000, 98, 3, 4, 19923),
> +	PLL_36XX_RATE(45158400, 90, 3, 4, 20762),
> +	PLL_36XX_RATE(32768000, 131, 3, 5, 4719)
> +	{ },
> +};
> +
>  struct __initdata samsung_pll_clock exynos5250_plls[nr_plls] = {
>  	[apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", 
APLL_LOCK,
> APLL_CON0, "fout_apll", NULL),
> @@ -506,14 +529,16 @@ struct __initdata samsung_pll_clock
> exynos5250_plls[nr_plls] = { CPLL_CON0, NULL),
>  	[epll] = PLL(pll_36xx, fout_epll, "fout_epll", "fin_pll", 
EPLL_LOCK,
>  		EPLL_CON0, NULL),
> -	[vpll] = PLL(pll_36xx, fout_vpll, "fout_vpll", "fin_pll", 
VPLL_LOCK,
> -		VPLL_CON0, NULL),
> +	[vpll] = PLL(pll_36xx, fout_vpll, "fout_vpll", "mout_vpllsrc",
> +		VPLL_LOCK, VPLL_CON0, NULL),

IMHO the parent should be fixed in separate patch, as this doesn't seem to 
be related strictly to adding rate table.

>  };
> 
>  /* register exynox5250 clocks */
>  void __init exynos5250_clk_init(struct device_node *np)
>  {
>  	void __iomem *reg_base;
> +	struct clk *vpllsrc;
> +	unsigned long fin_pll_rate, mout_vpllsrc_rate = 0;
> 
>  	if (np) {
>  		reg_base = of_iomap(np, 0);
> @@ -531,6 +556,19 @@ void __init exynos5250_clk_init(struct device_node
> *np) ext_clk_match);
>  	samsung_clk_register_mux(exynos5250_pll_pmux_clks,
>  				ARRAY_SIZE(exynos5250_pll_pmux_clks));
> +
> +	fin_pll_rate = _get_rate("fin_pll");
> +
> +	if (fin_pll_rate == (24 * MHZ))

Nit: Unnecessary parentheses around 24 * MHZ.

> +		exynos5250_plls[epll].rate_table = epll_24mhz_tbl;
> +
> +	vpllsrc = __clk_lookup("mout_vpllsrc");
> +	if (vpllsrc)
> +		mout_vpllsrc_rate = clk_get_rate(vpllsrc);
> +
> +	if (mout_vpllsrc_rate == (24 * MHZ))

Ditto.

> +		exynos5250_plls[vpll].rate_table =  vpll_24mhz_tbl;
> +
>  	samsung_clk_register_pll(exynos5250_plls, 
ARRAY_SIZE(exynos5250_plls),
> reg_base);
>  	samsung_clk_register_fixed_rate(exynos5250_fixed_rate_clks,
> diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h
> index 3e6501c..378bf98 100644
> --- a/drivers/clk/samsung/clk.h
> +++ b/drivers/clk/samsung/clk.h
> @@ -40,6 +40,8 @@ struct samsung_clock_alias {
>  		.alias		= a,				\
>  	}
> 
> +#define MHZ (1000*1000)

Nit: (1000 * 1000)

Best regards,
Tomasz

> +
>  /**
>   * struct samsung_fixed_rate_clock: information about fixed-rate clock
>   * @id: platform specific id of the clock.

      reply	other threads:[~2013-06-19 17:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 13:24 [PATCH v6 0/7] Add generic set_rate clk_ops for PLL35xx and PLL36xx for samsung SoCs Yadwinder Singh Brar
2013-06-10 13:24 ` [PATCH v6 1/7] clk: samsung: Introduce a common samsung_clk_pll struct Yadwinder Singh Brar
2013-06-19 17:03   ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 2/7] clk: samsung: Define a common samsung_clk_register_pll() Yadwinder Singh Brar
2013-06-19 16:54   ` Tomasz Figa
2013-06-19 18:14     ` Yadwinder Singh Brar
2013-06-19 18:21       ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 3/7] clk: samsung: Add support to register rate_table for samsung plls Yadwinder Singh Brar
2013-06-19 17:00   ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 4/7] clk: samsung: Add set_rate() clk_ops for PLL35xx Yadwinder Singh Brar
2013-06-19 17:02   ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 5/7] clk: samsung: Add set_rate() clk_ops for PLL36xx Yadwinder Singh Brar
2013-06-19 17:05   ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 6/7] clk: samsung: Reorder MUX registration for mout_vpllsrc Yadwinder Singh Brar
2013-06-19 17:05   ` Tomasz Figa
2013-06-10 13:24 ` [PATCH v6 7/7] clk: samsung: Add EPLL and VPLL freq table for exynos5250 SoC Yadwinder Singh Brar
2013-06-19 17:13   ` Tomasz Figa [this message]

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=5316963.ksEAAU3W6C@flatron \
    --to=tomasz.figa@gmail.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