[Top] [All Lists]

Re: [PATCH] generic clk API implementation for MIPS

To: "Atsushi Nemoto" <>
Subject: Re: [PATCH] generic clk API implementation for MIPS
From: "Franck Bui-Huu" <>
Date: Tue, 26 Jun 2007 17:20:43 +0200
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed;; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pPmHfGZIyHv4JuUGCHnQFicYfTLU8Tt7rCUZIa6qVOOn3ikI1gKMp+RpM7UuRagu7jmzadkHPeN75JGO/i1CIXRLlFQrtekH9/HeZWg0Fva1muqslaMpWgTtIR7KPGFsG2t1QotCqGEUhGfwprJKUSUF1ZfETTFIBRZbCkHO4VA=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lbOTE4ehBS8WxKxfKua5VqFALfiTdubkCXtEs0ZDNsqVOndb12qpo3NIt9Lp0WquIcvBnitK2YnW9QrenzBk1YG/ok/BxZ3DR+c07Ye82bQ5AggpYGzeQ93stldKlZOl1I7gieXQRNWk1ENdAetq392vjCg2J78zYyWGhKkYtlc=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <>
Atsushi Nemoto wrote:

Well, it seems simpler, but I suppose clk_register() is very useful ;)

Thinking about it, it seems to me that a clock is very static. I can't
think of a use case that would need to register a new clock after the
kernel has booted. Do you have a use case in mind ? cpu hotplug
perhaps ?

I'm a bit worry because if we go that way, we must be sure that
clk_register() can be called very early in the boot process. For
example, when using early printk thing...

+static void clk_kref_release(struct kref *kref)
+       /* Nothing to do */
+static void __clk_disable(struct clk *clk)
+       if (clk->flags & CLK_ALWAYS_ENABLED)
+               return;
+       kref_put(&clk->kref, clk_kref_release);
+void clk_disable(struct clk *clk)
+       unsigned long flags;
+       spin_lock_irqsave(&clock_lock, flags);
+       __clk_disable(clk);
+       spin_unlock_irqrestore(&clock_lock, flags);

It seems that you stripped too much here: where clk->disable() method
is called ?

+struct clk;
+struct clk_ops {
+       void (*init)(struct clk *clk);
+       void (*enable)(struct clk *clk);
+       void (*disable)(struct clk *clk);
+       int (*set_rate)(struct clk *clk, unsigned long rate);
+struct clk {
+       struct list_head        node;
+       const char              *name;
+       int                     id;
+       struct clk              *parent;

Is this field used by board code ?

<Prev in Thread] Current Thread [Next in Thread>