linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clk/zynq/pll: Fix documentation for PLL register function
@ 2013-07-19 17:16 Soren Brinkmann
  2013-07-19 17:16 ` [PATCH 2/2] clk/zynq/pll: Use #defines for fbdiv min/max values Soren Brinkmann
       [not found] ` <1632076624.115.1374260902674.JavaMail.mail@webmail02>
  0 siblings, 2 replies; 3+ messages in thread
From: Soren Brinkmann @ 2013-07-19 17:16 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
 drivers/clk/zynq/pll.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c
index 47e307c..67f1b5e 100644
--- a/drivers/clk/zynq/pll.c
+++ b/drivers/clk/zynq/pll.c
@@ -182,7 +182,12 @@ static const struct clk_ops zynq_pll_ops = {
 
 /**
  * clk_register_zynq_pll() - Register PLL with the clock framework
- * @np	Pointer to the DT device node
+ * @name	PLL name
+ * @parent	Parent clock name
+ * @pll_ctrl	Pointer to PLL control register
+ * @pll_status	Pointer to PLL status register
+ * @lock_index	Bit index to this PLL's lock status bit in @pll_status
+ * @lock	Register lock
  */
 struct clk *clk_register_zynq_pll(const char *name, const char *parent,
 		void __iomem *pll_ctrl, void __iomem *pll_status, u8 lock_index,
-- 
1.8.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] clk/zynq/pll: Use #defines for fbdiv min/max values
  2013-07-19 17:16 [PATCH 1/2] clk/zynq/pll: Fix documentation for PLL register function Soren Brinkmann
@ 2013-07-19 17:16 ` Soren Brinkmann
       [not found] ` <1632076624.115.1374260902674.JavaMail.mail@webmail02>
  1 sibling, 0 replies; 3+ messages in thread
From: Soren Brinkmann @ 2013-07-19 17:16 UTC (permalink / raw)
  To: linux-arm-kernel

Use more descriptive #defines for the minimum and maximum PLL
feedback divider.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
 drivers/clk/zynq/pll.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c
index 67f1b5e..26a8d8b 100644
--- a/drivers/clk/zynq/pll.c
+++ b/drivers/clk/zynq/pll.c
@@ -50,6 +50,9 @@ struct zynq_pll {
 #define PLLCTRL_RESET_MASK	1
 #define PLLCTRL_RESET_SHIFT	0
 
+#define PLL_FBDIV_MIN	13
+#define PLL_FBDIV_MAX	66
+
 /**
  * zynq_pll_round_rate() - Round a clock frequency
  * @hw:		Handle between common and hardware-specific interfaces
@@ -63,10 +66,10 @@ static long zynq_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 	u32 fbdiv;
 
 	fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
-	if (fbdiv < 13)
-		fbdiv = 13;
-	else if (fbdiv > 66)
-		fbdiv = 66;
+	if (fbdiv < PLL_FBDIV_MIN)
+		fbdiv = PLL_FBDIV_MIN;
+	else if (fbdiv > PLL_FBDIV_MAX)
+		fbdiv = PLL_FBDIV_MAX;
 
 	return *prate * fbdiv;
 }
-- 
1.8.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] clk/zynq/pll: Use #defines for fbdiv min/max values
       [not found] ` <1632076624.115.1374260902674.JavaMail.mail@webmail02>
@ 2013-07-19 19:12   ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2013-07-19 19:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2013-07-19 at 10:16 -0700, Soren Brinkmann wrote:
> Use more descriptive #defines for the minimum and maximum PLL
> feedback divider.

trivial

> diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c
[]
> @@ -63,10 +66,10 @@ static long zynq_pll_round_rate(struct clk_hw *hw, unsigned long rate,
>  	u32 fbdiv;
>  
>  	fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
> -	if (fbdiv < 13)
> -		fbdiv = 13;
> -	else if (fbdiv > 66)
> -		fbdiv = 66;
> +	if (fbdiv < PLL_FBDIV_MIN)
> +		fbdiv = PLL_FBDIV_MIN;
> +	else if (fbdiv > PLL_FBDIV_MAX)
> +		fbdiv = PLL_FBDIV_MAX;

clamp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-19 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19 17:16 [PATCH 1/2] clk/zynq/pll: Fix documentation for PLL register function Soren Brinkmann
2013-07-19 17:16 ` [PATCH 2/2] clk/zynq/pll: Use #defines for fbdiv min/max values Soren Brinkmann
     [not found] ` <1632076624.115.1374260902674.JavaMail.mail@webmail02>
2013-07-19 19:12   ` Joe Perches

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).