Add RCAN clock support to the R-Car generation 2 CPG driver. This clock gets
derived from the USB_EXTAL clock by dividing it by 6. The layout of RCANCKCR
register is close to those of the clocks supported by the 'clk-div6' driver
but has no divider field, and so can't be supported by that driver...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
---
The patch is against the 'clk-next' branch of Mike Turquette's 'linux.git' repo.
drivers/clk/shmobile/clk-rcar-gen2.c | 99 +++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+)
Index: linux/drivers/clk/shmobile/clk-rcar-gen2.c[...]
===================================================================
--- linux.orig/drivers/clk/shmobile/clk-rcar-gen2.c
+++ linux/drivers/clk/shmobile/clk-rcar-gen2.c
+static struct clk * __init cpg_rcan_clk_register(struct rcar_gen2_cpg *cpg,
+ struct device_node *np)
+{
+ static const char *parent_name;
+ struct clk_init_data init;
+ struct cpg_rcan_clk *rcanclk;
+ struct clk *clk;
+
+ rcanclk = kzalloc(sizeof(*rcanclk), GFP_KERNEL);
+ if (!rcanclk)
+ return ERR_PTR(-ENOMEM);
+
+ parent_name = of_clk_get_parent_name(np, 1);
+
+ init.name = "rcan";
+ init.ops = &cpg_rcan_clk_ops;
+ init.parent_names = &parent_name;
+ init.num_parents = 1;