Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9bf5b2ef
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9bf5b2ef
编写于
3月 01, 2010
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: Indirect round/set_rate operations through clk structure
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
3081e43b
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
76 addition
and
23 deletion
+76
-23
arch/arm/mach-integrator/impd1.c
arch/arm/mach-integrator/impd1.c
+8
-2
arch/arm/mach-integrator/include/mach/clkdev.h
arch/arm/mach-integrator/include/mach/clkdev.h
+2
-2
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-integrator/integrator_cp.c
+7
-1
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.c
+7
-1
arch/arm/mach-realview/include/mach/clkdev.h
arch/arm/mach-realview/include/mach/clkdev.h
+2
-2
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/core.c
+7
-1
arch/arm/mach-versatile/include/mach/clkdev.h
arch/arm/mach-versatile/include/mach/clkdev.h
+2
-2
arch/arm/plat-versatile/clock.c
arch/arm/plat-versatile/clock.c
+26
-12
arch/arm/plat-versatile/include/plat/clock.h
arch/arm/plat-versatile/include/plat/clock.h
+15
-0
未找到文件。
arch/arm/mach-integrator/impd1.c
浏览文件 @
9bf5b2ef
...
@@ -71,6 +71,12 @@ static void impd1_setvco(struct clk *clk, struct icst_vco vco)
...
@@ -71,6 +71,12 @@ static void impd1_setvco(struct clk *clk, struct icst_vco vco)
#endif
#endif
}
}
static
const
struct
clk_ops
impd1_clk_ops
=
{
.
round
=
icst_clk_round
,
.
set
=
icst_clk_set
,
.
setvco
=
impd1_setvco
,
};
void
impd1_tweak_control
(
struct
device
*
dev
,
u32
mask
,
u32
val
)
void
impd1_tweak_control
(
struct
device
*
dev
,
u32
mask
,
u32
val
)
{
{
struct
impd1_module
*
impd1
=
dev_get_drvdata
(
dev
);
struct
impd1_module
*
impd1
=
dev_get_drvdata
(
dev
);
...
@@ -366,10 +372,10 @@ static int impd1_probe(struct lm_device *dev)
...
@@ -366,10 +372,10 @@ static int impd1_probe(struct lm_device *dev)
(
unsigned
long
)
dev
->
resource
.
start
);
(
unsigned
long
)
dev
->
resource
.
start
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
impd1
->
vcos
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
impd1
->
vcos
);
i
++
)
{
impd1
->
vcos
[
i
].
ops
=
&
impd1_clk_ops
,
impd1
->
vcos
[
i
].
owner
=
THIS_MODULE
,
impd1
->
vcos
[
i
].
owner
=
THIS_MODULE
,
impd1
->
vcos
[
i
].
params
=
&
impd1_vco_params
,
impd1
->
vcos
[
i
].
params
=
&
impd1_vco_params
,
impd1
->
vcos
[
i
].
data
=
impd1
,
impd1
->
vcos
[
i
].
data
=
impd1
;
impd1
->
vcos
[
i
].
setvco
=
impd1_setvco
;
}
}
impd1
->
vcos
[
0
].
vcoreg
=
impd1
->
base
+
IMPD1_OSC1
;
impd1
->
vcos
[
0
].
vcoreg
=
impd1
->
base
+
IMPD1_OSC1
;
impd1
->
vcos
[
1
].
vcoreg
=
impd1
->
base
+
IMPD1_OSC2
;
impd1
->
vcos
[
1
].
vcoreg
=
impd1
->
base
+
IMPD1_OSC2
;
...
...
arch/arm/mach-integrator/include/mach/clkdev.h
浏览文件 @
9bf5b2ef
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
#define __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
#include <linux/module.h>
#include <linux/module.h>
#include <
asm/hardware/icst
.h>
#include <
plat/clock
.h>
struct
clk
{
struct
clk
{
unsigned
long
rate
;
unsigned
long
rate
;
const
struct
clk_ops
*
ops
;
struct
module
*
owner
;
struct
module
*
owner
;
const
struct
icst_params
*
params
;
const
struct
icst_params
*
params
;
void
__iomem
*
vcoreg
;
void
__iomem
*
vcoreg
;
void
(
*
setvco
)(
struct
clk
*
,
struct
icst_vco
vco
);
void
*
data
;
void
*
data
;
};
};
...
...
arch/arm/mach-integrator/integrator_cp.c
浏览文件 @
9bf5b2ef
...
@@ -293,10 +293,16 @@ static void cp_auxvco_set(struct clk *clk, struct icst_vco vco)
...
@@ -293,10 +293,16 @@ static void cp_auxvco_set(struct clk *clk, struct icst_vco vco)
writel
(
0
,
CM_LOCK
);
writel
(
0
,
CM_LOCK
);
}
}
static
const
struct
clk_ops
cp_auxclk_ops
=
{
.
round
=
icst_clk_round
,
.
set
=
icst_clk_set
,
.
setvco
=
cp_auxvco_set
,
};
static
struct
clk
cp_auxclk
=
{
static
struct
clk
cp_auxclk
=
{
.
ops
=
&
cp_auxclk_ops
,
.
params
=
&
cp_auxvco_params
,
.
params
=
&
cp_auxvco_params
,
.
vcoreg
=
CM_AUXOSC
,
.
vcoreg
=
CM_AUXOSC
,
.
setvco
=
cp_auxvco_set
,
};
};
static
struct
clk_lookup
cp_lookups
[]
=
{
static
struct
clk_lookup
cp_lookups
[]
=
{
...
...
arch/arm/mach-realview/core.c
浏览文件 @
9bf5b2ef
...
@@ -281,9 +281,15 @@ static void realview_oscvco_set(struct clk *clk, struct icst_vco vco)
...
@@ -281,9 +281,15 @@ static void realview_oscvco_set(struct clk *clk, struct icst_vco vco)
writel
(
0
,
sys_lock
);
writel
(
0
,
sys_lock
);
}
}
static
const
struct
clk_ops
oscvco_clk_ops
=
{
.
round
=
icst_clk_round
,
.
set
=
icst_clk_set
,
.
setvco
=
realview_oscvco_set
,
};
static
struct
clk
oscvco_clk
=
{
static
struct
clk
oscvco_clk
=
{
.
ops
=
&
oscvco_clk_ops
,
.
params
=
&
realview_oscvco_params
,
.
params
=
&
realview_oscvco_params
,
.
setvco
=
realview_oscvco_set
,
};
};
/*
/*
...
...
arch/arm/mach-realview/include/mach/clkdev.h
浏览文件 @
9bf5b2ef
#ifndef __ASM_MACH_CLKDEV_H
#ifndef __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
#include <
asm/hardware/icst
.h>
#include <
plat/clock
.h>
struct
clk
{
struct
clk
{
unsigned
long
rate
;
unsigned
long
rate
;
const
struct
clk_ops
*
ops
;
const
struct
icst_params
*
params
;
const
struct
icst_params
*
params
;
void
__iomem
*
vcoreg
;
void
__iomem
*
vcoreg
;
void
(
*
setvco
)(
struct
clk
*
,
struct
icst_vco
vco
);
};
};
#define __clk_get(clk) ({ 1; })
#define __clk_get(clk) ({ 1; })
...
...
arch/arm/mach-versatile/core.c
浏览文件 @
9bf5b2ef
...
@@ -381,9 +381,15 @@ static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco)
...
@@ -381,9 +381,15 @@ static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco)
writel
(
0
,
sys_lock
);
writel
(
0
,
sys_lock
);
}
}
static
const
struct
clk_ops
osc4_clk_ops
=
{
.
round
=
icst_clk_round
,
.
set
=
icst_clk_set
,
.
setvco
=
versatile_oscvco_set
,
};
static
struct
clk
osc4_clk
=
{
static
struct
clk
osc4_clk
=
{
.
ops
=
&
osc4_clk_ops
,
.
params
=
&
versatile_oscvco_params
,
.
params
=
&
versatile_oscvco_params
,
.
setvco
=
versatile_oscvco_set
,
};
};
/*
/*
...
...
arch/arm/mach-versatile/include/mach/clkdev.h
浏览文件 @
9bf5b2ef
#ifndef __ASM_MACH_CLKDEV_H
#ifndef __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
#include <
asm/hardware/icst
.h>
#include <
plat/clock
.h>
struct
clk
{
struct
clk
{
unsigned
long
rate
;
unsigned
long
rate
;
const
struct
clk_ops
*
ops
;
const
struct
icst_params
*
params
;
const
struct
icst_params
*
params
;
void
__iomem
*
vcoreg
;
void
__iomem
*
vcoreg
;
void
(
*
setvco
)(
struct
clk
*
,
struct
icst_vco
vco
);
};
};
#define __clk_get(clk) ({ 1; })
#define __clk_get(clk) ({ 1; })
...
...
arch/arm/plat-versatile/clock.c
浏览文件 @
9bf5b2ef
...
@@ -37,24 +37,38 @@ EXPORT_SYMBOL(clk_get_rate);
...
@@ -37,24 +37,38 @@ EXPORT_SYMBOL(clk_get_rate);
long
clk_round_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
long
clk_round_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
{
struct
icst_vco
vco
;
long
ret
=
-
EIO
;
vco
=
icst_hz_to_vco
(
clk
->
params
,
rate
);
if
(
clk
->
ops
&&
clk
->
ops
->
round
)
return
icst_hz
(
clk
->
params
,
vco
);
ret
=
clk
->
ops
->
round
(
clk
,
rate
);
return
ret
;
}
}
EXPORT_SYMBOL
(
clk_round_rate
);
EXPORT_SYMBOL
(
clk_round_rate
);
int
clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
int
clk_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
{
int
ret
=
-
EIO
;
int
ret
=
-
EIO
;
if
(
clk
->
ops
&&
clk
->
ops
->
set
)
ret
=
clk
->
ops
->
set
(
clk
,
rate
);
return
ret
;
}
EXPORT_SYMBOL
(
clk_set_rate
);
long
icst_clk_round
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
struct
icst_vco
vco
;
vco
=
icst_hz_to_vco
(
clk
->
params
,
rate
);
return
icst_hz
(
clk
->
params
,
vco
);
}
EXPORT_SYMBOL
(
icst_clk_round
);
if
(
clk
->
setvco
)
{
int
icst_clk_set
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
struct
icst_vco
vco
;
struct
icst_vco
vco
;
vco
=
icst_hz_to_vco
(
clk
->
params
,
rate
);
vco
=
icst_hz_to_vco
(
clk
->
params
,
rate
);
clk
->
rate
=
icst_hz
(
clk
->
params
,
vco
);
clk
->
rate
=
icst_hz
(
clk
->
params
,
vco
);
clk
->
setvco
(
clk
,
vco
);
clk
->
ops
->
setvco
(
clk
,
vco
);
ret
=
0
;
}
return
0
;
return
ret
;
}
}
EXPORT_SYMBOL
(
clk_set_rate
);
EXPORT_SYMBOL
(
icst_clk_set
);
arch/arm/plat-versatile/include/plat/clock.h
0 → 100644
浏览文件 @
9bf5b2ef
#ifndef PLAT_CLOCK_H
#define PLAT_CLOCK_H
#include <asm/hardware/icst.h>
struct
clk_ops
{
long
(
*
round
)(
struct
clk
*
,
unsigned
long
);
int
(
*
set
)(
struct
clk
*
,
unsigned
long
);
void
(
*
setvco
)(
struct
clk
*
,
struct
icst_vco
);
};
int
icst_clk_set
(
struct
clk
*
,
unsigned
long
);
long
icst_clk_round
(
struct
clk
*
,
unsigned
long
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录