Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
84965337
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
84965337
编写于
11月 16, 2010
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'common/clkfwk' into sh-fixes-for-linus
上级
6800e4c0
549015c3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
85 deletion
+11
-85
Documentation/DocBook/sh.tmpl
Documentation/DocBook/sh.tmpl
+0
-4
Documentation/sh/clk.txt
Documentation/sh/clk.txt
+0
-32
arch/arm/mach-shmobile/clock-sh7372.c
arch/arm/mach-shmobile/clock-sh7372.c
+2
-4
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
+1
-1
drivers/sh/clk/core.c
drivers/sh/clk/core.c
+3
-10
drivers/sh/clk/cpg.c
drivers/sh/clk/cpg.c
+2
-3
include/linux/sh_clk.h
include/linux/sh_clk.h
+3
-31
未找到文件。
Documentation/DocBook/sh.tmpl
浏览文件 @
84965337
...
@@ -79,10 +79,6 @@
...
@@ -79,10 +79,6 @@
</sect2>
</sect2>
</sect1>
</sect1>
</chapter>
</chapter>
<chapter
id=
"clk"
>
<title>
Clock Framework Extensions
</title>
!Iinclude/linux/sh_clk.h
</chapter>
<chapter
id=
"mach"
>
<chapter
id=
"mach"
>
<title>
Machine Specific Interfaces
</title>
<title>
Machine Specific Interfaces
</title>
<sect1
id=
"dreamcast"
>
<sect1
id=
"dreamcast"
>
...
...
Documentation/sh/clk.txt
已删除
100644 → 0
浏览文件 @
6800e4c0
Clock framework on SuperH architecture
The framework on SH extends existing API by the function clk_set_rate_ex,
which prototype is as follows:
clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id)
The algo_id parameter is used to specify algorithm used to recalculate clocks,
adjanced to clock, specified as first argument. It is assumed that algo_id==0
means no changes to adjanced clock
Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method,
if it is present in ops structure. The method should set the clock rate and adjust
all needed clocks according to the passed algo_id.
Exact values for algo_id are machine-dependent. For the sh7722, the following
values are defined:
NO_CHANGE = 0,
IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */
IUS_322, /* I:U:Sh = 3:2:2 */
IUS_522, /* I:U:Sh = 5:2:2 */
IUS_N11, /* I:U:Sh = N:1:1 */
SB_N1, /* Sh:B = N:1 */
SB3_N1, /* Sh:B3 = N:1 */
SB3_32, /* Sh:B3 = 3:2 */
SB3_43, /* Sh:B3 = 4:3 */
SB3_54, /* Sh:B3 = 5:4 */
BP_N1, /* B:P = N:1 */
IP_N1 /* I:P = N:1 */
Each of these constants means relation between clocks that can be set via the FRQCR
register
arch/arm/mach-shmobile/clock-sh7372.c
浏览文件 @
84965337
...
@@ -220,8 +220,7 @@ static void pllc2_disable(struct clk *clk)
...
@@ -220,8 +220,7 @@ static void pllc2_disable(struct clk *clk)
__raw_writel
(
__raw_readl
(
PLLC2CR
)
&
~
0x80000000
,
PLLC2CR
);
__raw_writel
(
__raw_readl
(
PLLC2CR
)
&
~
0x80000000
,
PLLC2CR
);
}
}
static
int
pllc2_set_rate
(
struct
clk
*
clk
,
static
int
pllc2_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
unsigned
long
rate
,
int
algo_id
)
{
{
unsigned
long
value
;
unsigned
long
value
;
int
idx
;
int
idx
;
...
@@ -463,8 +462,7 @@ static int fsidiv_enable(struct clk *clk)
...
@@ -463,8 +462,7 @@ static int fsidiv_enable(struct clk *clk)
return
0
;
return
0
;
}
}
static
int
fsidiv_set_rate
(
struct
clk
*
clk
,
static
int
fsidiv_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
unsigned
long
rate
,
int
algo_id
)
{
{
int
idx
;
int
idx
;
...
...
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
浏览文件 @
84965337
...
@@ -110,7 +110,7 @@ static int shoc_clk_verify_rate(struct clk *clk, unsigned long rate)
...
@@ -110,7 +110,7 @@ static int shoc_clk_verify_rate(struct clk *clk, unsigned long rate)
return
0
;
return
0
;
}
}
static
int
shoc_clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
,
int
algo_id
)
static
int
shoc_clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
{
unsigned
long
frqcr3
;
unsigned
long
frqcr3
;
unsigned
int
tmp
;
unsigned
int
tmp
;
...
...
drivers/sh/clk/core.c
浏览文件 @
84965337
...
@@ -454,12 +454,6 @@ unsigned long clk_get_rate(struct clk *clk)
...
@@ -454,12 +454,6 @@ unsigned long clk_get_rate(struct clk *clk)
EXPORT_SYMBOL_GPL
(
clk_get_rate
);
EXPORT_SYMBOL_GPL
(
clk_get_rate
);
int
clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
int
clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
return
clk_set_rate_ex
(
clk
,
rate
,
0
);
}
EXPORT_SYMBOL_GPL
(
clk_set_rate
);
int
clk_set_rate_ex
(
struct
clk
*
clk
,
unsigned
long
rate
,
int
algo_id
)
{
{
int
ret
=
-
EOPNOTSUPP
;
int
ret
=
-
EOPNOTSUPP
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -467,7 +461,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id)
...
@@ -467,7 +461,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id)
spin_lock_irqsave
(
&
clock_lock
,
flags
);
spin_lock_irqsave
(
&
clock_lock
,
flags
);
if
(
likely
(
clk
->
ops
&&
clk
->
ops
->
set_rate
))
{
if
(
likely
(
clk
->
ops
&&
clk
->
ops
->
set_rate
))
{
ret
=
clk
->
ops
->
set_rate
(
clk
,
rate
,
algo_id
);
ret
=
clk
->
ops
->
set_rate
(
clk
,
rate
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out_unlock
;
goto
out_unlock
;
}
else
{
}
else
{
...
@@ -485,7 +479,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id)
...
@@ -485,7 +479,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id)
return
ret
;
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
clk_set_rate
_ex
);
EXPORT_SYMBOL_GPL
(
clk_set_rate
);
int
clk_set_parent
(
struct
clk
*
clk
,
struct
clk
*
parent
)
int
clk_set_parent
(
struct
clk
*
clk
,
struct
clk
*
parent
)
{
{
...
@@ -653,8 +647,7 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
...
@@ -653,8 +647,7 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
clkp
->
ops
->
set_parent
(
clkp
,
clkp
->
ops
->
set_parent
(
clkp
,
clkp
->
parent
);
clkp
->
parent
);
if
(
likely
(
clkp
->
ops
->
set_rate
))
if
(
likely
(
clkp
->
ops
->
set_rate
))
clkp
->
ops
->
set_rate
(
clkp
,
clkp
->
ops
->
set_rate
(
clkp
,
rate
);
rate
,
NO_CHANGE
);
else
if
(
likely
(
clkp
->
ops
->
recalc
))
else
if
(
likely
(
clkp
->
ops
->
recalc
))
clkp
->
rate
=
clkp
->
ops
->
recalc
(
clkp
);
clkp
->
rate
=
clkp
->
ops
->
recalc
(
clkp
);
}
}
...
...
drivers/sh/clk/cpg.c
浏览文件 @
84965337
...
@@ -110,8 +110,7 @@ static int sh_clk_div6_set_parent(struct clk *clk, struct clk *parent)
...
@@ -110,8 +110,7 @@ static int sh_clk_div6_set_parent(struct clk *clk, struct clk *parent)
return
0
;
return
0
;
}
}
static
int
sh_clk_div6_set_rate
(
struct
clk
*
clk
,
static
int
sh_clk_div6_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
unsigned
long
rate
,
int
algo_id
)
{
{
unsigned
long
value
;
unsigned
long
value
;
int
idx
;
int
idx
;
...
@@ -253,7 +252,7 @@ static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
...
@@ -253,7 +252,7 @@ static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
return
0
;
return
0
;
}
}
static
int
sh_clk_div4_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
,
int
algo_id
)
static
int
sh_clk_div4_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
{
struct
clk_div4_table
*
d4t
=
clk
->
priv
;
struct
clk_div4_table
*
d4t
=
clk
->
priv
;
unsigned
long
value
;
unsigned
long
value
;
...
...
include/linux/sh_clk.h
浏览文件 @
84965337
...
@@ -19,11 +19,13 @@ struct clk_mapping {
...
@@ -19,11 +19,13 @@ struct clk_mapping {
};
};
struct
clk_ops
{
struct
clk_ops
{
#ifdef CONFIG_SH_CLK_CPG_LEGACY
void
(
*
init
)(
struct
clk
*
clk
);
void
(
*
init
)(
struct
clk
*
clk
);
#endif
int
(
*
enable
)(
struct
clk
*
clk
);
int
(
*
enable
)(
struct
clk
*
clk
);
void
(
*
disable
)(
struct
clk
*
clk
);
void
(
*
disable
)(
struct
clk
*
clk
);
unsigned
long
(
*
recalc
)(
struct
clk
*
clk
);
unsigned
long
(
*
recalc
)(
struct
clk
*
clk
);
int
(
*
set_rate
)(
struct
clk
*
clk
,
unsigned
long
rate
,
int
algo_id
);
int
(
*
set_rate
)(
struct
clk
*
clk
,
unsigned
long
rate
);
int
(
*
set_parent
)(
struct
clk
*
clk
,
struct
clk
*
parent
);
int
(
*
set_parent
)(
struct
clk
*
clk
,
struct
clk
*
parent
);
long
(
*
round_rate
)(
struct
clk
*
clk
,
unsigned
long
rate
);
long
(
*
round_rate
)(
struct
clk
*
clk
,
unsigned
long
rate
);
};
};
...
@@ -67,36 +69,6 @@ int clk_register(struct clk *);
...
@@ -67,36 +69,6 @@ int clk_register(struct clk *);
void
clk_unregister
(
struct
clk
*
);
void
clk_unregister
(
struct
clk
*
);
void
clk_enable_init_clocks
(
void
);
void
clk_enable_init_clocks
(
void
);
/**
* clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
* @clk: clock source
* @rate: desired clock rate in Hz
* @algo_id: algorithm id to be passed down to ops->set_rate
*
* Returns success (0) or negative errno.
*/
int
clk_set_rate_ex
(
struct
clk
*
clk
,
unsigned
long
rate
,
int
algo_id
);
enum
clk_sh_algo_id
{
NO_CHANGE
=
0
,
IUS_N1_N1
,
IUS_322
,
IUS_522
,
IUS_N11
,
SB_N1
,
SB3_N1
,
SB3_32
,
SB3_43
,
SB3_54
,
BP_N1
,
IP_N1
,
};
struct
clk_div_mult_table
{
struct
clk_div_mult_table
{
unsigned
int
*
divisors
;
unsigned
int
*
divisors
;
unsigned
int
nr_divisors
;
unsigned
int
nr_divisors
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录