public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Davide Rizzo <elpa.rizzo@gmail.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
	ben-linux@fluff.org, linux-api@vger.kernel.org
Subject: Re: [PATCH 1/2] User access to internal clocks
Date: Mon, 9 Feb 2009 19:17:07 +0100	[thread overview]
Message-ID: <8447d6730902091017m21cb30d0w6be6fbbbf33db4f3@mail.gmail.com> (raw)
In-Reply-To: <20090209175514.GB19453@n2100.arm.linux.org.uk>

> You're not understanding the issue(s).
>
> 1. there is no 1:1 mapping between the identifiers (struct device +
>   connection ID) and the struct clk.  It's actually a many-to-one
>   mapping.
>
>   That means there is _no_ name associated with a struct clk.
>
>   Conceptually, clk_get() gives you a struct clk for the struct device
>   and a connection ID.  How that mapping is achieved isn't specified
>   in the API, all that's required is that such a mapping is performed.
>   It is _specifically_ intended that more than one set of {device,id}
>   pairs will map to the same clk.
>
>   So, now to insist that you can go from a struct clk to some kind of
>   string identifier for it is changing this - you're now requiring
>   that every struct clk has a unique name.  This is not the case.
>   PXA, for instance, struct clk's are now completely nameless.  They
>   have no identifier.
>
>   If you want to have a string identifier which works in every case,
>   this will:
>
>        sprintf(identifer, "%p", clk);
>
>   Or, I guess you could force every struct clk to have a 'sysfs_name'
>   field just to export them out via sysfs - and that'll be all that
>   it's used for.
>
> 2. there is no generic way to walk a set of struct clk's - indeed, there
>   may be no list of them (and there exists implmentations where that is
>   true) and the only list which does exist is a set ID to clk mapping
>   structures.
>
>> Otherwise, what do you suggest to enumerate and distinguish all system
>> clocks ?
>
> There exists no such concept in the API, what you're asking for is
> implementation specific.
>

Thank you for this explanation, now it's much more clear to me.

What about adding a dedicated function to clk api that registers a struct clk
 in a linked list and associates it with a name, with the only specific purpose
 to enumerate and list (and possibly change rate and parents) all
clocks in sysfs ?
Obviously only specifically registered clocks will be visible in sysfs...

  reply	other threads:[~2009-02-09 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 17:04 [PATCH 1/2] User access to internal clocks Davide Rizzo
2009-02-09 17:10 ` Russell King - ARM Linux
2009-02-09 17:44   ` Davide Rizzo
2009-02-09 17:55     ` Russell King - ARM Linux
2009-02-09 18:17       ` Davide Rizzo [this message]
2009-02-09 18:54         ` Davide Rizzo
2009-02-09 19:01           ` Russell King - ARM Linux
2009-02-09 21:06             ` Davide Rizzo
2009-02-09 17:12 ` Hans J. Koch
2009-02-09 18:12 ` Russell King - ARM Linux

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=8447d6730902091017m21cb30d0w6be6fbbbf33db4f3@mail.gmail.com \
    --to=elpa.rizzo@gmail.com \
    --cc=ben-linux@fluff.org \
    --cc=gregkh@suse.de \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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