Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
1ad13028
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看板
提交
1ad13028
编写于
9月 01, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
上级
5288be36
84fcf447
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
20 deletion
+31
-20
drivers/regulator/core.c
drivers/regulator/core.c
+26
-18
include/linux/regulator/consumer.h
include/linux/regulator/consumer.h
+5
-2
未找到文件。
drivers/regulator/core.c
浏览文件 @
1ad13028
...
...
@@ -323,13 +323,14 @@ static ssize_t regulator_uA_show(struct device *dev,
}
static
DEVICE_ATTR
(
microamps
,
0444
,
regulator_uA_show
,
NULL
);
static
ssize_t
regulator_name_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
name_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%s
\n
"
,
rdev_get_name
(
rdev
));
}
static
DEVICE_ATTR_RO
(
name
);
static
ssize_t
regulator_print_opmode
(
char
*
buf
,
int
mode
)
{
...
...
@@ -489,15 +490,16 @@ static ssize_t regulator_total_uA_show(struct device *dev,
}
static
DEVICE_ATTR
(
requested_microamps
,
0444
,
regulator_total_uA_show
,
NULL
);
static
ssize_t
regulator_num_users_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
num_users_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
return
sprintf
(
buf
,
"%d
\n
"
,
rdev
->
use_count
);
}
static
DEVICE_ATTR_RO
(
num_users
);
static
ssize_t
regulator_type_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
static
ssize_t
type_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
regulator_dev
*
rdev
=
dev_get_drvdata
(
dev
);
...
...
@@ -509,6 +511,7 @@ static ssize_t regulator_type_show(struct device *dev,
}
return
sprintf
(
buf
,
"unknown
\n
"
);
}
static
DEVICE_ATTR_RO
(
type
);
static
ssize_t
regulator_suspend_mem_uV_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
...
...
@@ -632,12 +635,13 @@ static DEVICE_ATTR(bypass, 0444,
* These are the only attributes are present for all regulators.
* Other attributes are a function of regulator functionality.
*/
static
struct
device_attribute
regulator_dev_attrs
[]
=
{
__ATTR
(
name
,
0444
,
regulator_name_show
,
NULL
)
,
__ATTR
(
num_users
,
0444
,
regulator_num_users_show
,
NULL
)
,
__ATTR
(
type
,
0444
,
regulator_type_show
,
NULL
)
,
__ATTR_
NULL
,
static
struct
attribute
*
regulator_dev_attrs
[]
=
{
&
dev_attr_name
.
attr
,
&
dev_attr_num_users
.
attr
,
&
dev_attr_type
.
attr
,
NULL
,
};
ATTRIBUTE_GROUPS
(
regulator_dev
);
static
void
regulator_dev_release
(
struct
device
*
dev
)
{
...
...
@@ -648,7 +652,7 @@ static void regulator_dev_release(struct device *dev)
static
struct
class
regulator_class
=
{
.
name
=
"regulator"
,
.
dev_release
=
regulator_dev_release
,
.
dev_
attrs
=
regulator_dev_attr
s
,
.
dev_
groups
=
regulator_dev_group
s
,
};
/* Calculate the new optimum regulator operating mode based on the new total
...
...
@@ -1238,7 +1242,7 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
/* Internal regulator request function */
static
struct
regulator
*
_regulator_get
(
struct
device
*
dev
,
const
char
*
id
,
int
exclusive
)
bool
exclusive
)
{
struct
regulator_dev
*
rdev
;
struct
regulator
*
regulator
=
ERR_PTR
(
-
EPROBE_DEFER
);
...
...
@@ -1344,7 +1348,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
*/
struct
regulator
*
regulator_get
(
struct
device
*
dev
,
const
char
*
id
)
{
return
_regulator_get
(
dev
,
id
,
0
);
return
_regulator_get
(
dev
,
id
,
false
);
}
EXPORT_SYMBOL_GPL
(
regulator_get
);
...
...
@@ -1405,7 +1409,7 @@ EXPORT_SYMBOL_GPL(devm_regulator_get);
*/
struct
regulator
*
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
{
return
_regulator_get
(
dev
,
id
,
1
);
return
_regulator_get
(
dev
,
id
,
true
);
}
EXPORT_SYMBOL_GPL
(
regulator_get_exclusive
);
...
...
@@ -1890,8 +1894,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
rdev
->
deferred_disables
++
;
mutex_unlock
(
&
rdev
->
mutex
);
ret
=
schedule_delayed_work
(
&
rdev
->
disable_work
,
msecs_to_jiffies
(
ms
));
ret
=
queue_delayed_work
(
system_power_efficient_wq
,
&
rdev
->
disable_work
,
msecs_to_jiffies
(
ms
));
if
(
ret
<
0
)
return
ret
;
else
...
...
@@ -3835,8 +3840,11 @@ void regulator_unregister(struct regulator_dev *rdev)
if
(
rdev
==
NULL
)
return
;
if
(
rdev
->
supply
)
if
(
rdev
->
supply
)
{
while
(
rdev
->
use_count
--
)
regulator_disable
(
rdev
->
supply
);
regulator_put
(
rdev
->
supply
);
}
mutex_lock
(
&
regulator_list_mutex
);
debugfs_remove_recursive
(
rdev
->
debugfs
);
flush_work
(
&
rdev
->
disable_work
.
work
);
...
...
include/linux/regulator/consumer.h
浏览文件 @
1ad13028
...
...
@@ -369,8 +369,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
static
inline
int
regulator_set_voltage_tol
(
struct
regulator
*
regulator
,
int
new_uV
,
int
tol_uV
)
{
return
regulator_set_voltage
(
regulator
,
new_uV
-
tol_uV
,
new_uV
+
tol_uV
);
if
(
regulator_set_voltage
(
regulator
,
new_uV
,
new_uV
+
tol_uV
)
==
0
)
return
0
;
else
return
regulator_set_voltage
(
regulator
,
new_uV
-
tol_uV
,
new_uV
+
tol_uV
);
}
static
inline
int
regulator_is_supported_voltage_tol
(
struct
regulator
*
regulator
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录