Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
72e3524c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
72e3524c
编写于
8月 20, 2007
作者:
R
Russell King
提交者:
Russell King
10月 12, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ARM] pxa: update pxafb to use clk support
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
a6dba20c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
13 deletion
+24
-13
drivers/video/pxafb.c
drivers/video/pxafb.c
+23
-13
drivers/video/pxafb.h
drivers/video/pxafb.h
+1
-0
未找到文件。
drivers/video/pxafb.c
浏览文件 @
72e3524c
...
...
@@ -37,6 +37,8 @@
#include <linux/cpufreq.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <asm/hardware.h>
#include <asm/io.h>
...
...
@@ -506,15 +508,15 @@ static struct fb_ops pxafb_ops = {
*
* Factoring the 10^4 and 10^-12 out gives 10^-8 == 1 / 100000000 as used below.
*/
static
inline
unsigned
int
get_pcd
(
unsigned
int
pixclock
)
static
inline
unsigned
int
get_pcd
(
struct
pxafb_info
*
fbi
,
unsigned
int
pixclock
)
{
unsigned
long
long
pcd
;
/* FIXME: Need to take into account Double Pixel Clock mode
* (DPC) bit? or perhaps set it based on the various clock
* speeds */
pcd
=
(
unsigned
long
long
)
get_lcdclk_frequency_10khz
()
*
pixclock
;
* (DPC) bit? or perhaps set it based on the various clock
* speeds */
pcd
=
(
unsigned
long
long
)(
clk_get_rate
(
fbi
->
clk
)
/
10000
);
pcd
*=
pixclock
;
do_div
(
pcd
,
100000000
*
2
);
/* no need for this, since we should subtract 1 anyway. they cancel */
/* pcd += 1; */
/* make up for integer math truncations */
...
...
@@ -523,19 +525,21 @@ static inline unsigned int get_pcd(unsigned int pixclock)
/*
* Some touchscreens need hsync information from the video driver to
* function correctly. We export it here.
* function correctly. We export it here. Note that 'hsync_time' and
* the value returned from pxafb_get_hsync_time() is the *reciprocal*
* of the hsync period in seconds.
*/
static
inline
void
set_hsync_time
(
struct
pxafb_info
*
fbi
,
unsigned
int
pcd
)
{
unsigned
long
long
htime
;
unsigned
long
htime
;
if
((
pcd
==
0
)
||
(
fbi
->
fb
.
var
.
hsync_len
==
0
))
{
fbi
->
hsync_time
=
0
;
return
;
}
htime
=
(
unsigned
long
long
)
get_lcdclk_frequency_10khz
()
*
10000
;
do_div
(
htime
,
pcd
*
fbi
->
fb
.
var
.
hsync_len
);
htime
=
clk_get_rate
(
fbi
->
clk
)
/
(
pcd
*
fbi
->
fb
.
var
.
hsync_len
)
;
fbi
->
hsync_time
=
htime
;
}
...
...
@@ -560,7 +564,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *
{
struct
pxafb_lcd_reg
new_regs
;
u_long
flags
;
u_int
lines_per_panel
,
pcd
=
get_pcd
(
var
->
pixclock
);
u_int
lines_per_panel
,
pcd
=
get_pcd
(
fbi
,
var
->
pixclock
);
pr_debug
(
"pxafb: Configuring PXA LCD
\n
"
);
...
...
@@ -803,7 +807,7 @@ static void pxafb_enable_controller(struct pxafb_info *fbi)
pr_debug
(
"reg_lccr3 0x%08x
\n
"
,
(
unsigned
int
)
fbi
->
reg_lccr3
);
/* enable LCD controller clock */
pxa_set_cken
(
CKEN_LCD
,
1
);
clk_enable
(
fbi
->
clk
);
/* Sequence from 11.7.10 */
LCCR3
=
fbi
->
reg_lccr3
;
...
...
@@ -840,7 +844,7 @@ static void pxafb_disable_controller(struct pxafb_info *fbi)
remove_wait_queue
(
&
fbi
->
ctrlr_wait
,
&
wait
);
/* disable LCD controller clock */
pxa_set_cken
(
CKEN_LCD
,
0
);
clk_disable
(
fbi
->
clk
);
}
/*
...
...
@@ -994,7 +998,7 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data)
break
;
case
CPUFREQ_POSTCHANGE
:
pcd
=
get_pcd
(
fbi
->
fb
.
var
.
pixclock
);
pcd
=
get_pcd
(
fbi
,
fbi
->
fb
.
var
.
pixclock
);
set_hsync_time
(
fbi
,
pcd
);
fbi
->
reg_lccr3
=
(
fbi
->
reg_lccr3
&
~
0xff
)
|
LCCR3_PixClkDiv
(
pcd
);
set_ctrlr_state
(
fbi
,
C_ENABLE_CLKCHANGE
);
...
...
@@ -1119,6 +1123,12 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
memset
(
fbi
,
0
,
sizeof
(
struct
pxafb_info
));
fbi
->
dev
=
dev
;
fbi
->
clk
=
clk_get
(
dev
,
"LCDCLK"
);
if
(
IS_ERR
(
fbi
->
clk
))
{
kfree
(
fbi
);
return
NULL
;
}
strcpy
(
fbi
->
fb
.
fix
.
id
,
PXA_NAME
);
fbi
->
fb
.
fix
.
type
=
FB_TYPE_PACKED_PIXELS
;
...
...
drivers/video/pxafb.h
浏览文件 @
72e3524c
...
...
@@ -40,6 +40,7 @@ struct pxafb_dma_descriptor {
struct
pxafb_info
{
struct
fb_info
fb
;
struct
device
*
dev
;
struct
clk
*
clk
;
/*
* These are the addresses we mapped
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录