Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
fb3de30c
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看板
提交
fb3de30c
编写于
1月 07, 2015
作者:
W
Wolfram Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
i2c: pmcmsp: make use of the new infrastructure for quirks
Signed-off-by:
N
Wolfram Sang
<
wsa@the-dreams.de
>
上级
f2325c54
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
26 deletion
+16
-26
drivers/i2c/busses/i2c-pmcmsp.c
drivers/i2c/busses/i2c-pmcmsp.c
+16
-26
未找到文件。
drivers/i2c/busses/i2c-pmcmsp.c
浏览文件 @
fb3de30c
...
...
@@ -456,14 +456,6 @@ static enum pmcmsptwi_xfer_result pmcmsptwi_xfer_cmd(
return
-
EINVAL
;
}
if
(
cmd
->
read_len
>
MSP_MAX_BYTES_PER_RW
||
cmd
->
write_len
>
MSP_MAX_BYTES_PER_RW
)
{
dev_err
(
&
pmcmsptwi_adapter
.
dev
,
"%s: Cannot transfer more than %d bytes
\n
"
,
__func__
,
MSP_MAX_BYTES_PER_RW
);
return
-
EINVAL
;
}
mutex_lock
(
&
data
->
lock
);
dev_dbg
(
&
pmcmsptwi_adapter
.
dev
,
"Setting address to 0x%04x
\n
"
,
cmd
->
addr
);
...
...
@@ -520,25 +512,14 @@ static int pmcmsptwi_master_xfer(struct i2c_adapter *adap,
struct
pmcmsptwi_cfg
oldcfg
,
newcfg
;
int
ret
;
if
(
num
>
2
)
{
dev_dbg
(
&
adap
->
dev
,
"%d messages unsupported
\n
"
,
num
);
return
-
EINVAL
;
}
else
if
(
num
==
2
)
{
/* Check for a dual write-then-read command */
if
(
num
==
2
)
{
struct
i2c_msg
*
nextmsg
=
msg
+
1
;
if
(
!
(
msg
->
flags
&
I2C_M_RD
)
&&
(
nextmsg
->
flags
&
I2C_M_RD
)
&&
msg
->
addr
==
nextmsg
->
addr
)
{
cmd
.
type
=
MSP_TWI_CMD_WRITE_READ
;
cmd
.
write_len
=
msg
->
len
;
cmd
.
write_data
=
msg
->
buf
;
cmd
.
read_len
=
nextmsg
->
len
;
cmd
.
read_data
=
nextmsg
->
buf
;
}
else
{
dev_dbg
(
&
adap
->
dev
,
"Non write-read dual messages unsupported
\n
"
);
return
-
EINVAL
;
}
cmd
.
type
=
MSP_TWI_CMD_WRITE_READ
;
cmd
.
write_len
=
msg
->
len
;
cmd
.
write_data
=
msg
->
buf
;
cmd
.
read_len
=
nextmsg
->
len
;
cmd
.
read_data
=
nextmsg
->
buf
;
}
else
if
(
msg
->
flags
&
I2C_M_RD
)
{
cmd
.
type
=
MSP_TWI_CMD_READ
;
cmd
.
read_len
=
msg
->
len
;
...
...
@@ -598,6 +579,14 @@ static u32 pmcmsptwi_i2c_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_WORD_DATA
|
I2C_FUNC_SMBUS_PROC_CALL
;
}
static
struct
i2c_adapter_quirks
pmcmsptwi_i2c_quirks
=
{
.
flags
=
I2C_AQ_COMB_WRITE_THEN_READ
,
.
max_write_len
=
MSP_MAX_BYTES_PER_RW
,
.
max_read_len
=
MSP_MAX_BYTES_PER_RW
,
.
max_comb_1st_msg_len
=
MSP_MAX_BYTES_PER_RW
,
.
max_comb_2nd_msg_len
=
MSP_MAX_BYTES_PER_RW
,
};
/* -- Initialization -- */
static
struct
i2c_algorithm
pmcmsptwi_algo
=
{
...
...
@@ -609,6 +598,7 @@ static struct i2c_adapter pmcmsptwi_adapter = {
.
owner
=
THIS_MODULE
,
.
class
=
I2C_CLASS_HWMON
|
I2C_CLASS_SPD
,
.
algo
=
&
pmcmsptwi_algo
,
.
quirks
=
&
pmcmsptwi_i2c_quirks
,
.
name
=
DRV_NAME
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录