]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/clockdomain.c
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / clockdomain.c
index f867d8f1d0e99cb80247392855882b0f5211354f..4c3ce9cfd9480f9b4974a671498513e74ee1cc5f 100644 (file)
@@ -219,6 +219,8 @@ int clkdm_register(struct clockdomain *clkdm)
 
        list_add(&clkdm->node, &clkdm_list);
 
+       pwrdm_add_clkdm(pwrdm, clkdm);
+
        pr_debug("clockdomain: registered %s\n", clkdm->name);
        ret = 0;
 
@@ -240,6 +242,8 @@ int clkdm_unregister(struct clockdomain *clkdm)
        if (!clkdm)
                return -EINVAL;
 
+       pwrdm_del_clkdm(clkdm->pwrdm, clkdm);
+
        mutex_lock(&clkdm_mutex);
        list_del(&clkdm->node);
        mutex_unlock(&clkdm_mutex);
@@ -311,6 +315,22 @@ int clkdm_for_each(int (*fn)(struct clockdomain *clkdm))
 }
 
 
+/**
+ * clkdm_get_pwrdm - return a ptr to the pwrdm that this clkdm resides in
+ * @clkdm: struct clockdomain *
+ *
+ * Return a pointer to the struct powerdomain that the specified clockdomain
+ * 'clkdm' exists in, or returns NULL if clkdm argument is NULL.
+ */
+struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
+{
+       if (!clkdm)
+               return NULL;
+
+       return clkdm->pwrdm;
+}
+
+
 /* Hardware clockdomain control */
 
 /**