Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
d7f8172c
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d7f8172c
编写于
7月 03, 2011
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nvd0/gpio: initial implementation
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
eeb3ca12
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
4 deletion
+48
-4
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+9
-3
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+2
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+6
-1
drivers/gpu/drm/nouveau/nv50_gpio.c
drivers/gpu/drm/nouveau/nv50_gpio.c
+31
-0
未找到文件。
drivers/gpu/drm/nouveau/nouveau_bios.c
浏览文件 @
d7f8172c
...
...
@@ -5884,9 +5884,15 @@ parse_dcb_gpio_table(struct nvbios *bios)
}
e
->
line
=
(
e
->
entry
&
0x0000001f
)
>>
0
;
e
->
state_default
=
(
e
->
entry
&
0x01000000
)
>>
24
;
e
->
state
[
0
]
=
(
e
->
entry
&
0x18000000
)
>>
27
;
e
->
state
[
1
]
=
(
e
->
entry
&
0x60000000
)
>>
29
;
if
(
gpio
[
0
]
==
0x40
)
{
e
->
state_default
=
(
e
->
entry
&
0x01000000
)
>>
24
;
e
->
state
[
0
]
=
(
e
->
entry
&
0x18000000
)
>>
27
;
e
->
state
[
1
]
=
(
e
->
entry
&
0x60000000
)
>>
29
;
}
else
{
e
->
state_default
=
(
e
->
entry
&
0x00000080
)
>>
7
;
e
->
state
[
0
]
=
(
entry
[
4
]
>>
4
)
&
3
;
e
->
state
[
1
]
=
(
entry
[
4
]
>>
6
)
&
3
;
}
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
d7f8172c
...
...
@@ -1391,6 +1391,8 @@ int nv50_gpio_init(struct drm_device *dev);
void
nv50_gpio_fini
(
struct
drm_device
*
dev
);
int
nv50_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nv50_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
int
nvd0_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nvd0_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
int
nv50_gpio_irq_register
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
void
(
*
)(
void
*
,
int
),
void
*
);
void
nv50_gpio_irq_unregister
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
浏览文件 @
d7f8172c
...
...
@@ -459,8 +459,13 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
display
.
create
=
nouveau_stub_init
;
engine
->
display
.
init
=
nouveau_stub_init
;
engine
->
display
.
destroy
=
nouveau_stub_takedown
;
engine
->
gpio
.
init
=
n
ouveau_stub
_init
;
engine
->
gpio
.
init
=
n
v50_gpio
_init
;
engine
->
gpio
.
takedown
=
nouveau_stub_takedown
;
engine
->
gpio
.
get
=
nvd0_gpio_get
;
engine
->
gpio
.
set
=
nvd0_gpio_set
;
engine
->
gpio
.
irq_register
=
nv50_gpio_irq_register
;
engine
->
gpio
.
irq_unregister
=
nv50_gpio_irq_unregister
;
engine
->
gpio
.
irq_enable
=
nv50_gpio_irq_enable
;
engine
->
vram
.
init
=
nvc0_vram_init
;
engine
->
vram
.
takedown
=
nv50_vram_fini
;
engine
->
vram
.
get
=
nvc0_vram_new
;
...
...
drivers/gpu/drm/nouveau/nv50_gpio.c
浏览文件 @
d7f8172c
...
...
@@ -97,6 +97,37 @@ nv50_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state)
return
0
;
}
int
nvd0_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
)
{
struct
dcb_gpio_entry
*
gpio
;
u32
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
v
=
nv_rd32
(
dev
,
0x00d610
+
(
gpio
->
line
*
4
));
v
&=
0x00004000
;
return
(
!!
v
==
(
gpio
->
state
[
1
]
&
1
));
}
int
nvd0_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
)
{
struct
dcb_gpio_entry
*
gpio
;
u32
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
v
=
gpio
->
state
[
state
]
^
2
;
nv_mask
(
dev
,
0x00d610
+
(
gpio
->
line
*
4
),
0x00003000
,
v
<<
12
);
return
0
;
}
int
nv50_gpio_irq_register
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
void
(
*
handler
)(
void
*
,
int
),
void
*
data
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录