Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kern
[linux-2.6-microblaze.git] / drivers / clk / at91 / at91rm9200.c
index 2c3d8e6..0fad100 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "pmc.h"
 
+static DEFINE_SPINLOCK(rm9200_mck_lock);
+
 struct sck {
        char *n;
        char *p;
@@ -137,9 +139,20 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
        parent_names[1] = "mainck";
        parent_names[2] = "pllack";
        parent_names[3] = "pllbck";
-       hw = at91_clk_register_master(regmap, "masterck", 4, parent_names,
-                                     &at91rm9200_master_layout,
-                                     &rm9200_mck_characteristics);
+       hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
+                                          parent_names,
+                                          &at91rm9200_master_layout,
+                                          &rm9200_mck_characteristics,
+                                          &rm9200_mck_lock, CLK_SET_RATE_GATE,
+                                          INT_MIN);
+       if (IS_ERR(hw))
+               goto err_free;
+
+       hw = at91_clk_register_master_div(regmap, "masterck_div",
+                                         "masterck_pres",
+                                         &at91rm9200_master_layout,
+                                         &rm9200_mck_characteristics,
+                                         &rm9200_mck_lock, CLK_SET_RATE_GATE);
        if (IS_ERR(hw))
                goto err_free;
 
@@ -181,7 +194,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
        for (i = 0; i < ARRAY_SIZE(at91rm9200_periphck); i++) {
                hw = at91_clk_register_peripheral(regmap,
                                                  at91rm9200_periphck[i].n,
-                                                 "masterck",
+                                                 "masterck_div",
                                                  at91rm9200_periphck[i].id);
                if (IS_ERR(hw))
                        goto err_free;