From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, paul@pwsan.com, tony@atomide.com,
nm@ti.com, rnayak@ti.com, bcousson@baylibre.com,
mturquette@linaro.org
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: [PATCHv8 07/36] CLK: TI: add support for clockdomain binding
Date: Wed, 9 Oct 2013 18:30:38 +0300 [thread overview]
Message-ID: <1381332668-962-8-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1381332668-962-1-git-send-email-t-kristo@ti.com>
Some OMAP clocks require knowledge about their parent clockdomain for
book keeping purposes. This patch creates a new DT binding for TI
clockdomains, which act as a collection of device clocks.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
.../devicetree/bindings/clock/ti/clockdomain.txt | 21 +++++++++
arch/arm/mach-omap2/clock.h | 1 -
drivers/clk/ti/Makefile | 2 +-
drivers/clk/ti/clockdomain.c | 46 ++++++++++++++++++++
include/linux/clk/ti.h | 2 +
5 files changed, 70 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/ti/clockdomain.txt
create mode 100644 drivers/clk/ti/clockdomain.c
diff --git a/Documentation/devicetree/bindings/clock/ti/clockdomain.txt b/Documentation/devicetree/bindings/clock/ti/clockdomain.txt
new file mode 100644
index 0000000..45e6f7c
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/clockdomain.txt
@@ -0,0 +1,21 @@
+Binding for Texas Instruments clockdomain.
+
+Binding status: Unstable - ABI compatibility may be broken in the future
+
+This binding uses the common clock binding[1]. Every clock on
+TI SoC belongs to one clockdomain, but software only needs this
+information for specific clocks which require their parent
+clockdomain to be controlled when the clock is enabled/disabled.
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible : shall be "ti,clockdomain"
+- #clock-cells : from common clock binding; shall be set to 0.
+- clocks : link phandles of clocks within this domain
+
+Examples:
+ dss_clkdm: dss_clkdm {
+ compatible = "ti,clockdomain";
+ clocks = <&dss1_alwon_fck_3430es2>, <&dss_ick_3430es2>;
+ };
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index f0b7218..56d4664 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -38,7 +38,6 @@ struct omap_clk {
}
struct clockdomain;
-#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
#define DEFINE_STRUCT_CLK(_name, _parent_array_name, _clkops_name) \
static struct clk _name = { \
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
index 63b1c45..ce8bd06 100644
--- a/drivers/clk/ti/Makefile
+++ b/drivers/clk/ti/Makefile
@@ -1,4 +1,4 @@
ifneq ($(CONFIG_OF),)
obj-y += clk.o dpll.o autoidle.o divider.o \
- fixed-factor.o gate.o
+ fixed-factor.o gate.o clockdomain.o
endif
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c
new file mode 100644
index 0000000..3573bc9
--- /dev/null
+++ b/drivers/clk/ti/clockdomain.c
@@ -0,0 +1,46 @@
+/*
+ * OMAP clockdomain support
+ *
+ * Copyright (C) 2013 Texas Instruments, Inc.
+ *
+ * Tero Kristo <t-kristo@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/clk/ti.h>
+
+static void __init of_ti_clockdomain_setup(struct device_node *node)
+{
+ struct clk *clk;
+ struct clk_hw *clk_hw;
+ const char *clkdm_name = node->name;
+ int i;
+ int num_clks;
+
+ num_clks = of_count_phandle_with_args(node, "clocks", "#clock-cells");
+
+ for (i = 0; i < num_clks; i++) {
+ clk = of_clk_get(node, i);
+ if (__clk_get_flags(clk) & CLK_IS_BASIC) {
+ pr_warn("%s: can't setup clkdm for basic clk %s\n",
+ __func__, __clk_get_name(clk));
+ continue;
+ }
+ clk_hw = __clk_get_hw(clk);
+ to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name;
+ omap2_init_clk_clkdm(clk_hw);
+ }
+}
+CLK_OF_DECLARE(ti_clockdomain, "ti,clockdomain", of_ti_clockdomain_setup);
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index e0a2d32..e70a2eb 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -186,6 +186,8 @@ struct ti_dt_clk {
.node_name = name, \
}
+#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
+
void omap2_init_clk_hw_omap_clocks(struct clk *clk);
int omap3_noncore_dpll_enable(struct clk_hw *hw);
void omap3_noncore_dpll_disable(struct clk_hw *hw);
--
1.7.9.5
next prev parent reply other threads:[~2013-10-09 15:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 15:30 [PATCHv8 00/36] ARM: OMAP: DT clock conversion Tero Kristo
2013-10-09 15:30 ` [PATCHv8 01/36] CLK: TI: Add DPLL clock support Tero Kristo
2013-10-13 23:47 ` Paul Walmsley
2013-10-09 15:30 ` [PATCHv8 02/36] CLK: TI: add DT alias clock registration mechanism Tero Kristo
2013-10-09 15:30 ` [PATCHv8 03/36] CLK: TI: add autoidle support Tero Kristo
2013-10-09 15:30 ` [PATCHv8 04/36] CLK: ti: add support for ti divider-clock Tero Kristo
2013-10-09 15:30 ` [PATCHv8 05/36] clk: ti: add support for TI fixed factor clock Tero Kristo
2013-10-09 15:30 ` [PATCHv8 06/36] CLK: TI: add support for OMAP gate clock Tero Kristo
2013-10-09 15:30 ` Tero Kristo [this message]
2013-10-09 15:30 ` [PATCHv8 08/36] ARM: dts: omap4 clock data Tero Kristo
2013-10-09 15:30 ` [PATCHv8 09/36] clk: ti: add mux-gate clock support Tero Kristo
2013-10-09 15:30 ` [PATCHv8 10/36] clk: ti: add support for basic mux clock Tero Kristo
2013-10-09 15:30 ` [PATCHv8 11/36] CLK: TI: add omap4 clock init file Tero Kristo
2013-10-09 15:30 ` [PATCHv8 12/36] ARM: OMAP4: remove old clock data and link in new clock init code Tero Kristo
2013-10-09 15:30 ` [PATCHv8 13/36] ARM: dts: omap5 clock data Tero Kristo
2013-10-09 15:30 ` [PATCHv8 14/36] CLK: TI: add omap5 clock init file Tero Kristo
2013-10-09 15:30 ` [PATCHv8 15/36] CLK: TI: omap5: Initialize USB_DPLL at boot Tero Kristo
2013-10-09 15:30 ` [PATCHv8 16/36] ARM: dts: dra7 clock data Tero Kristo
2013-10-09 15:30 ` [PATCHv8 17/36] ARM: dts: clk: Add apll related clocks Tero Kristo
2013-10-09 15:30 ` [PATCHv8 18/36] ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock Tero Kristo
2013-10-09 15:30 ` [PATCHv8 19/36] ARM: dts: DRA7: Add PCIe related clock nodes Tero Kristo
2013-10-09 15:30 ` [PATCHv8 20/36] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-10-09 15:30 ` [PATCHv8 21/36] CLK: TI: add dra7 clock init file Tero Kristo
2013-10-09 15:30 ` [PATCHv8 22/36] ARM: OMAP: DRA7: Enable clock init Tero Kristo
2013-10-09 15:30 ` [PATCHv8 23/36] ARM: dts: DRA7: link in clock DT data Tero Kristo
2013-10-09 15:30 ` [PATCHv8 24/36] ARM: dts: am33xx clock data Tero Kristo
2013-10-09 15:30 ` [PATCHv8 25/36] CLK: TI: add am33xx clock init file Tero Kristo
2013-10-09 15:30 ` [PATCHv8 26/36] ARM: AM33xx: remove old clock data and link in new clock init code Tero Kristo
[not found] ` <1381332668-962-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2013-10-09 15:30 ` [PATCHv8 27/36] CLK: TI: add interface clock support for OMAP3 Tero Kristo
2013-10-09 15:30 ` [PATCHv8 28/36] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Tero Kristo
2013-10-09 15:31 ` [PATCHv8 29/36] ARM: OMAP3: hwmod: initialize clkdm from clkdm_name Tero Kristo
2013-10-09 15:31 ` [PATCHv8 30/36] ARM: dts: omap3 clock data Tero Kristo
2013-10-09 15:31 ` [PATCHv8 31/36] CLK: TI: add omap3 clock init file Tero Kristo
2013-10-09 15:31 ` [PATCHv8 32/36] ARM: dts: AM35xx: use DT clock data Tero Kristo
2013-10-09 15:31 ` [PATCHv8 33/36] ARM: OMAP3: use DT clock init if DT data is available Tero Kristo
2013-10-09 15:31 ` [PATCHv8 34/36] ARM: dts: am43xx clock data Tero Kristo
2013-10-09 15:31 ` [PATCHv8 35/36] ARM: dts: AM43xx: link in clock DT data Tero Kristo
2013-10-09 15:31 ` [PATCHv8 36/36] CLK: TI: add am43xx clock init file Tero Kristo
2013-10-09 15:48 ` [PATCHv8 00/36] ARM: OMAP: DT clock conversion Tony Lindgren
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=1381332668-962-8-git-send-email-t-kristo@ti.com \
--to=t-kristo@ti.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=tony@atomide.com \
/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).