mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-14 05:12:17 +00:00
32cc002116
Convert all OMAP4 specific platform files to use COMMON clk and keep all the changes under the CONFIG_COMMON_CLK macro check so it does not break any existing code. At a later point switch to COMMON clk and get rid of all old/legacy code. This converts all apis which will be called directly from COMMON clk to take a struct clk_hw parameter, and all the internal platform apis to take a struct clk_hw_omap parameter. Changes are based off the original patch from Mike Turquette. Signed-off-by: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: created new omap2_clksel_find_parent_index() rather than modifying omap2_init_clksel_parent(); moved clkhwops_iclk_wait to clkt_iclk.c to fix OMAP4-only builds; added clk-provider.h include to clock.h to try to fix some 3430-builds] [mturquette@ti.com: squash patch for omap2_clkops_{en,dis}able_clkdm; omap2_dflt_clk_is_enabled should not enable clocks] Signed-off-by: Mike Turquette <mturquette@ti.com> [paul@pwsan.com: fix compiler warning; update to apply; added kerneldoc on non-trivial new functions; added the dpll3xxx clockdomain modifications] Signed-off-by: Paul Walmsley <paul@pwsan.com>
93 lines
2.3 KiB
C
93 lines
2.3 KiB
C
/*
|
|
* OMAP2/3 interface clock control
|
|
*
|
|
* Copyright (C) 2011 Nokia Corporation
|
|
* Paul Walmsley
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
#undef DEBUG
|
|
|
|
#include <linux/kernel.h>
|
|
#ifdef CONFIG_COMMON_CLK
|
|
#include <linux/clk-provider.h>
|
|
#else
|
|
#include <linux/clk.h>
|
|
#endif
|
|
#include <linux/io.h>
|
|
|
|
|
|
#include "clock.h"
|
|
#include "clock2xxx.h"
|
|
#include "cm2xxx_3xxx.h"
|
|
#include "cm-regbits-24xx.h"
|
|
|
|
/* Private functions */
|
|
|
|
/* XXX */
|
|
void omap2_clkt_iclk_allow_idle(struct clk *clk)
|
|
{
|
|
u32 v, r;
|
|
|
|
r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
|
|
|
|
v = __raw_readl((__force void __iomem *)r);
|
|
v |= (1 << clk->enable_bit);
|
|
__raw_writel(v, (__force void __iomem *)r);
|
|
}
|
|
|
|
/* XXX */
|
|
void omap2_clkt_iclk_deny_idle(struct clk *clk)
|
|
{
|
|
u32 v, r;
|
|
|
|
r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
|
|
|
|
v = __raw_readl((__force void __iomem *)r);
|
|
v &= ~(1 << clk->enable_bit);
|
|
__raw_writel(v, (__force void __iomem *)r);
|
|
}
|
|
|
|
/* Public data */
|
|
|
|
#ifdef CONFIG_COMMON_CLK
|
|
const struct clk_hw_omap_ops clkhwops_iclk_wait = {
|
|
.allow_idle = omap2_clkt_iclk_allow_idle,
|
|
.deny_idle = omap2_clkt_iclk_deny_idle,
|
|
.find_idlest = omap2_clk_dflt_find_idlest,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
};
|
|
#else
|
|
const struct clkops clkops_omap2_iclk_dflt_wait = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
.find_idlest = omap2_clk_dflt_find_idlest,
|
|
.allow_idle = omap2_clkt_iclk_allow_idle,
|
|
.deny_idle = omap2_clkt_iclk_deny_idle,
|
|
};
|
|
|
|
const struct clkops clkops_omap2_iclk_dflt = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.allow_idle = omap2_clkt_iclk_allow_idle,
|
|
.deny_idle = omap2_clkt_iclk_deny_idle,
|
|
};
|
|
|
|
const struct clkops clkops_omap2_iclk_idle_only = {
|
|
.allow_idle = omap2_clkt_iclk_allow_idle,
|
|
.deny_idle = omap2_clkt_iclk_deny_idle,
|
|
};
|
|
|
|
const struct clkops clkops_omap2_mdmclk_dflt_wait = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
.find_idlest = omap2_clk_dflt_find_idlest,
|
|
.allow_idle = omap2_clkt_iclk_allow_idle,
|
|
.deny_idle = omap2_clkt_iclk_deny_idle,
|
|
};
|
|
#endif
|