From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 05/10] clk: berlin: add driver for BG2x complex divider cells
Date: Thu, 15 May 2014 09:56:59 +0200 [thread overview]
Message-ID: <20140515075659.GP29318@piout.net> (raw)
In-Reply-To: <1400098522-14770-6-git-send-email-sebastian.hesselbarth@gmail.com>
On 14/05/2014 at 22:15:16 +0200, Sebastian Hesselbarth wrote :
> +static u8 berlin2_div_get_parent(struct clk_hw *hw)
> +{
> + struct berlin2_div *div = to_berlin2_div(hw);
> + struct berlin2_div_map *map = &div->map;
> + u32 reg;
> + u8 index = 0;
> +
> + if (div->lock)
> + spin_lock(div->lock);
> +
> + /* PLL_SWITCH == 0 is index 0 */
> + reg = readl_relaxed(div->base + map->pll_switch_offs);
> + reg &= BIT(map->pll_switch_shift);
> + if (reg) {
> + reg = readl_relaxed(div->base + map->pll_select_offs);
> + reg >>= map->pll_select_shift;
> + reg &= PLL_SELECT_MASK;
> + index = 1 + reg;
After getting more insight, I think we don't need to add 1, see my
comment on the next patchs.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Mike Turquette <mturquette@linaro.org>,
Jisheng Zhang <jszhang@marvell.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 05/10] clk: berlin: add driver for BG2x complex divider cells
Date: Thu, 15 May 2014 09:56:59 +0200 [thread overview]
Message-ID: <20140515075659.GP29318@piout.net> (raw)
In-Reply-To: <1400098522-14770-6-git-send-email-sebastian.hesselbarth@gmail.com>
On 14/05/2014 at 22:15:16 +0200, Sebastian Hesselbarth wrote :
> +static u8 berlin2_div_get_parent(struct clk_hw *hw)
> +{
> + struct berlin2_div *div = to_berlin2_div(hw);
> + struct berlin2_div_map *map = &div->map;
> + u32 reg;
> + u8 index = 0;
> +
> + if (div->lock)
> + spin_lock(div->lock);
> +
> + /* PLL_SWITCH == 0 is index 0 */
> + reg = readl_relaxed(div->base + map->pll_switch_offs);
> + reg &= BIT(map->pll_switch_shift);
> + if (reg) {
> + reg = readl_relaxed(div->base + map->pll_select_offs);
> + reg >>= map->pll_select_shift;
> + reg &= PLL_SELECT_MASK;
> + index = 1 + reg;
After getting more insight, I think we don't need to add 1, see my
comment on the next patchs.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-05-15 7:56 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 20:24 [PATCH 0/8] Marvell Berlin full clock support Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 1/8] clk: add helper for unique DT clock names Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-13 19:49 ` Mike Turquette
2014-05-13 19:49 ` Mike Turquette
2014-05-13 19:49 ` Mike Turquette
2014-05-13 20:19 ` Sebastian Hesselbarth
2014-05-13 20:19 ` Sebastian Hesselbarth
2014-05-13 20:19 ` Sebastian Hesselbarth
2014-05-13 20:51 ` Mike Turquette
2014-05-13 20:51 ` Mike Turquette
2014-05-13 21:25 ` Sebastian Hesselbarth
2014-05-13 21:25 ` Sebastian Hesselbarth
2014-05-13 21:25 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 2/8] clk: berlin: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-13 8:38 ` Sebastian Hesselbarth
2014-05-13 8:38 ` Sebastian Hesselbarth
2014-05-13 8:38 ` Sebastian Hesselbarth
2014-05-13 14:47 ` Alexandre Belloni
2014-05-13 14:47 ` Alexandre Belloni
2014-05-14 22:32 ` Mike Turquette
2014-05-14 22:32 ` Mike Turquette
2014-05-14 22:32 ` Mike Turquette
2014-05-14 23:17 ` Sebastian Hesselbarth
2014-05-14 23:17 ` Sebastian Hesselbarth
2014-05-14 23:17 ` Sebastian Hesselbarth
2014-05-15 4:41 ` Mike Turquette
2014-05-15 4:41 ` Mike Turquette
2014-05-15 6:53 ` Sebastian Hesselbarth
2014-05-15 6:53 ` Sebastian Hesselbarth
2014-05-15 8:34 ` Alexandre Belloni
2014-05-15 8:34 ` Alexandre Belloni
2014-05-11 20:24 ` [PATCH 3/8] clk: berlin: add driver for BG2x audio/video PLL Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 4/8] clk: berlin: add driver for BG2x simple PLLs Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 5/8] clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-13 8:40 ` Sebastian Hesselbarth
2014-05-13 8:40 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 6/8] clk: berlin: add core clock driver for BG2/BG2CD Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-14 11:43 ` Alexandre Belloni
2014-05-14 11:43 ` Alexandre Belloni
2014-05-14 11:48 ` Sebastian Hesselbarth
2014-05-14 11:48 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 7/8] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-12 19:55 ` Sebastian Hesselbarth
2014-05-12 19:55 ` Sebastian Hesselbarth
2014-05-12 19:55 ` Sebastian Hesselbarth
2014-05-13 8:42 ` Sebastian Hesselbarth
2014-05-13 8:42 ` Sebastian Hesselbarth
2014-05-13 8:42 ` Sebastian Hesselbarth
2014-05-11 20:24 ` [PATCH 8/8] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth
2014-05-11 20:24 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 01/10] dt-binding: clk: add clock binding docs for Marvell Berlin2 SoCs Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 02/10] clk: berlin: add binding include for BG2/BG2CD clock ids Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 03/10] clk: berlin: add driver for BG2x audio/video PLL Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 04/10] clk: berlin: add driver for BG2x simple PLLs Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 05/10] clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-15 7:56 ` Alexandre Belloni [this message]
2014-05-15 7:56 ` Alexandre Belloni
2014-05-14 20:15 ` [PATCH v2 06/10] clk: berlin: add core clock driver for BG2/BG2CD Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-15 8:09 ` Alexandre Belloni
2014-05-15 8:09 ` Alexandre Belloni
2014-05-15 15:43 ` Sebastian Hesselbarth
2014-05-15 15:43 ` Sebastian Hesselbarth
2014-05-15 16:55 ` Alexandre Belloni
2014-05-15 16:55 ` Alexandre Belloni
2014-05-14 20:15 ` [PATCH v2 07/10] clk: berlin: add core clock driver for BG2Q Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-15 7:46 ` Alexandre Belloni
2014-05-15 7:46 ` Alexandre Belloni
2014-05-14 20:15 ` [PATCH v2 08/10] ARM: dts: berlin: convert BG2CD to DT clock nodes Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 09/10] ARM: dts: berlin: convert BG2 " Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
2014-05-14 20:15 ` [PATCH v2 10/10] ARM: dts: berlin: convert BG2Q " Sebastian Hesselbarth
2014-05-14 20:15 ` Sebastian Hesselbarth
-- strict thread matches above, loose matches on Subject: below --
2014-05-19 16:43 [PATCH v2 00/10] Marvell Berlin full clock support Sebastian Hesselbarth
2014-05-19 16:43 ` [PATCH v2 05/10] clk: berlin: add driver for BG2x complex divider cells Sebastian Hesselbarth
2014-05-19 16:43 ` Sebastian Hesselbarth
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=20140515075659.GP29318@piout.net \
--to=alexandre.belloni@free-electrons.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.