devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH WIP] ARM: kirkwood: covert orion-spi to fdt.
Date: Tue, 28 Feb 2012 10:40:59 +0100	[thread overview]
Message-ID: <20120228094059.GA27255@lunn.ch> (raw)

> > @@ -524,6 +528,13 @@ static int __init kirkwood_clock_gate(void)
> >       } else  /* keep this bit set for devices that don't have PCIe1 */
> >               kirkwood_clk_ctrl |= CGC_PEX1;
> >
> > +#ifdef CONFIG_OF
> > +     dp = of_find_node_by_path("/");
> > +     if (of_device_is_available(of_find_compatible_node(dp, NULL,
> > +
> +"marvell,orion-spi")))
> > +             kirkwood_clk_ctrl |= CGC_RUNIT;
> > +#endif
> > +
> >       /* Now gate clock the required units */
> >       writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
> >       printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
> 
> This looks like it could be improved by only enabling the clock
> if we actually start using the device from the spi driver, in its
> probe function. Not sure if that's worth it.

I have two comments about this:

I think this code belongs on the board-dts.c file. kirkwood_clk_ctrl
is a global so can be set from anywhere. It is also set in other files
than common.c, eg pcie.c.

In the end, i hope this all goes away. I have patches based on Mike's
generic clk infrastructure, which adds clk/clkdev to all orion based
machines. So the SPI driver, in its probe function will get its clock,
enable it, and also find out the speed of it. The release function
also disables the clock, turning it off if nobody else is using it. 

I just hope the generic clk does not take too long to land.

  Andrew

             reply	other threads:[~2012-02-28  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28  9:40 Andrew Lunn [this message]
     [not found] ` <20120228094059.GA27255-g2DYL2Zd6BY@public.gmane.org>
2012-02-28 10:04   ` [PATCH WIP] ARM: kirkwood: covert orion-spi to fdt Arnd Bergmann
     [not found]     ` <201202281004.14366.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-28 15:06       ` Jason
  -- strict thread matches above, loose matches on Subject: below --
2012-02-27 22:31 Jason Cooper
2012-02-28  7:39 ` Arnd Bergmann
     [not found]   ` <201202280739.24399.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-28 15:25     ` Jason
     [not found]       ` <20120228152553.GZ23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-28 16:07         ` Arnd Bergmann

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=20120228094059.GA27255@lunn.ch \
    --to=andrew-g2dyl2zd6by@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.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).