Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4de93a08
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看板
提交
4de93a08
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/gpio: switch to device pri macros
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
2bdb4995
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
60 addition
and
44 deletion
+60
-44
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/g94.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/g94.c
+12
-10
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gf110.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gf110.c
+9
-6
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
+12
-10
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv10.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv10.c
+13
-9
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv50.c
+14
-9
未找到文件。
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/g94.c
浏览文件 @
4de93a08
...
...
@@ -26,21 +26,23 @@
void
g94_gpio_intr_stat
(
struct
nvkm_gpio
*
gpio
,
u32
*
hi
,
u32
*
lo
)
{
u32
intr0
=
nv_rd32
(
gpio
,
0x00e054
);
u32
intr1
=
nv_rd32
(
gpio
,
0x00e074
);
u32
stat0
=
nv_rd32
(
gpio
,
0x00e050
)
&
intr0
;
u32
stat1
=
nv_rd32
(
gpio
,
0x00e070
)
&
intr1
;
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
intr0
=
nvkm_rd32
(
device
,
0x00e054
);
u32
intr1
=
nvkm_rd32
(
device
,
0x00e074
);
u32
stat0
=
nvkm_rd32
(
device
,
0x00e050
)
&
intr0
;
u32
stat1
=
nvkm_rd32
(
device
,
0x00e070
)
&
intr1
;
*
lo
=
(
stat1
&
0xffff0000
)
|
(
stat0
>>
16
);
*
hi
=
(
stat1
<<
16
)
|
(
stat0
&
0x0000ffff
);
nv
_wr32
(
gpio
,
0x00e054
,
intr0
);
nv
_wr32
(
gpio
,
0x00e074
,
intr1
);
nv
km_wr32
(
device
,
0x00e054
,
intr0
);
nv
km_wr32
(
device
,
0x00e074
,
intr1
);
}
void
g94_gpio_intr_mask
(
struct
nvkm_gpio
*
gpio
,
u32
type
,
u32
mask
,
u32
data
)
{
u32
inte0
=
nv_rd32
(
gpio
,
0x00e050
);
u32
inte1
=
nv_rd32
(
gpio
,
0x00e070
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
inte0
=
nvkm_rd32
(
device
,
0x00e050
);
u32
inte1
=
nvkm_rd32
(
device
,
0x00e070
);
if
(
type
&
NVKM_GPIO_LO
)
inte0
=
(
inte0
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
...
...
@@ -51,8 +53,8 @@ g94_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
inte1
=
(
inte1
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
inte1
=
(
inte1
&
~
mask
)
|
data
;
nv
_wr32
(
gpio
,
0x00e050
,
inte0
);
nv
_wr32
(
gpio
,
0x00e070
,
inte1
);
nv
km_wr32
(
device
,
0x00e050
,
inte0
);
nv
km_wr32
(
device
,
0x00e070
,
inte1
);
}
struct
nvkm_oclass
*
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gf110.c
浏览文件 @
4de93a08
...
...
@@ -26,7 +26,8 @@
void
gf110_gpio_reset
(
struct
nvkm_gpio
*
gpio
,
u8
match
)
{
struct
nvkm_bios
*
bios
=
nvkm_bios
(
gpio
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
struct
nvkm_bios
*
bios
=
device
->
bios
;
u8
ver
,
len
;
u16
entry
;
int
ent
=
-
1
;
...
...
@@ -45,25 +46,27 @@ gf110_gpio_reset(struct nvkm_gpio *gpio, u8 match)
gpio
->
set
(
gpio
,
0
,
func
,
line
,
defs
);
nv
_mask
(
gpio
,
0x00d610
+
(
line
*
4
),
0xff
,
unk0
);
nv
km_mask
(
device
,
0x00d610
+
(
line
*
4
),
0xff
,
unk0
);
if
(
unk1
--
)
nv
_mask
(
gpio
,
0x00d740
+
(
unk1
*
4
),
0xff
,
line
);
nv
km_mask
(
device
,
0x00d740
+
(
unk1
*
4
),
0xff
,
line
);
}
}
int
gf110_gpio_drive
(
struct
nvkm_gpio
*
gpio
,
int
line
,
int
dir
,
int
out
)
{
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
data
=
((
dir
^
1
)
<<
13
)
|
(
out
<<
12
);
nv
_mask
(
gpio
,
0x00d610
+
(
line
*
4
),
0x00003000
,
data
);
nv
_mask
(
gpio
,
0x00d604
,
0x00000001
,
0x00000001
);
/* update? */
nv
km_mask
(
device
,
0x00d610
+
(
line
*
4
),
0x00003000
,
data
);
nv
km_mask
(
device
,
0x00d604
,
0x00000001
,
0x00000001
);
/* update? */
return
0
;
}
int
gf110_gpio_sense
(
struct
nvkm_gpio
*
gpio
,
int
line
)
{
return
!!
(
nv_rd32
(
gpio
,
0x00d610
+
(
line
*
4
))
&
0x00004000
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
return
!!
(
nvkm_rd32
(
device
,
0x00d610
+
(
line
*
4
))
&
0x00004000
);
}
struct
nvkm_oclass
*
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
浏览文件 @
4de93a08
...
...
@@ -26,21 +26,23 @@
static
void
gk104_gpio_intr_stat
(
struct
nvkm_gpio
*
gpio
,
u32
*
hi
,
u32
*
lo
)
{
u32
intr0
=
nv_rd32
(
gpio
,
0x00dc00
);
u32
intr1
=
nv_rd32
(
gpio
,
0x00dc80
);
u32
stat0
=
nv_rd32
(
gpio
,
0x00dc08
)
&
intr0
;
u32
stat1
=
nv_rd32
(
gpio
,
0x00dc88
)
&
intr1
;
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
intr0
=
nvkm_rd32
(
device
,
0x00dc00
);
u32
intr1
=
nvkm_rd32
(
device
,
0x00dc80
);
u32
stat0
=
nvkm_rd32
(
device
,
0x00dc08
)
&
intr0
;
u32
stat1
=
nvkm_rd32
(
device
,
0x00dc88
)
&
intr1
;
*
lo
=
(
stat1
&
0xffff0000
)
|
(
stat0
>>
16
);
*
hi
=
(
stat1
<<
16
)
|
(
stat0
&
0x0000ffff
);
nv
_wr32
(
gpio
,
0x00dc00
,
intr0
);
nv
_wr32
(
gpio
,
0x00dc80
,
intr1
);
nv
km_wr32
(
device
,
0x00dc00
,
intr0
);
nv
km_wr32
(
device
,
0x00dc80
,
intr1
);
}
void
gk104_gpio_intr_mask
(
struct
nvkm_gpio
*
gpio
,
u32
type
,
u32
mask
,
u32
data
)
{
u32
inte0
=
nv_rd32
(
gpio
,
0x00dc08
);
u32
inte1
=
nv_rd32
(
gpio
,
0x00dc88
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
inte0
=
nvkm_rd32
(
device
,
0x00dc08
);
u32
inte1
=
nvkm_rd32
(
device
,
0x00dc88
);
if
(
type
&
NVKM_GPIO_LO
)
inte0
=
(
inte0
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
...
...
@@ -51,8 +53,8 @@ gk104_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
inte1
=
(
inte1
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
inte1
=
(
inte1
&
~
mask
)
|
data
;
nv
_wr32
(
gpio
,
0x00dc08
,
inte0
);
nv
_wr32
(
gpio
,
0x00dc88
,
inte1
);
nv
km_wr32
(
device
,
0x00dc08
,
inte0
);
nv
km_wr32
(
device
,
0x00dc88
,
inte1
);
}
struct
nvkm_oclass
*
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv10.c
浏览文件 @
4de93a08
...
...
@@ -28,19 +28,20 @@
static
int
nv10_gpio_sense
(
struct
nvkm_gpio
*
gpio
,
int
line
)
{
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
if
(
line
<
2
)
{
line
=
line
*
16
;
line
=
nv
_rd32
(
gpio
,
0x600818
)
>>
line
;
line
=
nv
km_rd32
(
device
,
0x600818
)
>>
line
;
return
!!
(
line
&
0x0100
);
}
else
if
(
line
<
10
)
{
line
=
(
line
-
2
)
*
4
;
line
=
nv
_rd32
(
gpio
,
0x60081c
)
>>
line
;
line
=
nv
km_rd32
(
device
,
0x60081c
)
>>
line
;
return
!!
(
line
&
0x04
);
}
else
if
(
line
<
14
)
{
line
=
(
line
-
10
)
*
4
;
line
=
nv
_rd32
(
gpio
,
0x600850
)
>>
line
;
line
=
nv
km_rd32
(
device
,
0x600850
)
>>
line
;
return
!!
(
line
&
0x04
);
}
...
...
@@ -50,6 +51,7 @@ nv10_gpio_sense(struct nvkm_gpio *gpio, int line)
static
int
nv10_gpio_drive
(
struct
nvkm_gpio
*
gpio
,
int
line
,
int
dir
,
int
out
)
{
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
reg
,
mask
,
data
;
if
(
line
<
2
)
{
...
...
@@ -73,29 +75,31 @@ nv10_gpio_drive(struct nvkm_gpio *gpio, int line, int dir, int out)
return
-
EINVAL
;
}
nv
_mask
(
gpio
,
reg
,
mask
<<
line
,
data
<<
line
);
nv
km_mask
(
device
,
reg
,
mask
<<
line
,
data
<<
line
);
return
0
;
}
static
void
nv10_gpio_intr_stat
(
struct
nvkm_gpio
*
gpio
,
u32
*
hi
,
u32
*
lo
)
{
u32
intr
=
nv_rd32
(
gpio
,
0x001104
);
u32
stat
=
nv_rd32
(
gpio
,
0x001144
)
&
intr
;
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
intr
=
nvkm_rd32
(
device
,
0x001104
);
u32
stat
=
nvkm_rd32
(
device
,
0x001144
)
&
intr
;
*
lo
=
(
stat
&
0xffff0000
)
>>
16
;
*
hi
=
(
stat
&
0x0000ffff
);
nv
_wr32
(
gpio
,
0x001104
,
intr
);
nv
km_wr32
(
device
,
0x001104
,
intr
);
}
static
void
nv10_gpio_intr_mask
(
struct
nvkm_gpio
*
gpio
,
u32
type
,
u32
mask
,
u32
data
)
{
u32
inte
=
nv_rd32
(
gpio
,
0x001144
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
inte
=
nvkm_rd32
(
device
,
0x001144
);
if
(
type
&
NVKM_GPIO_LO
)
inte
=
(
inte
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
inte
=
(
inte
&
~
mask
)
|
data
;
nv
_wr32
(
gpio
,
0x001144
,
inte
);
nv
km_wr32
(
device
,
0x001144
,
inte
);
}
struct
nvkm_oclass
*
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/nv50.c
浏览文件 @
4de93a08
...
...
@@ -26,7 +26,8 @@
void
nv50_gpio_reset
(
struct
nvkm_gpio
*
gpio
,
u8
match
)
{
struct
nvkm_bios
*
bios
=
nvkm_bios
(
gpio
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
struct
nvkm_bios
*
bios
=
device
->
bios
;
u8
ver
,
len
;
u16
entry
;
int
ent
=
-
1
;
...
...
@@ -49,7 +50,7 @@ nv50_gpio_reset(struct nvkm_gpio *gpio, u8 match)
gpio
->
set
(
gpio
,
0
,
func
,
line
,
defs
);
nv
_mask
(
gpio
,
reg
,
0x00010001
<<
lsh
,
val
<<
lsh
);
nv
km_mask
(
device
,
reg
,
0x00010001
<<
lsh
,
val
<<
lsh
);
}
}
...
...
@@ -69,45 +70,49 @@ nv50_gpio_location(int line, u32 *reg, u32 *shift)
int
nv50_gpio_drive
(
struct
nvkm_gpio
*
gpio
,
int
line
,
int
dir
,
int
out
)
{
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
reg
,
shift
;
if
(
nv50_gpio_location
(
line
,
&
reg
,
&
shift
))
return
-
EINVAL
;
nv
_mask
(
gpio
,
reg
,
3
<<
shift
,
(((
dir
^
1
)
<<
1
)
|
out
)
<<
shift
);
nv
km_mask
(
device
,
reg
,
3
<<
shift
,
(((
dir
^
1
)
<<
1
)
|
out
)
<<
shift
);
return
0
;
}
int
nv50_gpio_sense
(
struct
nvkm_gpio
*
gpio
,
int
line
)
{
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
reg
,
shift
;
if
(
nv50_gpio_location
(
line
,
&
reg
,
&
shift
))
return
-
EINVAL
;
return
!!
(
nv
_rd32
(
gpio
,
reg
)
&
(
4
<<
shift
));
return
!!
(
nv
km_rd32
(
device
,
reg
)
&
(
4
<<
shift
));
}
static
void
nv50_gpio_intr_stat
(
struct
nvkm_gpio
*
gpio
,
u32
*
hi
,
u32
*
lo
)
{
u32
intr
=
nv_rd32
(
gpio
,
0x00e054
);
u32
stat
=
nv_rd32
(
gpio
,
0x00e050
)
&
intr
;
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
intr
=
nvkm_rd32
(
device
,
0x00e054
);
u32
stat
=
nvkm_rd32
(
device
,
0x00e050
)
&
intr
;
*
lo
=
(
stat
&
0xffff0000
)
>>
16
;
*
hi
=
(
stat
&
0x0000ffff
);
nv
_wr32
(
gpio
,
0x00e054
,
intr
);
nv
km_wr32
(
device
,
0x00e054
,
intr
);
}
static
void
nv50_gpio_intr_mask
(
struct
nvkm_gpio
*
gpio
,
u32
type
,
u32
mask
,
u32
data
)
{
u32
inte
=
nv_rd32
(
gpio
,
0x00e050
);
struct
nvkm_device
*
device
=
gpio
->
subdev
.
device
;
u32
inte
=
nvkm_rd32
(
device
,
0x00e050
);
if
(
type
&
NVKM_GPIO_LO
)
inte
=
(
inte
&
~
(
mask
<<
16
))
|
(
data
<<
16
);
if
(
type
&
NVKM_GPIO_HI
)
inte
=
(
inte
&
~
mask
)
|
data
;
nv
_wr32
(
gpio
,
0x00e050
,
inte
);
nv
km_wr32
(
device
,
0x00e050
,
inte
);
}
struct
nvkm_oclass
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录