Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
732bbcc4
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
732bbcc4
编写于
9月 11, 2011
作者:
L
Laurent Pinchart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fbdev: sh_mipi_dsi: Implement sh_mobile_lcdc_entity interface
Signed-off-by:
N
Laurent Pinchart
<
laurent.pinchart@ideasonboard.com
>
上级
8511ea4a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
51 addition
and
15 deletion
+51
-15
drivers/video/sh_mipi_dsi.c
drivers/video/sh_mipi_dsi.c
+51
-15
未找到文件。
drivers/video/sh_mipi_dsi.c
浏览文件 @
732bbcc4
...
...
@@ -24,6 +24,8 @@
#include <video/sh_mipi_dsi.h>
#include <video/sh_mobile_lcdc.h>
#include "sh_mobile_lcdcfb.h"
#define SYSCTRL 0x0000
#define SYSCONF 0x0004
#define TIMSET 0x0008
...
...
@@ -50,6 +52,8 @@
#define MAX_SH_MIPI_DSI 2
struct
sh_mipi
{
struct
sh_mobile_lcdc_entity
entity
;
void
__iomem
*
base
;
void
__iomem
*
linkbase
;
struct
clk
*
dsit_clk
;
...
...
@@ -60,6 +64,8 @@ struct sh_mipi {
void
(
*
next_display_off
)(
void
*
board_data
);
};
#define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
static
struct
sh_mipi
*
mipi_dsi
[
MAX_SH_MIPI_DSI
];
/* Protect the above array */
...
...
@@ -120,7 +126,7 @@ static void sh_mipi_dsi_enable(struct sh_mipi *mipi, bool enable)
static
void
sh_mipi_shutdown
(
struct
platform_device
*
pdev
)
{
struct
sh_mipi
*
mipi
=
platform_get_drvdata
(
pdev
);
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
platform_get_drvdata
(
pdev
)
);
sh_mipi_dsi_enable
(
mipi
,
false
);
}
...
...
@@ -392,9 +398,10 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
return
0
;
}
static
void
mipi_display_on
(
void
*
arg
,
struct
fb_info
*
info
)
static
int
__mipi_display_on
(
struct
sh_mobile_lcdc_entity
*
entity
,
struct
fb_info
*
info
)
{
struct
sh_mipi
*
mipi
=
arg
;
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
entity
)
;
struct
sh_mipi_dsi_info
*
pdata
=
mipi
->
pdev
->
dev
.
platform_data
;
int
ret
;
...
...
@@ -410,24 +417,34 @@ static void mipi_display_on(void *arg, struct fb_info *info)
sh_mipi_dsi_enable
(
mipi
,
true
);
if
(
mipi
->
next_display_on
)
mipi
->
next_display_on
(
mipi
->
next_board_data
,
info
);
return
;
return
0
;
mipi_display_on_fail1:
pm_runtime_put_sync
(
&
mipi
->
pdev
->
dev
);
mipi_display_on_fail2:
pdata
->
set_dot_clock
(
mipi
->
pdev
,
mipi
->
base
,
0
);
return
ret
;
}
static
void
mipi_display_o
ff
(
void
*
arg
)
static
void
mipi_display_o
n
(
void
*
arg
,
struct
fb_info
*
info
)
{
struct
sh_mipi
*
mipi
=
arg
;
struct
sh_mipi_dsi_info
*
pdata
=
mipi
->
pdev
->
dev
.
platform_data
;
struct
sh_mobile_lcdc_entity
*
entity
=
arg
;
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
entity
);
int
ret
;
if
(
mipi
->
next_display_off
)
mipi
->
next_display_off
(
mipi
->
next_board_data
);
ret
=
__mipi_display_on
(
entity
,
info
);
if
(
ret
<
0
)
return
;
if
(
mipi
->
next_display_on
)
mipi
->
next_display_on
(
mipi
->
next_board_data
,
info
);
}
static
void
__mipi_display_off
(
struct
sh_mobile_lcdc_entity
*
entity
)
{
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
entity
);
struct
sh_mipi_dsi_info
*
pdata
=
mipi
->
pdev
->
dev
.
platform_data
;
sh_mipi_dsi_enable
(
mipi
,
false
);
...
...
@@ -436,6 +453,22 @@ static void mipi_display_off(void *arg)
pm_runtime_put_sync
(
&
mipi
->
pdev
->
dev
);
}
static
void
mipi_display_off
(
void
*
arg
)
{
struct
sh_mobile_lcdc_entity
*
entity
=
arg
;
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
entity
);
if
(
mipi
->
next_display_off
)
mipi
->
next_display_off
(
mipi
->
next_board_data
);
__mipi_display_off
(
entity
);
}
static
const
struct
sh_mobile_lcdc_entity_ops
mipi_ops
=
{
.
display_on
=
__mipi_display_on
,
.
display_off
=
__mipi_display_off
,
};
static
int
__init
sh_mipi_probe
(
struct
platform_device
*
pdev
)
{
struct
sh_mipi
*
mipi
;
...
...
@@ -467,6 +500,9 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
goto
ealloc
;
}
mipi
->
entity
.
owner
=
THIS_MODULE
;
mipi
->
entity
.
ops
=
&
mipi_ops
;
if
(
!
request_mem_region
(
res
->
start
,
resource_size
(
res
),
pdev
->
name
))
{
dev_err
(
&
pdev
->
dev
,
"MIPI register region already claimed
\n
"
);
ret
=
-
EBUSY
;
...
...
@@ -521,7 +557,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
pm_runtime_resume
(
&
pdev
->
dev
);
mutex_unlock
(
&
array_lock
);
platform_set_drvdata
(
pdev
,
mipi
);
platform_set_drvdata
(
pdev
,
&
mipi
->
entity
);
/* Save original LCDC callbacks */
mipi
->
next_board_data
=
pdata
->
lcd_chan
->
board_cfg
.
board_data
;
...
...
@@ -529,7 +565,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
mipi
->
next_display_off
=
pdata
->
lcd_chan
->
board_cfg
.
display_off
;
/* Set up LCDC callbacks */
pdata
->
lcd_chan
->
board_cfg
.
board_data
=
mipi
;
pdata
->
lcd_chan
->
board_cfg
.
board_data
=
&
mipi
->
entity
;
pdata
->
lcd_chan
->
board_cfg
.
display_on
=
mipi_display_on
;
pdata
->
lcd_chan
->
board_cfg
.
display_off
=
mipi_display_off
;
pdata
->
lcd_chan
->
board_cfg
.
owner
=
THIS_MODULE
;
...
...
@@ -561,7 +597,7 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
struct
sh_mipi_dsi_info
*
pdata
=
pdev
->
dev
.
platform_data
;
struct
resource
*
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
struct
resource
*
res2
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
1
);
struct
sh_mipi
*
mipi
=
platform_get_drvdata
(
pdev
);
struct
sh_mipi
*
mipi
=
to_sh_mipi
(
platform_get_drvdata
(
pdev
)
);
int
i
,
ret
;
mutex_lock
(
&
array_lock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录