Re: [PATCH v2 2/2] spi: coldfire-qspi: Use clk_prepare_enable and clk_disable_unprepare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux