Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
64de5ec1
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看板
提交
64de5ec1
编写于
9月 21, 2010
作者:
U
Uwe Kleine-König
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: imx: reorganize imx-i2c device registration to use a struct per SoC
Signed-off-by:
N
Uwe Kleine-König
<
u.kleine-koenig@pengutronix.de
>
上级
4697bb92
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
105 addition
and
35 deletion
+105
-35
arch/arm/mach-imx/devices-imx1.h
arch/arm/mach-imx/devices-imx1.h
+2
-1
arch/arm/mach-imx/devices-imx21.h
arch/arm/mach-imx/devices-imx21.h
+2
-1
arch/arm/mach-imx/devices-imx27.h
arch/arm/mach-imx/devices-imx27.h
+5
-4
arch/arm/mach-mx25/devices-imx25.h
arch/arm/mach-mx25/devices-imx25.h
+6
-6
arch/arm/mach-mx3/devices-imx31.h
arch/arm/mach-mx3/devices-imx31.h
+6
-6
arch/arm/mach-mx3/devices-imx35.h
arch/arm/mach-mx3/devices-imx35.h
+6
-6
arch/arm/plat-mxc/devices/platform-imx-i2c.c
arch/arm/plat-mxc/devices/platform-imx-i2c.c
+68
-7
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/devices-common.h
+8
-2
arch/arm/plat-mxc/include/mach/mx51.h
arch/arm/plat-mxc/include/mach/mx51.h
+2
-2
未找到文件。
arch/arm/mach-imx/devices-imx1.h
浏览文件 @
64de5ec1
...
...
@@ -9,8 +9,9 @@
#include <mach/mx1.h>
#include <mach/devices-common.h>
extern
const
struct
imx_imx_i2c_data
imx1_imx_i2c_data
__initconst
;
#define imx1_add_i2c_imx(pdata) \
imx_add_imx_i2c(
0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C
, pdata)
imx_add_imx_i2c(
&imx1_imx_i2c_data
, pdata)
extern
const
struct
imx_imx_uart_3irq_data
imx1_imx_uart_data
[]
__initconst
;
#define imx1_add_imx_uart(id, pdata) \
...
...
arch/arm/mach-imx/devices-imx21.h
浏览文件 @
64de5ec1
...
...
@@ -9,8 +9,9 @@
#include <mach/mx21.h>
#include <mach/devices-common.h>
extern
const
struct
imx_imx_i2c_data
imx21_imx_i2c_data
__initconst
;
#define imx21_add_i2c_imx(pdata) \
imx_add_imx_i2c(
0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C
, pdata)
imx_add_imx_i2c(
&imx21_imx_i2c_data
, pdata)
extern
const
struct
imx_imx_ssi_data
imx21_imx_ssi_data
[]
__initconst
;
#define imx21_add_imx_ssi(id, pdata) \
...
...
arch/arm/mach-imx/devices-imx27.h
浏览文件 @
64de5ec1
...
...
@@ -9,10 +9,11 @@
#include <mach/mx27.h>
#include <mach/devices-common.h>
#define imx27_add_i2c_imx0(pdata) \
imx_add_imx_i2c(0, MX27_I2C1_BASE_ADDR, SZ_4K, MX27_INT_I2C1, pdata)
#define imx27_add_i2c_imx1(pdata) \
imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata)
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)
#define imx27_add_i2c_imx0(pdata) imx27_add_imx_i2c(0, pdata)
#define imx27_add_i2c_imx1(pdata) imx27_add_imx_i2c(1, pdata)
extern
const
struct
imx_imx_ssi_data
imx27_imx_ssi_data
[]
__initconst
;
#define imx27_add_imx_ssi(id, pdata) \
...
...
arch/arm/mach-mx25/devices-imx25.h
浏览文件 @
64de5ec1
...
...
@@ -14,12 +14,12 @@
#define imx25_add_flexcan1(pdata) \
imx_add_flexcan(1, MX25_CAN2_BASE_ADDR, SZ_16K, MX25_INT_CAN2, pdata)
#define imx25_add_imx_i2c0(pdata) \
imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata)
#define imx25_add_imx_i2c1(pdata) \
imx_add_imx_i2c(1, MX25_I2C2_BASE_ADDR, SZ_16K, MX25_INT_I2C2
, pdata)
#define imx25_add_imx_i2c
2(pdata) \
imx_add_imx_i2c(2, MX25_I2C3_BASE_ADDR, SZ_16K, MX25_INT_I2C3
, pdata)
extern
const
struct
imx_imx_i2c_data
imx25_imx_i2c_data
[]
__initconst
;
#define imx25_add_imx_i2c(id, pdata) \
imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata)
#define imx25_add_imx_i2c0(pdata) imx25_add_imx_i2c(0
, pdata)
#define imx25_add_imx_i2c
1(pdata) imx25_add_imx_i2c(1, pdata)
#define imx25_add_imx_i2c2(pdata) imx25_add_imx_i2c(2
, pdata)
extern
const
struct
imx_imx_ssi_data
imx25_imx_ssi_data
[]
__initconst
;
#define imx25_add_imx_ssi(id, pdata) \
...
...
arch/arm/mach-mx3/devices-imx31.h
浏览文件 @
64de5ec1
...
...
@@ -9,12 +9,12 @@
#include <mach/mx31.h>
#include <mach/devices-common.h>
#define imx31_add_imx_i2c0(pdata) \
imx_add_imx_i2c(0, MX31_I2C1_BASE_ADDR, SZ_4K, MX31_INT_I2C1, pdata)
#define imx31_add_imx_i2c1(pdata) \
imx_add_imx_i2c(1, MX31_I2C2_BASE_ADDR, SZ_4K, MX31_INT_I2C2
, pdata)
#define imx31_add_imx_i2c
2(pdata) \
imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3
, pdata)
extern
const
struct
imx_imx_i2c_data
imx31_imx_i2c_data
[]
__initconst
;
#define imx31_add_imx_i2c(id, pdata) \
imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata)
#define imx31_add_imx_i2c0(pdata) imx31_add_imx_i2c(0
, pdata)
#define imx31_add_imx_i2c
1(pdata) imx31_add_imx_i2c(1, pdata)
#define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2
, pdata)
extern
const
struct
imx_imx_ssi_data
imx31_imx_ssi_data
[]
__initconst
;
#define imx31_add_imx_ssi(id, pdata) \
...
...
arch/arm/mach-mx3/devices-imx35.h
浏览文件 @
64de5ec1
...
...
@@ -14,12 +14,12 @@
#define imx35_add_flexcan1(pdata) \
imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata)
#define imx35_add_imx_i2c0(pdata) \
imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata)
#define imx35_add_imx_i2c1(pdata) \
imx_add_imx_i2c(1, MX35_I2C2_BASE_ADDR, SZ_4K, MX35_INT_I2C2
, pdata)
#define imx35_add_imx_i2c
2(pdata) \
imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3
, pdata)
extern
const
struct
imx_imx_i2c_data
imx35_imx_i2c_data
[]
__initconst
;
#define imx35_add_imx_i2c(id, pdata) \
imx_add_imx_i2c(&imx35_imx_i2c_data[id], pdata)
#define imx35_add_imx_i2c0(pdata) imx35_add_imx_i2c(0
, pdata)
#define imx35_add_imx_i2c
1(pdata) imx35_add_imx_i2c(1, pdata)
#define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2
, pdata)
extern
const
struct
imx_imx_ssi_data
imx35_imx_ssi_data
[]
__initconst
;
#define imx35_add_imx_ssi(id, pdata) \
...
...
arch/arm/plat-mxc/devices/platform-imx-i2c.c
浏览文件 @
64de5ec1
...
...
@@ -6,24 +6,85 @@
* 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>
struct
platform_device
*
__init
imx_add_imx_i2c
(
int
id
,
resource_size_t
iobase
,
resource_size_t
iosize
,
int
irq
,
#define imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \
{ \
.id = _id, \
.iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \
.iosize = _size, \
.irq = soc ## _INT_I2C ## _hwid, \
}
#define imx_imx_i2c_data_entry(soc, _id, _hwid, _size) \
[_id] = imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size)
#ifdef CONFIG_SOC_IMX1
const
struct
imx_imx_i2c_data
imx1_imx_i2c_data
__initconst
=
imx_imx_i2c_data_entry_single
(
MX1
,
0
,
,
SZ_4K
);
#endif
/* ifdef CONFIG_SOC_IMX1 */
#ifdef CONFIG_SOC_IMX21
const
struct
imx_imx_i2c_data
imx21_imx_i2c_data
__initconst
=
imx_imx_i2c_data_entry_single
(
MX21
,
0
,
,
SZ_4K
);
#endif
/* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_ARCH_MX25
const
struct
imx_imx_i2c_data
imx25_imx_i2c_data
[]
__initconst
=
{
#define imx25_imx_i2c_data_entry(_id, _hwid) \
imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K)
imx25_imx_i2c_data_entry
(
0
,
1
),
imx25_imx_i2c_data_entry
(
1
,
2
),
imx25_imx_i2c_data_entry
(
2
,
3
),
};
#endif
/* ifdef CONFIG_ARCH_MX25 */
#ifdef CONFIG_SOC_IMX27
const
struct
imx_imx_i2c_data
imx27_imx_i2c_data
[]
__initconst
=
{
#define imx27_imx_i2c_data_entry(_id, _hwid) \
imx_imx_i2c_data_entry(MX27, _id, _hwid, SZ_4K)
imx27_imx_i2c_data_entry
(
0
,
1
),
imx27_imx_i2c_data_entry
(
1
,
2
),
};
#endif
/* ifdef CONFIG_SOC_IMX27 */
#ifdef CONFIG_ARCH_MX31
const
struct
imx_imx_i2c_data
imx31_imx_i2c_data
[]
__initconst
=
{
#define imx31_imx_i2c_data_entry(_id, _hwid) \
imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K)
imx31_imx_i2c_data_entry
(
0
,
1
),
imx31_imx_i2c_data_entry
(
1
,
2
),
imx31_imx_i2c_data_entry
(
2
,
3
),
};
#endif
/* ifdef CONFIG_ARCH_MX31 */
#ifdef CONFIG_ARCH_MX35
const
struct
imx_imx_i2c_data
imx35_imx_i2c_data
[]
__initconst
=
{
#define imx35_imx_i2c_data_entry(_id, _hwid) \
imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K)
imx35_imx_i2c_data_entry
(
0
,
1
),
imx35_imx_i2c_data_entry
(
1
,
2
),
};
#endif
/* ifdef CONFIG_ARCH_MX35 */
struct
platform_device
*
__init
imx_add_imx_i2c
(
const
struct
imx_imx_i2c_data
*
data
,
const
struct
imxi2c_platform_data
*
pdata
)
{
struct
resource
res
[]
=
{
{
.
start
=
iobase
,
.
end
=
iobase
+
iosize
-
1
,
.
start
=
data
->
iobase
,
.
end
=
data
->
iobase
+
data
->
iosize
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
irq
,
.
end
=
irq
,
.
start
=
data
->
irq
,
.
end
=
data
->
irq
,
.
flags
=
IORESOURCE_IRQ
,
},
};
return
imx_add_platform_device
(
"imx-i2c"
,
id
,
res
,
ARRAY_SIZE
(
res
),
return
imx_add_platform_device
(
"imx-i2c"
,
data
->
id
,
res
,
ARRAY_SIZE
(
res
),
pdata
,
sizeof
(
*
pdata
));
}
arch/arm/plat-mxc/include/mach/devices-common.h
浏览文件 @
64de5ec1
...
...
@@ -21,8 +21,14 @@ struct platform_device *__init imx_add_flexcan(int id,
const
struct
flexcan_platform_data
*
pdata
);
#include <mach/i2c.h>
struct
platform_device
*
__init
imx_add_imx_i2c
(
int
id
,
resource_size_t
iobase
,
resource_size_t
iosize
,
int
irq
,
struct
imx_imx_i2c_data
{
int
id
;
resource_size_t
iobase
;
resource_size_t
iosize
;
resource_size_t
irq
;
};
struct
platform_device
*
__init
imx_add_imx_i2c
(
const
struct
imx_imx_i2c_data
*
data
,
const
struct
imxi2c_platform_data
*
pdata
);
#include <mach/ssi.h>
...
...
arch/arm/plat-mxc/include/mach/mx51.h
浏览文件 @
64de5ec1
...
...
@@ -341,8 +341,8 @@
#define MX51_MXC_INT_WDOG2 59
#define MX51_MXC_INT_KPP 60
#define MX51_MXC_INT_PWM1 61
#define MX51_
MXC_INT_I2C1
62
#define MX51_
MXC_INT_I2C2
63
#define MX51_
INT_I2C1
62
#define MX51_
INT_I2C2
63
#define MX51_MXC_INT_HS_I2C 64
#define MX51_MXC_INT_RESV65 65
#define MX51_MXC_INT_RESV66 66
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录