mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhangqing <zhangqing@loongson.cn>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v2 2/2] spi: coldfire-qspi: Use clk_prepare_enable and clk_disable_unprepare
Date: Thu, 16 Jul 2020 18:01:18 +0800	[thread overview]
Message-ID: <1616bb3e-ba20-46df-7818-c11c382a0d86@loongson.cn> (raw)
In-Reply-To: <20200715094940.GB5431@sirena.org.uk>



On 07/15/2020 05:49 PM, Mark Brown wrote:
> On Wed, Jul 15, 2020 at 01:26:47PM +0800, Qing Zhang wrote:
>> Convert clk_enable() to clk_prepare_enable() and clk_disable() to
>> clk_disable_unprepare() respectively in the spi-coldfire-qspi.c.
> Like I said on the previous version are you sure that ColdFire uses the
> common clock framework and has the prepare calls?
Hi Mark,

Thanks for your reminder again.

I see the following comment and code in arch/m68k/coldfire/clk.c:

For more advanced ColdFire parts that have clocks that can be enabled
we supply enable/disable functions. These must properly define their
clocks in their platform specific code.

int clk_enable(struct clk *clk)
{
     unsigned long flags;
     spin_lock_irqsave(&clk_lock, flags);
     if ((clk->enabled++ == 0) && clk->clk_ops)
         clk->clk_ops->enable(clk);
     spin_unlock_irqrestore(&clk_lock, flags);

     return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
     unsigned long flags;

     if (!clk)
         return;

     spin_lock_irqsave(&clk_lock, flags);
     if ((--clk->enabled == 0) && clk->clk_ops)
         clk->clk_ops->disable(clk);
     spin_unlock_irqrestore(&clk_lock, flags);
}
EXPORT_SYMBOL(clk_disable);

Thanks,
Qing


  reply	other threads:[~2020-07-16 10:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  5:26 [PATCH v2 1/2] spi: omap-uwire: " Qing Zhang
2020-07-15  5:26 ` [PATCH v2 2/2] spi: coldfire-qspi: " Qing Zhang
2020-07-15  9:49   ` Mark Brown
2020-07-16 10:01     ` zhangqing [this message]
2020-07-15 14:59 ` [PATCH v2 1/2] spi: omap-uwire: " Mark Brown
2020-07-16 23:58 ` 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=1616bb3e-ba20-46df-7818-c11c382a0d86@loongson.cn \
    --to=zhangqing@loongson.cn \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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

all inboxes | Powered by JetHome®