Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
aa11a358
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
aa11a358
编写于
10月 24, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'regulator/topic/stw481x' into regulator-next
上级
67471b6a
18dca93e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
120 addition
and
0 deletion
+120
-0
drivers/regulator/Kconfig
drivers/regulator/Kconfig
+8
-0
drivers/regulator/Makefile
drivers/regulator/Makefile
+1
-0
drivers/regulator/stw481x-vmmc.c
drivers/regulator/stw481x-vmmc.c
+111
-0
未找到文件。
drivers/regulator/Kconfig
浏览文件 @
aa11a358
...
@@ -427,6 +427,14 @@ config REGULATOR_TI_ABB
...
@@ -427,6 +427,14 @@ config REGULATOR_TI_ABB
on TI SoCs may be unstable without enabling this as it provides
on TI SoCs may be unstable without enabling this as it provides
device specific optimized bias to allow/optimize functionality.
device specific optimized bias to allow/optimize functionality.
config REGULATOR_STW481X_VMMC
bool "ST Microelectronics STW481X VMMC regulator"
depends on MFD_STW481X
default y if MFD_STW481X
help
This driver supports the internal VMMC regulator in the STw481x
PMIC chips.
config REGULATOR_TPS51632
config REGULATOR_TPS51632
tristate "TI TPS51632 Power Regulator"
tristate "TI TPS51632 Power Regulator"
depends on I2C
depends on I2C
...
...
drivers/regulator/Makefile
浏览文件 @
aa11a358
...
@@ -57,6 +57,7 @@ obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
...
@@ -57,6 +57,7 @@ obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
obj-$(CONFIG_REGULATOR_RC5T583)
+=
rc5t583-regulator.o
obj-$(CONFIG_REGULATOR_RC5T583)
+=
rc5t583-regulator.o
obj-$(CONFIG_REGULATOR_S2MPS11)
+=
s2mps11.o
obj-$(CONFIG_REGULATOR_S2MPS11)
+=
s2mps11.o
obj-$(CONFIG_REGULATOR_S5M8767)
+=
s5m8767.o
obj-$(CONFIG_REGULATOR_S5M8767)
+=
s5m8767.o
obj-$(CONFIG_REGULATOR_STW481X_VMMC)
+=
stw481x-vmmc.o
obj-$(CONFIG_REGULATOR_TI_ABB)
+=
ti-abb-regulator.o
obj-$(CONFIG_REGULATOR_TI_ABB)
+=
ti-abb-regulator.o
obj-$(CONFIG_REGULATOR_TPS6105X)
+=
tps6105x-regulator.o
obj-$(CONFIG_REGULATOR_TPS6105X)
+=
tps6105x-regulator.o
obj-$(CONFIG_REGULATOR_TPS62360)
+=
tps62360-regulator.o
obj-$(CONFIG_REGULATOR_TPS62360)
+=
tps62360-regulator.o
...
...
drivers/regulator/stw481x-vmmc.c
0 → 100644
浏览文件 @
aa11a358
/*
* Regulator driver for STw4810/STw4811 VMMC regulator.
*
* Copyright (C) 2013 ST-Ericsson SA
* Written on behalf of Linaro for ST-Ericsson
*
* Author: Linus Walleij <linus.walleij@linaro.org>
*
* License terms: GNU General Public License (GPL) version 2
*/
#include <linux/err.h>
#include <linux/init.h>
#include <linux/mfd/stw481x.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
static
const
unsigned
int
stw481x_vmmc_voltages
[]
=
{
1800000
,
1800000
,
2850000
,
3000000
,
1850000
,
2600000
,
2700000
,
3300000
,
};
static
struct
regulator_ops
stw481x_vmmc_ops
=
{
.
list_voltage
=
regulator_list_voltage_table
,
.
enable
=
regulator_enable_regmap
,
.
disable
=
regulator_disable_regmap
,
.
is_enabled
=
regulator_is_enabled_regmap
,
.
get_voltage_sel
=
regulator_get_voltage_sel_regmap
,
.
set_voltage_sel
=
regulator_set_voltage_sel_regmap
,
};
static
struct
regulator_desc
vmmc_regulator
=
{
.
name
=
"VMMC"
,
.
id
=
0
,
.
ops
=
&
stw481x_vmmc_ops
,
.
type
=
REGULATOR_VOLTAGE
,
.
owner
=
THIS_MODULE
,
.
n_voltages
=
ARRAY_SIZE
(
stw481x_vmmc_voltages
),
.
volt_table
=
stw481x_vmmc_voltages
,
.
enable_time
=
200
,
/* FIXME: look this up */
.
enable_reg
=
STW_CONF1
,
.
enable_mask
=
STW_CONF1_PDN_VMMC
,
.
vsel_reg
=
STW_CONF1
,
.
vsel_mask
=
STW_CONF1_VMMC_MASK
,
};
static
int
stw481x_vmmc_regulator_probe
(
struct
platform_device
*
pdev
)
{
struct
stw481x
*
stw481x
=
dev_get_platdata
(
&
pdev
->
dev
);
struct
regulator_config
config
=
{
};
int
ret
;
/* First disable the external VMMC if it's active */
ret
=
regmap_update_bits
(
stw481x
->
map
,
STW_CONF2
,
STW_CONF2_VMMC_EXT
,
0
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"could not disable external VMMC
\n
"
);
return
ret
;
}
/* Register VMMC regulator */
config
.
dev
=
&
pdev
->
dev
;
config
.
driver_data
=
stw481x
;
config
.
regmap
=
stw481x
->
map
;
config
.
of_node
=
pdev
->
dev
.
of_node
;
config
.
init_data
=
of_get_regulator_init_data
(
&
pdev
->
dev
,
pdev
->
dev
.
of_node
);
stw481x
->
vmmc_regulator
=
regulator_register
(
&
vmmc_regulator
,
&
config
);
if
(
IS_ERR
(
stw481x
->
vmmc_regulator
))
{
dev_err
(
&
pdev
->
dev
,
"error initializing STw481x VMMC regulator
\n
"
);
return
PTR_ERR
(
stw481x
->
vmmc_regulator
);
}
dev_info
(
&
pdev
->
dev
,
"initialized STw481x VMMC regulator
\n
"
);
return
0
;
}
static
int
stw481x_vmmc_regulator_remove
(
struct
platform_device
*
pdev
)
{
struct
stw481x
*
stw481x
=
dev_get_platdata
(
&
pdev
->
dev
);
regulator_unregister
(
stw481x
->
vmmc_regulator
);
return
0
;
}
static
const
struct
of_device_id
stw481x_vmmc_match
[]
=
{
{
.
compatible
=
"st,stw481x-vmmc"
,
},
{},
};
static
struct
platform_driver
stw481x_vmmc_regulator_driver
=
{
.
driver
=
{
.
name
=
"stw481x-vmmc-regulator"
,
.
owner
=
THIS_MODULE
,
.
of_match_table
=
stw481x_vmmc_match
,
},
.
probe
=
stw481x_vmmc_regulator_probe
,
.
remove
=
stw481x_vmmc_regulator_remove
,
};
module_platform_driver
(
stw481x_vmmc_regulator_driver
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录