From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 10/11] ARM: hi3xxx: add clk-hi3716
Date: Wed, 21 Aug 2013 14:43:00 -0700 [thread overview]
Message-ID: <20130821214300.8231.81515@quantum> (raw)
In-Reply-To: <1376965873-14431-11-git-send-email-haojian.zhuang@linaro.org>
Quoting Haojian Zhuang (2013-08-19 19:31:12)
> From: Zhangfei Gao <zhangfei.gao@linaro.org>
>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> Signed-off-by: Zhang Mingjun <zhang.mingjun@linaro.org>
> ---
> Documentation/devicetree/bindings/clock/hi3716.txt | 121 ++++++++++
> drivers/clk/Makefile | 2 +-
> drivers/clk/clk-hi3716.c | 268 +++++++++++++++++++++
> 3 files changed, 390 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/clock/hi3716.txt
> create mode 100644 drivers/clk/clk-hi3716.c
>
> diff --git a/Documentation/devicetree/bindings/clock/hi3716.txt b/Documentation/devicetree/bindings/clock/hi3716.txt
> new file mode 100644
> index 0000000..60af61e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/hi3716.txt
> @@ -0,0 +1,121 @@
> +Device Tree Clock bindings for hi3716
> +
> +This binding uses the common clock binding[1].
> +
> +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> +
> +Clock control register
> +Required properties:
> +- compatible : "hisilicon,clkbase"
> +- reg : Address and size of clkbase.
> +
> +Device Clocks
> +
> +Device clocks are required to have one or both of the following sets of
> +properties:
> +
> +
> +Gated device clocks:
> +
> +Required properties:
> +- compatible : "hisilicon,hi3716-clk-gate"
> +- gate-reg : shall be the register offset from clkbase and enable bit, reset bit
The 'reg' property is standard and well understood. Best not to try and
re-invent that with gate-reg.
Instead put the register address in the 'reg' property and the other
bits in separate properties.
The same goes for the *-reg properties below.
<snip>
> +static int hi3716_clkgate_prepare(struct clk_hw *hw)
> +{
> + struct hi3716_clk *clk = to_clk_hi3716(hw);
> + unsigned long flags = 0;
> + u32 reg;
> +
> + spin_lock_irqsave(&_lock, flags);
> +
> + reg = readl_relaxed(clk->reg);
> + reg &= ~BIT(clk->reset_bit);
> + writel_relaxed(reg, clk->reg);
> +
> + spin_unlock_irqrestore(&_lock, flags);
> +
> + return 0;
> +}
> +
> +static void hi3716_clkgate_unprepare(struct clk_hw *hw)
> +{
> + struct hi3716_clk *clk = to_clk_hi3716(hw);
> + unsigned long flags = 0;
> + u32 reg;
> +
> + spin_lock_irqsave(&_lock, flags);
> +
> + reg = readl_relaxed(clk->reg);
> + reg |= BIT(clk->reset_bit);
> + writel_relaxed(reg, clk->reg);
> +
> + spin_unlock_irqrestore(&_lock, flags);
> +}
> +
> +static struct clk_ops hi3716_clkgate_ops = {
> + .prepare = hi3716_clkgate_prepare,
> + .unprepare = hi3716_clkgate_unprepare,
> +};
Why .prepare & .unprepare instead of .enable & .disable?
Regards,
Mike
next prev parent reply other threads:[~2013-08-21 21:43 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 2:31 [PATCH v7 00/11] Enable Hisilicon Hi3620 SoC Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 01/11] ARM: debug: support debug ll on hisilicon soc Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 02/11] clk: hi3xxx: add clock support Haojian Zhuang
2013-08-21 21:29 ` Mike Turquette
2013-08-24 4:13 ` Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 03/11] clk: gate: add CLK_GATE_SEPERATED_REG flag Haojian Zhuang
2013-08-21 21:18 ` Mike Turquette
2013-08-20 2:31 ` [PATCH v7 04/11] ARM: hi3xxx: add board support with device tree Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 05/11] ARM: dts: enable hi4511 " Haojian Zhuang
2013-08-22 18:07 ` Kevin Hilman
2013-08-22 18:50 ` Stephen Warren
2013-08-24 3:52 ` Haojian Zhuang
2013-08-26 16:48 ` Stephen Warren
2013-08-26 16:48 ` Stephen Warren
2013-08-28 2:17 ` Haojian Zhuang
2013-08-28 2:17 ` Haojian Zhuang
2013-08-28 14:20 ` Stephen Warren
2013-08-28 14:20 ` Stephen Warren
2013-08-28 15:15 ` Haojian Zhuang
2013-08-28 15:15 ` Haojian Zhuang
2013-08-28 15:45 ` Stephen Warren
2013-08-28 15:45 ` Stephen Warren
2013-08-24 3:59 ` Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 06/11] ARM: config: enable hi3xxx in multi_v7_defconfig Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 07/11] ARM: config: add defconfig for Hi3xxx Haojian Zhuang
2013-08-20 2:31 ` [PATCH v7 08/11] ARM: hi3xxx: add smp support Haojian Zhuang
2013-08-28 2:12 ` Olof Johansson
2013-08-28 11:53 ` zhangfei gao
2013-08-28 17:19 ` Olof Johansson
2013-08-29 1:54 ` zhangfei
2013-08-20 2:31 ` [PATCH v7 09/11] ARM: hi3xxx: add hotplug support Haojian Zhuang
2013-08-28 2:21 ` Olof Johansson
2013-08-28 11:45 ` zhangfei gao
2013-08-20 2:31 ` [PATCH v7 10/11] ARM: hi3xxx: add clk-hi3716 Haojian Zhuang
2013-08-21 21:43 ` Mike Turquette [this message]
2013-08-22 1:19 ` zhangfei gao
2013-08-22 5:59 ` Mike Turquette
2013-08-22 7:50 ` Haojian Zhuang
2013-08-22 8:16 ` Mike Turquette
2013-08-20 2:31 ` [PATCH v7 11/11] ARM: hi3xxx: support hi3716-dkb board Haojian Zhuang
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=20130821214300.8231.81515@quantum \
--to=mturquette@linaro.org \
--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.