<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>Signed-off-by: Tony Prisk (linux@prisktech.co.nz)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>--- /dev/null 2011-02-26 19:04:30.530140059 +1300<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+++ arch/arm/mach-vt8500/clock.c 2011-02-27 12:12:39.000000000 +1300<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>@@ -0,0 +1,164 @@<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+/*<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * arch/arm/mach-vt8500/clock.c<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * Copyright (C) 2011 Tony Prisk<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * This program is free software; you can redistribute it and/or modify<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * it under the terms of the GNU General Public License as published by<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * the Free Software Foundation; either version 2 of the License, or<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * (at your option) any later version.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * This program is distributed in the hope that it will be useful,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * GNU General Public License for more details.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ *<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * You should have received a copy of the GNU General Public License<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * along with this program; if not, write to the Free Software<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/module.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/kernel.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/init.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/errno.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/clk.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/err.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/mutex.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/io.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/delay.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include <linux/list.h><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+#include "clock.h"<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static LIST_HEAD(clocks);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static DEFINE_SPINLOCK(clocks_lock);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static DEFINE_MUTEX(clocks_mutex);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static void __clk_enable(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->parent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ __clk_enable(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->usecount++ == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->type & CLK_ENABLE)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->ops->enable(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static void __clk_disable(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (--clk->usecount == 0)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->type & CLK_ENABLE)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->ops->disable(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->parent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ __clk_disable(clk->parent);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int clk_enable(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long flags;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_lock_irqsave(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ __clk_enable(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_unlock_irqrestore(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->delay)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ udelay(clk->delay);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+EXPORT_SYMBOL(clk_enable);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+void clk_disable(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long flags;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ WARN_ON(clk->usecount == 0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_lock_irqsave(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ __clk_disable(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_unlock_irqrestore(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+EXPORT_SYMBOL(clk_disable);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+unsigned long clk_get_rate(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk == NULL || IS_ERR(clk))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ rate = clk->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if ((clk->ops->getrate) && (clk->type & CLK_PROGRAMABLE))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ rate = clk->ops->getrate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+EXPORT_SYMBOL(clk_get_rate);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+static void propagate_rate(struct clk *root)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ struct clk *clk;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ list_for_each_entry(clk, &root->children, childnode) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->ops->setrate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->ops->setrate(clk, clk->rate);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->ops->getrate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = clk->ops->getrate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ propagate_rate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int clk_set_rate(struct clk *clk, unsigned long rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ unsigned long flags;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk == NULL || IS_ERR(clk))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (!(clk->type & CLK_PROGRAMABLE))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->ops->setrate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->ops->setrate(clk, rate);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->ops->getrate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = clk->ops->getrate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_lock_irqsave(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (!(clk->type & CLK_NO_PROPAGATE))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ propagate_rate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ spin_unlock_irqrestore(&clocks_lock, flags);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+EXPORT_SYMBOL(clk_set_rate);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+int clk_register(struct clk *clk)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk == NULL || IS_ERR(clk))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->parent && !clk->parent->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return -EINVAL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ INIT_LIST_HEAD(&clk->children);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ mutex_lock(&clocks_mutex);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ list_add_tail(&clk->node, &clocks);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->parent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ list_add_tail(&clk->childnode, &clk->parent->children);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ mutex_unlock(&clocks_mutex);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* if rate already set, use it */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->rate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* see if we can calculate the rate */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ if (clk->ops->getrate)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->ops->getrate(clk);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ /* otherwise use the parents rate */<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ else if (clk->parent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ clk->rate = clk->parent->rate;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+ return 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'>+}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>