diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-03-31 22:39:28 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2011-07-12 07:50:38 -0400 |
commit | e04eb14fd28ab044a48fd0a71e8c9117087176fb (patch) | |
tree | e48cb690a2261ffa1520e7a8a91f09fac7d89b44 /arch/arm/mach-mmp | |
parent | f16e05c7501d6cc5d7c947e8d8ff2f8ac6fa97f4 (diff) |
ARM: mmp/dkb: enable max7312 gpio expander
Support max7312 gpio expander in TTC DKB.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/ttc_dkb.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index e411039ea59e..6bd37a27e5fc 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/mtd/partitions.h> | 15 | #include <linux/mtd/partitions.h> |
16 | #include <linux/mtd/onenand.h> | 16 | #include <linux/mtd/onenand.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/i2c/pca953x.h> | ||
19 | #include <linux/gpio.h> | ||
18 | 20 | ||
19 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
20 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -25,7 +27,17 @@ | |||
25 | 27 | ||
26 | #include "common.h" | 28 | #include "common.h" |
27 | 29 | ||
28 | #define TTCDKB_NR_IRQS (IRQ_BOARD_START + 24) | 30 | #define TTCDKB_GPIO_EXT0(x) (NR_BUILTIN_GPIO + ((x < 0) ? 0 : \ |
31 | ((x < 16) ? x : 15))) | ||
32 | #define TTCDKB_GPIO_EXT1(x) (NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \ | ||
33 | ((x < 16) ? x : 15))) | ||
34 | |||
35 | /* | ||
36 | * 16 board interrupts -- MAX7312 GPIO expander | ||
37 | * 16 board interrupts -- PCA9575 GPIO expander | ||
38 | * 24 board interrupts -- 88PM860x PMIC | ||
39 | */ | ||
40 | #define TTCDKB_NR_IRQS (IRQ_BOARD_START + 16 + 16 + 24) | ||
29 | 41 | ||
30 | static unsigned long ttc_dkb_pin_config[] __initdata = { | 42 | static unsigned long ttc_dkb_pin_config[] __initdata = { |
31 | /* UART2 */ | 43 | /* UART2 */ |
@@ -113,6 +125,22 @@ static struct platform_device *ttc_dkb_devices[] = { | |||
113 | &ttc_dkb_device_onenand, | 125 | &ttc_dkb_device_onenand, |
114 | }; | 126 | }; |
115 | 127 | ||
128 | static struct pca953x_platform_data max7312_data[] = { | ||
129 | { | ||
130 | .gpio_base = TTCDKB_GPIO_EXT0(0), | ||
131 | .irq_base = IRQ_BOARD_START, | ||
132 | }, | ||
133 | }; | ||
134 | |||
135 | static struct i2c_board_info ttc_dkb_i2c_info[] = { | ||
136 | { | ||
137 | .type = "max7312", | ||
138 | .addr = 0x23, | ||
139 | .irq = IRQ_GPIO(80), | ||
140 | .platform_data = &max7312_data, | ||
141 | }, | ||
142 | }; | ||
143 | |||
116 | static void __init ttc_dkb_init(void) | 144 | static void __init ttc_dkb_init(void) |
117 | { | 145 | { |
118 | mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); | 146 | mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); |
@@ -121,6 +149,7 @@ static void __init ttc_dkb_init(void) | |||
121 | pxa910_add_uart(1); | 149 | pxa910_add_uart(1); |
122 | 150 | ||
123 | /* off-chip devices */ | 151 | /* off-chip devices */ |
152 | pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); | ||
124 | platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); | 153 | platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); |
125 | } | 154 | } |
126 | 155 | ||