Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
aef393da
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
aef393da
编写于
10月 24, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/optional' into regulator-next
上级
88c260a1
4040394e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
49 deletion
+15
-49
drivers/regulator/Kconfig
drivers/regulator/Kconfig
+0
-10
drivers/regulator/core.c
drivers/regulator/core.c
+15
-34
include/linux/regulator/machine.h
include/linux/regulator/machine.h
+0
-5
未找到文件。
drivers/regulator/Kconfig
浏览文件 @
aef393da
...
@@ -28,16 +28,6 @@ config REGULATOR_DEBUG
...
@@ -28,16 +28,6 @@ config REGULATOR_DEBUG
help
help
Say yes here to enable debugging support.
Say yes here to enable debugging support.
config REGULATOR_DUMMY
bool "Provide a dummy regulator if regulator lookups fail"
help
If this option is enabled then when a regulator lookup fails
and the board has not specified that it has provided full
constraints the regulator core will provide an always
enabled dummy regulator, allowing consumer drivers to continue.
A warning will be generated when this substitution is done.
config REGULATOR_FIXED_VOLTAGE
config REGULATOR_FIXED_VOLTAGE
tristate "Fixed voltage regulator support"
tristate "Fixed voltage regulator support"
help
help
...
...
drivers/regulator/core.c
浏览文件 @
aef393da
...
@@ -55,7 +55,6 @@ static LIST_HEAD(regulator_map_list);
...
@@ -55,7 +55,6 @@ static LIST_HEAD(regulator_map_list);
static
LIST_HEAD
(
regulator_ena_gpio_list
);
static
LIST_HEAD
(
regulator_ena_gpio_list
);
static
LIST_HEAD
(
regulator_supply_alias_list
);
static
LIST_HEAD
(
regulator_supply_alias_list
);
static
bool
has_full_constraints
;
static
bool
has_full_constraints
;
static
bool
board_wants_dummy_regulator
;
static
struct
dentry
*
debugfs_root
;
static
struct
dentry
*
debugfs_root
;
...
@@ -1303,12 +1302,12 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
...
@@ -1303,12 +1302,12 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
/* Internal regulator request function */
/* Internal regulator request function */
static
struct
regulator
*
_regulator_get
(
struct
device
*
dev
,
const
char
*
id
,
static
struct
regulator
*
_regulator_get
(
struct
device
*
dev
,
const
char
*
id
,
bool
exclusive
)
bool
exclusive
,
bool
allow_dummy
)
{
{
struct
regulator_dev
*
rdev
;
struct
regulator_dev
*
rdev
;
struct
regulator
*
regulator
=
ERR_PTR
(
-
EPROBE_DEFER
);
struct
regulator
*
regulator
=
ERR_PTR
(
-
EPROBE_DEFER
);
const
char
*
devname
=
NULL
;
const
char
*
devname
=
NULL
;
int
ret
=
0
;
int
ret
=
-
EPROBE_DEFER
;
if
(
id
==
NULL
)
{
if
(
id
==
NULL
)
{
pr_err
(
"get() with no identifier
\n
"
);
pr_err
(
"get() with no identifier
\n
"
);
...
@@ -1324,34 +1323,32 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
...
@@ -1324,34 +1323,32 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
if
(
rdev
)
if
(
rdev
)
goto
found
;
goto
found
;
regulator
=
ERR_PTR
(
ret
);
/*
/*
* If we have return value from dev_lookup fail, we do not expect to
* If we have return value from dev_lookup fail, we do not expect to
* succeed, so, quit with appropriate error value
* succeed, so, quit with appropriate error value
*/
*/
if
(
ret
)
{
if
(
ret
&&
ret
!=
-
ENODEV
)
{
regulator
=
ERR_PTR
(
ret
);
goto
out
;
goto
out
;
}
}
if
(
board_wants_dummy_regulator
)
{
rdev
=
dummy_regulator_rdev
;
goto
found
;
}
#ifdef CONFIG_REGULATOR_DUMMY
if
(
!
devname
)
if
(
!
devname
)
devname
=
"deviceless"
;
devname
=
"deviceless"
;
/* If the board didn't flag that it was fully constrained then
/*
* substitute in a dummy regulator so consumers can continue.
* Assume that a regulator is physically present and enabled
* even if it isn't hooked up and just provide a dummy.
*/
*/
if
(
!
has_full_constraints
)
{
if
(
has_full_constraints
&&
allow_dummy
)
{
pr_warn
(
"%s supply %s not found, using dummy regulator
\n
"
,
pr_warn
(
"%s supply %s not found, using dummy regulator
\n
"
,
devname
,
id
);
devname
,
id
);
rdev
=
dummy_regulator_rdev
;
rdev
=
dummy_regulator_rdev
;
goto
found
;
goto
found
;
}
else
{
dev_err
(
dev
,
"dummy supplies not allowed
\n
"
);
}
}
#endif
mutex_unlock
(
&
regulator_list_mutex
);
mutex_unlock
(
&
regulator_list_mutex
);
return
regulator
;
return
regulator
;
...
@@ -1409,7 +1406,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
...
@@ -1409,7 +1406,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
*/
*/
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
,
false
);
return
_regulator_get
(
dev
,
id
,
false
,
true
);
}
}
EXPORT_SYMBOL_GPL
(
regulator_get
);
EXPORT_SYMBOL_GPL
(
regulator_get
);
...
@@ -1436,7 +1433,7 @@ EXPORT_SYMBOL_GPL(regulator_get);
...
@@ -1436,7 +1433,7 @@ EXPORT_SYMBOL_GPL(regulator_get);
*/
*/
struct
regulator
*
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
struct
regulator
*
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
{
{
return
_regulator_get
(
dev
,
id
,
true
);
return
_regulator_get
(
dev
,
id
,
true
,
false
);
}
}
EXPORT_SYMBOL_GPL
(
regulator_get_exclusive
);
EXPORT_SYMBOL_GPL
(
regulator_get_exclusive
);
...
@@ -1465,7 +1462,7 @@ EXPORT_SYMBOL_GPL(regulator_get_exclusive);
...
@@ -1465,7 +1462,7 @@ EXPORT_SYMBOL_GPL(regulator_get_exclusive);
*/
*/
struct
regulator
*
regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
struct
regulator
*
regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
{
{
return
_regulator_get
(
dev
,
id
,
0
);
return
_regulator_get
(
dev
,
id
,
false
,
false
);
}
}
EXPORT_SYMBOL_GPL
(
regulator_get_optional
);
EXPORT_SYMBOL_GPL
(
regulator_get_optional
);
...
@@ -3663,22 +3660,6 @@ void regulator_has_full_constraints(void)
...
@@ -3663,22 +3660,6 @@ void regulator_has_full_constraints(void)
}
}
EXPORT_SYMBOL_GPL
(
regulator_has_full_constraints
);
EXPORT_SYMBOL_GPL
(
regulator_has_full_constraints
);
/**
* regulator_use_dummy_regulator - Provide a dummy regulator when none is found
*
* Calling this function will cause the regulator API to provide a
* dummy regulator to consumers if no physical regulator is found,
* allowing most consumers to proceed as though a regulator were
* configured. This allows systems such as those with software
* controllable regulators for the CPU core only to be brought up more
* readily.
*/
void
regulator_use_dummy_regulator
(
void
)
{
board_wants_dummy_regulator
=
true
;
}
EXPORT_SYMBOL_GPL
(
regulator_use_dummy_regulator
);
/**
/**
* rdev_get_drvdata - get rdev regulator driver data
* rdev_get_drvdata - get rdev regulator driver data
* @rdev: regulator
* @rdev: regulator
...
...
include/linux/regulator/machine.h
浏览文件 @
aef393da
...
@@ -195,15 +195,10 @@ int regulator_suspend_finish(void);
...
@@ -195,15 +195,10 @@ int regulator_suspend_finish(void);
#ifdef CONFIG_REGULATOR
#ifdef CONFIG_REGULATOR
void
regulator_has_full_constraints
(
void
);
void
regulator_has_full_constraints
(
void
);
void
regulator_use_dummy_regulator
(
void
);
#else
#else
static
inline
void
regulator_has_full_constraints
(
void
)
static
inline
void
regulator_has_full_constraints
(
void
)
{
{
}
}
static
inline
void
regulator_use_dummy_regulator
(
void
)
{
}
#endif
#endif
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录