Skip to contentSkip to conversation

clk: vt8500: updates for 3.11

PATCH New Tony Prisk 2 participants 4 messages May 13, 2013 – May 29, 2013

Subsystems (2)
lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

cover clk: vt8500: updates for 3.11

Hi Mike,

Two updates for the arch-vt8500 clock code:

#1: Add support for the WM8850 PLL.
#2: Remove a second divisor check in vt8500_dclk_set_rate() which causes the divisor to be round-down too low.

Regards
Tony Prisk

Tony Prisk (2):
clk: vt8500: Add support for clocks on the WM8850 SoCs
clk: vt8500: Remove unnecessary divisor adjustment in
vtwm_dclk_set_rate()

 Documentation/devicetree/bindings/clock/vt8500.txt |    2 +
 drivers/clk/clk-vt8500.c                           |   75 ++++++++++++++++++--
 2 files changed, 73 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/2 clk: vt8500: Add support for clocks on the WM8850 SoCs

The WM8850 has a different PLL clock to the previous versions. This patch adds support for the WM8850-style PLL clocks.

---
 Documentation/devicetree/bindings/clock/vt8500.txt |    2 +
 drivers/clk/clk-vt8500.c                           |   71 ++++++++++++++++++++
 2 files changed, 73 insertions(+)
Documentation/devicetree/bindings/clock/vt8500.txt +2 -0
index a880c70..91d71cc 100644
@@ -8,6 +8,8 @@ Required properties:
 - compatible : shall be one of the following:
 	"via,vt8500-pll-clock" - for a VT8500/WM8505 PLL clock
 	"wm,wm8650-pll-clock" - for a WM8650 PLL clock
+	"wm,wm8750-pll-clock" - for a WM8750 PLL clock
+	"wm,wm8850-pll-clock" - for a WM8850 PLL clock
 	"via,vt8500-device-clock" - for a VT/WM device clock
 
 Required properties for PLL clocks:
drivers/clk/clk-vt8500.c +71 -0

113 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/2 clk: vt8500: Remove unnecessary divisor adjustment in vtwm_dclk_set_rate()

In reply to Tony Prisk

The divisor adjustment code to ensure that a divisor is not rounded down, thereby giving a rate higher than requested, is unnecessary and in some instances results in the actual rate being much lower than requested due to rounding errors.

The test is already performed in vtwm_dclk_round_rate(), which is always called when clk_set_rate is called. Due to rounding errors in the line:
divisor = parent_rate / rate (clk-vt8500.c:160) we will sometimes end up adjusting the divisor twice - first in round_rate and then again in set_rate.

This patch removes the test/adjustment in vtwm_dclk_set_rate.

---
 drivers/clk/clk-vt8500.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/clk/clk-vt8500.c +0 -4
index 6d5b6e9..d8fd085 100644
@@ -157,10 +157,6 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 	divisor =  parent_rate / rate;
 
-	/* If prate / rate would be decimal, incr the divisor */
-	if (rate * divisor < parent_rate)
-		divisor++;
-
 	if (divisor == cdev->div_mask + 1)
 		divisor = 0;
 
Signature · 1 line
1.7.9.5
#3 lore raw

cover clk: vt8500: updates for 3.11

In reply to Tony Prisk

Quoting Tony Prisk (2013-05-13 01:20:58)

Quoted 8 lines

Hi Mike,

Two updates for the arch-vt8500 clock code:

#1: Add support for the WM8850 PLL.
#2: Remove a second divisor check in vt8500_dclk_set_rate() which causes the divisor to be round-down too low.

Taken both into clk-next.

Thanks,
Mike

Quoted 14 lines

Regards
Tony Prisk

Tony Prisk (2):
clk: vt8500: Add support for clocks on the WM8850 SoCs
clk: vt8500: Remove unnecessary divisor adjustment in
vtwm_dclk_set_rate()

 Documentation/devicetree/bindings/clock/vt8500.txt |    2 +
 drivers/clk/clk-vt8500.c                           |   75 ++++++++++++++++++--
 2 files changed, 73 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5