Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
66c8719b
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看板
提交
66c8719b
编写于
12月 16, 2008
作者:
S
Sascha Hauer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
i.MX Framebuffer: Cleanup Coding style
Signed-off-by:
N
Sascha Hauer
<
s.hauer@pengutronix.de
>
上级
24b9baf7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
36 deletion
+34
-36
drivers/video/imxfb.c
drivers/video/imxfb.c
+34
-36
未找到文件。
drivers/video/imxfb.c
浏览文件 @
66c8719b
/*
* linux/drivers/video/imxfb.c
*
* Freescale i.MX Frame Buffer device driver
*
* Copyright (C) 2004 Sascha Hauer, Pengutronix
...
...
@@ -168,20 +166,21 @@ struct imxfb_info {
#define MIN_YRES 64
static
struct
imxfb_rgb
def_rgb_16
=
{
.
red
=
{
.
offset
=
8
,
.
length
=
4
,
},
.
green
=
{
.
offset
=
4
,
.
length
=
4
,
},
.
blue
=
{
.
offset
=
0
,
.
length
=
4
,
},
.
transp
=
{
.
offset
=
0
,
.
length
=
0
,
},
.
red
=
{
.
offset
=
8
,
.
length
=
4
,
},
.
green
=
{
.
offset
=
4
,
.
length
=
4
,
},
.
blue
=
{
.
offset
=
0
,
.
length
=
4
,
},
.
transp
=
{
.
offset
=
0
,
.
length
=
0
,
},
};
static
struct
imxfb_rgb
def_rgb_8
=
{
.
red
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
green
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
blue
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
transp
=
{
.
offset
=
0
,
.
length
=
0
,
},
.
red
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
green
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
blue
=
{
.
offset
=
0
,
.
length
=
8
,
},
.
transp
=
{
.
offset
=
0
,
.
length
=
0
,
},
};
static
int
imxfb_activate_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
);
static
int
imxfb_activate_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
);
static
inline
u_int
chan_to_field
(
u_int
chan
,
struct
fb_bitfield
*
bf
)
{
...
...
@@ -190,9 +189,8 @@ static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
return
chan
<<
bf
->
offset
;
}
static
int
imxfb_setpalettereg
(
u_int
regno
,
u_int
red
,
u_int
green
,
u_int
blue
,
u_int
trans
,
struct
fb_info
*
info
)
static
int
imxfb_setpalettereg
(
u_int
regno
,
u_int
red
,
u_int
green
,
u_int
blue
,
u_int
trans
,
struct
fb_info
*
info
)
{
struct
imxfb_info
*
fbi
=
info
->
par
;
u_int
val
,
ret
=
1
;
...
...
@@ -209,8 +207,7 @@ imxfb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
return
ret
;
}
static
int
imxfb_setcolreg
(
u_int
regno
,
u_int
red
,
u_int
green
,
u_int
blue
,
static
int
imxfb_setcolreg
(
u_int
regno
,
u_int
red
,
u_int
green
,
u_int
blue
,
u_int
trans
,
struct
fb_info
*
info
)
{
struct
imxfb_info
*
fbi
=
info
->
par
;
...
...
@@ -270,8 +267,7 @@ imxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale,
* bitfields, horizontal timing, vertical timing.
*/
static
int
imxfb_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
static
int
imxfb_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
struct
imxfb_info
*
fbi
=
info
->
par
;
int
rgbidx
;
...
...
@@ -343,8 +339,7 @@ static int imxfb_set_par(struct fb_info *info)
info
->
fix
.
visual
=
FB_VISUAL_STATIC_PSEUDOCOLOR
;
}
info
->
fix
.
line_length
=
var
->
xres_virtual
*
var
->
bits_per_pixel
/
8
;
info
->
fix
.
line_length
=
var
->
xres_virtual
*
var
->
bits_per_pixel
/
8
;
fbi
->
palette_size
=
var
->
bits_per_pixel
==
8
?
256
:
16
;
imxfb_activate_var
(
var
,
info
);
...
...
@@ -375,9 +370,9 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
writel
(
RMCR_LCDC_EN
,
fbi
->
regs
+
LCDC_RMCR
);
if
(
fbi
->
backlight_power
)
if
(
fbi
->
backlight_power
)
fbi
->
backlight_power
(
1
);
if
(
fbi
->
lcd_power
)
if
(
fbi
->
lcd_power
)
fbi
->
lcd_power
(
1
);
}
...
...
@@ -385,9 +380,9 @@ static void imxfb_disable_controller(struct imxfb_info *fbi)
{
pr_debug
(
"Disabling LCD controller
\n
"
);
if
(
fbi
->
backlight_power
)
if
(
fbi
->
backlight_power
)
fbi
->
backlight_power
(
0
);
if
(
fbi
->
lcd_power
)
if
(
fbi
->
lcd_power
)
fbi
->
lcd_power
(
0
);
writel
(
0
,
fbi
->
regs
+
LCDC_RMCR
);
...
...
@@ -495,7 +490,8 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
static
int
imxfb_suspend
(
struct
platform_device
*
dev
,
pm_message_t
state
)
{
struct
imxfb_info
*
fbi
=
platform_get_drvdata
(
dev
);
pr_debug
(
"%s
\n
"
,
__func__
);
pr_debug
(
"%s
\n
"
,
__func__
);
imxfb_disable_controller
(
fbi
);
return
0
;
...
...
@@ -504,7 +500,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
static
int
imxfb_resume
(
struct
platform_device
*
dev
)
{
struct
imxfb_info
*
fbi
=
platform_get_drvdata
(
dev
);
pr_debug
(
"%s
\n
"
,
__func__
);
pr_debug
(
"%s
\n
"
,
__func__
);
imxfb_enable_controller
(
fbi
);
return
0
;
...
...
@@ -522,7 +519,7 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
pr_debug
(
"%s
\n
"
,
__func__
);
info
->
pseudo_palette
=
kmalloc
(
sizeof
(
u32
)
*
16
,
GFP_KERNEL
);
info
->
pseudo_palette
=
kmalloc
(
sizeof
(
u32
)
*
16
,
GFP_KERNEL
);
if
(
!
info
->
pseudo_palette
)
return
-
ENOMEM
;
...
...
@@ -530,22 +527,23 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
strlcpy
(
info
->
fix
.
id
,
IMX_NAME
,
sizeof
(
info
->
fix
.
id
));
info
->
fix
.
type
=
FB_TYPE_PACKED_PIXELS
;
info
->
fix
.
type
=
FB_TYPE_PACKED_PIXELS
;
info
->
fix
.
type_aux
=
0
;
info
->
fix
.
xpanstep
=
0
;
info
->
fix
.
ypanstep
=
0
;
info
->
fix
.
ywrapstep
=
0
;
info
->
fix
.
accel
=
FB_ACCEL_NONE
;
info
->
fix
.
accel
=
FB_ACCEL_NONE
;
info
->
var
.
nonstd
=
0
;
info
->
var
.
activate
=
FB_ACTIVATE_NOW
;
info
->
var
.
height
=
-
1
;
info
->
var
.
width
=
-
1
;
info
->
var
.
accel_flags
=
0
;
info
->
var
.
vmode
=
FB_VMODE_NONINTERLACED
;
info
->
var
.
vmode
=
FB_VMODE_NONINTERLACED
;
info
->
fbops
=
&
imxfb_ops
;
info
->
flags
=
FBINFO_FLAG_DEFAULT
|
FBINFO_READS_FAST
;
info
->
flags
=
FBINFO_FLAG_DEFAULT
|
FBINFO_READS_FAST
;
fbi
->
rgb
[
RGB_16
]
=
&
def_rgb_16
;
fbi
->
rgb
[
RGB_8
]
=
&
def_rgb_8
;
...
...
@@ -593,17 +591,17 @@ static int __init imxfb_probe(struct platform_device *pdev)
printk
(
"i.MX Framebuffer driver
\n
"
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
res
)
if
(
!
res
)
return
-
ENODEV
;
inf
=
pdev
->
dev
.
platform_data
;
if
(
!
inf
)
{
if
(
!
inf
)
{
dev_err
(
&
pdev
->
dev
,
"No platform_data available
\n
"
);
return
-
ENOMEM
;
}
info
=
framebuffer_alloc
(
sizeof
(
struct
imxfb_info
),
&
pdev
->
dev
);
if
(
!
info
)
if
(
!
info
)
return
-
ENOMEM
;
fbi
=
info
->
par
;
...
...
@@ -611,7 +609,7 @@ static int __init imxfb_probe(struct platform_device *pdev)
platform_set_drvdata
(
pdev
,
info
);
ret
=
imxfb_init_fbinfo
(
pdev
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
failed_init
;
res
=
request_mem_region
(
res
->
start
,
resource_size
(
res
),
...
...
@@ -658,7 +656,7 @@ static int __init imxfb_probe(struct platform_device *pdev)
*/
imxfb_check_var
(
&
info
->
var
,
info
);
ret
=
fb_alloc_cmap
(
&
info
->
cmap
,
1
<<
info
->
var
.
bits_per_pixel
,
0
);
ret
=
fb_alloc_cmap
(
&
info
->
cmap
,
1
<<
info
->
var
.
bits_per_pixel
,
0
);
if
(
ret
<
0
)
goto
failed_cmap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录