Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
45284162
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45284162
编写于
4月 07, 2010
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50: implement gpio set/get routines
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
02faec09
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
86 addition
and
7 deletion
+86
-7
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-1
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+5
-6
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+4
-0
drivers/gpu/drm/nouveau/nv50_gpio.c
drivers/gpu/drm/nouveau/nv50_gpio.c
+76
-0
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
45284162
...
...
@@ -22,7 +22,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
nv50_cursor.o nv50_display.o nv50_fbcon.o
\
nv04_dac.o nv04_dfp.o nv04_tv.o nv17_tv.o nv17_tv_modes.o
\
nv04_crtc.o nv04_display.o nv04_cursor.o nv04_fbcon.o
\
nv17_gpio.o
nv17_gpio.o
nv50_gpio.o
nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG)
+=
nouveau_debugfs.o
nouveau-$(CONFIG_COMPAT)
+=
nouveau_ioc32.o
...
...
drivers/gpu/drm/nouveau/nouveau_bios.c
浏览文件 @
45284162
...
...
@@ -2574,7 +2574,6 @@ init_gpio(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
*/
struct
drm_nouveau_private
*
dev_priv
=
bios
->
dev
->
dev_private
;
const
uint32_t
nv50_gpio_reg
[
4
]
=
{
0xe104
,
0xe108
,
0xe280
,
0xe284
};
const
uint32_t
nv50_gpio_ctl
[
2
]
=
{
0xe100
,
0xe28c
};
int
i
;
...
...
@@ -2592,12 +2591,12 @@ init_gpio(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
BIOSLOG
(
bios
,
"0x%04X: Entry: 0x%08X
\n
"
,
offset
,
gpio
->
entry
);
r
=
nv50_gpio_reg
[
gpio
->
line
>>
3
];
s
=
(
gpio
->
line
&
0x07
)
<<
2
;
v
=
bios_rd32
(
bios
,
r
)
&
~
(
0x00000003
<<
s
);
v
|=
(
gpio
->
state
[
gpio
->
state_default
]
^
2
)
<<
s
;
bios_wr32
(
bios
,
r
,
v
);
nv50_gpio_set
(
bios
->
dev
,
gpio
->
tag
,
gpio
->
state_default
);
/* The NVIDIA binary driver doesn't appear to actually do
* any of this, my VBIOS does however.
*/
/* Not a clue, needs de-magicing */
r
=
nv50_gpio_ctl
[
gpio
->
line
>>
4
];
s
=
(
gpio
->
line
&
0x0f
);
v
=
bios_rd32
(
bios
,
r
)
&
~
(
0x00010001
<<
s
);
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
45284162
...
...
@@ -1162,6 +1162,10 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
int
nv17_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nv17_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
/* nv50_gpio.c */
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
);
#ifndef ioread32_native
#ifdef __BIG_ENDIAN
#define ioread16_native ioread16be
...
...
drivers/gpu/drm/nouveau/nv50_gpio.c
0 → 100644
浏览文件 @
45284162
/*
* Copyright 2010 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "drmP.h"
#include "nouveau_drv.h"
#include "nouveau_hw.h"
static
int
nv50_gpio_location
(
struct
dcb_gpio_entry
*
gpio
,
uint32_t
*
reg
,
uint32_t
*
shift
)
{
const
uint32_t
nv50_gpio_reg
[
4
]
=
{
0xe104
,
0xe108
,
0xe280
,
0xe284
};
if
(
gpio
->
line
>
32
)
return
-
EINVAL
;
*
reg
=
nv50_gpio_reg
[
gpio
->
line
>>
3
];
*
shift
=
(
gpio
->
line
&
7
)
<<
2
;
return
0
;
}
int
nv50_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
)
{
struct
dcb_gpio_entry
*
gpio
;
uint32_t
r
,
s
,
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
if
(
nv50_gpio_location
(
gpio
,
&
r
,
&
s
))
return
-
EINVAL
;
v
=
nv_rd32
(
dev
,
r
)
>>
(
s
+
2
);
return
((
v
&
1
)
==
(
gpio
->
state
[
1
]
&
1
));
}
int
nv50_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
)
{
struct
dcb_gpio_entry
*
gpio
;
uint32_t
r
,
s
,
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
if
(
nv50_gpio_location
(
gpio
,
&
r
,
&
s
))
return
-
EINVAL
;
v
=
nv_rd32
(
dev
,
r
)
&
~
(
0x3
<<
s
);
v
|=
(
gpio
->
state
[
state
]
^
2
)
<<
s
;
nv_wr32
(
dev
,
r
,
v
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录