aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2009-04-13 03:34:54 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-06-04 22:32:02 -0400
commit1a77920e4cbe508c8dc40fef1d0beb21aac8cc17 (patch)
tree19ce0dbcd421e2c48c62438b089c1ada26cc99e7 /arch/arm
parentf0a83701399123b0e95cc4d949fcccf9941fd190 (diff)
[ARM] pxa: add I2C (TWSI) devices to pxa168/pxa910
Signed-off-by: Paul Shen <paul.shen@marvell.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa168.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h24
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h24
-rw-r--r--arch/arm/mach-mmp/pxa168.c6
-rw-r--r--arch/arm/mach-mmp/pxa910.c6
5 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
index 2e914649b9e4..dc4226371d64 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -253,6 +253,10 @@
253#define GPIO58_LCD_PCLK_WR MFP_CFG(GPIO58, AF1) 253#define GPIO58_LCD_PCLK_WR MFP_CFG(GPIO58, AF1)
254#define GPIO85_LCD_VSYNC MFP_CFG(GPIO85, AF1) 254#define GPIO85_LCD_VSYNC MFP_CFG(GPIO85, AF1)
255 255
256/* I2C */
257#define GPIO105_CI2C_SDA MFP_CFG(GPIO105, AF1)
258#define GPIO106_CI2C_SCL MFP_CFG(GPIO106, AF1)
259
256/* I2S */ 260/* I2S */
257#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6) 261#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6)
258#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1) 262#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1)
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index ef0a8a2076e9..bfdd6299dff5 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -1,10 +1,14 @@
1#ifndef __ASM_MACH_PXA168_H 1#ifndef __ASM_MACH_PXA168_H
2#define __ASM_MACH_PXA168_H 2#define __ASM_MACH_PXA168_H
3 3
4#include <linux/i2c.h>
4#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h>
5 7
6extern struct pxa_device_desc pxa168_device_uart1; 8extern struct pxa_device_desc pxa168_device_uart1;
7extern struct pxa_device_desc pxa168_device_uart2; 9extern struct pxa_device_desc pxa168_device_uart2;
10extern struct pxa_device_desc pxa168_device_twsi0;
11extern struct pxa_device_desc pxa168_device_twsi1;
8 12
9static inline int pxa168_add_uart(int id) 13static inline int pxa168_add_uart(int id)
10{ 14{
@@ -20,4 +24,24 @@ static inline int pxa168_add_uart(int id)
20 24
21 return pxa_register_device(d, NULL, 0); 25 return pxa_register_device(d, NULL, 0);
22} 26}
27
28static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
29 struct i2c_board_info *info, unsigned size)
30{
31 struct pxa_device_desc *d = NULL;
32 int ret;
33
34 switch (id) {
35 case 0: d = &pxa168_device_twsi0; break;
36 case 1: d = &pxa168_device_twsi1; break;
37 default:
38 return -EINVAL;
39 }
40
41 ret = i2c_register_board_info(id, info, size);
42 if (ret)
43 return ret;
44
45 return pxa_register_device(d, data, sizeof(*data));
46}
23#endif /* __ASM_MACH_PXA168_H */ 47#endif /* __ASM_MACH_PXA168_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index b7aeaf574c36..a0f0cbee1c07 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -1,10 +1,14 @@
1#ifndef __ASM_MACH_PXA910_H 1#ifndef __ASM_MACH_PXA910_H
2#define __ASM_MACH_PXA910_H 2#define __ASM_MACH_PXA910_H
3 3
4#include <linux/i2c.h>
4#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h>
5 7
6extern struct pxa_device_desc pxa910_device_uart1; 8extern struct pxa_device_desc pxa910_device_uart1;
7extern struct pxa_device_desc pxa910_device_uart2; 9extern struct pxa_device_desc pxa910_device_uart2;
10extern struct pxa_device_desc pxa910_device_twsi0;
11extern struct pxa_device_desc pxa910_device_twsi1;
8 12
9static inline int pxa910_add_uart(int id) 13static inline int pxa910_add_uart(int id)
10{ 14{
@@ -20,4 +24,24 @@ static inline int pxa910_add_uart(int id)
20 24
21 return pxa_register_device(d, NULL, 0); 25 return pxa_register_device(d, NULL, 0);
22} 26}
27
28static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
29 struct i2c_board_info *info, unsigned size)
30{
31 struct pxa_device_desc *d = NULL;
32 int ret;
33
34 switch (id) {
35 case 0: d = &pxa910_device_twsi0; break;
36 case 1: d = &pxa910_device_twsi1; break;
37 default:
38 return -EINVAL;
39 }
40
41 ret = i2c_register_board_info(id, info, size);
42 if (ret)
43 return ret;
44
45 return pxa_register_device(d, data, sizeof(*data));
46}
23#endif /* __ASM_MACH_PXA910_H */ 47#endif /* __ASM_MACH_PXA910_H */
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index ae924468658c..e0729e34f7ad 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -65,11 +65,15 @@ void __init pxa168_init_irq(void)
65/* APB peripheral clocks */ 65/* APB peripheral clocks */
66static APBC_CLK(uart1, PXA168_UART1, 1, 14745600); 66static APBC_CLK(uart1, PXA168_UART1, 1, 14745600);
67static APBC_CLK(uart2, PXA168_UART2, 1, 14745600); 67static APBC_CLK(uart2, PXA168_UART2, 1, 14745600);
68static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
69static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
68 70
69/* device and clock bindings */ 71/* device and clock bindings */
70static struct clk_lookup pxa168_clkregs[] = { 72static struct clk_lookup pxa168_clkregs[] = {
71 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 73 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
72 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), 74 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
75 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
76 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
73}; 77};
74 78
75static int __init pxa168_init(void) 79static int __init pxa168_init(void)
@@ -109,3 +113,5 @@ struct sys_timer pxa168_timer = {
109/* on-chip devices */ 113/* on-chip devices */
110PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); 114PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
111PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); 115PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);
116PXA168_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28);
117PXA168_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28);
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 453f8f7758bf..b97328b96ce7 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -103,11 +103,15 @@ void __init pxa910_init_irq(void)
103/* APB peripheral clocks */ 103/* APB peripheral clocks */
104static APBC_CLK(uart1, PXA910_UART0, 1, 14745600); 104static APBC_CLK(uart1, PXA910_UART0, 1, 14745600);
105static APBC_CLK(uart2, PXA910_UART1, 1, 14745600); 105static APBC_CLK(uart2, PXA910_UART1, 1, 14745600);
106static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
107static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
106 108
107/* device and clock bindings */ 109/* device and clock bindings */
108static struct clk_lookup pxa910_clkregs[] = { 110static struct clk_lookup pxa910_clkregs[] = {
109 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 111 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
110 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), 112 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
113 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
114 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
111}; 115};
112 116
113static int __init pxa910_init(void) 117static int __init pxa910_init(void)
@@ -156,3 +160,5 @@ struct sys_timer pxa910_timer = {
156 */ 160 */
157PXA910_DEVICE(uart1, "pxa2xx-uart", 0, UART2, 0xd4017000, 0x30, 21, 22); 161PXA910_DEVICE(uart1, "pxa2xx-uart", 0, UART2, 0xd4017000, 0x30, 21, 22);
158PXA910_DEVICE(uart2, "pxa2xx-uart", 1, UART3, 0xd4018000, 0x30, 23, 24); 162PXA910_DEVICE(uart2, "pxa2xx-uart", 1, UART3, 0xd4018000, 0x30, 23, 24);
163PXA910_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28);
164PXA910_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28);