Skip to contentSkip to conversation

clk: ux500: Add support for ab850x clocks

PATCH Superseded Ulf Hansson 4 participants 9 messages Apr 2, 2013 – Apr 10, 2013

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover clk: ux500: Add support for ab850x clocks

From: Ulf Hansson <[email protected]>

This patchset implements a new clock hw type called sysctrl used for abx500 clocks. It will then setup the first version of clock tree specfic for ab850x.

The new sysctrl clk hw type depends on the ab8500-sysctrl API. The last patch is a mfd patch which alignes the probe order between the abx500-clk driver and the ab8500-sysctrl driver.

The intent is to merge the patchset together, preferably through Mike's clk tree. I would thus try to fetch an ack from Samuel regarding the mfd patch.

Ulf Hansson (3):
clk: ux500: Add support for sysctrl clocks
clk: ux500: abx500: Define clock tree for ab850x
mfd: ab8500: sysctrl: Initialize driver at arch_initcall

 drivers/clk/ux500/Makefile      |    1 +
 drivers/clk/ux500/abx500-clk.c  |   71 ++++++++++++-
 drivers/clk/ux500/clk-sysctrl.c |  224 +++++++++++++++++++++++++++++++++++++++
 drivers/clk/ux500/clk.h         |   29 +++++
 drivers/mfd/ab8500-sysctrl.c    |    2 +-
 5 files changed, 323 insertions(+), 4 deletions(-)
 create mode 100644 drivers/clk/ux500/clk-sysctrl.c
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/3 clk: ux500: Add support for sysctrl clocks

From: Ulf Hansson <[email protected]>

The abx500 sysctrl clocks are using the ab8500 sysctrl driver to modify the clock hardware. Sysctrl clocks are represented by a ab8500 sysctrl register and with a corresponding bitmask.

The sysctrl clocks are slow path clocks, which means clk_prepare and clk_unprepare will be used to gate|ungate these clocks.

---
 drivers/clk/ux500/Makefile      |    1 +
 drivers/clk/ux500/clk-sysctrl.c |  224 +++++++++++++++++++++++++++++++++++++++
 drivers/clk/ux500/clk.h         |   29 +++++
 3 files changed, 254 insertions(+)
 create mode 100644 drivers/clk/ux500/clk-sysctrl.c
drivers/clk/ux500/Makefile +1 -0
index bcc0c11..c6a806e 100644
@@ -5,6 +5,7 @@
 # Clock types
 obj-y += clk-prcc.o
 obj-y += clk-prcmu.o
+obj-y += clk-sysctrl.o
 
 # Clock definitions
 obj-y += u8500_clk.o
drivers/clk/ux500/clk-sysctrl.c new file +224 -0

224 lines not on this page · raw message

drivers/clk/ux500/clk.h +29 -0
index c3e4491..3d2dfdc 100644
@@ -11,6 +11,7 @@
 #define __UX500_CLK_H
 
 #include <linux/clk.h>
+#include <linux/device.h>
 
 struct clk *clk_reg_prcc_pclk(const char *name,
 			      const char *parent_name,
@@ -57,4 +58,32 @@ struct clk *clk_reg_prcmu_opp_volt_scalable(const char *name,
 					    unsigned long rate,
 					    unsigned long flags);
 
+struct clk *clk_reg_sysctrl_gate(struct device *dev,
+				 const char *name,
+				 const char *parent_name,
+				 u16 reg_sel,
+				 u8 reg_mask,
+				 u8 reg_bits,
+				 unsigned long enable_delay_us,
+				 unsigned long flags);
+
+struct clk *clk_reg_sysctrl_gate_fixed_rate(struct device *dev,
+					    const char *name,
+					    const char *parent_name,
+					    u16 reg_sel,
+					    u8 reg_mask,
+					    u8 reg_bits,
+					    unsigned long rate,
+					    unsigned long enable_delay_us,
+					    unsigned long flags);
+
+struct clk *clk_reg_sysctrl_set_parent(struct device *dev,
+				       const char *name,
+				       const char **parent_names,
+				       u8 num_parents,
+				       u16 *reg_sel,
+				       u8 *reg_mask,
+				       u8 *reg_bits,
+				       unsigned long flags);
+
 #endif /* __UX500_CLK_H */
Signature · 1 line
1.7.10
#2 lore raw

PATCH 1/3 clk: ux500: Add support for sysctrl clocks

Quoting Ulf Hansson (2013-04-02 16:06:25)

Quoted 36 lines

From: Ulf Hansson <[email protected]>

The abx500 sysctrl clocks are using the ab8500 sysctrl driver to modify the clock hardware. Sysctrl clocks are represented by a ab8500 sysctrl register and with a corresponding bitmask.

The sysctrl clocks are slow path clocks, which means clk_prepare and clk_unprepare will be used to gate|ungate these clocks.

---
 drivers/clk/ux500/Makefile      |    1 +
 drivers/clk/ux500/clk-sysctrl.c |  224 +++++++++++++++++++++++++++++++++++++++
 drivers/clk/ux500/clk.h         |   29 +++++
 3 files changed, 254 insertions(+)
 create mode 100644 drivers/clk/ux500/clk-sysctrl.c
drivers/clk/ux500/Makefile +1 -0
index bcc0c11..c6a806e 100644
@@ -5,6 +5,7 @@
 # Clock types
 obj-y += clk-prcc.o
 obj-y += clk-prcmu.o
+obj-y += clk-sysctrl.o
 
 # Clock definitions
 obj-y += u8500_clk.o
drivers/clk/ux500/clk-sysctrl.c new file +1 -0
new file mode 100644
index 0000000..72c826d
@@ -0,0 +1,224 @@
+/*

drivers/clk/ux500/clk-sysctrl.c line 11

Quoted 10 lines
drivers/clk/ux500/clk-sysctrl.c new file +10 -0
+ * Sysctrl clock implementation for ux500 platform.
+ *
+ * Copyright (C) 2013 ST-Ericsson SA
+ * Author: Ulf Hansson <[email protected]>
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clk-private.h>

I think the above header accidentally slipped in.

Regards,
Mike

#3 lore raw

PATCH 2/3 clk: ux500: abx500: Define clock tree for ab850x

In reply to Ulf Hansson

From: Ulf Hansson <[email protected]>

The patch setups the first version of the clock tree for ab850x, which is used by u8500 platforms. Mainly sysctrl clocks are used.

---
 drivers/clk/ux500/abx500-clk.c |   71 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 3 deletions(-)
drivers/clk/ux500/abx500-clk.c +68 -3
index 9f7400d..a0fca00 100644
@@ -12,13 +12,78 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/abx500/ab8500.h>
-
-/* TODO: Add clock implementations here */
-
+#include <linux/mfd/abx500/ab8500-sysctrl.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/mfd/dbx500-prcmu.h>
+#include "clk.h"
 
 /* Clock definitions for ab8500 */
 static int ab8500_reg_clks(struct device *dev)
 {
+	int ret;
+	struct clk *clk;
+
+	const char *intclk_parents[] = {"ab8500_sysclk", "ulpclk"};
+	u16 intclk_reg_sel[] = {0 , AB8500_SYSULPCLKCTRL1};
+	u8 intclk_reg_mask[] = {0 , AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK};
+	u8 intclk_reg_bits[] = {
+		0 ,
+		(1 << AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT)
+	};
+
+	dev_info(dev, "register clocks for ab850x\n");
+
+	/* Enable SWAT */
+	ret = ab8500_sysctrl_set(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE);
+	if (ret)
+		return ret;
+
+	/* ab8500_sysclk */
+	clk = clk_reg_prcmu_gate("ab8500_sysclk", NULL, PRCMU_SYSCLK,
+				CLK_IS_ROOT);
+	clk_register_clkdev(clk, "sysclk", "ab8500-usb.0");
+	clk_register_clkdev(clk, "sysclk", "ab-iddet.0");
+	clk_register_clkdev(clk, "sysclk", "ab85xx-codec.0");
+	clk_register_clkdev(clk, "sysclk", "shrm_bus");
+
+	/* ab8500_sysclk2 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk2", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ, 0, 0);
+	clk_register_clkdev(clk, "sysclk", "0-0070");
+
+	/* ab8500_sysclk3 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk3", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ, 0, 0);
+	clk_register_clkdev(clk, "sysclk", "cg1960_core.0");
+
+	/* ab8500_sysclk4 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk4", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ, 0, 0);
+
+	/* ab_ulpclk */
+	clk = clk_reg_sysctrl_gate_fixed_rate(dev, "ulpclk", NULL,
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+		AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+		38400000, 9000, CLK_IS_ROOT);
+	clk_register_clkdev(clk, "ulpclk", "ab85xx-codec.0");
+
+	/* ab8500_intclk */
+	clk = clk_reg_sysctrl_set_parent(dev , "intclk", intclk_parents, 2,
+		intclk_reg_sel, intclk_reg_mask, intclk_reg_bits, 0);
+	clk_register_clkdev(clk, "intclk", "ab85xx-codec.0");
+	clk_register_clkdev(clk, NULL, "ab8500-pwm.1");
+
+	/* ab8500_audioclk */
+	clk = clk_reg_sysctrl_gate(dev , "audioclk", "intclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_AUDIOCLKENA,
+		AB8500_SYSULPCLKCTRL1_AUDIOCLKENA, 0, 0);
+	clk_register_clkdev(clk, "audioclk", "ab85xx-codec.0");
+
 	return 0;
 }
 
Signature · 1 line
1.7.10
#4 lore raw

PATCH 2/3 clk: ux500: abx500: Define clock tree for ab850x

Hi Ulf,

Quoted 4 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

The patch setups the first version of the clock tree for ab850x, which is used by u8500 platforms. Mainly sysctrl clocks are used.

I was just going to ask you if you had plans to develop this stuff, as I was missing a clock for ab8500-usb.

This worked nice for me so, FWIW:

Thanks,
Fabio

Quoted 91 lines
---
 drivers/clk/ux500/abx500-clk.c |   71 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 3 deletions(-)
drivers/clk/ux500/abx500-clk.c +68 -3
index 9f7400d..a0fca00 100644
@@ -12,13 +12,78 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/abx500/ab8500.h>
-
-/* TODO: Add clock implementations here */
-
+#include <linux/mfd/abx500/ab8500-sysctrl.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/mfd/dbx500-prcmu.h>
+#include "clk.h"
 
 /* Clock definitions for ab8500 */
 static int ab8500_reg_clks(struct device *dev)
 {
+	int ret;
+	struct clk *clk;
+
+	const char *intclk_parents[] = {"ab8500_sysclk", "ulpclk"};
+	u16 intclk_reg_sel[] = {0 , AB8500_SYSULPCLKCTRL1};
+	u8 intclk_reg_mask[] = {0 , AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK};
+	u8 intclk_reg_bits[] = {
+		0 ,
+		(1 << AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT)
+	};
+
+	dev_info(dev, "register clocks for ab850x\n");
+
+	/* Enable SWAT */
+	ret = ab8500_sysctrl_set(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE);
+	if (ret)
+		return ret;
+
+	/* ab8500_sysclk */
+	clk = clk_reg_prcmu_gate("ab8500_sysclk", NULL, PRCMU_SYSCLK,
+				CLK_IS_ROOT);
+	clk_register_clkdev(clk, "sysclk", "ab8500-usb.0");
+	clk_register_clkdev(clk, "sysclk", "ab-iddet.0");
+	clk_register_clkdev(clk, "sysclk", "ab85xx-codec.0");
+	clk_register_clkdev(clk, "sysclk", "shrm_bus");
+
+	/* ab8500_sysclk2 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk2", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ, 0, 0);
+	clk_register_clkdev(clk, "sysclk", "0-0070");
+
+	/* ab8500_sysclk3 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk3", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ, 0, 0);
+	clk_register_clkdev(clk, "sysclk", "cg1960_core.0");
+
+	/* ab8500_sysclk4 */
+	clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk4", "ab8500_sysclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ,
+		AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ, 0, 0);
+
+	/* ab_ulpclk */
+	clk = clk_reg_sysctrl_gate_fixed_rate(dev, "ulpclk", NULL,
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+		AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+		38400000, 9000, CLK_IS_ROOT);
+	clk_register_clkdev(clk, "ulpclk", "ab85xx-codec.0");
+
+	/* ab8500_intclk */
+	clk = clk_reg_sysctrl_set_parent(dev , "intclk", intclk_parents, 2,
+		intclk_reg_sel, intclk_reg_mask, intclk_reg_bits, 0);
+	clk_register_clkdev(clk, "intclk", "ab85xx-codec.0");
+	clk_register_clkdev(clk, NULL, "ab8500-pwm.1");
+
+	/* ab8500_audioclk */
+	clk = clk_reg_sysctrl_gate(dev , "audioclk", "intclk",
+		AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_AUDIOCLKENA,
+		AB8500_SYSULPCLKCTRL1_AUDIOCLKENA, 0, 0);
+	clk_register_clkdev(clk, "audioclk", "ab85xx-codec.0");
+
 	return 0;
 }
Signature · 1 line
Fabio Baltieri
#5 lore raw

PATCH 2/3 clk: ux500: abx500: Define clock tree for ab850x

In reply to Ulf Hansson

Quoting Ulf Hansson (2013-04-02 16:06:26)

Quoted 6 lines

From: Ulf Hansson <[email protected]>

The patch setups the first version of the clock tree for ab850x, which is used by u8500 platforms. Mainly sysctrl clocks are used.

Ulf,

Does the V1 version of this patch #2 go along with the recently posted v3 version of patch #1 titled, "[PATCH V3 1/3] clk: ux500: Add support for sysctrl clocks"?

Regards,
Mike

Quoted 92 lines
---
 drivers/clk/ux500/abx500-clk.c |   71 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 3 deletions(-)
drivers/clk/ux500/abx500-clk.c +68 -3
index 9f7400d..a0fca00 100644
@@ -12,13 +12,78 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/abx500/ab8500.h>
-
-/* TODO: Add clock implementations here */
-
+#include <linux/mfd/abx500/ab8500-sysctrl.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/mfd/dbx500-prcmu.h>
+#include "clk.h"
 
 /* Clock definitions for ab8500 */
 static int ab8500_reg_clks(struct device *dev)
 {
+       int ret;
+       struct clk *clk;
+
+       const char *intclk_parents[] = {"ab8500_sysclk", "ulpclk"};
+       u16 intclk_reg_sel[] = {0 , AB8500_SYSULPCLKCTRL1};
+       u8 intclk_reg_mask[] = {0 , AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK};
+       u8 intclk_reg_bits[] = {
+               0 ,
+               (1 << AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT)
+       };
+
+       dev_info(dev, "register clocks for ab850x\n");
+
+       /* Enable SWAT */
+       ret = ab8500_sysctrl_set(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE);
+       if (ret)
+               return ret;
+
+       /* ab8500_sysclk */
+       clk = clk_reg_prcmu_gate("ab8500_sysclk", NULL, PRCMU_SYSCLK,
+                               CLK_IS_ROOT);
+       clk_register_clkdev(clk, "sysclk", "ab8500-usb.0");
+       clk_register_clkdev(clk, "sysclk", "ab-iddet.0");
+       clk_register_clkdev(clk, "sysclk", "ab85xx-codec.0");
+       clk_register_clkdev(clk, "sysclk", "shrm_bus");
+
+       /* ab8500_sysclk2 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk2", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ, 0, 0);
+       clk_register_clkdev(clk, "sysclk", "0-0070");
+
+       /* ab8500_sysclk3 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk3", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ, 0, 0);
+       clk_register_clkdev(clk, "sysclk", "cg1960_core.0");
+
+       /* ab8500_sysclk4 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk4", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ, 0, 0);
+
+       /* ab_ulpclk */
+       clk = clk_reg_sysctrl_gate_fixed_rate(dev, "ulpclk", NULL,
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+               AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+               38400000, 9000, CLK_IS_ROOT);
+       clk_register_clkdev(clk, "ulpclk", "ab85xx-codec.0");
+
+       /* ab8500_intclk */
+       clk = clk_reg_sysctrl_set_parent(dev , "intclk", intclk_parents, 2,
+               intclk_reg_sel, intclk_reg_mask, intclk_reg_bits, 0);
+       clk_register_clkdev(clk, "intclk", "ab85xx-codec.0");
+       clk_register_clkdev(clk, NULL, "ab8500-pwm.1");
+
+       /* ab8500_audioclk */
+       clk = clk_reg_sysctrl_gate(dev , "audioclk", "intclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_AUDIOCLKENA,
+               AB8500_SYSULPCLKCTRL1_AUDIOCLKENA, 0, 0);
+       clk_register_clkdev(clk, "audioclk", "ab85xx-codec.0");
+
        return 0;
 }
 
Signature · 1 line
1.7.10
#6 lore raw

PATCH 2/3 clk: ux500: abx500: Define clock tree for ab850x

In reply to Ulf Hansson

Quoting Ulf Hansson (2013-04-02 16:06:26)

Quoted 6 lines

From: Ulf Hansson <[email protected]>

The patch setups the first version of the clock tree for ab850x, which is used by u8500 platforms. Mainly sysctrl clocks are used.

Taken into clk-next.

Regards,
Mike

Quoted 92 lines
---
 drivers/clk/ux500/abx500-clk.c |   71 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 3 deletions(-)
drivers/clk/ux500/abx500-clk.c +68 -3
index 9f7400d..a0fca00 100644
@@ -12,13 +12,78 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/abx500/ab8500.h>
-
-/* TODO: Add clock implementations here */
-
+#include <linux/mfd/abx500/ab8500-sysctrl.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/mfd/dbx500-prcmu.h>
+#include "clk.h"
 
 /* Clock definitions for ab8500 */
 static int ab8500_reg_clks(struct device *dev)
 {
+       int ret;
+       struct clk *clk;
+
+       const char *intclk_parents[] = {"ab8500_sysclk", "ulpclk"};
+       u16 intclk_reg_sel[] = {0 , AB8500_SYSULPCLKCTRL1};
+       u8 intclk_reg_mask[] = {0 , AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK};
+       u8 intclk_reg_bits[] = {
+               0 ,
+               (1 << AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT)
+       };
+
+       dev_info(dev, "register clocks for ab850x\n");
+
+       /* Enable SWAT */
+       ret = ab8500_sysctrl_set(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE);
+       if (ret)
+               return ret;
+
+       /* ab8500_sysclk */
+       clk = clk_reg_prcmu_gate("ab8500_sysclk", NULL, PRCMU_SYSCLK,
+                               CLK_IS_ROOT);
+       clk_register_clkdev(clk, "sysclk", "ab8500-usb.0");
+       clk_register_clkdev(clk, "sysclk", "ab-iddet.0");
+       clk_register_clkdev(clk, "sysclk", "ab85xx-codec.0");
+       clk_register_clkdev(clk, "sysclk", "shrm_bus");
+
+       /* ab8500_sysclk2 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk2", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ, 0, 0);
+       clk_register_clkdev(clk, "sysclk", "0-0070");
+
+       /* ab8500_sysclk3 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk3", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ, 0, 0);
+       clk_register_clkdev(clk, "sysclk", "cg1960_core.0");
+
+       /* ab8500_sysclk4 */
+       clk = clk_reg_sysctrl_gate(dev , "ab8500_sysclk4", "ab8500_sysclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ,
+               AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ, 0, 0);
+
+       /* ab_ulpclk */
+       clk = clk_reg_sysctrl_gate_fixed_rate(dev, "ulpclk", NULL,
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+               AB8500_SYSULPCLKCTRL1_ULPCLKREQ,
+               38400000, 9000, CLK_IS_ROOT);
+       clk_register_clkdev(clk, "ulpclk", "ab85xx-codec.0");
+
+       /* ab8500_intclk */
+       clk = clk_reg_sysctrl_set_parent(dev , "intclk", intclk_parents, 2,
+               intclk_reg_sel, intclk_reg_mask, intclk_reg_bits, 0);
+       clk_register_clkdev(clk, "intclk", "ab85xx-codec.0");
+       clk_register_clkdev(clk, NULL, "ab8500-pwm.1");
+
+       /* ab8500_audioclk */
+       clk = clk_reg_sysctrl_gate(dev , "audioclk", "intclk",
+               AB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_AUDIOCLKENA,
+               AB8500_SYSULPCLKCTRL1_AUDIOCLKENA, 0, 0);
+       clk_register_clkdev(clk, "audioclk", "ab85xx-codec.0");
+
        return 0;
 }
 
Signature · 1 line
1.7.10
#7 lore raw

PATCH 3/3 mfd: ab8500: sysctrl: Initialize driver at arch_initcall

In reply to Ulf Hansson

From: Ulf Hansson <[email protected]>

The abx500-clk driver is initiated at arch_initcall level. Moreover it is relying on the ab8500-sysctrl API to be available. Therefore move ab8500-sysctrl to arch_initcall level as well. The device is already added before the abx500 clk device, thus it will be probed before as well, which is exactly what we want.

---
 drivers/mfd/ab8500-sysctrl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/ab8500-sysctrl.c +1 -1
index 108fd86..3b65053 100644
@@ -166,7 +166,7 @@ static int __init ab8500_sysctrl_init(void)
 {
 	return platform_driver_register(&ab8500_sysctrl_driver);
 }
-subsys_initcall(ab8500_sysctrl_init);
+arch_initcall(ab8500_sysctrl_init);
 
 MODULE_AUTHOR("Mattias Nilsson <[email protected]");
 MODULE_DESCRIPTION("AB8500 system control driver");
Signature · 1 line
1.7.10
Applied
#8 lore raw

PATCH 3/3 mfd: ab8500: sysctrl: Initialize driver at arch_initcall

Hi Ulf,

Quoted 8 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

The abx500-clk driver is initiated at arch_initcall level. Moreover it is relying on the ab8500-sysctrl API to be available. Therefore move ab8500-sysctrl to arch_initcall level as well. The device is already added before the abx500 clk device, thus it will be probed before as well, which is exactly what we want.

Quoted 5 lines
---
 drivers/mfd/ab8500-sysctrl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/