Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
b315ec06
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看板
提交
b315ec06
编写于
7月 11, 2012
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'renesas-ag5evm' into renesas-board
* renesas-ag5evm: ARM: mach-shmobile: add fixed voltage regulators to ag5evm
上级
8600fb68
6add9691
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
79 addition
and
3 deletion
+79
-3
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ag5evm.c
+79
-3
未找到文件。
arch/arm/mach-shmobile/board-ag5evm.c
浏览文件 @
b315ec06
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/serial_sci.h>
#include <linux/serial_sci.h>
#include <linux/smsc911x.h>
#include <linux/smsc911x.h>
#include <linux/gpio.h>
#include <linux/gpio.h>
...
@@ -52,6 +54,12 @@
...
@@ -52,6 +54,12 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/traps.h>
#include <asm/traps.h>
/* Dummy supplies, where voltage doesn't matter */
static
struct
regulator_consumer_supply
dummy_supplies
[]
=
{
REGULATOR_SUPPLY
(
"vddvario"
,
"smsc911x"
),
REGULATOR_SUPPLY
(
"vdd33a"
,
"smsc911x"
),
};
static
struct
resource
smsc9220_resources
[]
=
{
static
struct
resource
smsc9220_resources
[]
=
{
[
0
]
=
{
[
0
]
=
{
.
start
=
0x14000000
,
.
start
=
0x14000000
,
...
@@ -142,6 +150,13 @@ static struct platform_device fsi_device = {
...
@@ -142,6 +150,13 @@ static struct platform_device fsi_device = {
.
resource
=
fsi_resources
,
.
resource
=
fsi_resources
,
};
};
/* Fixed 1.8V regulator to be used by MMCIF */
static
struct
regulator_consumer_supply
fixed1v8_power_consumers
[]
=
{
REGULATOR_SUPPLY
(
"vmmc"
,
"sh_mmcif.0"
),
REGULATOR_SUPPLY
(
"vqmmc"
,
"sh_mmcif.0"
),
};
static
struct
resource
sh_mmcif_resources
[]
=
{
static
struct
resource
sh_mmcif_resources
[]
=
{
[
0
]
=
{
[
0
]
=
{
.
name
=
"MMCIF"
,
.
name
=
"MMCIF"
,
...
@@ -364,6 +379,13 @@ static struct platform_device mipidsi0_device = {
...
@@ -364,6 +379,13 @@ static struct platform_device mipidsi0_device = {
},
},
};
};
/* Fixed 2.8V regulators to be used by SDHI0 */
static
struct
regulator_consumer_supply
fixed2v8_power_consumers
[]
=
{
REGULATOR_SUPPLY
(
"vmmc"
,
"sh_mobile_sdhi.0"
),
REGULATOR_SUPPLY
(
"vqmmc"
,
"sh_mobile_sdhi.0"
),
};
/* SDHI0 */
/* SDHI0 */
static
struct
sh_mobile_sdhi_info
sdhi0_info
=
{
static
struct
sh_mobile_sdhi_info
sdhi0_info
=
{
.
dma_slave_tx
=
SHDMA_SLAVE_SDHI0_TX
,
.
dma_slave_tx
=
SHDMA_SLAVE_SDHI0_TX
,
...
@@ -408,8 +430,57 @@ static struct platform_device sdhi0_device = {
...
@@ -408,8 +430,57 @@ static struct platform_device sdhi0_device = {
},
},
};
};
void
ag5evm_sdhi1_set_pwr
(
struct
platform_device
*
pdev
,
int
state
)
/* Fixed 3.3V regulator to be used by SDHI1 */
static
struct
regulator_consumer_supply
cn4_power_consumers
[]
=
{
{
REGULATOR_SUPPLY
(
"vmmc"
,
"sh_mobile_sdhi.1"
),
REGULATOR_SUPPLY
(
"vqmmc"
,
"sh_mobile_sdhi.1"
),
};
static
struct
regulator_init_data
cn4_power_init_data
=
{
.
constraints
=
{
.
valid_ops_mask
=
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
ARRAY_SIZE
(
cn4_power_consumers
),
.
consumer_supplies
=
cn4_power_consumers
,
};
static
struct
fixed_voltage_config
cn4_power_info
=
{
.
supply_name
=
"CN4 SD/MMC Vdd"
,
.
microvolts
=
3300000
,
.
gpio
=
GPIO_PORT114
,
.
enable_high
=
1
,
.
init_data
=
&
cn4_power_init_data
,
};
static
struct
platform_device
cn4_power
=
{
.
name
=
"reg-fixed-voltage"
,
.
id
=
2
,
.
dev
=
{
.
platform_data
=
&
cn4_power_info
,
},
};
static
void
ag5evm_sdhi1_set_pwr
(
struct
platform_device
*
pdev
,
int
state
)
{
static
int
power_gpio
=
-
EINVAL
;
if
(
power_gpio
<
0
)
{
int
ret
=
gpio_request
(
GPIO_PORT114
,
"sdhi1_power"
);
if
(
!
ret
)
{
power_gpio
=
GPIO_PORT114
;
gpio_direction_output
(
power_gpio
,
0
);
}
}
/*
* If requesting the GPIO above failed, it means, that the regulator got
* probed and grabbed the GPIO, but we don't know, whether the sdhi
* driver already uses the regulator. If it doesn't, we have to toggle
* the GPIO ourselves, even though it is now owned by the fixed
* regulator driver. We have to live with the race in case the driver
* gets unloaded and the GPIO freed between these two steps.
*/
gpio_set_value
(
GPIO_PORT114
,
state
);
gpio_set_value
(
GPIO_PORT114
,
state
);
}
}
...
@@ -455,6 +526,7 @@ static struct platform_device sdhi1_device = {
...
@@ -455,6 +526,7 @@ static struct platform_device sdhi1_device = {
};
};
static
struct
platform_device
*
ag5evm_devices
[]
__initdata
=
{
static
struct
platform_device
*
ag5evm_devices
[]
__initdata
=
{
&
cn4_power
,
&
eth_device
,
&
eth_device
,
&
keysc_device
,
&
keysc_device
,
&
fsi_device
,
&
fsi_device
,
...
@@ -468,6 +540,12 @@ static struct platform_device *ag5evm_devices[] __initdata = {
...
@@ -468,6 +540,12 @@ static struct platform_device *ag5evm_devices[] __initdata = {
static
void
__init
ag5evm_init
(
void
)
static
void
__init
ag5evm_init
(
void
)
{
{
regulator_register_always_on
(
0
,
"fixed-1.8V"
,
fixed1v8_power_consumers
,
ARRAY_SIZE
(
fixed1v8_power_consumers
),
1800000
);
regulator_register_always_on
(
1
,
"fixed-2.8V"
,
fixed2v8_power_consumers
,
ARRAY_SIZE
(
fixed2v8_power_consumers
),
3300000
);
regulator_register_fixed
(
3
,
dummy_supplies
,
ARRAY_SIZE
(
dummy_supplies
));
sh73a0_pinmux_init
();
sh73a0_pinmux_init
();
/* enable SCIFA2 */
/* enable SCIFA2 */
...
@@ -562,8 +640,6 @@ static void __init ag5evm_init(void)
...
@@ -562,8 +640,6 @@ static void __init ag5evm_init(void)
gpio_request
(
GPIO_FN_SDHID1_2_PU
,
NULL
);
gpio_request
(
GPIO_FN_SDHID1_2_PU
,
NULL
);
gpio_request
(
GPIO_FN_SDHID1_1_PU
,
NULL
);
gpio_request
(
GPIO_FN_SDHID1_1_PU
,
NULL
);
gpio_request
(
GPIO_FN_SDHID1_0_PU
,
NULL
);
gpio_request
(
GPIO_FN_SDHID1_0_PU
,
NULL
);
gpio_request
(
GPIO_PORT114
,
"sdhi1_power"
);
gpio_direction_output
(
GPIO_PORT114
,
0
);
#ifdef CONFIG_CACHE_L2X0
#ifdef CONFIG_CACHE_L2X0
/* Shared attribute override enable, 64K*8way */
/* Shared attribute override enable, 64K*8way */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录