Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
4435b577
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4435b577
编写于
8月 20, 2018
作者:
J
Jiri Kosina
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.19/i2c-hid' into for-linus
Low voltage support for i2c-hid
上级
5a12d86c
6136f97c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
32 addition
and
35 deletion
+32
-35
Documentation/devicetree/bindings/input/hid-over-i2c.txt
Documentation/devicetree/bindings/input/hid-over-i2c.txt
+2
-1
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/i2c-hid/i2c-hid.c
+27
-30
include/linux/platform_data/i2c-hid.h
include/linux/platform_data/i2c-hid.h
+3
-4
未找到文件。
Documentation/devicetree/bindings/input/hid-over-i2c.txt
浏览文件 @
4435b577
...
...
@@ -26,7 +26,8 @@ device-specific compatible properties, which should be used in addition to the
- compatible:
* "wacom,w9013" (Wacom W9013 digitizer). Supports:
- vdd-supply
- vdd-supply (3.3V)
- vddl-supply (1.8V)
- post-power-on-delay-ms
- vdd-supply: phandle of the regulator that provides the supply voltage.
...
...
drivers/hid/i2c-hid/i2c-hid.c
浏览文件 @
4435b577
...
...
@@ -1002,18 +1002,18 @@ static int i2c_hid_probe(struct i2c_client *client,
return
client
->
irq
;
}
ihid
=
kzalloc
(
sizeof
(
struct
i2c_
hid
),
GFP_KERNEL
);
ihid
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
i
hid
),
GFP_KERNEL
);
if
(
!
ihid
)
return
-
ENOMEM
;
if
(
client
->
dev
.
of_node
)
{
ret
=
i2c_hid_of_probe
(
client
,
&
ihid
->
pdata
);
if
(
ret
)
goto
err
;
return
ret
;
}
else
if
(
!
platform_data
)
{
ret
=
i2c_hid_acpi_pdata
(
client
,
&
ihid
->
pdata
);
if
(
ret
)
goto
err
;
return
ret
;
}
else
{
ihid
->
pdata
=
*
platform_data
;
}
...
...
@@ -1021,21 +1021,20 @@ static int i2c_hid_probe(struct i2c_client *client,
/* Parse platform agnostic common properties from ACPI / device tree */
i2c_hid_fwnode_probe
(
client
,
&
ihid
->
pdata
);
ihid
->
pdata
.
supply
=
devm_regulator_get
(
&
client
->
dev
,
"vdd"
);
if
(
IS_ERR
(
ihid
->
pdata
.
supply
))
{
ret
=
PTR_ERR
(
ihid
->
pdata
.
supply
);
if
(
ret
!=
-
EPROBE_DEFER
)
dev_err
(
&
client
->
dev
,
"Failed to get regulator: %d
\n
"
,
ret
);
goto
err
;
}
ihid
->
pdata
.
supplies
[
0
].
supply
=
"vdd"
;
ihid
->
pdata
.
supplies
[
1
].
supply
=
"vddl"
;
ret
=
devm_regulator_bulk_get
(
&
client
->
dev
,
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
if
(
ret
)
return
ret
;
ret
=
regulator_bulk_enable
(
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
if
(
ret
<
0
)
return
ret
;
ret
=
regulator_enable
(
ihid
->
pdata
.
supply
);
if
(
ret
<
0
)
{
dev_err
(
&
client
->
dev
,
"Failed to enable regulator: %d
\n
"
,
ret
);
goto
err
;
}
if
(
ihid
->
pdata
.
post_power_delay_ms
)
msleep
(
ihid
->
pdata
.
post_power_delay_ms
);
...
...
@@ -1122,11 +1121,9 @@ static int i2c_hid_probe(struct i2c_client *client,
pm_runtime_disable
(
&
client
->
dev
);
err_regulator:
regulator_disable
(
ihid
->
pdata
.
supply
);
err:
regulator_bulk_disable
(
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
i2c_hid_free_buffers
(
ihid
);
kfree
(
ihid
);
return
ret
;
}
...
...
@@ -1148,9 +1145,8 @@ static int i2c_hid_remove(struct i2c_client *client)
if
(
ihid
->
bufsize
)
i2c_hid_free_buffers
(
ihid
);
regulator_disable
(
ihid
->
pdata
.
supply
);
kfree
(
ihid
);
regulator_bulk_disable
(
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
return
0
;
}
...
...
@@ -1201,9 +1197,8 @@ static int i2c_hid_suspend(struct device *dev)
hid_warn
(
hid
,
"Failed to enable irq wake: %d
\n
"
,
wake_status
);
}
else
{
ret
=
regulator_disable
(
ihid
->
pdata
.
supply
);
if
(
ret
<
0
)
hid_warn
(
hid
,
"Failed to disable supply: %d
\n
"
,
ret
);
regulator_bulk_disable
(
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
}
return
0
;
...
...
@@ -1218,9 +1213,11 @@ static int i2c_hid_resume(struct device *dev)
int
wake_status
;
if
(
!
device_may_wakeup
(
&
client
->
dev
))
{
ret
=
regulator_enable
(
ihid
->
pdata
.
supply
);
if
(
ret
<
0
)
hid_warn
(
hid
,
"Failed to enable supply: %d
\n
"
,
ret
);
ret
=
regulator_bulk_enable
(
ARRAY_SIZE
(
ihid
->
pdata
.
supplies
),
ihid
->
pdata
.
supplies
);
if
(
ret
)
hid_warn
(
hid
,
"Failed to enable supplies: %d
\n
"
,
ret
);
if
(
ihid
->
pdata
.
post_power_delay_ms
)
msleep
(
ihid
->
pdata
.
post_power_delay_ms
);
}
else
if
(
ihid
->
irq_wake_enabled
)
{
...
...
include/linux/platform_data/i2c-hid.h
浏览文件 @
4435b577
...
...
@@ -12,14 +12,13 @@
#ifndef __LINUX_I2C_HID_H
#define __LINUX_I2C_HID_H
#include <linux/regulator/consumer.h>
#include <linux/types.h>
struct
regulator
;
/**
* struct i2chid_platform_data - used by hid over i2c implementation.
* @hid_descriptor_address: i2c register where the HID descriptor is stored.
* @suppl
y: regulator
for powering on the device.
* @suppl
ies: regulators
for powering on the device.
* @post_power_delay_ms: delay after powering on before device is usable.
*
* Note that it is the responsibility of the platform driver (or the acpi 5.0
...
...
@@ -35,7 +34,7 @@ struct regulator;
*/
struct
i2c_hid_platform_data
{
u16
hid_descriptor_address
;
struct
regulator
*
supply
;
struct
regulator
_bulk_data
supplies
[
2
]
;
int
post_power_delay_ms
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录