aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-15 05:36:25 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-15 05:36:25 -0500
commit1f7f569c0ae6e619504095eabf796edd712d943d (patch)
treeee7b579923772699a326626d570cff5ecb94a7af /arch/arm
parenta02f45cfca97dcf97c03b32603ec2399bf006605 (diff)
parente38a9707d8d94de86fe84109fa6823ddc969721a (diff)
Merge branch 'for_rmk' of git://git.mnementh.co.uk/linux-2.6-im into devel
Diffstat (limited to 'arch/arm')
-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.c46
-rw-r--r--arch/arm/mach-pxa/e750.c36
-rw-r--r--arch/arm/mach-pxa/e800.c30
-rw-r--r--arch/arm/mach-pxa/eseries.c124
-rw-r--r--arch/arm/mach-pxa/eseries.h12
-rw-r--r--arch/arm/mach-pxa/include/mach/eseries-gpio.h4
9 files changed, 380 insertions, 9 deletions
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
index d488eded205..1bd7f740427 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 8ecbc547982..251129391d7 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 544bbaa2062..7716ad0c3b3 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 c57a15b37f0..b00d670b2ea 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,12 +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>
32#include <mach/irda.h>
28 33
29#include "generic.h" 34#include "generic.h"
30#include "eseries.h" 35#include "eseries.h"
31 36#include "clock.h"
37#include "devices.h"
32 38
33/* ------------------------ e740 video support --------------------------- */ 39/* ------------------------ e740 video support --------------------------- */
34 40
@@ -116,7 +122,17 @@ static unsigned long e740_pin_config[] __initdata = {
116 GPIO42_BTUART_RXD, 122 GPIO42_BTUART_RXD,
117 GPIO43_BTUART_TXD, 123 GPIO43_BTUART_TXD,
118 GPIO44_BTUART_CTS, 124 GPIO44_BTUART_CTS,
119 GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ 125
126 /* TMIO controller */
127 GPIO19_GPIO, /* t7l66xb #PCLR */
128 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
129
130 /* UDC */
131 GPIO13_GPIO,
132 GPIO3_GPIO,
133
134 /* IrDA */
135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
120 136
121 /* PC Card */ 137 /* PC Card */
122 GPIO8_GPIO, /* CD0 */ 138 GPIO8_GPIO, /* CD0 */
@@ -142,17 +158,43 @@ static unsigned long e740_pin_config[] __initdata = {
142 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, 158 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
143}; 159};
144 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
145/* ----------------------------------------------------------------------- */ 180/* ----------------------------------------------------------------------- */
146 181
147static struct platform_device *devices[] __initdata = { 182static struct platform_device *devices[] __initdata = {
148 &e740_fb_device, 183 &e740_fb_device,
184 &e740_t7l66xb_device,
149}; 185};
150 186
151static void __init e740_init(void) 187static void __init e740_init(void)
152{ 188{
153 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();
154 platform_add_devices(devices, ARRAY_SIZE(devices)); 194 platform_add_devices(devices, ARRAY_SIZE(devices));
155 pxa_set_udc_info(&e7xx_udc_mach_info); 195 pxa_set_udc_info(&e7xx_udc_mach_info);
196 e7xx_irda_init();
197 pxa_set_ficp_info(&e7xx_ficp_platform_data);
156} 198}
157 199
158MACHINE_START(E740, "Toshiba e740") 200MACHINE_START(E740, "Toshiba e740")
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 640e738b85d..84d7c1aac58 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,11 +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>
31#include <mach/irda.h>
28 32
29#include "generic.h" 33#include "generic.h"
30#include "eseries.h" 34#include "eseries.h"
35#include "clock.h"
31 36
32/* ---------------------- E750 LCD definitions -------------------- */ 37/* ---------------------- E750 LCD definitions -------------------- */
33 38
@@ -100,16 +105,45 @@ static struct platform_device e750_fb_device = {
100 .resource = e750_fb_resources, 105 .resource = e750_fb_resources,
101}; 106};
102 107
103/* ----------------------------------------------------------------------- */ 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/* ------------------------------------------------------------- */
104 132
105static struct platform_device *devices[] __initdata = { 133static struct platform_device *devices[] __initdata = {
106 &e750_fb_device, 134 &e750_fb_device,
135 &e750_tc6393xb_device,
107}; 136};
108 137
109static void __init e750_init(void) 138static void __init e750_init(void)
110{ 139{
140 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
141 "GPIO11_CLK", NULL),
142 eseries_get_tmio_gpios();
111 platform_add_devices(devices, ARRAY_SIZE(devices)); 143 platform_add_devices(devices, ARRAY_SIZE(devices));
112 pxa_set_udc_info(&e7xx_udc_mach_info); 144 pxa_set_udc_info(&e7xx_udc_mach_info);
145 e7xx_irda_init();
146 pxa_set_ficp_info(&e7xx_ficp_platform_data);
113} 147}
114 148
115MACHINE_START(E750, "Toshiba e750") 149MACHINE_START(E750, "Toshiba e750")
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index a293e09bfe2..9a86a426f92 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 d28849b50a1..dfce7d5b659 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -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/gpio.h>
16#include <linux/delay.h>
17#include <linux/platform_device.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>
@@ -21,8 +24,10 @@
21#include <mach/hardware.h> 24#include <mach/hardware.h>
22#include <mach/eseries-gpio.h> 25#include <mach/eseries-gpio.h>
23#include <mach/udc.h> 26#include <mach/udc.h>
27#include <mach/irda.h>
24 28
25#include "generic.h" 29#include "generic.h"
30#include "clock.h"
26 31
27/* Only e800 has 128MB RAM */ 32/* Only e800 has 128MB RAM */
28void __init eseries_fixup(struct machine_desc *desc, 33void __init eseries_fixup(struct machine_desc *desc,
@@ -43,3 +48,122 @@ struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
43 .gpio_pullup_inverted = 1 48 .gpio_pullup_inverted = 1
44}; 49};
45 50
51static void e7xx_irda_transceiver_mode(struct device *dev, int mode)
52{
53 if (mode & IR_OFF) {
54 gpio_set_value(GPIO_E7XX_IR_OFF, 1);
55 pxa2xx_transceiver_mode(dev, mode);
56 } else {
57 pxa2xx_transceiver_mode(dev, mode);
58 gpio_set_value(GPIO_E7XX_IR_OFF, 0);
59 }
60}
61
62int e7xx_irda_init(void)
63{
64 int ret;
65
66 ret = gpio_request(GPIO_E7XX_IR_OFF, "IrDA power");
67 if (ret)
68 goto out;
69
70 ret = gpio_direction_output(GPIO_E7XX_IR_OFF, 0);
71 if (ret)
72 goto out;
73
74 e7xx_irda_transceiver_mode(NULL, IR_SIRMODE | IR_OFF);
75out:
76 return ret;
77}
78
79static void e7xx_irda_shutdown(struct device *dev)
80{
81 e7xx_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
82 gpio_free(GPIO_E7XX_IR_OFF);
83}
84
85struct pxaficp_platform_data e7xx_ficp_platform_data = {
86 .transceiver_cap = IR_SIRMODE | IR_OFF,
87 .transceiver_mode = e7xx_irda_transceiver_mode,
88 .shutdown = e7xx_irda_shutdown,
89};
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 a83f88d4b6a..5930f5e2a12 100644
--- a/arch/arm/mach-pxa/eseries.h
+++ b/arch/arm/mach-pxa/eseries.h
@@ -2,3 +2,15 @@ void __init eseries_fixup(struct machine_desc *desc,
2 struct tag *tags, char **cmdline, struct meminfo *mi); 2 struct tag *tags, char **cmdline, struct meminfo *mi);
3 3
4extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info; 4extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info;
5extern struct pxaficp_platform_data e7xx_ficp_platform_data;
6extern int e7xx_irda_init(void);
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 4c90b131027..efbd2aa9ece 100644
--- a/arch/arm/mach-pxa/include/mach/eseries-gpio.h
+++ b/arch/arm/mach-pxa/include/mach/eseries-gpio.h
@@ -43,8 +43,10 @@
43#define GPIO_E800_PCMCIA_PWR1 73 43#define GPIO_E800_PCMCIA_PWR1 73
44 44
45/* e7xx IrDA power control */ 45/* e7xx IrDA power control */
46#define GPIO_E7XX_IR_ON 38 46#define GPIO_E7XX_IR_OFF 38
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