aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/include
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/mach-mmp/include
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/mach-mmp/include')
-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
3 files changed, 52 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 */