aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIan Molton <spyro@f2s.com>2008-09-26 08:38:59 -0400
committerIan Molton <spyro@f2s.com>2008-12-14 22:29:34 -0500
commitb1ae1b7b274f67c149bee4731e38a7516c723de4 (patch)
tree9f31ef6e8fb28359f6dbc8bb7ecac2c75bce2fa1 /arch
parentf4ad9a9624fafec4647e7e45469e0446586f81fb (diff)
[ARM] pxa: Add multi-io support for e-series
This patchset provides support for the TMIO based IO controller used in the Toshiba e-series PDAs. Signed-off-by: Ian Molton <spyro@f2s.com> Acked-by: Samuel Ortiz <sameo@openedhand.com> Acked-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/e330.c36
-rw-r--r--arch/arm/mach-pxa/e350.c36
-rw-r--r--arch/arm/mach-pxa/e400.c65
-rw-r--r--arch/arm/mach-pxa/e740.c36
-rw-r--r--arch/arm/mach-pxa/e750.c33
-rw-r--r--arch/arm/mach-pxa/e800.c30
-rw-r--r--arch/arm/mach-pxa/eseries.c81
-rw-r--r--arch/arm/mach-pxa/eseries.h9
-rw-r--r--arch/arm/mach-pxa/include/mach/eseries-gpio.h2
9 files changed, 320 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
index d488eded2058..1bd7f740427c 100644
--- a/arch/arm/mach-pxa/e330.c
+++ b/arch/arm/mach-pxa/e330.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Hardware definitions for the Toshiba eseries PDAs 2 * Hardware definitions for the Toshiba e330 PDAs
3 * 3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com> 4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 * 5 *
@@ -12,6 +12,9 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/tc6387xb.h>
15 18
16#include <asm/setup.h> 19#include <asm/setup.h>
17#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -19,13 +22,44 @@
19 22
20#include <mach/mfp-pxa25x.h> 23#include <mach/mfp-pxa25x.h>
21#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/pxa-regs.h>
26#include <mach/eseries-gpio.h>
22#include <mach/udc.h> 27#include <mach/udc.h>
23 28
24#include "generic.h" 29#include "generic.h"
25#include "eseries.h" 30#include "eseries.h"
31#include "clock.h"
32
33/* -------------------- e330 tc6387xb parameters -------------------- */
34
35static struct tc6387xb_platform_data e330_tc6387xb_info = {
36 .enable = &eseries_tmio_enable,
37 .disable = &eseries_tmio_disable,
38 .suspend = &eseries_tmio_suspend,
39 .resume = &eseries_tmio_resume,
40};
41
42static struct platform_device e330_tc6387xb_device = {
43 .name = "tc6387xb",
44 .id = -1,
45 .dev = {
46 .platform_data = &e330_tc6387xb_info,
47 },
48 .num_resources = 2,
49 .resource = eseries_tmio_resources,
50};
51
52/* --------------------------------------------------------------- */
53
54static struct platform_device *devices[] __initdata = {
55 &e330_tc6387xb_device,
56};
26 57
27static void __init e330_init(void) 58static void __init e330_init(void)
28{ 59{
60 eseries_register_clks();
61 eseries_get_tmio_gpios();
62 platform_add_devices(devices, ARRAY_SIZE(devices));
29 pxa_set_udc_info(&e7xx_udc_mach_info); 63 pxa_set_udc_info(&e7xx_udc_mach_info);
30} 64}
31 65
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
index 8ecbc5479828..251129391d7d 100644
--- a/arch/arm/mach-pxa/e350.c
+++ b/arch/arm/mach-pxa/e350.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Hardware definitions for the Toshiba eseries PDAs 2 * Hardware definitions for the Toshiba e350 PDAs
3 * 3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com> 4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 * 5 *
@@ -12,20 +12,54 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/t7l66xb.h>
15 18
16#include <asm/setup.h> 19#include <asm/setup.h>
17#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
18#include <asm/mach-types.h> 21#include <asm/mach-types.h>
19 22
20#include <mach/mfp-pxa25x.h> 23#include <mach/mfp-pxa25x.h>
24#include <mach/pxa-regs.h>
21#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/eseries-gpio.h>
22#include <mach/udc.h> 27#include <mach/udc.h>
23 28
24#include "generic.h" 29#include "generic.h"
25#include "eseries.h" 30#include "eseries.h"
31#include "clock.h"
32
33/* -------------------- e350 t7l66xb parameters -------------------- */
34
35static struct t7l66xb_platform_data e350_t7l66xb_info = {
36 .irq_base = IRQ_BOARD_START,
37 .enable = &eseries_tmio_enable,
38 .suspend = &eseries_tmio_suspend,
39 .resume = &eseries_tmio_resume,
40};
41
42static struct platform_device e350_t7l66xb_device = {
43 .name = "t7l66xb",
44 .id = -1,
45 .dev = {
46 .platform_data = &e350_t7l66xb_info,
47 },
48 .num_resources = 2,
49 .resource = eseries_tmio_resources,
50};
51
52/* ---------------------------------------------------------- */
53
54static struct platform_device *devices[] __initdata = {
55 &e350_t7l66xb_device,
56};
26 57
27static void __init e350_init(void) 58static void __init e350_init(void)
28{ 59{
60 eseries_register_clks();
61 eseries_get_tmio_gpios();
62 platform_add_devices(devices, ARRAY_SIZE(devices));
29 pxa_set_udc_info(&e7xx_udc_mach_info); 63 pxa_set_udc_info(&e7xx_udc_mach_info);
30} 64}
31 65
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index 544bbaa20621..7716ad0c3b34 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -12,20 +12,26 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/t7l66xb.h>
18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h>
15 20
16#include <asm/setup.h> 21#include <asm/setup.h>
17#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
18#include <asm/mach-types.h> 23#include <asm/mach-types.h>
19 24
20#include <mach/pxa-regs.h>
21#include <mach/mfp-pxa25x.h> 25#include <mach/mfp-pxa25x.h>
26#include <mach/pxa-regs.h>
22#include <mach/hardware.h> 27#include <mach/hardware.h>
23 28#include <mach/eseries-gpio.h>
24#include <mach/pxafb.h> 29#include <mach/pxafb.h>
25#include <mach/udc.h> 30#include <mach/udc.h>
26 31
27#include "generic.h" 32#include "generic.h"
28#include "eseries.h" 33#include "eseries.h"
34#include "clock.h"
29 35
30/* ------------------------ E400 LCD definitions ------------------------ */ 36/* ------------------------ E400 LCD definitions ------------------------ */
31 37
@@ -65,7 +71,10 @@ static unsigned long e400_pin_config[] __initdata = {
65 GPIO42_BTUART_RXD, 71 GPIO42_BTUART_RXD,
66 GPIO43_BTUART_TXD, 72 GPIO43_BTUART_TXD,
67 GPIO44_BTUART_CTS, 73 GPIO44_BTUART_CTS,
68 GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ 74
75 /* TMIO controller */
76 GPIO19_GPIO, /* t7l66xb #PCLR */
77 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
69 78
70 /* wakeup */ 79 /* wakeup */
71 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, 80 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
@@ -73,10 +82,60 @@ static unsigned long e400_pin_config[] __initdata = {
73 82
74/* ---------------------------------------------------------------------- */ 83/* ---------------------------------------------------------------------- */
75 84
85static struct mtd_partition partition_a = {
86 .name = "Internal NAND flash",
87 .offset = 0,
88 .size = MTDPART_SIZ_FULL,
89};
90
91static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
92
93static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
94 .options = 0,
95 .offs = 4,
96 .len = 2,
97 .pattern = scan_ff_pattern
98};
99
100static struct tmio_nand_data e400_t7l66xb_nand_config = {
101 .num_partitions = 1,
102 .partition = &partition_a,
103 .badblock_pattern = &e400_t7l66xb_nand_bbt,
104};
105
106static struct t7l66xb_platform_data e400_t7l66xb_info = {
107 .irq_base = IRQ_BOARD_START,
108 .enable = &eseries_tmio_enable,
109 .suspend = &eseries_tmio_suspend,
110 .resume = &eseries_tmio_resume,
111
112 .nand_data = &e400_t7l66xb_nand_config,
113};
114
115static struct platform_device e400_t7l66xb_device = {
116 .name = "t7l66xb",
117 .id = -1,
118 .dev = {
119 .platform_data = &e400_t7l66xb_info,
120 },
121 .num_resources = 2,
122 .resource = eseries_tmio_resources,
123};
124
125/* ---------------------------------------------------------- */
126
127static struct platform_device *devices[] __initdata = {
128 &e400_t7l66xb_device,
129};
130
76static void __init e400_init(void) 131static void __init e400_init(void)
77{ 132{
78 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); 133 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
134 /* Fixme - e400 may have a switched clock */
135 eseries_register_clks();
136 eseries_get_tmio_gpios();
79 set_pxa_fb_info(&e400_pxafb_mach_info); 137 set_pxa_fb_info(&e400_pxafb_mach_info);
138 platform_add_devices(devices, ARRAY_SIZE(devices));
80 pxa_set_udc_info(&e7xx_udc_mach_info); 139 pxa_set_udc_info(&e7xx_udc_mach_info);
81} 140}
82 141
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index a9f070b1b80f..b00d670b2ea6 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -15,6 +15,8 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include <linux/clk.h>
19#include <linux/mfd/t7l66xb.h>
18 20
19#include <video/w100fb.h> 21#include <video/w100fb.h>
20 22
@@ -23,13 +25,16 @@
23#include <asm/mach-types.h> 25#include <asm/mach-types.h>
24 26
25#include <mach/mfp-pxa25x.h> 27#include <mach/mfp-pxa25x.h>
28#include <mach/pxa-regs.h>
26#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/eseries-gpio.h>
27#include <mach/udc.h> 31#include <mach/udc.h>
28#include <mach/irda.h> 32#include <mach/irda.h>
29 33
30#include "generic.h" 34#include "generic.h"
31#include "eseries.h" 35#include "eseries.h"
32 36#include "clock.h"
37#include "devices.h"
33 38
34/* ------------------------ e740 video support --------------------------- */ 39/* ------------------------ e740 video support --------------------------- */
35 40
@@ -117,7 +122,10 @@ static unsigned long e740_pin_config[] __initdata = {
117 GPIO42_BTUART_RXD, 122 GPIO42_BTUART_RXD,
118 GPIO43_BTUART_TXD, 123 GPIO43_BTUART_TXD,
119 GPIO44_BTUART_CTS, 124 GPIO44_BTUART_CTS,
120 GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ 125
126 /* TMIO controller */
127 GPIO19_GPIO, /* t7l66xb #PCLR */
128 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
121 129
122 /* UDC */ 130 /* UDC */
123 GPIO13_GPIO, 131 GPIO13_GPIO,
@@ -150,15 +158,39 @@ static unsigned long e740_pin_config[] __initdata = {
150 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, 158 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
151}; 159};
152 160
161/* -------------------- e740 t7l66xb parameters -------------------- */
162
163static struct t7l66xb_platform_data e740_t7l66xb_info = {
164 .irq_base = IRQ_BOARD_START,
165 .enable = &eseries_tmio_enable,
166 .suspend = &eseries_tmio_suspend,
167 .resume = &eseries_tmio_resume,
168};
169
170static struct platform_device e740_t7l66xb_device = {
171 .name = "t7l66xb",
172 .id = -1,
173 .dev = {
174 .platform_data = &e740_t7l66xb_info,
175 },
176 .num_resources = 2,
177 .resource = eseries_tmio_resources,
178};
179
153/* ----------------------------------------------------------------------- */ 180/* ----------------------------------------------------------------------- */
154 181
155static struct platform_device *devices[] __initdata = { 182static struct platform_device *devices[] __initdata = {
156 &e740_fb_device, 183 &e740_fb_device,
184 &e740_t7l66xb_device,
157}; 185};
158 186
159static void __init e740_init(void) 187static void __init e740_init(void)
160{ 188{
161 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); 189 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
190 eseries_register_clks();
191 clk_add_alias("CLK_CK48M", &e740_t7l66xb_device.dev,
192 "UDCCLK", &pxa25x_device_udc.dev),
193 eseries_get_tmio_gpios();
162 platform_add_devices(devices, ARRAY_SIZE(devices)); 194 platform_add_devices(devices, ARRAY_SIZE(devices));
163 pxa_set_udc_info(&e7xx_udc_mach_info); 195 pxa_set_udc_info(&e7xx_udc_mach_info);
164 e7xx_irda_init(); 196 e7xx_irda_init();
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 1410ad7e20b1..84d7c1aac58d 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -15,6 +15,7 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include <linux/mfd/tc6393xb.h>
18 19
19#include <video/w100fb.h> 20#include <video/w100fb.h>
20 21
@@ -23,12 +24,15 @@
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24 25
25#include <mach/mfp-pxa25x.h> 26#include <mach/mfp-pxa25x.h>
27#include <mach/pxa-regs.h>
26#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/eseries-gpio.h>
27#include <mach/udc.h> 30#include <mach/udc.h>
28#include <mach/irda.h> 31#include <mach/irda.h>
29 32
30#include "generic.h" 33#include "generic.h"
31#include "eseries.h" 34#include "eseries.h"
35#include "clock.h"
32 36
33/* ---------------------- E750 LCD definitions -------------------- */ 37/* ---------------------- E750 LCD definitions -------------------- */
34 38
@@ -101,14 +105,41 @@ static struct platform_device e750_fb_device = {
101 .resource = e750_fb_resources, 105 .resource = e750_fb_resources,
102}; 106};
103 107
104/* ----------------------------------------------------------------------- */ 108/* ----------------- e750 tc6393xb parameters ------------------ */
109
110static struct tc6393xb_platform_data e750_tc6393xb_info = {
111 .irq_base = IRQ_BOARD_START,
112 .scr_pll2cr = 0x0cc1,
113 .scr_gper = 0,
114 .gpio_base = -1,
115 .suspend = &eseries_tmio_suspend,
116 .resume = &eseries_tmio_resume,
117 .enable = &eseries_tmio_enable,
118 .disable = &eseries_tmio_disable,
119};
120
121static struct platform_device e750_tc6393xb_device = {
122 .name = "tc6393xb",
123 .id = -1,
124 .dev = {
125 .platform_data = &e750_tc6393xb_info,
126 },
127 .num_resources = 2,
128 .resource = eseries_tmio_resources,
129};
130
131/* ------------------------------------------------------------- */
105 132
106static struct platform_device *devices[] __initdata = { 133static struct platform_device *devices[] __initdata = {
107 &e750_fb_device, 134 &e750_fb_device,
135 &e750_tc6393xb_device,
108}; 136};
109 137
110static void __init e750_init(void) 138static void __init e750_init(void)
111{ 139{
140 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
141 "GPIO11_CLK", NULL),
142 eseries_get_tmio_gpios();
112 platform_add_devices(devices, ARRAY_SIZE(devices)); 143 platform_add_devices(devices, ARRAY_SIZE(devices));
113 pxa_set_udc_info(&e7xx_udc_mach_info); 144 pxa_set_udc_info(&e7xx_udc_mach_info);
114 e7xx_irda_init(); 145 e7xx_irda_init();
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index a293e09bfe25..9a86a426f924 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -15,6 +15,7 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include <linux/mfd/tc6393xb.h>
18 19
19#include <video/w100fb.h> 20#include <video/w100fb.h>
20 21
@@ -23,12 +24,14 @@
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24 25
25#include <mach/mfp-pxa25x.h> 26#include <mach/mfp-pxa25x.h>
27#include <mach/pxa-regs.h>
26#include <mach/hardware.h> 28#include <mach/hardware.h>
27#include <mach/eseries-gpio.h> 29#include <mach/eseries-gpio.h>
28#include <mach/udc.h> 30#include <mach/udc.h>
29 31
30#include "generic.h" 32#include "generic.h"
31#include "eseries.h" 33#include "eseries.h"
34#include "clock.h"
32 35
33/* ------------------------ e800 LCD definitions ------------------------- */ 36/* ------------------------ e800 LCD definitions ------------------------- */
34 37
@@ -160,14 +163,41 @@ static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
160 .gpio_pullup_inverted = 1 163 .gpio_pullup_inverted = 1
161}; 164};
162 165
166/* ----------------- e800 tc6393xb parameters ------------------ */
167
168static struct tc6393xb_platform_data e800_tc6393xb_info = {
169 .irq_base = IRQ_BOARD_START,
170 .scr_pll2cr = 0x0cc1,
171 .scr_gper = 0,
172 .gpio_base = -1,
173 .suspend = &eseries_tmio_suspend,
174 .resume = &eseries_tmio_resume,
175 .enable = &eseries_tmio_enable,
176 .disable = &eseries_tmio_disable,
177};
178
179static struct platform_device e800_tc6393xb_device = {
180 .name = "tc6393xb",
181 .id = -1,
182 .dev = {
183 .platform_data = &e800_tc6393xb_info,
184 },
185 .num_resources = 2,
186 .resource = eseries_tmio_resources,
187};
188
163/* ----------------------------------------------------------------------- */ 189/* ----------------------------------------------------------------------- */
164 190
165static struct platform_device *devices[] __initdata = { 191static struct platform_device *devices[] __initdata = {
166 &e800_fb_device, 192 &e800_fb_device,
193 &e800_tc6393xb_device,
167}; 194};
168 195
169static void __init e800_init(void) 196static void __init e800_init(void)
170{ 197{
198 clk_add_alias("CLK_CK3P6MI", &e800_tc6393xb_device.dev,
199 "GPIO11_CLK", NULL),
200 eseries_get_tmio_gpios();
171 platform_add_devices(devices, ARRAY_SIZE(devices)); 201 platform_add_devices(devices, ARRAY_SIZE(devices));
172 pxa_set_udc_info(&e800_udc_mach_info); 202 pxa_set_udc_info(&e800_udc_mach_info);
173} 203}
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index ee79e33b1748..dfce7d5b659e 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/delay.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17 18
18#include <asm/setup.h> 19#include <asm/setup.h>
@@ -26,6 +27,7 @@
26#include <mach/irda.h> 27#include <mach/irda.h>
27 28
28#include "generic.h" 29#include "generic.h"
30#include "clock.h"
29 31
30/* Only e800 has 128MB RAM */ 32/* Only e800 has 128MB RAM */
31void __init eseries_fixup(struct machine_desc *desc, 33void __init eseries_fixup(struct machine_desc *desc,
@@ -86,3 +88,82 @@ struct pxaficp_platform_data e7xx_ficp_platform_data = {
86 .shutdown = e7xx_irda_shutdown, 88 .shutdown = e7xx_irda_shutdown,
87}; 89};
88 90
91int eseries_tmio_enable(struct platform_device *dev)
92{
93 /* Reset - bring SUSPEND high before PCLR */
94 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
95 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
96 msleep(1);
97 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
98 msleep(1);
99 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
100 msleep(1);
101 return 0;
102}
103
104int eseries_tmio_disable(struct platform_device *dev)
105{
106 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
107 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
108 return 0;
109}
110
111int eseries_tmio_suspend(struct platform_device *dev)
112{
113 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
114 return 0;
115}
116
117int eseries_tmio_resume(struct platform_device *dev)
118{
119 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
120 msleep(1);
121 return 0;
122}
123
124void eseries_get_tmio_gpios(void)
125{
126 gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
127 gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
128 gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
129 gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
130}
131
132/* TMIO controller uses the same resources on all e-series machines. */
133struct resource eseries_tmio_resources[] = {
134 [0] = {
135 .start = PXA_CS4_PHYS,
136 .end = PXA_CS4_PHYS + 0x1fffff,
137 .flags = IORESOURCE_MEM,
138 },
139 [1] = {
140 .start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
141 .end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
142 .flags = IORESOURCE_IRQ,
143 },
144};
145
146/* Some e-series hardware cannot control the 32K clock */
147static void clk_32k_dummy(struct clk *clk)
148{
149}
150
151static const struct clkops clk_32k_dummy_ops = {
152 .enable = clk_32k_dummy,
153 .disable = clk_32k_dummy,
154};
155
156static struct clk tmio_dummy_clk = {
157 .ops = &clk_32k_dummy_ops,
158 .rate = 32768,
159};
160
161static struct clk_lookup eseries_clkregs[] = {
162 INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
163};
164
165void eseries_register_clks(void)
166{
167 clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
168}
169
diff --git a/arch/arm/mach-pxa/eseries.h b/arch/arm/mach-pxa/eseries.h
index bcfc589d6e22..5930f5e2a123 100644
--- a/arch/arm/mach-pxa/eseries.h
+++ b/arch/arm/mach-pxa/eseries.h
@@ -5,3 +5,12 @@ extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info;
5extern struct pxaficp_platform_data e7xx_ficp_platform_data; 5extern struct pxaficp_platform_data e7xx_ficp_platform_data;
6extern int e7xx_irda_init(void); 6extern int e7xx_irda_init(void);
7 7
8extern int eseries_tmio_enable(struct platform_device *dev);
9extern int eseries_tmio_disable(struct platform_device *dev);
10extern int eseries_tmio_suspend(struct platform_device *dev);
11extern int eseries_tmio_resume(struct platform_device *dev);
12extern void eseries_get_tmio_gpios(void);
13extern struct resource eseries_tmio_resources[];
14extern struct platform_device e300_tc6387xb_device;
15extern void eseries_register_clks(void);
16
diff --git a/arch/arm/mach-pxa/include/mach/eseries-gpio.h b/arch/arm/mach-pxa/include/mach/eseries-gpio.h
index 794bc338b4df..efbd2aa9ecec 100644
--- a/arch/arm/mach-pxa/include/mach/eseries-gpio.h
+++ b/arch/arm/mach-pxa/include/mach/eseries-gpio.h
@@ -47,4 +47,6 @@
47 47
48/* ASIC related GPIOs */ 48/* ASIC related GPIOs */
49#define GPIO_ESERIES_TMIO_IRQ 5 49#define GPIO_ESERIES_TMIO_IRQ 5
50#define GPIO_ESERIES_TMIO_PCLR 19
51#define GPIO_ESERIES_TMIO_SUSPEND 45
50#define GPIO_E800_ANGELX_IRQ 8 52#define GPIO_E800_ANGELX_IRQ 8