Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
98bb8c3e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
98bb8c3e
编写于
9月 27, 2010
作者:
T
Tony Lindgren
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'devel-boards' into omap-for-linus
上级
d58cc92b
3da434ac
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
199 addition
and
3 deletion
+199
-3
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
+68
-1
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3beagle.c
+99
-2
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-omap4panda.c
+32
-0
未找到文件。
arch/arm/mach-omap2/board-4430sdp.c
浏览文件 @
98bb8c3e
...
...
@@ -20,6 +20,7 @@
#include <linux/usb/otg.h>
#include <linux/spi/spi.h>
#include <linux/i2c/twl.h>
#include <linux/gpio_keys.h>
#include <linux/regulator/machine.h>
#include <linux/leds.h>
...
...
@@ -40,6 +41,8 @@
#define ETH_KS8851_IRQ 34
#define ETH_KS8851_POWER_ON 48
#define ETH_KS8851_QUART 138
#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
#define OMAP4_SFH7741_ENABLE_GPIO 188
static
struct
gpio_led
sdp4430_gpio_leds
[]
=
{
{
...
...
@@ -77,11 +80,47 @@ static struct gpio_led sdp4430_gpio_leds[] = {
};
static
struct
gpio_keys_button
sdp4430_gpio_keys
[]
=
{
{
.
desc
=
"Proximity Sensor"
,
.
type
=
EV_SW
,
.
code
=
SW_FRONT_PROXIMITY
,
.
gpio
=
OMAP4_SFH7741_SENSOR_OUTPUT_GPIO
,
.
active_low
=
0
,
}
};
static
struct
gpio_led_platform_data
sdp4430_led_data
=
{
.
leds
=
sdp4430_gpio_leds
,
.
num_leds
=
ARRAY_SIZE
(
sdp4430_gpio_leds
),
};
static
int
omap_prox_activate
(
struct
device
*
dev
)
{
gpio_set_value
(
OMAP4_SFH7741_ENABLE_GPIO
,
1
);
return
0
;
}
static
void
omap_prox_deactivate
(
struct
device
*
dev
)
{
gpio_set_value
(
OMAP4_SFH7741_ENABLE_GPIO
,
0
);
}
static
struct
gpio_keys_platform_data
sdp4430_gpio_keys_data
=
{
.
buttons
=
sdp4430_gpio_keys
,
.
nbuttons
=
ARRAY_SIZE
(
sdp4430_gpio_keys
),
.
enable
=
omap_prox_activate
,
.
disable
=
omap_prox_deactivate
,
};
static
struct
platform_device
sdp4430_gpio_keys_device
=
{
.
name
=
"gpio-keys"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
sdp4430_gpio_keys_data
,
},
};
static
struct
platform_device
sdp4430_leds_gpio
=
{
.
name
=
"leds-gpio"
,
.
id
=
-
1
,
...
...
@@ -161,6 +200,7 @@ static struct platform_device sdp4430_lcd_device = {
static
struct
platform_device
*
sdp4430_devices
[]
__initdata
=
{
&
sdp4430_lcd_device
,
&
sdp4430_gpio_keys_device
,
&
sdp4430_leds_gpio
,
};
...
...
@@ -412,6 +452,11 @@ static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
I2C_BOARD_INFO
(
"tmp105"
,
0x48
),
},
};
static
struct
i2c_board_info
__initdata
sdp4430_i2c_4_boardinfo
[]
=
{
{
I2C_BOARD_INFO
(
"hmc5843"
,
0x1e
),
},
};
static
int
__init
omap4_i2c_init
(
void
)
{
/*
...
...
@@ -423,14 +468,36 @@ static int __init omap4_i2c_init(void)
omap_register_i2c_bus
(
2
,
400
,
NULL
,
0
);
omap_register_i2c_bus
(
3
,
400
,
sdp4430_i2c_3_boardinfo
,
ARRAY_SIZE
(
sdp4430_i2c_3_boardinfo
));
omap_register_i2c_bus
(
4
,
400
,
NULL
,
0
);
omap_register_i2c_bus
(
4
,
400
,
sdp4430_i2c_4_boardinfo
,
ARRAY_SIZE
(
sdp4430_i2c_4_boardinfo
));
return
0
;
}
static
void
__init
omap_sfh7741prox_init
(
void
)
{
int
error
;
error
=
gpio_request
(
OMAP4_SFH7741_ENABLE_GPIO
,
"sfh7741"
);
if
(
error
<
0
)
{
pr_err
(
"%s:failed to request GPIO %d, error %d
\n
"
,
__func__
,
OMAP4_SFH7741_ENABLE_GPIO
,
error
);
return
;
}
error
=
gpio_direction_output
(
OMAP4_SFH7741_ENABLE_GPIO
,
0
);
if
(
error
<
0
)
{
pr_err
(
"%s: GPIO configuration failed: GPIO %d,error %d
\n
"
,
__func__
,
OMAP4_SFH7741_ENABLE_GPIO
,
error
);
gpio_free
(
OMAP4_SFH7741_ENABLE_GPIO
);
}
}
static
void
__init
omap_4430sdp_init
(
void
)
{
int
status
;
omap4_i2c_init
();
omap_sfh7741prox_init
();
platform_add_devices
(
sdp4430_devices
,
ARRAY_SIZE
(
sdp4430_devices
));
omap_serial_init
();
omap4_twl6030_hsmmc_init
(
mmc
);
...
...
arch/arm/mach-omap2/board-omap3beagle.c
浏览文件 @
98bb8c3e
...
...
@@ -51,6 +51,93 @@
#define NAND_BLOCK_SIZE SZ_128K
/*
* OMAP3 Beagle revision
* Run time detection of Beagle revision is done by reading GPIO.
* GPIO ID -
* AXBX = GPIO173, GPIO172, GPIO171: 1 1 1
* C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0
* C4 = GPIO173, GPIO172, GPIO171: 1 0 1
* XM = GPIO173, GPIO172, GPIO171: 0 0 0
*/
enum
{
OMAP3BEAGLE_BOARD_UNKN
=
0
,
OMAP3BEAGLE_BOARD_AXBX
,
OMAP3BEAGLE_BOARD_C1_3
,
OMAP3BEAGLE_BOARD_C4
,
OMAP3BEAGLE_BOARD_XM
,
};
static
u8
omap3_beagle_version
;
static
u8
omap3_beagle_get_rev
(
void
)
{
return
omap3_beagle_version
;
}
static
void
__init
omap3_beagle_init_rev
(
void
)
{
int
ret
;
u16
beagle_rev
=
0
;
omap_mux_init_gpio
(
171
,
OMAP_PIN_INPUT_PULLUP
);
omap_mux_init_gpio
(
172
,
OMAP_PIN_INPUT_PULLUP
);
omap_mux_init_gpio
(
173
,
OMAP_PIN_INPUT_PULLUP
);
ret
=
gpio_request
(
171
,
"rev_id_0"
);
if
(
ret
<
0
)
goto
fail0
;
ret
=
gpio_request
(
172
,
"rev_id_1"
);
if
(
ret
<
0
)
goto
fail1
;
ret
=
gpio_request
(
173
,
"rev_id_2"
);
if
(
ret
<
0
)
goto
fail2
;
gpio_direction_input
(
171
);
gpio_direction_input
(
172
);
gpio_direction_input
(
173
);
beagle_rev
=
gpio_get_value
(
171
)
|
(
gpio_get_value
(
172
)
<<
1
)
|
(
gpio_get_value
(
173
)
<<
2
);
switch
(
beagle_rev
)
{
case
7
:
printk
(
KERN_INFO
"OMAP3 Beagle Rev: Ax/Bx
\n
"
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_AXBX
;
break
;
case
6
:
printk
(
KERN_INFO
"OMAP3 Beagle Rev: C1/C2/C3
\n
"
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_C1_3
;
break
;
case
5
:
printk
(
KERN_INFO
"OMAP3 Beagle Rev: C4
\n
"
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_C4
;
break
;
case
0
:
printk
(
KERN_INFO
"OMAP3 Beagle Rev: xM
\n
"
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_XM
;
break
;
default:
printk
(
KERN_INFO
"OMAP3 Beagle Rev: unknown %hd
\n
"
,
beagle_rev
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_UNKN
;
}
return
;
fail2:
gpio_free
(
172
);
fail1:
gpio_free
(
171
);
fail0:
printk
(
KERN_ERR
"Unable to get revision detection GPIO pins
\n
"
);
omap3_beagle_version
=
OMAP3BEAGLE_BOARD_UNKN
;
return
;
}
static
struct
mtd_partition
omap3beagle_nand_partitions
[]
=
{
/* All the partition sizes are listed in terms of NAND block size */
{
...
...
@@ -186,7 +273,10 @@ static struct gpio_led gpio_leds[];
static
int
beagle_twl_gpio_setup
(
struct
device
*
dev
,
unsigned
gpio
,
unsigned
ngpio
)
{
if
(
system_rev
>=
0x20
&&
system_rev
<=
0x34301000
)
{
if
(
omap3_beagle_get_rev
()
==
OMAP3BEAGLE_BOARD_XM
)
{
mmc
[
0
].
gpio_wp
=
-
EINVAL
;
}
else
if
((
omap3_beagle_get_rev
()
==
OMAP3BEAGLE_BOARD_C1_3
)
||
(
omap3_beagle_get_rev
()
==
OMAP3BEAGLE_BOARD_C4
))
{
omap_mux_init_gpio
(
23
,
OMAP_PIN_INPUT
);
mmc
[
0
].
gpio_wp
=
23
;
}
else
{
...
...
@@ -323,13 +413,19 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
},
};
static
struct
i2c_board_info
__initdata
beagle_i2c_eeprom
[]
=
{
{
I2C_BOARD_INFO
(
"eeprom"
,
0x50
),
},
};
static
int
__init
omap3_beagle_i2c_init
(
void
)
{
omap_register_i2c_bus
(
1
,
2600
,
beagle_i2c_boardinfo
,
ARRAY_SIZE
(
beagle_i2c_boardinfo
));
/* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */
omap_register_i2c_bus
(
3
,
100
,
NULL
,
0
);
omap_register_i2c_bus
(
3
,
100
,
beagle_i2c_eeprom
,
ARRAY_SIZE
(
beagle_i2c_eeprom
)
);
return
0
;
}
...
...
@@ -465,6 +561,7 @@ static struct omap_musb_board_data musb_board_data = {
static
void
__init
omap3_beagle_init
(
void
)
{
omap3_mux_init
(
board_mux
,
OMAP_PACKAGE_CBB
);
omap3_beagle_init_rev
();
omap3_beagle_i2c_init
();
platform_add_devices
(
omap3_beagle_devices
,
ARRAY_SIZE
(
omap3_beagle_devices
));
...
...
arch/arm/mach-omap2/board-omap4panda.c
浏览文件 @
98bb8c3e
...
...
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/leds.h>
#include <linux/gpio.h>
#include <linux/usb/otg.h>
#include <linux/i2c/twl.h>
...
...
@@ -40,6 +41,36 @@
#include "hsmmc.h"
static
struct
gpio_led
gpio_leds
[]
=
{
{
.
name
=
"pandaboard::status1"
,
.
default_trigger
=
"heartbeat"
,
.
gpio
=
7
,
},
{
.
name
=
"pandaboard::status2"
,
.
default_trigger
=
"mmc0"
,
.
gpio
=
8
,
},
};
static
struct
gpio_led_platform_data
gpio_led_info
=
{
.
leds
=
gpio_leds
,
.
num_leds
=
ARRAY_SIZE
(
gpio_leds
),
};
static
struct
platform_device
leds_gpio
=
{
.
name
=
"leds-gpio"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
gpio_led_info
,
},
};
static
struct
platform_device
*
panda_devices
[]
__initdata
=
{
&
leds_gpio
,
};
static
void
__init
omap4_panda_init_irq
(
void
)
{
omap2_init_common_hw
(
NULL
,
NULL
);
...
...
@@ -275,6 +306,7 @@ static int __init omap4_panda_i2c_init(void)
static
void
__init
omap4_panda_init
(
void
)
{
omap4_panda_i2c_init
();
platform_add_devices
(
panda_devices
,
ARRAY_SIZE
(
panda_devices
));
omap_serial_init
();
omap4_twl6030_hsmmc_init
(
mmc
);
/* OMAP4 Panda uses internal transceiver so register nop transceiver */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录