Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
3f880141
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看板
提交
3f880141
编写于
11月 10, 2010
作者:
U
Uwe Kleine-König
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: imx: dynamically allocate imx-keypad devices
Signed-off-by:
N
Uwe Kleine-König
<
u.kleine-koenig@pengutronix.de
>
上级
bd455ed3
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
74 addition
and
26 deletion
+74
-26
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Kconfig
+2
-0
arch/arm/mach-imx/devices-imx21.h
arch/arm/mach-imx/devices-imx21.h
+4
-0
arch/arm/mach-imx/devices-imx27.h
arch/arm/mach-imx/devices-imx27.h
+4
-0
arch/arm/mach-imx/devices.c
arch/arm/mach-imx/devices.c
+0
-19
arch/arm/mach-imx/devices.h
arch/arm/mach-imx/devices.h
+0
-1
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+3
-3
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mach-mx27_3ds.c
+2
-3
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Kconfig
+3
-0
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/Makefile
+1
-0
arch/arm/plat-mxc/devices/platform-imx-keypad.c
arch/arm/plat-mxc/devices/platform-imx-keypad.c
+46
-0
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/devices-common.h
+9
-0
未找到文件。
arch/arm/mach-imx/Kconfig
浏览文件 @
3f880141
...
...
@@ -163,6 +163,7 @@ choice
config MACH_EUKREA_MBIMX27_BASEBOARD
bool "Eukrea MBIMX27 development board"
select IMX_HAVE_PLATFORM_IMX_FB
select IMX_HAVE_PLATFORM_IMX_KEYPAD
select IMX_HAVE_PLATFORM_IMX_SSI
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_MXC_MMC
...
...
@@ -175,6 +176,7 @@ endchoice
config MACH_MX27_3DS
bool "MX27PDK platform"
select IMX_HAVE_PLATFORM_IMX_KEYPAD
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_MXC_MMC
help
...
...
arch/arm/mach-imx/devices-imx21.h
浏览文件 @
3f880141
...
...
@@ -21,6 +21,10 @@ extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst;
#define imx21_add_imx_i2c(pdata) \
imx_add_imx_i2c(&imx21_imx_i2c_data, pdata)
extern
const
struct
imx_imx_keypad_data
imx21_imx_keypad_data
__initconst
;
#define imx21_add_imx_keypad(pdata) \
imx_add_imx_keypad(&imx21_imx_keypad_data, pdata)
extern
const
struct
imx_imx_ssi_data
imx21_imx_ssi_data
[]
__initconst
;
#define imx21_add_imx_ssi(id, pdata) \
imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata)
...
...
arch/arm/mach-imx/devices-imx27.h
浏览文件 @
3f880141
...
...
@@ -29,6 +29,10 @@ extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst;
#define imx27_add_imx_i2c(id, pdata) \
imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata)
extern
const
struct
imx_imx_keypad_data
imx27_imx_keypad_data
__initconst
;
#define imx27_add_imx_keypad(pdata) \
imx_add_imx_keypad(&imx27_imx_keypad_data, pdata)
extern
const
struct
imx_imx_ssi_data
imx27_imx_ssi_data
[]
__initconst
;
#define imx27_add_imx_ssi(id, pdata) \
imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata)
...
...
arch/arm/mach-imx/devices.c
浏览文件 @
3f880141
...
...
@@ -149,23 +149,4 @@ struct platform_device mx21_usbhc_device = {
};
#endif
static
struct
resource
imx_kpp_resources
[]
=
{
{
.
start
=
MX2x_KPP_BASE_ADDR
,
.
end
=
MX2x_KPP_BASE_ADDR
+
0xf
,
.
flags
=
IORESOURCE_MEM
},
{
.
start
=
MX2x_INT_KPP
,
.
end
=
MX2x_INT_KPP
,
.
flags
=
IORESOURCE_IRQ
,
},
};
struct
platform_device
imx_kpp_device
=
{
.
name
=
"imx-keypad"
,
.
id
=
-
1
,
.
num_resources
=
ARRAY_SIZE
(
imx_kpp_resources
),
.
resource
=
imx_kpp_resources
,
};
#endif
arch/arm/mach-imx/devices.h
浏览文件 @
3f880141
#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
extern
struct
platform_device
mx21_usbhc_device
;
extern
struct
platform_device
imx_kpp_device
;
#endif
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
浏览文件 @
3f880141
...
...
@@ -26,7 +26,6 @@
#include <linux/spi/ads7846.h>
#include <linux/backlight.h>
#include <video/platform_lcd.h>
#include <linux/input/matrix_keypad.h>
#include <asm/mach/arch.h>
...
...
@@ -109,7 +108,8 @@ static const uint32_t eukrea_mbimx27_keymap[] = {
KEY
(
1
,
1
,
KEY_LEFT
),
};
static
struct
matrix_keymap_data
eukrea_mbimx27_keymap_data
=
{
static
const
struct
matrix_keymap_data
eukrea_mbimx27_keymap_data
__initconst
=
{
.
keymap
=
eukrea_mbimx27_keymap
,
.
keymap_size
=
ARRAY_SIZE
(
eukrea_mbimx27_keymap
),
};
...
...
@@ -384,7 +384,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
gpio_request
(
GPIO_PORTA
|
25
,
"lcd_enable"
);
platform_device_register
(
&
eukrea_mbimx27_lcd_powerdev
);
mxc_register_device
(
&
imx_kpp_device
,
&
eukrea_mbimx27_keymap_data
);
imx27_add_imx_keypad
(
&
eukrea_mbimx27_keymap_data
);
platform_add_devices
(
platform_devices
,
ARRAY_SIZE
(
platform_devices
));
}
arch/arm/mach-imx/mach-mx27_3ds.c
浏览文件 @
3f880141
...
...
@@ -22,7 +22,6 @@
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/input/matrix_keypad.h>
#include <linux/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
...
...
@@ -91,7 +90,7 @@ static const uint32_t mx27_3ds_keymap[] = {
KEY
(
2
,
3
,
KEY_F10
),
};
static
struct
matrix_keymap_data
mx27_3ds_keymap_data
=
{
static
const
struct
matrix_keymap_data
mx27_3ds_keymap_data
__initconst
=
{
.
keymap
=
mx27_3ds_keymap
,
.
keymap_size
=
ARRAY_SIZE
(
mx27_3ds_keymap
),
};
...
...
@@ -127,7 +126,7 @@ static void __init mx27pdk_init(void)
mx27_3ds_sdhc1_enable_level_translator
();
imx27_add_imx_uart0
(
&
uart_pdata
);
imx27_add_fec
(
NULL
);
mxc_register_device
(
&
imx_kpp_device
,
&
mx27_3ds_keymap_data
);
imx27_add_imx_keypad
(
&
mx27_3ds_keymap_data
);
imx27_add_mxc_mmc
(
0
,
&
sdhc1_pdata
);
}
...
...
arch/arm/plat-mxc/devices/Kconfig
浏览文件 @
3f880141
...
...
@@ -25,6 +25,9 @@ config IMX_HAVE_PLATFORM_IMX_FB
config IMX_HAVE_PLATFORM_IMX_I2C
bool
config IMX_HAVE_PLATFORM_IMX_KEYPAD
bool
config IMX_HAVE_PLATFORM_IMX_SSI
bool
...
...
arch/arm/plat-mxc/devices/Makefile
浏览文件 @
3f880141
...
...
@@ -7,6 +7,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
obj-y
+=
platform-imx-dma.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB)
+=
platform-imx-fb.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C)
+=
platform-imx-i2c.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD)
+=
platform-imx-keypad.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI)
+=
platform-imx-ssi.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART)
+=
platform-imx-uart.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC)
+=
platform-imx_udc.o
...
...
arch/arm/plat-mxc/devices/platform-imx-keypad.c
0 → 100644
浏览文件 @
3f880141
/*
* Copyright (C) 2010 Pengutronix
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
#include <mach/hardware.h>
#include <mach/devices-common.h>
#define imx_imx_keypad_data_entry_single(soc) \
{ \
.iobase = soc ## _KPP_BASE_ADDR, \
.irq = soc ## _INT_KPP, \
}
#ifdef CONFIG_SOC_IMX21
const
struct
imx_imx_keypad_data
imx21_imx_keypad_data
__initconst
=
imx_imx_keypad_data_entry_single
(
MX21
);
#endif
/* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_SOC_IMX27
const
struct
imx_imx_keypad_data
imx27_imx_keypad_data
__initconst
=
imx_imx_keypad_data_entry_single
(
MX27
);
#endif
/* ifdef CONFIG_SOC_IMX27 */
struct
platform_device
*
__init
imx_add_imx_keypad
(
const
struct
imx_imx_keypad_data
*
data
,
const
struct
matrix_keymap_data
*
pdata
)
{
struct
resource
res
[]
=
{
{
.
start
=
data
->
iobase
,
.
end
=
data
->
iobase
+
SZ_16
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
data
->
irq
,
.
end
=
data
->
irq
,
.
flags
=
IORESOURCE_IRQ
,
},
};
return
imx_add_platform_device
(
"imx-keypad"
,
-
1
,
res
,
ARRAY_SIZE
(
res
),
pdata
,
sizeof
(
*
pdata
));
}
arch/arm/plat-mxc/include/mach/devices-common.h
浏览文件 @
3f880141
...
...
@@ -83,6 +83,15 @@ struct platform_device *__init imx_add_imx_i2c(
const
struct
imx_imx_i2c_data
*
data
,
const
struct
imxi2c_platform_data
*
pdata
);
#include <linux/input/matrix_keypad.h>
struct
imx_imx_keypad_data
{
resource_size_t
iobase
;
resource_size_t
irq
;
};
struct
platform_device
*
__init
imx_add_imx_keypad
(
const
struct
imx_imx_keypad_data
*
data
,
const
struct
matrix_keymap_data
*
pdata
);
#include <mach/ssi.h>
struct
imx_imx_ssi_data
{
int
id
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录