Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
61533841
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
61533841
编写于
9月 24, 2009
作者:
S
Sascha Hauer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pcm038: Add SPI/MC13783 support
Signed-off-by:
N
Sascha Hauer
<
s.hauer@pengutronix.de
>
上级
de41fddd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
94 addition
and
2 deletion
+94
-2
arch/arm/mach-mx2/pcm038.c
arch/arm/mach-mx2/pcm038.c
+94
-2
未找到文件。
arch/arm/mach-mx2/pcm038.c
浏览文件 @
61533841
...
...
@@ -23,6 +23,10 @@
#include <linux/mtd/plat-ram.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_device.h>
#include <linux/regulator/machine.h>
#include <linux/mfd/mc13783.h>
#include <linux/spi/spi.h>
#include <linux/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
...
...
@@ -35,6 +39,7 @@
#include <mach/iomux.h>
#include <mach/imx-uart.h>
#include <mach/mxc_nand.h>
#include <mach/spi.h>
#include "devices.h"
...
...
@@ -78,8 +83,6 @@ static int pcm038_pins[] = {
PC6_PF_I2C2_SCL
,
/* SPI1 */
PD25_PF_CSPI1_RDY
,
PD27_PF_CSPI1_SS1
,
PD28_PF_CSPI1_SS0
,
PD29_PF_CSPI1_SCLK
,
PD30_PF_CSPI1_MISO
,
PD31_PF_CSPI1_MOSI
,
...
...
@@ -196,6 +199,86 @@ static struct i2c_board_info pcm038_i2c_devices[] = {
}
};
static
int
pcm038_spi_cs
[]
=
{
GPIO_PORTD
+
28
};
static
struct
spi_imx_master
pcm038_spi_0_data
=
{
.
chipselect
=
pcm038_spi_cs
,
.
num_chipselect
=
ARRAY_SIZE
(
pcm038_spi_cs
),
};
static
struct
regulator_consumer_supply
sdhc1_consumers
[]
=
{
{
.
dev
=
&
mxc_sdhc_device1
.
dev
,
.
supply
=
"sdhc_vcc"
,
},
};
static
struct
regulator_init_data
sdhc1_data
=
{
.
constraints
=
{
.
min_uV
=
3000000
,
.
max_uV
=
3400000
,
.
valid_ops_mask
=
REGULATOR_CHANGE_VOLTAGE
|
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_FAST
,
.
always_on
=
0
,
.
boot_on
=
0
,
},
.
num_consumer_supplies
=
ARRAY_SIZE
(
sdhc1_consumers
),
.
consumer_supplies
=
sdhc1_consumers
,
};
static
struct
regulator_consumer_supply
cam_consumers
[]
=
{
{
.
dev
=
NULL
,
.
supply
=
"imx_cam_vcc"
,
},
};
static
struct
regulator_init_data
cam_data
=
{
.
constraints
=
{
.
min_uV
=
3000000
,
.
max_uV
=
3400000
,
.
valid_ops_mask
=
REGULATOR_CHANGE_VOLTAGE
|
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_FAST
,
.
always_on
=
0
,
.
boot_on
=
0
,
},
.
num_consumer_supplies
=
ARRAY_SIZE
(
cam_consumers
),
.
consumer_supplies
=
cam_consumers
,
};
struct
mc13783_regulator_init_data
pcm038_regulators
[]
=
{
{
.
id
=
MC13783_REGU_VCAM
,
.
init_data
=
&
cam_data
,
},
{
.
id
=
MC13783_REGU_VMMC1
,
.
init_data
=
&
sdhc1_data
,
},
};
static
struct
mc13783_platform_data
pcm038_pmic
=
{
.
regulators
=
pcm038_regulators
,
.
num_regulators
=
ARRAY_SIZE
(
pcm038_regulators
),
.
flags
=
MC13783_USE_ADC
|
MC13783_USE_REGULATOR
|
MC13783_USE_TOUCHSCREEN
,
};
static
struct
spi_board_info
pcm038_spi_board_info
[]
__initdata
=
{
{
.
modalias
=
"mc13783"
,
.
irq
=
IRQ_GPIOB
(
23
),
.
max_speed_hz
=
300000
,
.
bus_num
=
0
,
.
chip_select
=
0
,
.
platform_data
=
&
pcm038_pmic
,
.
mode
=
SPI_CS_HIGH
,
}
};
static
void
__init
pcm038_init
(
void
)
{
mxc_gpio_setup_multiple_pins
(
pcm038_pins
,
ARRAY_SIZE
(
pcm038_pins
),
...
...
@@ -219,6 +302,15 @@ static void __init pcm038_init(void)
/* PE18 for user-LED D40 */
mxc_gpio_mode
(
GPIO_PORTE
|
18
|
GPIO_GPIO
|
GPIO_OUT
);
mxc_gpio_mode
(
GPIO_PORTD
|
28
|
GPIO_GPIO
|
GPIO_OUT
);
/* MC13783 IRQ */
mxc_gpio_mode
(
GPIO_PORTB
|
23
|
GPIO_GPIO
|
GPIO_IN
);
mxc_register_device
(
&
mxc_spi_device0
,
&
pcm038_spi_0_data
);
spi_register_board_info
(
pcm038_spi_board_info
,
ARRAY_SIZE
(
pcm038_spi_board_info
));
platform_add_devices
(
platform_devices
,
ARRAY_SIZE
(
platform_devices
));
#ifdef CONFIG_MACH_PCM970_BASEBOARD
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录