Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
842c2953
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看板
提交
842c2953
编写于
5月 07, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/i2c: properly hand aux reply back to caller, and only retry on defer
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
febb8449
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
14 deletion
+20
-14
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
+1
-1
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
+2
-1
drivers/gpu/drm/nouveau/core/subdev/i2c/aux.c
drivers/gpu/drm/nouveau/core/subdev/i2c/aux.c
+3
-3
drivers/gpu/drm/nouveau/core/subdev/i2c/nv94.c
drivers/gpu/drm/nouveau/core/subdev/i2c/nv94.c
+14
-9
未找到文件。
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
浏览文件 @
842c2953
...
...
@@ -33,7 +33,7 @@ struct nouveau_i2c_func {
int
(
*
sense_scl
)(
struct
nouveau_i2c_port
*
);
int
(
*
sense_sda
)(
struct
nouveau_i2c_port
*
);
int
(
*
aux
)(
struct
nouveau_i2c_port
*
,
u8
,
u32
,
u8
*
,
u8
);
int
(
*
aux
)(
struct
nouveau_i2c_port
*
,
bool
,
u8
,
u32
,
u8
*
,
u8
);
int
(
*
pattern
)(
struct
nouveau_i2c_port
*
,
int
pattern
);
int
(
*
lnk_ctl
)(
struct
nouveau_i2c_port
*
,
int
nr
,
int
bw
,
bool
enh
);
int
(
*
drv_ctl
)(
struct
nouveau_i2c_port
*
,
int
lane
,
int
sw
,
int
pe
);
...
...
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
浏览文件 @
842c2953
...
...
@@ -60,7 +60,8 @@ anx9805_train(struct nouveau_i2c_port *port, int link_nr, int link_bw, bool enh)
}
static
int
anx9805_aux
(
struct
nouveau_i2c_port
*
port
,
u8
type
,
u32
addr
,
u8
*
data
,
u8
size
)
anx9805_aux
(
struct
nouveau_i2c_port
*
port
,
bool
retry
,
u8
type
,
u32
addr
,
u8
*
data
,
u8
size
)
{
struct
anx9805_i2c_port
*
chan
=
(
void
*
)
port
;
struct
nouveau_i2c_port
*
mast
=
(
void
*
)
nv_object
(
chan
)
->
parent
;
...
...
drivers/gpu/drm/nouveau/core/subdev/i2c/aux.c
浏览文件 @
842c2953
...
...
@@ -30,7 +30,7 @@ nv_rdaux(struct nouveau_i2c_port *port, u32 addr, u8 *data, u8 size)
if
(
port
->
func
->
aux
)
{
if
(
port
->
func
->
acquire
)
port
->
func
->
acquire
(
port
);
return
port
->
func
->
aux
(
port
,
9
,
addr
,
data
,
size
);
return
port
->
func
->
aux
(
port
,
true
,
9
,
addr
,
data
,
size
);
}
return
-
ENODEV
;
}
...
...
@@ -41,7 +41,7 @@ nv_wraux(struct nouveau_i2c_port *port, u32 addr, u8 *data, u8 size)
if
(
port
->
func
->
aux
)
{
if
(
port
->
func
->
acquire
)
port
->
func
->
acquire
(
port
);
return
port
->
func
->
aux
(
port
,
8
,
addr
,
data
,
size
);
return
port
->
func
->
aux
(
port
,
true
,
8
,
addr
,
data
,
size
);
}
return
-
ENODEV
;
}
...
...
@@ -74,7 +74,7 @@ aux_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
if
(
mcnt
||
remaining
>
16
)
cmd
|=
4
;
/* MOT */
ret
=
port
->
func
->
aux
(
port
,
cmd
,
msg
->
addr
,
ptr
,
cnt
);
ret
=
port
->
func
->
aux
(
port
,
true
,
cmd
,
msg
->
addr
,
ptr
,
cnt
);
if
(
ret
<
0
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/subdev/i2c/nv94.c
浏览文件 @
842c2953
...
...
@@ -69,7 +69,8 @@ auxch_init(struct nouveau_i2c *aux, int ch)
}
int
nv94_aux
(
struct
nouveau_i2c_port
*
base
,
u8
type
,
u32
addr
,
u8
*
data
,
u8
size
)
nv94_aux
(
struct
nouveau_i2c_port
*
base
,
bool
retry
,
u8
type
,
u32
addr
,
u8
*
data
,
u8
size
)
{
struct
nouveau_i2c
*
aux
=
nouveau_i2c
(
base
);
struct
nv50_i2c_port
*
port
=
(
void
*
)
base
;
...
...
@@ -105,9 +106,8 @@ nv94_aux(struct nouveau_i2c_port *base, u8 type, u32 addr, u8 *data, u8 size)
ctrl
|=
size
-
1
;
nv_wr32
(
aux
,
0x00e4e0
+
(
ch
*
0x50
),
addr
);
/* retry transaction a number of times on failure... */
ret
=
-
EREMOTEIO
;
for
(
retries
=
0
;
retries
<
32
;
retries
++
)
{
/* (maybe) retry transaction a number of times on failure... */
for
(
retries
=
0
;
!
ret
&&
retries
<
32
;
retries
++
)
{
/* reset, and delay a while if this is a retry */
nv_wr32
(
aux
,
0x00e4e4
+
(
ch
*
0x50
),
0x80000000
|
ctrl
);
nv_wr32
(
aux
,
0x00e4e4
+
(
ch
*
0x50
),
0x00000000
|
ctrl
);
...
...
@@ -123,16 +123,21 @@ nv94_aux(struct nouveau_i2c_port *base, u8 type, u32 addr, u8 *data, u8 size)
udelay
(
1
);
if
(
!
timeout
--
)
{
AUX_ERR
(
"tx req timeout 0x%08x
\n
"
,
ctrl
);
ret
=
-
EIO
;
goto
out
;
}
}
while
(
ctrl
&
0x00010000
);
ret
=
1
;
/* read status, and check if transaction completed ok */
stat
=
nv_mask
(
aux
,
0x00e4e8
+
(
ch
*
0x50
),
0
,
0
);
if
(
!
(
stat
&
0x000f0f00
))
{
ret
=
0
;
break
;
}
if
((
stat
&
0x000f0000
)
==
0x00080000
||
(
stat
&
0x000f0000
)
==
0x00020000
)
ret
=
retry
?
0
:
1
;
if
((
stat
&
0x00000100
))
ret
=
-
ETIMEDOUT
;
if
((
stat
&
0x00000e00
))
ret
=
-
EIO
;
AUX_DBG
(
"%02d 0x%08x 0x%08x
\n
"
,
retries
,
ctrl
,
stat
);
}
...
...
@@ -147,7 +152,7 @@ nv94_aux(struct nouveau_i2c_port *base, u8 type, u32 addr, u8 *data, u8 size)
out:
auxch_fini
(
aux
,
ch
);
return
ret
;
return
ret
<
0
?
ret
:
(
stat
&
0x000f0000
)
>>
16
;
}
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录