From: olof@lixom.net (Olof Johansson)
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, egor@pasemi.com, paulus@samba.org,
cpufreq@lists.linux.org.uk
Subject: Re: [PATCH v2] [2.6.22] pasemi: cpufreq driver
Date: Thu, 26 Apr 2007 11:48:36 -0500 [thread overview]
Message-ID: <20070426164835.GA14149@lixom.net> (raw)
In-Reply-To: <200704261055.33739.arnd@arndb.de>
On Thu, Apr 26, 2007 at 10:55:33AM +0200, Arnd Bergmann wrote:
> On Thursday 26 April 2007, Olof Johansson wrote:
>
> > I chose not to do this as an of_platform driver since it doesn't fit
> > that well with the cpufreq driver model; having 3 levels of init/probe
> > functions is excessive.
>
> <snip>
>
> > + dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
> > + if (!dn)
> > + goto out;
> > + err = of_address_to_resource(dn, 0, &res);
> > + of_node_put(dn);
> > + if (err)
> > + goto out;
> > + sdcasr_mapbase = ioremap(res.start + SDCASR_OFFSET, 0x2000);
> > + if (!sdcasr_mapbase) {
> > + err = -EINVAL;
> > + goto out;
> > + }
> > +
> > + dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
> > + if (!dn) {
> > + err = -ENODEV;
> > + goto out_unmap_sdcasr;
> > + }
> > + err = of_address_to_resource(dn, 0, &res);
> > + of_node_put(dn);
> > + if (err)
> > + goto out_unmap_sdcasr;
> > + sdcpwr_mapbase = ioremap(res.start, 0x1000);
> > + if (!sdcpwr_mapbase) {
> > + err = -EINVAL;
> > + goto out_unmap_sdcasr;
> > + }
>
> What are sdc and gizmo anyway? If they are both only used for cpufreq, maybe the
> easiest way to do this with an of_platform_driver would be to have a single
> node that has two register ranges.
SDC is the system and debug controller, it contains a number of smaller
devices such as the PIC, the PMU (Gizmo), RNG, and various debug
features. Some already have drivers submitted, others will later on.
Unfortunately the setting of the current active state is done to an SDC
register, while information of the states is in the PMU, so access to
both is needed in the driver.
That doesn't change the fact that making this an of_platform driver
is excessive:
* module_init to register an of_platform driver
* of_platform walks the tree, calls probes
* of_platform driver probe code to register the cpufreq driver
* cpufreq calls it's registered drivers
* the cpufreq driver in turn will do the inits
Compare to:
* module_init registers cpufreq driver if machine_is_compatible()
* cpufreq calls it's registered drivers
* the cpufreq driver in turn will do the inits
Don't get me wrong, of_platform drivers are often convenient, but I
don't see it being a benefit to use them in this case.
-Olof
next prev parent reply other threads:[~2007-04-26 16:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 20:46 [PATCH] [2.6.22] pasemi: cpufreq driver Olof Johansson
2007-04-25 23:47 ` Arnd Bergmann
2007-04-25 23:57 ` Olof Johansson
2007-04-26 1:57 ` Olof Johansson
2007-04-26 6:56 ` cbe_cpufreq crashes my machine Olof Johansson
2007-04-26 8:39 ` Benjamin Herrenschmidt
2007-04-26 23:07 ` [PATCH] cell: cbe_cpufreq cleanup and crash fix Olof Johansson
2007-04-27 5:22 ` [Cbe-oss-dev] " Akinobu Mita
2007-04-27 5:32 ` Olof Johansson
2007-04-27 5:33 ` [PATCH v2] " Olof Johansson
2007-04-27 7:55 ` Christian Krafft
2007-04-26 5:37 ` [PATCH v2] [2.6.22] pasemi: cpufreq driver Olof Johansson
2007-04-26 8:55 ` Arnd Bergmann
2007-04-26 16:48 ` Olof Johansson [this message]
2007-04-26 17:11 ` Arnd Bergmann
2007-04-26 19:05 ` Segher Boessenkool
2007-04-26 20:38 ` Olof Johansson
2007-04-27 0:10 ` Segher Boessenkool
2007-04-27 0:10 ` Segher Boessenkool
2007-04-26 20:26 ` Olof Johansson
2007-04-26 20:43 ` Arnd Bergmann
2007-04-26 10:26 ` Johannes Berg
2007-04-26 10:26 ` Johannes Berg
2007-04-26 20:37 ` Olof Johansson
2007-04-27 9:40 ` Johannes Berg
2007-04-27 9:40 ` Johannes Berg
2007-04-27 18:09 ` Olof Johansson
2007-04-27 5:46 ` [PATCH v3] " Olof Johansson
2007-04-29 2:50 ` Dominik Brodowski
2007-04-29 3:40 ` Stephen Rothwell
2007-04-29 4:39 ` Olof Johansson
2007-04-29 4:42 ` Olof Johansson
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=20070426164835.GA14149@lixom.net \
--to=olof@lixom.net \
--cc=arnd@arndb.de \
--cc=cpufreq@lists.linux.org.uk \
--cc=egor@pasemi.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.