Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
72d0beb4
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
72d0beb4
编写于
6月 08, 2018
作者:
J
Jiri Kosina
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.18/i2c-hid' into for-linus
Assorted smaller fixes to i2c-hid driver
上级
37acd687
d44c2816
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
8 deletion
+25
-8
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/i2c-hid/i2c-hid.c
+25
-8
未找到文件。
drivers/hid/i2c-hid/i2c-hid.c
浏览文件 @
72d0beb4
...
...
@@ -131,8 +131,6 @@ static const struct i2c_hid_cmd hid_no_cmd = { .length = 0 };
* static const struct i2c_hid_cmd hid_set_protocol_cmd = { I2C_HID_CMD(0x07) };
*/
static
DEFINE_MUTEX
(
i2c_hid_open_mut
);
/* The main device structure */
struct
i2c_hid
{
struct
i2c_client
*
client
;
/* i2c client */
...
...
@@ -868,6 +866,15 @@ static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
}
#ifdef CONFIG_ACPI
static
const
struct
acpi_device_id
i2c_hid_acpi_blacklist
[]
=
{
/*
* The CHPN0001 ACPI device, which is used to describe the Chipone
* ICN8505 controller, has a _CID of PNP0C50 but is not HID compatible.
*/
{
"CHPN0001"
,
0
},
{
},
};
static
int
i2c_hid_acpi_pdata
(
struct
i2c_client
*
client
,
struct
i2c_hid_platform_data
*
pdata
)
{
...
...
@@ -879,13 +886,18 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
acpi_handle
handle
;
handle
=
ACPI_HANDLE
(
&
client
->
dev
);
if
(
!
handle
||
acpi_bus_get_device
(
handle
,
&
adev
))
if
(
!
handle
||
acpi_bus_get_device
(
handle
,
&
adev
))
{
dev_err
(
&
client
->
dev
,
"Error could not get ACPI device
\n
"
);
return
-
ENODEV
;
}
if
(
acpi_match_device_ids
(
adev
,
i2c_hid_acpi_blacklist
)
==
0
)
return
-
ENODEV
;
obj
=
acpi_evaluate_dsm_typed
(
handle
,
&
i2c_hid_guid
,
1
,
1
,
NULL
,
ACPI_TYPE_INTEGER
);
if
(
!
obj
)
{
dev_err
(
&
client
->
dev
,
"
device _DSM execution
failed
\n
"
);
dev_err
(
&
client
->
dev
,
"
Error _DSM call to get HID descriptor address
failed
\n
"
);
return
-
ENODEV
;
}
...
...
@@ -1000,11 +1012,8 @@ static int i2c_hid_probe(struct i2c_client *client,
goto
err
;
}
else
if
(
!
platform_data
)
{
ret
=
i2c_hid_acpi_pdata
(
client
,
&
ihid
->
pdata
);
if
(
ret
)
{
dev_err
(
&
client
->
dev
,
"HID register address not provided
\n
"
);
if
(
ret
)
goto
err
;
}
}
else
{
ihid
->
pdata
=
*
platform_data
;
}
...
...
@@ -1054,6 +1063,14 @@ static int i2c_hid_probe(struct i2c_client *client,
pm_runtime_enable
(
&
client
->
dev
);
device_enable_async_suspend
(
&
client
->
dev
);
/* Make sure there is something at this address */
ret
=
i2c_smbus_read_byte
(
client
);
if
(
ret
<
0
)
{
dev_dbg
(
&
client
->
dev
,
"nothing at this address: %d
\n
"
,
ret
);
ret
=
-
ENXIO
;
goto
err_pm
;
}
ret
=
i2c_hid_fetch_hid_descriptor
(
ihid
);
if
(
ret
<
0
)
goto
err_pm
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录