sh: sh7786 clkdev lookups.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 29 Mar 2010 08:03:15 +0000 (17:03 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 29 Mar 2010 08:03:15 +0000 (17:03 +0900)
This plugs in clkdev lookups for the SH7786 clocks and migrates off of
clock string usage for the TMU clocks.

Previously the TMU clocks were aliased to the peripheral clock, so this
gets the driver actually toggling the proper clocks now as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/sh4a/clock-sh7786.c
arch/sh/kernel/cpu/sh4a/setup-sh7786.c

index 85e8d57f497112d6d6aaa399527a8409c018a854..c4a84bb2f3d92f51fc42986a285c4911926c95cd 100644 (file)
@@ -13,6 +13,8 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/clk.h>
+#include <asm/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 
@@ -120,12 +122,78 @@ static struct clk mstp_clks[] = {
        SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0),
 };
 
+static struct clk_lookup lookups[] = {
+       {
+               /* TMU0 */
+               .dev_id         = "sh_tmu.0",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[17],       /* tmu012_fck */
+       }, {
+               /* TMU1 */
+               .dev_id         = "sh_tmu.1",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[17],
+       }, {
+               /* TMU2 */
+               .dev_id         = "sh_tmu.2",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[17],
+       }, {
+               /* TMU3 */
+               .dev_id         = "sh_tmu.3",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[16],       /* tmu345_fck */
+       }, {
+               /* TMU4 */
+               .dev_id         = "sh_tmu.4",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[16],
+       }, {
+               /* TMU5 */
+               .dev_id         = "sh_tmu.5",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[16],
+       }, {
+               /* TMU6 */
+               .dev_id         = "sh_tmu.6",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[15],       /* tmu678_fck */
+       }, {
+               /* TMU7 */
+               .dev_id         = "sh_tmu.7",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[15],
+       }, {
+               /* TMU8 */
+               .dev_id         = "sh_tmu.8",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[15],
+       }, {
+               /* TMU9 */
+               .dev_id         = "sh_tmu.9",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[14],       /* tmu9_11_fck */
+       }, {
+               /* TMU10 */
+               .dev_id         = "sh_tmu.10",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[14],
+       }, {
+               /* TMU11 */
+               .dev_id         = "sh_tmu.11",
+               .con_id         = "tmu_fck",
+               .clk            = &mstp_clks[14],
+       }
+};
+
 int __init arch_clk_init(void)
 {
        int i, ret = 0;
 
        for (i = 0; i < ARRAY_SIZE(clks); i++)
                ret |= clk_register(clks[i]);
+       for (i = 0; i < ARRAY_SIZE(lookups); i++)
+               clkdev_add(&lookups[i]);
 
        if (!ret)
                ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
index 542ced88e50fce1fe72d37d2e92f2817ef0a9945..f5599907ac3d4db427b383a7cccca08e14acc42b 100644 (file)
@@ -119,7 +119,6 @@ static struct platform_device scif5_device = {
 static struct sh_timer_config tmu0_platform_data = {
        .channel_offset = 0x04,
        .timer_bit = 0,
-       .clk = "peripheral_clk",
        .clockevent_rating = 200,
 };
 
@@ -148,7 +147,6 @@ static struct platform_device tmu0_device = {
 static struct sh_timer_config tmu1_platform_data = {
        .channel_offset = 0x10,
        .timer_bit = 1,
-       .clk = "peripheral_clk",
        .clocksource_rating = 200,
 };
 
@@ -177,7 +175,6 @@ static struct platform_device tmu1_device = {
 static struct sh_timer_config tmu2_platform_data = {
        .channel_offset = 0x1c,
        .timer_bit = 2,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu2_resources[] = {
@@ -205,7 +202,6 @@ static struct platform_device tmu2_device = {
 static struct sh_timer_config tmu3_platform_data = {
        .channel_offset = 0x04,
        .timer_bit = 0,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu3_resources[] = {
@@ -233,7 +229,6 @@ static struct platform_device tmu3_device = {
 static struct sh_timer_config tmu4_platform_data = {
        .channel_offset = 0x10,
        .timer_bit = 1,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu4_resources[] = {
@@ -261,7 +256,6 @@ static struct platform_device tmu4_device = {
 static struct sh_timer_config tmu5_platform_data = {
        .channel_offset = 0x1c,
        .timer_bit = 2,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu5_resources[] = {
@@ -289,7 +283,6 @@ static struct platform_device tmu5_device = {
 static struct sh_timer_config tmu6_platform_data = {
        .channel_offset = 0x04,
        .timer_bit = 0,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu6_resources[] = {
@@ -317,7 +310,6 @@ static struct platform_device tmu6_device = {
 static struct sh_timer_config tmu7_platform_data = {
        .channel_offset = 0x10,
        .timer_bit = 1,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu7_resources[] = {
@@ -345,7 +337,6 @@ static struct platform_device tmu7_device = {
 static struct sh_timer_config tmu8_platform_data = {
        .channel_offset = 0x1c,
        .timer_bit = 2,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu8_resources[] = {
@@ -373,7 +364,6 @@ static struct platform_device tmu8_device = {
 static struct sh_timer_config tmu9_platform_data = {
        .channel_offset = 0x04,
        .timer_bit = 0,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu9_resources[] = {
@@ -401,7 +391,6 @@ static struct platform_device tmu9_device = {
 static struct sh_timer_config tmu10_platform_data = {
        .channel_offset = 0x10,
        .timer_bit = 1,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu10_resources[] = {
@@ -429,7 +418,6 @@ static struct platform_device tmu10_device = {
 static struct sh_timer_config tmu11_platform_data = {
        .channel_offset = 0x1c,
        .timer_bit = 2,
-       .clk = "peripheral_clk",
 };
 
 static struct resource tmu11_resources[] = {