Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f27a5fb4
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看板
提交
f27a5fb4
编写于
9月 01, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/optional' into regulator-next
上级
6979380d
9efdd276
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
121 addition
and
7 deletion
+121
-7
drivers/cpufreq/cpufreq-cpu0.c
drivers/cpufreq/cpufreq-cpu0.c
+1
-1
drivers/hwmon/sht15.c
drivers/hwmon/sht15.c
+1
-1
drivers/mmc/core/core.c
drivers/mmc/core/core.c
+1
-1
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.c
+1
-1
drivers/mmc/host/pxamci.c
drivers/mmc/host/pxamci.c
+1
-1
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.c
+2
-2
drivers/regulator/core.c
drivers/regulator/core.c
+89
-0
include/linux/regulator/consumer.h
include/linux/regulator/consumer.h
+25
-0
未找到文件。
drivers/cpufreq/cpufreq-cpu0.c
浏览文件 @
f27a5fb4
...
...
@@ -197,7 +197,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
cpu_dev
=
&
pdev
->
dev
;
cpu_dev
->
of_node
=
np
;
cpu_reg
=
devm_regulator_get
(
cpu_dev
,
"cpu0"
);
cpu_reg
=
devm_regulator_get
_optional
(
cpu_dev
,
"cpu0"
);
if
(
IS_ERR
(
cpu_reg
))
{
/*
* If cpu0 regulator supply node is present, but regulator is
...
...
drivers/hwmon/sht15.c
浏览文件 @
f27a5fb4
...
...
@@ -957,7 +957,7 @@ static int sht15_probe(struct platform_device *pdev)
* If a regulator is available,
* query what the supply voltage actually is!
*/
data
->
reg
=
devm_regulator_get
(
data
->
dev
,
"vcc"
);
data
->
reg
=
devm_regulator_get
_optional
(
data
->
dev
,
"vcc"
);
if
(
!
IS_ERR
(
data
->
reg
))
{
int
voltage
;
...
...
drivers/mmc/core/core.c
浏览文件 @
f27a5fb4
...
...
@@ -1313,7 +1313,7 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
supply
=
devm_regulator_get
(
dev
,
"vmmc"
);
mmc
->
supply
.
vmmc
=
supply
;
mmc
->
supply
.
vqmmc
=
devm_regulator_get
(
dev
,
"vqmmc"
);
mmc
->
supply
.
vqmmc
=
devm_regulator_get
_optional
(
dev
,
"vqmmc"
);
if
(
IS_ERR
(
supply
))
return
PTR_ERR
(
supply
);
...
...
drivers/mmc/host/dw_mmc.c
浏览文件 @
f27a5fb4
...
...
@@ -2231,7 +2231,7 @@ int dw_mci_probe(struct dw_mci *host)
}
}
host
->
vmmc
=
devm_regulator_get
(
host
->
dev
,
"vmmc"
);
host
->
vmmc
=
devm_regulator_get
_optional
(
host
->
dev
,
"vmmc"
);
if
(
IS_ERR
(
host
->
vmmc
))
{
ret
=
PTR_ERR
(
host
->
vmmc
);
if
(
ret
==
-
EPROBE_DEFER
)
...
...
drivers/mmc/host/pxamci.c
浏览文件 @
f27a5fb4
...
...
@@ -83,7 +83,7 @@ struct pxamci_host {
static
inline
void
pxamci_init_ocr
(
struct
pxamci_host
*
host
)
{
#ifdef CONFIG_REGULATOR
host
->
vcc
=
regulator_get
(
mmc_dev
(
host
->
mmc
),
"vmmc"
);
host
->
vcc
=
regulator_get
_optional
(
mmc_dev
(
host
->
mmc
),
"vmmc"
);
if
(
IS_ERR
(
host
->
vcc
))
host
->
vcc
=
NULL
;
...
...
drivers/mmc/host/sdhci.c
浏览文件 @
f27a5fb4
...
...
@@ -2966,7 +2966,7 @@ int sdhci_add_host(struct sdhci_host *host)
mmc
->
caps
|=
MMC_CAP_NEEDS_POLL
;
/* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
host
->
vqmmc
=
regulator_get
(
mmc_dev
(
mmc
),
"vqmmc"
);
host
->
vqmmc
=
regulator_get
_optional
(
mmc_dev
(
mmc
),
"vqmmc"
);
if
(
IS_ERR_OR_NULL
(
host
->
vqmmc
))
{
if
(
PTR_ERR
(
host
->
vqmmc
)
<
0
)
{
pr_info
(
"%s: no vqmmc regulator found
\n
"
,
...
...
@@ -3042,7 +3042,7 @@ int sdhci_add_host(struct sdhci_host *host)
ocr_avail
=
0
;
host
->
vmmc
=
regulator_get
(
mmc_dev
(
mmc
),
"vmmc"
);
host
->
vmmc
=
regulator_get
_optional
(
mmc_dev
(
mmc
),
"vmmc"
);
if
(
IS_ERR_OR_NULL
(
host
->
vmmc
))
{
if
(
PTR_ERR
(
host
->
vmmc
)
<
0
)
{
pr_info
(
"%s: no vmmc regulator found
\n
"
,
...
...
drivers/regulator/core.c
浏览文件 @
f27a5fb4
...
...
@@ -1413,6 +1413,65 @@ struct regulator *regulator_get_exclusive(struct device *dev, const char *id)
}
EXPORT_SYMBOL_GPL
(
regulator_get_exclusive
);
/**
* regulator_get_optional - obtain optional access to a regulator.
* @dev: device for regulator "consumer"
* @id: Supply name or regulator ID.
*
* Returns a struct regulator corresponding to the regulator producer,
* or IS_ERR() condition containing errno. Other consumers will be
* unable to obtain this reference is held and the use count for the
* regulator will be initialised to reflect the current state of the
* regulator.
*
* This is intended for use by consumers for devices which can have
* some supplies unconnected in normal use, such as some MMC devices.
* It can allow the regulator core to provide stub supplies for other
* supplies requested using normal regulator_get() calls without
* disrupting the operation of drivers that can handle absent
* supplies.
*
* Use of supply names configured via regulator_set_device_supply() is
* strongly encouraged. It is recommended that the supply name used
* should match the name used for the supply and/or the relevant
* device pins in the datasheet.
*/
struct
regulator
*
regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
{
return
_regulator_get
(
dev
,
id
,
0
);
}
EXPORT_SYMBOL_GPL
(
regulator_get_optional
);
/**
* devm_regulator_get_optional - Resource managed regulator_get_optional()
* @dev: device for regulator "consumer"
* @id: Supply name or regulator ID.
*
* Managed regulator_get_optional(). Regulators returned from this
* function are automatically regulator_put() on driver detach. See
* regulator_get_optional() for more information.
*/
struct
regulator
*
devm_regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
{
struct
regulator
**
ptr
,
*
regulator
;
ptr
=
devres_alloc
(
devm_regulator_release
,
sizeof
(
*
ptr
),
GFP_KERNEL
);
if
(
!
ptr
)
return
ERR_PTR
(
-
ENOMEM
);
regulator
=
regulator_get_optional
(
dev
,
id
);
if
(
!
IS_ERR
(
regulator
))
{
*
ptr
=
regulator
;
devres_add
(
dev
,
ptr
);
}
else
{
devres_free
(
ptr
);
}
return
regulator
;
}
EXPORT_SYMBOL_GPL
(
devm_regulator_get_optional
);
/* Locks held by regulator_put() */
static
void
_regulator_put
(
struct
regulator
*
regulator
)
{
...
...
@@ -1438,6 +1497,36 @@ static void _regulator_put(struct regulator *regulator)
module_put
(
rdev
->
owner
);
}
/**
* devm_regulator_get_exclusive - Resource managed regulator_get_exclusive()
* @dev: device for regulator "consumer"
* @id: Supply name or regulator ID.
*
* Managed regulator_get_exclusive(). Regulators returned from this function
* are automatically regulator_put() on driver detach. See regulator_get() for
* more information.
*/
struct
regulator
*
devm_regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
{
struct
regulator
**
ptr
,
*
regulator
;
ptr
=
devres_alloc
(
devm_regulator_release
,
sizeof
(
*
ptr
),
GFP_KERNEL
);
if
(
!
ptr
)
return
ERR_PTR
(
-
ENOMEM
);
regulator
=
_regulator_get
(
dev
,
id
,
1
);
if
(
!
IS_ERR
(
regulator
))
{
*
ptr
=
regulator
;
devres_add
(
dev
,
ptr
);
}
else
{
devres_free
(
ptr
);
}
return
regulator
;
}
EXPORT_SYMBOL_GPL
(
devm_regulator_get_exclusive
);
/**
* regulator_put - "free" the regulator source
* @regulator: regulator source
...
...
include/linux/regulator/consumer.h
浏览文件 @
f27a5fb4
...
...
@@ -137,6 +137,12 @@ struct regulator *__must_check devm_regulator_get(struct device *dev,
const
char
*
id
);
struct
regulator
*
__must_check
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
);
struct
regulator
*
__must_check
devm_regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
);
struct
regulator
*
__must_check
regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
);
struct
regulator
*
__must_check
devm_regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
);
void
regulator_put
(
struct
regulator
*
regulator
);
void
devm_regulator_put
(
struct
regulator
*
regulator
);
...
...
@@ -217,6 +223,25 @@ devm_regulator_get(struct device *dev, const char *id)
return
NULL
;
}
static
inline
struct
regulator
*
__must_check
regulator_get_exclusive
(
struct
device
*
dev
,
const
char
*
id
)
{
return
NULL
;
}
static
inline
struct
regulator
*
__must_check
regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
{
return
NULL
;
}
static
inline
struct
regulator
*
__must_check
devm_regulator_get_optional
(
struct
device
*
dev
,
const
char
*
id
)
{
return
NULL
;
}
static
inline
void
regulator_put
(
struct
regulator
*
regulator
)
{
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录