Skip to contentSkip to conversation

Linux-aspeed Digest, Vol 12, Issue 9

DISCUSSION Jae Hyun Yoo 1 participant 1 message May 21, 2018 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Lei,

Quoted 35 lines · linux-aspeed-request at lists.ozlabs.org

Date: Fri, 18 May 2018 16:57:02 +0800
From: Lei YU <[email protected]>
To: Michael Turquette <[email protected]>, Stephen Boyd
<[email protected]>, Joel Stanley <[email protected]>, Andrew Jeffery <[email protected]>, Rob Herring <[email protected]>, Mark Rutland <[email protected]>, Lei YU <[email protected]>, linux-clk at vger.kernel.org, linux-arm-kernel at lists.infradead.org, linux-aspeed at lists.ozlabs.org, linux-kernel at vger.kernel.org, devicetree at vger.kernel.org
Subject: [PATCH] clk: aspeed: Add 24MHz fixed clock
Message-ID: <[email protected]>

Add a 24MHz fixed clock.
This clock will be used for certain devices, e.g. pwm.

---
  drivers/clk/clk-aspeed.c                 | 9 ++++++++-
  include/dt-bindings/clock/aspeed-clock.h | 1 +
  2 files changed, 9 insertions(+), 1 deletion(-)
drivers/clk/clk-aspeed.c +1 -1
index 5eb50c3..4664088 100644
@@ -14,7 +14,7 @@
 
  #include <dt-bindings/clock/aspeed-clock.h>
 
-#define ASPEED_NUM_CLKS		35
+#define ASPEED_NUM_CLKS		36
 
  #define ASPEED_RESET_CTRL	0x04
  #define ASPEED_CLK_SELECTION	0x08

drivers/clk/clk-aspeed.c static int aspeed_clk_probe(struct platform_device *pdev) · line 483

Quoted 10 lines
drivers/clk/clk-aspeed.c +7 -0
@@ -474,6 +474,13 @@ static int aspeed_clk_probe(struct platform_device *pdev)
  		return PTR_ERR(hw);
  	aspeed_clk_data->hws[ASPEED_CLK_BCLK] = hw;
 
+	/* Fixed 24MHz clock */
+	hw = clk_hw_register_fixed_rate(NULL, "fixed-24m", "clkin",
+					0, 24000000);
+	if (IS_ERR(hw))
+		return PTR_ERR(hw);
+	aspeed_clk_data->hws[ASPEED_CLK_24M] = hw;
+

According to the datasheet, CLKIN could be a 25MHz too. How can this change handle the case?

Quoted 16 lines
drivers/clk/clk-aspeed.c +0 -0
  	/*
  	 * TODO: There are a number of clocks that not included in this driver
  	 * as more information is required:
include/dt-bindings/clock/aspeed-clock.h +1 -0
index d3558d8..ff29d8e 100644
@@ -38,6 +38,7 @@
  #define ASPEED_CLK_MAC			32
  #define ASPEED_CLK_BCLK			33
  #define ASPEED_CLK_MPLL			34
+#define ASPEED_CLK_24M			35
 
  #define ASPEED_RESET_XDMA		0
  #define ASPEED_RESET_MCTP		1