linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 1/2] ARM:Tegra: Device Tree Support: Initialize the audio card from the device tree.
Date: Fri, 3 Jun 2011 07:20:09 +0100	[thread overview]
Message-ID: <20110603062009.GD10532@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <BANLkTikiaA3CCRAXkB=x56wtt8nNF9dqxA@mail.gmail.com>

On Fri, Jun 03, 2011 at 10:32:52AM +0800, Barry Song wrote:
> but there is really no an unified rule by now, for exmaple, samsung
> just required platform device names matched with the string parameter
> to get a clock.
> it looks like clk_get in plat-samsung depends on the string more than
> device and the clock name is in SoC level.

Samsung has been broken in respect of this for quite some time, and I've
been nagging Ben about it ever since I provided clkdev.  The problem is
that Ben doesn't have the time to fix Samsung...

> same situation for mach-at91/clock.c:
> 
> /* clocks cannot be de-registered no refcounting necessary */
> struct clk *clk_get(struct device *dev, const char *id)
> {
>         struct clk *clk;
> 
>         list_for_each_entry(clk, &clocks, node) {
>                 if (strcmp(id, clk->name) == 0)
>                         return clk;
>                 if (clk->function && (dev == clk->dev) && strcmp(id,
> clk->function) == 0)
>                         return clk;
>         }
> 
>         return ERR_PTR(-ENOENT);
> }
> EXPORT_SYMBOL(clk_get);

That's broken, and it's incompatible with DT in any case because the
only way to set 'clk->dev' is to have devices statically declared.

OMAP used to be broken until I converted it to clkdev, and when I did
their drivers became more simple because they didn't need to ifdef
clocknames and such like.

> msm required device struct matched:
> struct clk *clk_get(struct device *dev, const char *id)
> {
>         struct clk *clk;
> 
>         mutex_lock(&clocks_mutex);
> 
>         list_for_each_entry(clk, &clocks, list)
>                 if (!strcmp(id, clk->name) && clk->dev == dev)
>                         goto found_it;
> 
>         list_for_each_entry(clk, &clocks, list)
>                 if (!strcmp(id, clk->name) && clk->dev == NULL)
>                         goto found_it;
> 
>         clk = ERR_PTR(-ENOENT);
> found_it:
>         mutex_unlock(&clocks_mutex);
>         return clk;
> }
> EXPORT_SYMBOL(clk_get);

Again, that's incompatible with DT in any case, as we don't know what
'clk->dev' would be if the devices aren't statically declared.  So this
is broken too.

Each need to be converted to clkdev _before_ they even start thinking
about device trees.

  reply	other threads:[~2011-06-03  6:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 20:56 [RFC 0/2] ARM: Tegra: Device Tree: Audio John Bonesio
     [not found] ` <20110527205706.21000.34832.stgit@riker>
2011-05-27 21:05   ` [RFC 1/2] ARM:Tegra: Device Tree Support: Initialize the audio card from the device tree Grant Likely
2011-05-28  1:28   ` Mark Brown
2011-06-01  7:07   ` Barry Song
2011-06-01 16:47     ` Grant Likely
2011-06-02  9:07       ` Barry Song
2011-06-02 16:04         ` Grant Likely
2011-06-02 16:21           ` Barry Song
2011-06-02 21:43             ` Russell King - ARM Linux
2011-06-03  2:32               ` Barry Song
2011-06-03  6:20                 ` Russell King - ARM Linux [this message]
2011-06-02 21:36           ` Russell King - ARM Linux
2011-06-03  1:19             ` Barry Song
2011-06-07  3:44               ` Barry Song
2011-06-14 15:42             ` Grant Likely
     [not found] ` <20110527205721.21000.78599.stgit@riker>
2011-05-27 21:06   ` [RFC 2/2] ARM:Tegra: Device Tree Support: Initialize audio card gpio's " Grant Likely
2011-05-28  1:24   ` Mark Brown
2011-05-30  3:11     ` Olof Johansson
2011-05-30  3:38       ` Mark Brown
2011-05-30  6:11         ` Grant Likely
2011-05-30  6:18           ` Mitch Bradley
2011-05-30  6:22             ` Grant Likely
2011-05-30  7:01             ` Mark Brown
2011-05-30 16:22               ` Grant Likely
2011-05-30 18:54               ` Segher Boessenkool
2011-05-30 19:20                 ` Grant Likely
2011-05-30 20:53                   ` Mitch Bradley
2011-05-31 17:55                     ` Stephen Warren
2011-05-31 18:42                       ` Mitch Bradley
2011-06-01 15:59                         ` Stephen Warren
2011-06-01 16:18                           ` Mark Brown
2011-06-02 15:40                             ` Grant Likely
2011-06-01 21:32                           ` Mitch Bradley
2011-06-03 21:24                             ` Stephen Warren
2011-06-04  0:25                               ` Mitch Bradley
2011-06-02 14:59                       ` Grant Likely
2011-06-02 15:40                     ` Grant Likely
2011-06-28 21:39                   ` Grant Likely
2011-05-30 23:27               ` Benjamin Herrenschmidt
2011-05-30 23:49                 ` Olof Johansson
2011-05-31  0:58                   ` Segher Boessenkool
2011-05-31 10:24                   ` Mark Brown
2011-05-30  7:10           ` Mark Brown
2011-05-30 23:26           ` Benjamin Herrenschmidt
2011-05-31 10:03             ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110603062009.GD10532@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).