aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-20 20:52:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-20 20:52:36 -0400
commit050335db2a777ffaa859d77beb05fffe9e8c5ae9 (patch)
tree6f1fb3e3477de613b4adac8c46bd6e86301ed8ae /arch/arm/mach-pxa
parenta4cfae13cef6a700a04b13ba1d819c0641b1b26f (diff)
parent905f14672e6d0552bfde954d5f7adb5f2c7a7960 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (42 commits) [ARM] Fix tosa build error [ARM] 3610/1: Make reboot work on Versatile [ARM] 3609/1: S3C24XX: defconfig update for s3c2410_defconfig [ARM] 3591/1: Anubis: IDE device definitions [ARM] Include asm/hardware.h not asm/arch/hardware.h [ARM] 3594/1: Poodle: Add touchscreen support + other updates [ARM] 3564/1: sharpsl_pm: Abstract some machine specific parameters [ARM] 3561/1: Poodle: Correct the MMC/SD power control [ARM] 3593/1: Add reboot and shutdown handlers for Zaurus handhelds [ARM] 3599/1: AT91RM9200 remove global variables [ARM] 3607/1: AT91RM9200 misc fixes [ARM] 3605/1: AT91RM9200 Power Management [ARM] 3604/1: AT91RM9200 New boards [ARM] 3603/1: AT91RM9200 remove old files [ARM] 3592/1: AT91RM9200 Serial driver update [ARM] 3590/1: AT91RM9200 Platform devices support [ARM] 3589/1: AT91RM9200 DK/EK board update [ARM] 3588/1: AT91RM9200 CSB337/637 board update [ARM] 3587/1: AT91RM9200 hardware headers [ARM] 3586/1: AT91RM9200 header update ...
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig1
-rw-r--r--arch/arm/mach-pxa/Makefile2
-rw-r--r--arch/arm/mach-pxa/corgi.c25
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c23
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c42
-rw-r--r--arch/arm/mach-pxa/poodle.c108
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c7
-rw-r--r--arch/arm/mach-pxa/spitz.c25
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c15
-rw-r--r--arch/arm/mach-pxa/tosa.c26
10 files changed, 248 insertions, 26 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 0104fd142e70..ea5137f319c4 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -61,6 +61,7 @@ config MACH_POODLE
61 bool "Enable Sharp SL-5600 (Poodle) Support" 61 bool "Enable Sharp SL-5600 (Poodle) Support"
62 depends PXA_SHARPSL_25x 62 depends PXA_SHARPSL_25x
63 select SHARP_LOCOMO 63 select SHARP_LOCOMO
64 select PXA_SSP
64 65
65config MACH_CORGI 66config MACH_CORGI
66 bool "Enable Sharp SL-C700 (Corgi) Support" 67 bool "Enable Sharp SL-C700 (Corgi) Support"
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 4e8a983e2b83..1610690be419 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
15obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o 15obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o
16obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o 16obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o
17obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o 17obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
18obj-$(CONFIG_MACH_POODLE) += poodle.o 18obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o
19obj-$(CONFIG_MACH_TOSA) += tosa.o 19obj-$(CONFIG_MACH_TOSA) += tosa.o
20 20
21# Support for blinky lights 21# Support for blinky lights
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index d6d726036361..bf6648a83901 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -19,6 +19,7 @@
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/pm.h>
22 23
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/memory.h> 25#include <asm/memory.h>
@@ -26,6 +27,7 @@
26#include <asm/hardware.h> 27#include <asm/hardware.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/system.h>
29 31
30#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 33#include <asm/mach/map.h>
@@ -310,8 +312,31 @@ static struct platform_device *devices[] __initdata = {
310 &corgiled_device, 312 &corgiled_device,
311}; 313};
312 314
315static void corgi_poweroff(void)
316{
317 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
318
319 if (!machine_is_corgi())
320 /* Green LED off tells the bootloader to halt */
321 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
322 arm_machine_restart('h');
323}
324
325static void corgi_restart(char mode)
326{
327 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
328
329 if (!machine_is_corgi())
330 /* Green LED on tells the bootloader to reboot */
331 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
332 arm_machine_restart('h');
333}
334
313static void __init corgi_init(void) 335static void __init corgi_init(void)
314{ 336{
337 pm_power_off = corgi_poweroff;
338 arm_pm_restart = corgi_restart;
339
315 /* setup sleep mode values */ 340 /* setup sleep mode values */
316 PWER = 0x00000002; 341 PWER = 0x00000002;
317 PFER = 0x00000000; 342 PFER = 0x00000000;
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index 7a1ab73e9e10..4c3de4008a43 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -27,6 +27,13 @@
27#include <asm/arch/pxa-regs.h> 27#include <asm/arch/pxa-regs.h>
28#include "sharpsl.h" 28#include "sharpsl.h"
29 29
30#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
31#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */
32#define SHARPSL_CHARGE_ON_ACIN_HIGH 0x9b /* 6V */
33#define SHARPSL_CHARGE_ON_ACIN_LOW 0x34 /* 2V */
34#define SHARPSL_FATAL_ACIN_VOLT 182 /* 3.45V */
35#define SHARPSL_FATAL_NOACIN_VOLT 170 /* 3.40V */
36
30static void corgi_charger_init(void) 37static void corgi_charger_init(void)
31{ 38{
32 pxa_gpio_mode(CORGI_GPIO_ADC_TEMP_ON | GPIO_OUT); 39 pxa_gpio_mode(CORGI_GPIO_ADC_TEMP_ON | GPIO_OUT);
@@ -195,9 +202,16 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
195 .read_devdata = corgipm_read_devdata, 202 .read_devdata = corgipm_read_devdata,
196 .charger_wakeup = corgi_charger_wakeup, 203 .charger_wakeup = corgi_charger_wakeup,
197 .should_wakeup = corgi_should_wakeup, 204 .should_wakeup = corgi_should_wakeup,
198 .bat_levels = 40, 205 .backlight_limit = corgibl_limit_intensity,
199 .bat_levels_noac = spitz_battery_levels_noac, 206 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
200 .bat_levels_acin = spitz_battery_levels_acin, 207 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
208 .charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH,
209 .charge_acin_low = SHARPSL_CHARGE_ON_ACIN_LOW,
210 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
211 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
212 .bat_levels = 40,
213 .bat_levels_noac = spitz_battery_levels_noac,
214 .bat_levels_acin = spitz_battery_levels_acin,
201 .status_high_acin = 188, 215 .status_high_acin = 188,
202 .status_low_acin = 178, 216 .status_low_acin = 178,
203 .status_high_noac = 185, 217 .status_high_noac = 185,
@@ -214,6 +228,9 @@ static int __devinit corgipm_init(void)
214 if (!corgipm_device) 228 if (!corgipm_device)
215 return -ENOMEM; 229 return -ENOMEM;
216 230
231 if (!machine_is_corgi())
232 corgi_pm_machinfo.batfull_irq = 1;
233
217 corgipm_device->dev.platform_data = &corgi_pm_machinfo; 234 corgipm_device->dev.platform_data = &corgi_pm_machinfo;
218 ret = platform_device_add(corgipm_device); 235 ret = platform_device_add(corgipm_device);
219 236
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 8a25a1c8019f..f9421318cb7a 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -50,12 +50,14 @@ unsigned long corgi_ssp_ads7846_putget(ulong data)
50 unsigned long ret,flag; 50 unsigned long ret,flag;
51 51
52 spin_lock_irqsave(&corgi_ssp_lock, flag); 52 spin_lock_irqsave(&corgi_ssp_lock, flag);
53 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 53 if (ssp_machinfo->cs_ads7846 >= 0)
54 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
54 55
55 ssp_write_word(&corgi_ssp_dev,data); 56 ssp_write_word(&corgi_ssp_dev,data);
56 ret = ssp_read_word(&corgi_ssp_dev); 57 ret = ssp_read_word(&corgi_ssp_dev);
57 58
58 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 59 if (ssp_machinfo->cs_ads7846 >= 0)
60 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
59 spin_unlock_irqrestore(&corgi_ssp_lock, flag); 61 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
60 62
61 return ret; 63 return ret;
@@ -68,12 +70,14 @@ unsigned long corgi_ssp_ads7846_putget(ulong data)
68void corgi_ssp_ads7846_lock(void) 70void corgi_ssp_ads7846_lock(void)
69{ 71{
70 spin_lock(&corgi_ssp_lock); 72 spin_lock(&corgi_ssp_lock);
71 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 73 if (ssp_machinfo->cs_ads7846 >= 0)
74 GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
72} 75}
73 76
74void corgi_ssp_ads7846_unlock(void) 77void corgi_ssp_ads7846_unlock(void)
75{ 78{
76 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); 79 if (ssp_machinfo->cs_ads7846 >= 0)
80 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846);
77 spin_unlock(&corgi_ssp_lock); 81 spin_unlock(&corgi_ssp_lock);
78} 82}
79 83
@@ -110,11 +114,13 @@ unsigned long corgi_ssp_dac_put(ulong data)
110 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), sscr1, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_lcdcon)); 114 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), sscr1, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_lcdcon));
111 ssp_enable(&corgi_ssp_dev); 115 ssp_enable(&corgi_ssp_dev);
112 116
113 GPCR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); 117 if (ssp_machinfo->cs_lcdcon >= 0)
118 GPCR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);
114 ssp_write_word(&corgi_ssp_dev,data); 119 ssp_write_word(&corgi_ssp_dev,data);
115 /* Read null data back from device to prevent SSP overflow */ 120 /* Read null data back from device to prevent SSP overflow */
116 ssp_read_word(&corgi_ssp_dev); 121 ssp_read_word(&corgi_ssp_dev);
117 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); 122 if (ssp_machinfo->cs_lcdcon >= 0)
123 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);
118 124
119 ssp_disable(&corgi_ssp_dev); 125 ssp_disable(&corgi_ssp_dev);
120 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); 126 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846));
@@ -147,7 +153,8 @@ int corgi_ssp_max1111_get(ulong data)
147 int voltage,voltage1,voltage2; 153 int voltage,voltage1,voltage2;
148 154
149 spin_lock_irqsave(&corgi_ssp_lock, flag); 155 spin_lock_irqsave(&corgi_ssp_lock, flag);
150 GPCR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); 156 if (ssp_machinfo->cs_max1111 >= 0)
157 GPCR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111);
151 ssp_disable(&corgi_ssp_dev); 158 ssp_disable(&corgi_ssp_dev);
152 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_max1111)); 159 ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_max1111));
153 ssp_enable(&corgi_ssp_dev); 160 ssp_enable(&corgi_ssp_dev);
@@ -169,7 +176,8 @@ int corgi_ssp_max1111_get(ulong data)
169 ssp_disable(&corgi_ssp_dev); 176 ssp_disable(&corgi_ssp_dev);
170 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); 177 ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846));
171 ssp_enable(&corgi_ssp_dev); 178 ssp_enable(&corgi_ssp_dev);
172 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); 179 if (ssp_machinfo->cs_max1111 >= 0)
180 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111);
173 spin_unlock_irqrestore(&corgi_ssp_lock, flag); 181 spin_unlock_irqrestore(&corgi_ssp_lock, flag);
174 182
175 if (voltage1 & 0xc0 || voltage2 & 0x3f) 183 if (voltage1 & 0xc0 || voltage2 & 0x3f)
@@ -196,9 +204,12 @@ static int __init corgi_ssp_probe(struct platform_device *dev)
196 int ret; 204 int ret;
197 205
198 /* Chip Select - Disable All */ 206 /* Chip Select - Disable All */
199 pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH); 207 if (ssp_machinfo->cs_lcdcon >= 0)
200 pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH); 208 pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH);
201 pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH); 209 if (ssp_machinfo->cs_max1111 >= 0)
210 pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH);
211 if (ssp_machinfo->cs_ads7846 >= 0)
212 pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH);
202 213
203 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0); 214 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0);
204 215
@@ -229,9 +240,12 @@ static int corgi_ssp_suspend(struct platform_device *dev, pm_message_t state)
229 240
230static int corgi_ssp_resume(struct platform_device *dev) 241static int corgi_ssp_resume(struct platform_device *dev)
231{ 242{
232 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ 243 if (ssp_machinfo->cs_lcdcon >= 0)
233 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/ 244 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */
234 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/ 245 if (ssp_machinfo->cs_max1111 >= 0)
246 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/
247 if (ssp_machinfo->cs_ads7846 >= 0)
248 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/
235 ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state); 249 ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state);
236 ssp_enable(&corgi_ssp_dev); 250 ssp_enable(&corgi_ssp_dev);
237 251
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index a042473deedd..9a9fa87cea9f 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -18,11 +18,14 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/fb.h> 20#include <linux/fb.h>
21#include <linux/pm.h>
22#include <linux/delay.h>
21 23
22#include <asm/hardware.h> 24#include <asm/hardware.h>
23#include <asm/mach-types.h> 25#include <asm/mach-types.h>
24#include <asm/irq.h> 26#include <asm/irq.h>
25#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/system.h>
26 29
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -34,12 +37,15 @@
34#include <asm/arch/irda.h> 37#include <asm/arch/irda.h>
35#include <asm/arch/poodle.h> 38#include <asm/arch/poodle.h>
36#include <asm/arch/pxafb.h> 39#include <asm/arch/pxafb.h>
40#include <asm/arch/sharpsl.h>
41#include <asm/arch/ssp.h>
37 42
38#include <asm/hardware/scoop.h> 43#include <asm/hardware/scoop.h>
39#include <asm/hardware/locomo.h> 44#include <asm/hardware/locomo.h>
40#include <asm/mach/sharpsl_param.h> 45#include <asm/mach/sharpsl_param.h>
41 46
42#include "generic.h" 47#include "generic.h"
48#include "sharpsl.h"
43 49
44static struct resource poodle_scoop_resources[] = { 50static struct resource poodle_scoop_resources[] = {
45 [0] = { 51 [0] = {
@@ -117,13 +123,71 @@ static struct resource locomo_resources[] = {
117 }, 123 },
118}; 124};
119 125
120static struct platform_device locomo_device = { 126struct platform_device poodle_locomo_device = {
121 .name = "locomo", 127 .name = "locomo",
122 .id = 0, 128 .id = 0,
123 .num_resources = ARRAY_SIZE(locomo_resources), 129 .num_resources = ARRAY_SIZE(locomo_resources),
124 .resource = locomo_resources, 130 .resource = locomo_resources,
125}; 131};
126 132
133EXPORT_SYMBOL(poodle_locomo_device);
134
135/*
136 * Poodle SSP Device
137 */
138
139struct platform_device poodle_ssp_device = {
140 .name = "corgi-ssp",
141 .id = -1,
142};
143
144struct corgissp_machinfo poodle_ssp_machinfo = {
145 .port = 1,
146 .cs_lcdcon = -1,
147 .cs_ads7846 = -1,
148 .cs_max1111 = -1,
149 .clk_lcdcon = 2,
150 .clk_ads7846 = 36,
151 .clk_max1111 = 2,
152};
153
154
155/*
156 * Poodle Touch Screen Device
157 */
158static struct resource poodlets_resources[] = {
159 [0] = {
160 .start = POODLE_IRQ_GPIO_TP_INT,
161 .end = POODLE_IRQ_GPIO_TP_INT,
162 .flags = IORESOURCE_IRQ,
163 },
164};
165
166static unsigned long poodle_get_hsync_len(void)
167{
168 return 0;
169}
170
171static void poodle_null_hsync(void)
172{
173}
174
175static struct corgits_machinfo poodle_ts_machinfo = {
176 .get_hsync_len = poodle_get_hsync_len,
177 .put_hsync = poodle_null_hsync,
178 .wait_hsync = poodle_null_hsync,
179};
180
181static struct platform_device poodle_ts_device = {
182 .name = "corgi-ts",
183 .dev = {
184 .platform_data = &poodle_ts_machinfo,
185 },
186 .id = -1,
187 .num_resources = ARRAY_SIZE(poodlets_resources),
188 .resource = poodlets_resources,
189};
190
127 191
128/* 192/*
129 * MMC/SD Device 193 * MMC/SD Device
@@ -141,7 +205,9 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(
141 pxa_gpio_mode(GPIO6_MMCCLK_MD); 205 pxa_gpio_mode(GPIO6_MMCCLK_MD);
142 pxa_gpio_mode(GPIO8_MMCCS0_MD); 206 pxa_gpio_mode(GPIO8_MMCCS0_MD);
143 pxa_gpio_mode(POODLE_GPIO_nSD_DETECT | GPIO_IN); 207 pxa_gpio_mode(POODLE_GPIO_nSD_DETECT | GPIO_IN);
208 pxa_gpio_mode(POODLE_GPIO_nSD_WP | GPIO_IN);
144 pxa_gpio_mode(POODLE_GPIO_SD_PWR | GPIO_OUT); 209 pxa_gpio_mode(POODLE_GPIO_SD_PWR | GPIO_OUT);
210 pxa_gpio_mode(POODLE_GPIO_SD_PWR1 | GPIO_OUT);
145 211
146 poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); 212 poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250);
147 213
@@ -160,12 +226,22 @@ static void poodle_mci_setpower(struct device *dev, unsigned int vdd)
160{ 226{
161 struct pxamci_platform_data* p_d = dev->platform_data; 227 struct pxamci_platform_data* p_d = dev->platform_data;
162 228
163 if (( 1 << vdd) & p_d->ocr_mask) 229 if (( 1 << vdd) & p_d->ocr_mask) {
164 GPSR1 = GPIO_bit(POODLE_GPIO_SD_PWR); 230 GPSR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR);
165 else 231 mdelay(2);
166 GPCR1 = GPIO_bit(POODLE_GPIO_SD_PWR); 232 GPSR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1);
233 } else {
234 GPCR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1);
235 GPCR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR);
236 }
237}
238
239static int poodle_mci_get_ro(struct device *dev)
240{
241 return GPLR(POODLE_GPIO_nSD_WP) & GPIO_bit(POODLE_GPIO_nSD_WP);
167} 242}
168 243
244
169static void poodle_mci_exit(struct device *dev, void *data) 245static void poodle_mci_exit(struct device *dev, void *data)
170{ 246{
171 free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data); 247 free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data);
@@ -174,6 +250,7 @@ static void poodle_mci_exit(struct device *dev, void *data)
174static struct pxamci_platform_data poodle_mci_platform_data = { 250static struct pxamci_platform_data poodle_mci_platform_data = {
175 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 251 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
176 .init = poodle_mci_init, 252 .init = poodle_mci_init,
253 .get_ro = poodle_mci_get_ro,
177 .setpower = poodle_mci_setpower, 254 .setpower = poodle_mci_setpower,
178 .exit = poodle_mci_exit, 255 .exit = poodle_mci_exit,
179}; 256};
@@ -243,14 +320,31 @@ static struct pxafb_mach_info poodle_fb_info __initdata = {
243}; 320};
244 321
245static struct platform_device *devices[] __initdata = { 322static struct platform_device *devices[] __initdata = {
246 &locomo_device, 323 &poodle_locomo_device,
247 &poodle_scoop_device, 324 &poodle_scoop_device,
325 &poodle_ssp_device,
326 &poodle_ts_device,
248}; 327};
249 328
329static void poodle_poweroff(void)
330{
331 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
332 arm_machine_restart('h');
333}
334
335static void poodle_restart(char mode)
336{
337 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
338 arm_machine_restart('h');
339}
340
250static void __init poodle_init(void) 341static void __init poodle_init(void)
251{ 342{
252 int ret = 0; 343 int ret = 0;
253 344
345 pm_power_off = poodle_poweroff;
346 arm_pm_restart = poodle_restart;
347
254 /* setup sleep mode values */ 348 /* setup sleep mode values */
255 PWER = 0x00000002; 349 PWER = 0x00000002;
256 PFER = 0x00000000; 350 PFER = 0x00000000;
@@ -288,6 +382,7 @@ static void __init poodle_init(void)
288 GPSR1 = 0x00000000; 382 GPSR1 = 0x00000000;
289 GPSR2 = 0x00000000; 383 GPSR2 = 0x00000000;
290 384
385 set_pxa_fb_parent(&poodle_locomo_device.dev);
291 set_pxa_fb_info(&poodle_fb_info); 386 set_pxa_fb_info(&poodle_fb_info);
292 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT); 387 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT);
293 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT); 388 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT);
@@ -301,6 +396,7 @@ static void __init poodle_init(void)
301 if (ret) { 396 if (ret) {
302 printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n"); 397 printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
303 } 398 }
399 corgi_ssp_set_machinfo(&poodle_ssp_machinfo);
304} 400}
305 401
306static void __init fixup_poodle(struct machine_desc *desc, 402static void __init fixup_poodle(struct machine_desc *desc,
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 6d402b262d8a..0f1648780c41 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -128,6 +128,9 @@ struct battery_thresh spitz_battery_levels_noac[] = {
128 */ 128 */
129int sharpsl_pm_pxa_read_max1111(int channel) 129int sharpsl_pm_pxa_read_max1111(int channel)
130{ 130{
131 if (machine_is_tosa()) // Ugly, better move this function into another module
132 return 0;
133
131 return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1 134 return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
132 | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR); 135 | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
133} 136}
@@ -156,7 +159,7 @@ void sharpsl_pm_pxa_init(void)
156 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQT_FALLING); 159 else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal),IRQT_FALLING);
157 } 160 }
158 161
159 if (!machine_is_corgi()) 162 if (sharpsl_pm.machinfo->batfull_irq)
160 { 163 {
161 /* Register interrupt handler. */ 164 /* Register interrupt handler. */
162 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, SA_INTERRUPT, "CO", sharpsl_chrg_full_isr)) { 165 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, SA_INTERRUPT, "CO", sharpsl_chrg_full_isr)) {
@@ -174,6 +177,6 @@ void sharpsl_pm_pxa_remove(void)
174 if (sharpsl_pm.machinfo->gpio_fatal) 177 if (sharpsl_pm.machinfo->gpio_fatal)
175 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); 178 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
176 179
177 if (!machine_is_corgi()) 180 if (sharpsl_pm.machinfo->batfull_irq)
178 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); 181 free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
179} 182}
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 44bcb8097c7a..eb9937f6f5cd 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -20,6 +20,7 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/pm.h>
23 24
24#include <asm/setup.h> 25#include <asm/setup.h>
25#include <asm/memory.h> 26#include <asm/memory.h>
@@ -27,6 +28,7 @@
27#include <asm/hardware.h> 28#include <asm/hardware.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
29#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/system.h>
30 32
31#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 34#include <asm/mach/map.h>
@@ -432,8 +434,31 @@ static struct platform_device *devices[] __initdata = {
432 &spitzled_device, 434 &spitzled_device,
433}; 435};
434 436
437static void spitz_poweroff(void)
438{
439 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
440
441 pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
442 GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);
443
444 mdelay(1000);
445 arm_machine_restart('h');
446}
447
448static void spitz_restart(char mode)
449{
450 /* Bootloader magic for a reboot */
451 if((MSC0 & 0xffff0000) == 0x7ff00000)
452 MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
453
454 spitz_poweroff();
455}
456
435static void __init common_init(void) 457static void __init common_init(void)
436{ 458{
459 pm_power_off = spitz_poweroff;
460 arm_pm_restart = spitz_restart;
461
437 PMCR = 0x00; 462 PMCR = 0x00;
438 463
439 /* setup sleep mode values */ 464 /* setup sleep mode values */
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 5e5bdc898482..40be833079c7 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -27,6 +27,13 @@
27#include <asm/arch/pxa-regs.h> 27#include <asm/arch/pxa-regs.h>
28#include "sharpsl.h" 28#include "sharpsl.h"
29 29
30#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
31#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */
32#define SHARPSL_CHARGE_ON_ACIN_HIGH 0x9b /* 6V */
33#define SHARPSL_CHARGE_ON_ACIN_LOW 0x34 /* 2V */
34#define SHARPSL_FATAL_ACIN_VOLT 182 /* 3.45V */
35#define SHARPSL_FATAL_NOACIN_VOLT 170 /* 3.40V */
36
30static int spitz_last_ac_status; 37static int spitz_last_ac_status;
31 38
32static void spitz_charger_init(void) 39static void spitz_charger_init(void)
@@ -190,6 +197,7 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
190 .gpio_batlock = SPITZ_GPIO_BAT_COVER, 197 .gpio_batlock = SPITZ_GPIO_BAT_COVER,
191 .gpio_acin = SPITZ_GPIO_AC_IN, 198 .gpio_acin = SPITZ_GPIO_AC_IN,
192 .gpio_batfull = SPITZ_GPIO_CHRG_FULL, 199 .gpio_batfull = SPITZ_GPIO_CHRG_FULL,
200 .batfull_irq = 1,
193 .gpio_fatal = SPITZ_GPIO_FATAL_BAT, 201 .gpio_fatal = SPITZ_GPIO_FATAL_BAT,
194 .discharge = spitz_discharge, 202 .discharge = spitz_discharge,
195 .discharge1 = spitz_discharge1, 203 .discharge1 = spitz_discharge1,
@@ -200,6 +208,13 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
200 .read_devdata = spitzpm_read_devdata, 208 .read_devdata = spitzpm_read_devdata,
201 .charger_wakeup = spitz_charger_wakeup, 209 .charger_wakeup = spitz_charger_wakeup,
202 .should_wakeup = spitz_should_wakeup, 210 .should_wakeup = spitz_should_wakeup,
211 .backlight_limit = corgibl_limit_intensity,
212 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
213 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
214 .charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH,
215 .charge_acin_low = SHARPSL_CHARGE_ON_ACIN_LOW,
216 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
217 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
203 .bat_levels = 40, 218 .bat_levels = 40,
204 .bat_levels_noac = spitz_battery_levels_noac, 219 .bat_levels_noac = spitz_battery_levels_noac,
205 .bat_levels_acin = spitz_battery_levels_acin, 220 .bat_levels_acin = spitz_battery_levels_acin,
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 76c0e7f0a219..7152bc13680f 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -19,12 +19,15 @@
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/pm.h>
23#include <linux/delay.h>
22 24
23#include <asm/setup.h> 25#include <asm/setup.h>
24#include <asm/memory.h> 26#include <asm/memory.h>
25#include <asm/mach-types.h> 27#include <asm/mach-types.h>
26#include <asm/hardware.h> 28#include <asm/hardware.h>
27#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/system.h>
28#include <asm/arch/irda.h> 31#include <asm/arch/irda.h>
29#include <asm/arch/mmc.h> 32#include <asm/arch/mmc.h>
30#include <asm/arch/udc.h> 33#include <asm/arch/udc.h>
@@ -266,8 +269,31 @@ static struct platform_device *devices[] __initdata = {
266 &tosaled_device, 269 &tosaled_device,
267}; 270};
268 271
272static void tosa_poweroff(void)
273{
274 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
275
276 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_OUT);
277 GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET);
278
279 mdelay(1000);
280 arm_machine_restart('h');
281}
282
283static void tosa_restart(char mode)
284{
285 /* Bootloader magic for a reboot */
286 if((MSC0 & 0xffff0000) == 0x7ff00000)
287 MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
288
289 tosa_poweroff();
290}
291
269static void __init tosa_init(void) 292static void __init tosa_init(void)
270{ 293{
294 pm_power_off = tosa_poweroff;
295 arm_pm_restart = tosa_restart;
296
271 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN); 297 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
272 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN); 298 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
273 pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN); 299 pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);