All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: <linux-omap@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<mturquette@baylibre.com>, <sboyd@codeaurora.org>,
	<tony@atomide.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	Nishanth Menon <nm@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Lokesh Vutla <lokeshvutla@ti.com>
Subject: [PATCH 1/3] clk: ti: dpll: add support for specifying max rate for DPLLs
Date: Wed, 16 Mar 2016 21:54:55 +0200	[thread overview]
Message-ID: <1458158097-21137-2-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1458158097-21137-1-git-send-email-t-kristo@ti.com>

DPLLs typically have a maximum rate they can support, and this varies
from DPLL to DPLL. Add support of the maximum rate value to the DPLL
data struct, and also add check for this in the DPLL round_rate function.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
---
 drivers/clk/ti/clkt_dpll.c |    3 +++
 include/linux/clk/ti.h     |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c
index b5cc6f6..7d97b07 100644
--- a/drivers/clk/ti/clkt_dpll.c
+++ b/drivers/clk/ti/clkt_dpll.c
@@ -301,6 +301,9 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
 
 	dd = clk->dpll_data;
 
+	if (dd->max_rate && target_rate > dd->max_rate)
+		target_rate = dd->max_rate;
+
 	ref_rate = clk_get_rate(dd->clk_ref);
 	clk_name = clk_hw_get_name(hw);
 	pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 9a63860..1a48ee2 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -37,6 +37,7 @@
  * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
  * @min_divider: minimum valid non-bypass divider value (actual)
  * @max_divider: maximum valid non-bypass divider value (actual)
+ * @max_rate: maximum clock rate for the DPLL
  * @modes: possible values of @enable_mask
  * @autoidle_reg: register containing the DPLL autoidle mode bitfield
  * @idlest_reg: register containing the DPLL idle status bitfield
@@ -81,6 +82,7 @@ struct dpll_data {
 	u8			last_rounded_n;
 	u8			min_divider;
 	u16			max_divider;
+	unsigned long		max_rate;
 	u8			modes;
 	void __iomem		*autoidle_reg;
 	void __iomem		*idlest_reg;
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
	mturquette@baylibre.com, sboyd@codeaurora.org, tony@atomide.com
Cc: linux-arm-kernel@lists.infradead.org, Nishanth Menon <nm@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Lokesh Vutla <lokeshvutla@ti.com>
Subject: [PATCH 1/3] clk: ti: dpll: add support for specifying max rate for DPLLs
Date: Wed, 16 Mar 2016 21:54:55 +0200	[thread overview]
Message-ID: <1458158097-21137-2-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1458158097-21137-1-git-send-email-t-kristo@ti.com>

DPLLs typically have a maximum rate they can support, and this varies
from DPLL to DPLL. Add support of the maximum rate value to the DPLL
data struct, and also add check for this in the DPLL round_rate function.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
---
 drivers/clk/ti/clkt_dpll.c |    3 +++
 include/linux/clk/ti.h     |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c
index b5cc6f6..7d97b07 100644
--- a/drivers/clk/ti/clkt_dpll.c
+++ b/drivers/clk/ti/clkt_dpll.c
@@ -301,6 +301,9 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
 
 	dd = clk->dpll_data;
 
+	if (dd->max_rate && target_rate > dd->max_rate)
+		target_rate = dd->max_rate;
+
 	ref_rate = clk_get_rate(dd->clk_ref);
 	clk_name = clk_hw_get_name(hw);
 	pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 9a63860..1a48ee2 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -37,6 +37,7 @@
  * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
  * @min_divider: minimum valid non-bypass divider value (actual)
  * @max_divider: maximum valid non-bypass divider value (actual)
+ * @max_rate: maximum clock rate for the DPLL
  * @modes: possible values of @enable_mask
  * @autoidle_reg: register containing the DPLL autoidle mode bitfield
  * @idlest_reg: register containing the DPLL idle status bitfield
@@ -81,6 +82,7 @@ struct dpll_data {
 	u8			last_rounded_n;
 	u8			min_divider;
 	u16			max_divider;
+	unsigned long		max_rate;
 	u8			modes;
 	void __iomem		*autoidle_reg;
 	void __iomem		*idlest_reg;
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] clk: ti: dpll: add support for specifying max rate for DPLLs
Date: Wed, 16 Mar 2016 21:54:55 +0200	[thread overview]
Message-ID: <1458158097-21137-2-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1458158097-21137-1-git-send-email-t-kristo@ti.com>

DPLLs typically have a maximum rate they can support, and this varies
from DPLL to DPLL. Add support of the maximum rate value to the DPLL
data struct, and also add check for this in the DPLL round_rate function.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
---
 drivers/clk/ti/clkt_dpll.c |    3 +++
 include/linux/clk/ti.h     |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c
index b5cc6f6..7d97b07 100644
--- a/drivers/clk/ti/clkt_dpll.c
+++ b/drivers/clk/ti/clkt_dpll.c
@@ -301,6 +301,9 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
 
 	dd = clk->dpll_data;
 
+	if (dd->max_rate && target_rate > dd->max_rate)
+		target_rate = dd->max_rate;
+
 	ref_rate = clk_get_rate(dd->clk_ref);
 	clk_name = clk_hw_get_name(hw);
 	pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 9a63860..1a48ee2 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -37,6 +37,7 @@
  * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
  * @min_divider: minimum valid non-bypass divider value (actual)
  * @max_divider: maximum valid non-bypass divider value (actual)
+ * @max_rate: maximum clock rate for the DPLL
  * @modes: possible values of @enable_mask
  * @autoidle_reg: register containing the DPLL autoidle mode bitfield
  * @idlest_reg: register containing the DPLL idle status bitfield
@@ -81,6 +82,7 @@ struct dpll_data {
 	u8			last_rounded_n;
 	u8			min_divider;
 	u16			max_divider;
+	unsigned long		max_rate;
 	u8			modes;
 	void __iomem		*autoidle_reg;
 	void __iomem		*idlest_reg;
-- 
1.7.9.5

  reply	other threads:[~2016-03-16 19:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 19:54 [PATCH 0/3] ARM: AMx3xx: misc clock fixes Tero Kristo
2016-03-16 19:54 ` Tero Kristo
2016-03-16 19:54 ` Tero Kristo
2016-03-16 19:54 ` Tero Kristo [this message]
2016-03-16 19:54   ` [PATCH 1/3] clk: ti: dpll: add support for specifying max rate for DPLLs Tero Kristo
2016-03-16 19:54   ` Tero Kristo
2016-04-01 19:27   ` Stephen Boyd
2016-04-01 19:27     ` Stephen Boyd
2016-04-16  0:26   ` Stephen Boyd
2016-04-16  0:26     ` Stephen Boyd
2016-03-16 19:54 ` [PATCH 2/3] clk: ti: amx3xx: limit the maximum frequency of DPLLs based on spec Tero Kristo
2016-03-16 19:54   ` Tero Kristo
2016-03-16 19:54   ` Tero Kristo
2016-04-01 19:28   ` Stephen Boyd
2016-04-01 19:28     ` Stephen Boyd
2016-04-13 12:51     ` Tero Kristo
2016-04-13 12:51       ` Tero Kristo
2016-04-13 12:51       ` Tero Kristo
2016-04-16  0:23       ` Stephen Boyd
2016-04-16  0:23         ` Stephen Boyd
2016-04-16  0:27   ` Stephen Boyd
2016-04-16  0:27     ` Stephen Boyd
2016-03-16 19:54 ` [PATCH 3/3] ARM: dts: am43xx: add support for clkout1 clock Tero Kristo
2016-03-16 19:54   ` Tero Kristo
2016-03-16 19:54   ` Tero Kristo
2016-04-12 21:05   ` Tony Lindgren
2016-04-12 21:05     ` Tony Lindgren
2016-04-13 12:52     ` Tero Kristo
2016-04-13 12:52       ` Tero Kristo
2016-04-13 12:52       ` Tero Kristo
2016-04-13 19:07       ` Tony Lindgren
2016-04-13 19:07         ` Tony Lindgren
2016-03-16 22:33 ` [PATCH 0/3] ARM: AMx3xx: misc clock fixes Nishanth Menon
2016-03-16 22:33   ` Nishanth Menon
2016-03-16 22:33   ` Nishanth Menon

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=1458158097-21137-2-git-send-email-t-kristo@ti.com \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=tomi.valkeinen@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 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.