Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
a340ba10
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a340ba10
编写于
6月 01, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Automatic merge of
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/i2c-2.6
上级
c10fccdd
4a4e5787
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
15 deletion
+37
-15
MAINTAINERS
MAINTAINERS
+6
-0
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali1563.c
+31
-15
未找到文件。
MAINTAINERS
浏览文件 @
a340ba10
...
...
@@ -239,6 +239,12 @@ L: linux-usb-devel@lists.sourceforge.net
W: http://www.linux-usb.org/SpeedTouch/
S: Maintained
ALI1563 I2C DRIVER
P: Rudolf Marek
M: r.marek@sh.cvut.cz
L: sensors@stimpy.netroedge.com
S: Maintained
ALPHA PORT
P: Richard Henderson
M: rth@twiddle.net
...
...
drivers/i2c/busses/i2c-ali1563.c
浏览文件 @
a340ba10
...
...
@@ -2,6 +2,7 @@
* i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge
*
* Copyright (C) 2004 Patrick Mochel
* 2005 Rudolf Marek <r.marek@sh.cvut.cz>
*
* The 1563 southbridge is deceptively similar to the 1533, with a
* few notable exceptions. One of those happens to be the fact they
...
...
@@ -57,10 +58,11 @@
#define HST_CNTL2_BLOCK 0x05
#define HST_CNTL2_SIZEMASK 0x38
static
unsigned
short
ali1563_smba
;
static
int
ali1563_transaction
(
struct
i2c_adapter
*
a
)
static
int
ali1563_transaction
(
struct
i2c_adapter
*
a
,
int
size
)
{
u32
data
;
int
timeout
;
...
...
@@ -73,7 +75,7 @@ static int ali1563_transaction(struct i2c_adapter * a)
data
=
inb_p
(
SMB_HST_STS
);
if
(
data
&
HST_STS_BAD
)
{
dev_
warn
(
&
a
->
dev
,
"ali1563: Trying to reset busy device
\n
"
);
dev_
err
(
&
a
->
dev
,
"ali1563: Trying to reset busy device
\n
"
);
outb_p
(
data
|
HST_STS_BAD
,
SMB_HST_STS
);
data
=
inb_p
(
SMB_HST_STS
);
if
(
data
&
HST_STS_BAD
)
...
...
@@ -94,19 +96,31 @@ static int ali1563_transaction(struct i2c_adapter * a)
if
(
timeout
&&
!
(
data
&
HST_STS_BAD
))
return
0
;
dev_warn
(
&
a
->
dev
,
"SMBus Error: %s%s%s%s%s
\n
"
,
timeout
?
"Timeout "
:
""
,
data
&
HST_STS_FAIL
?
"Transaction Failed "
:
""
,
data
&
HST_STS_BUSERR
?
"No response or Bus Collision "
:
""
,
data
&
HST_STS_DEVERR
?
"Device Error "
:
""
,
!
(
data
&
HST_STS_DONE
)
?
"Transaction Never Finished "
:
""
);
if
(
!
(
data
&
HST_STS_DONE
))
if
(
!
timeout
)
{
dev_err
(
&
a
->
dev
,
"Timeout - Trying to KILL transaction!
\n
"
);
/* Issue 'kill' to host controller */
outb_p
(
HST_CNTL2_KILL
,
SMB_HST_CNTL2
);
else
/* Issue timeout to reset all devices on bus */
data
=
inb_p
(
SMB_HST_STS
);
}
/* device error - no response, ignore the autodetection case */
if
((
data
&
HST_STS_DEVERR
)
&&
(
size
!=
HST_CNTL2_QUICK
))
{
dev_err
(
&
a
->
dev
,
"Device error!
\n
"
);
}
/* bus collision */
if
(
data
&
HST_STS_BUSERR
)
{
dev_err
(
&
a
->
dev
,
"Bus collision!
\n
"
);
/* Issue timeout, hoping it helps */
outb_p
(
HST_CNTL1_TIMEOUT
,
SMB_HST_CNTL1
);
}
if
(
data
&
HST_STS_FAIL
)
{
dev_err
(
&
a
->
dev
,
"Cleaning fail after KILL!
\n
"
);
outb_p
(
0x0
,
SMB_HST_CNTL2
);
}
return
-
1
;
}
...
...
@@ -149,7 +163,7 @@ static int ali1563_block_start(struct i2c_adapter * a)
if
(
timeout
&&
!
(
data
&
HST_STS_BAD
))
return
0
;
dev_
warn
(
&
a
->
dev
,
"SMBus Error: %s%s%s%s%s
\n
"
,
dev_
err
(
&
a
->
dev
,
"SMBus Error: %s%s%s%s%s
\n
"
,
timeout
?
"Timeout "
:
""
,
data
&
HST_STS_FAIL
?
"Transaction Failed "
:
""
,
data
&
HST_STS_BUSERR
?
"No response or Bus Collision "
:
""
,
...
...
@@ -242,13 +256,15 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
}
outb_p
(((
addr
&
0x7f
)
<<
1
)
|
(
rw
&
0x01
),
SMB_HST_ADD
);
outb_p
(
inb_p
(
SMB_HST_CNTL2
)
|
(
size
<<
3
),
SMB_HST_CNTL2
);
outb_p
(
(
inb_p
(
SMB_HST_CNTL2
)
&
~
HST_CNTL2_SIZEMASK
)
|
(
size
<<
3
),
SMB_HST_CNTL2
);
/* Write the command register */
switch
(
size
)
{
case
HST_CNTL2_BYTE
:
if
(
rw
==
I2C_SMBUS_WRITE
)
outb_p
(
cmd
,
SMB_HST_CMD
);
/* Beware it uses DAT0 register and not CMD! */
outb_p
(
cmd
,
SMB_HST_DAT0
);
break
;
case
HST_CNTL2_BYTE_DATA
:
outb_p
(
cmd
,
SMB_HST_CMD
);
...
...
@@ -268,7 +284,7 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
goto
Done
;
}
if
((
error
=
ali1563_transaction
(
a
)))
if
((
error
=
ali1563_transaction
(
a
,
size
)))
goto
Done
;
if
((
rw
==
I2C_SMBUS_WRITE
)
||
(
size
==
HST_CNTL2_QUICK
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录