Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
706664c2
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看板
提交
706664c2
编写于
10月 24, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/fixed' into regulator-next
上级
b735e47f
609d5f6d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
33 deletion
+12
-33
drivers/regulator/core.c
drivers/regulator/core.c
+4
-1
drivers/regulator/fixed.c
drivers/regulator/fixed.c
+6
-32
include/linux/regulator/driver.h
include/linux/regulator/driver.h
+2
-0
未找到文件。
drivers/regulator/core.c
浏览文件 @
706664c2
...
...
@@ -2582,6 +2582,8 @@ static int _regulator_get_voltage(struct regulator_dev *rdev)
ret
=
rdev
->
desc
->
ops
->
get_voltage
(
rdev
);
}
else
if
(
rdev
->
desc
->
ops
->
list_voltage
)
{
ret
=
rdev
->
desc
->
ops
->
list_voltage
(
rdev
,
0
);
}
else
if
(
rdev
->
desc
->
fixed_uV
&&
(
rdev
->
desc
->
n_voltages
==
1
))
{
ret
=
rdev
->
desc
->
fixed_uV
;
}
else
{
return
-
EINVAL
;
}
...
...
@@ -3217,7 +3219,8 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
/* some attributes need specific methods to be displayed */
if
((
ops
->
get_voltage
&&
ops
->
get_voltage
(
rdev
)
>=
0
)
||
(
ops
->
get_voltage_sel
&&
ops
->
get_voltage_sel
(
rdev
)
>=
0
)
||
(
ops
->
list_voltage
&&
ops
->
list_voltage
(
rdev
,
0
)
>=
0
))
{
(
ops
->
list_voltage
&&
ops
->
list_voltage
(
rdev
,
0
)
>=
0
)
||
(
rdev
->
desc
->
fixed_uV
&&
(
rdev
->
desc
->
n_voltages
==
1
)))
{
status
=
device_create_file
(
dev
,
&
dev_attr_microvolts
);
if
(
status
<
0
)
return
status
;
...
...
drivers/regulator/fixed.c
浏览文件 @
706664c2
...
...
@@ -34,7 +34,6 @@
struct
fixed_voltage_data
{
struct
regulator_desc
desc
;
struct
regulator_dev
*
dev
;
int
microvolts
;
};
...
...
@@ -108,30 +107,7 @@ of_get_fixed_voltage_config(struct device *dev)
return
config
;
}
static
int
fixed_voltage_get_voltage
(
struct
regulator_dev
*
dev
)
{
struct
fixed_voltage_data
*
data
=
rdev_get_drvdata
(
dev
);
if
(
data
->
microvolts
)
return
data
->
microvolts
;
else
return
-
EINVAL
;
}
static
int
fixed_voltage_list_voltage
(
struct
regulator_dev
*
dev
,
unsigned
selector
)
{
struct
fixed_voltage_data
*
data
=
rdev_get_drvdata
(
dev
);
if
(
selector
!=
0
)
return
-
EINVAL
;
return
data
->
microvolts
;
}
static
struct
regulator_ops
fixed_voltage_ops
=
{
.
get_voltage
=
fixed_voltage_get_voltage
,
.
list_voltage
=
fixed_voltage_list_voltage
,
};
static
int
reg_fixed_voltage_probe
(
struct
platform_device
*
pdev
)
...
...
@@ -186,23 +162,21 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
if
(
config
->
microvolts
)
drvdata
->
desc
.
n_voltages
=
1
;
drvdata
->
microvolts
=
config
->
microvolts
;
drvdata
->
desc
.
fixed_uV
=
config
->
microvolts
;
if
(
config
->
gpio
>=
0
)
cfg
.
ena_gpio
=
config
->
gpio
;
cfg
.
ena_gpio_invert
=
!
config
->
enable_high
;
if
(
config
->
enabled_at_boot
)
{
if
(
config
->
enable_high
)
{
if
(
config
->
enable_high
)
cfg
.
ena_gpio_flags
|=
GPIOF_OUT_INIT_HIGH
;
}
else
{
else
cfg
.
ena_gpio_flags
|=
GPIOF_OUT_INIT_LOW
;
}
}
else
{
if
(
config
->
enable_high
)
{
if
(
config
->
enable_high
)
cfg
.
ena_gpio_flags
|=
GPIOF_OUT_INIT_LOW
;
}
else
{
else
cfg
.
ena_gpio_flags
|=
GPIOF_OUT_INIT_HIGH
;
}
}
if
(
config
->
gpio_is_open_drain
)
cfg
.
ena_gpio_flags
|=
GPIOF_OPEN_DRAIN
;
...
...
@@ -222,7 +196,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
platform_set_drvdata
(
pdev
,
drvdata
);
dev_dbg
(
&
pdev
->
dev
,
"%s supplying %duV
\n
"
,
drvdata
->
desc
.
name
,
drvdata
->
microvolts
);
drvdata
->
desc
.
fixed_uV
);
return
0
;
...
...
include/linux/regulator/driver.h
浏览文件 @
706664c2
...
...
@@ -209,6 +209,7 @@ enum regulator_type {
* @min_uV: Voltage given by the lowest selector (if linear mapping)
* @uV_step: Voltage increase with each selector (if linear mapping)
* @linear_min_sel: Minimal selector for starting linear mapping
* @fixed_uV: Fixed voltage of rails.
* @ramp_delay: Time to settle down after voltage change (unit: uV/us)
* @volt_table: Voltage mapping table (if table based mapping)
*
...
...
@@ -241,6 +242,7 @@ struct regulator_desc {
unsigned
int
min_uV
;
unsigned
int
uV_step
;
unsigned
int
linear_min_sel
;
int
fixed_uV
;
unsigned
int
ramp_delay
;
const
struct
regulator_linear_range
*
linear_ranges
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录