summaryrefslogtreecommitdiff
path: root/packages/linux/linux-rp-2.6.23+2.6.24-rc6+git/hx2750_base-r31.patch
blob: 5d58bcf55db239832f242f48f0dd1fd2953bd4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
---
 arch/arm/mach-pxa/Kconfig         |   10 
 arch/arm/mach-pxa/Makefile        |    1 
 arch/arm/mach-pxa/hx2750.c        |  450 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-pxa/hx2750_test.c   |  433 ++++++++++++++++++++++++++++++++++++
 arch/arm/mach-pxa/pm.c            |    5 
 arch/arm/mach-pxa/pxa25x.c        |    4 
 arch/arm/mach-pxa/pxa27x.c        |    4 
 include/asm-arm/arch-pxa/hx2750.h |   90 +++++++
 8 files changed, 995 insertions(+), 2 deletions(-)

--- /dev/null
+++ linux-2.6.24-rc1/include/asm-arm/arch-pxa/hx2750.h
@@ -0,0 +1,90 @@
+/*
+ * Hardware specific definitions for iPAQ hx2750
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_ARCH_HX2750_H
+#define __ASM_ARCH_HX2750_H  1
+
+/*
+ * HX2750 (Non Standard) GPIO Definitions
+ */
+
+#define HX2750_GPIO_KEYPWR      (0)    /* Power button */
+#define HX2750_GPIO_BATTCOVER1  (9)    /* Battery Cover Switch */
+#define HX2750_GPIO_CF_IRQ      (11)   /* CF IRQ? */
+#define HX2750_GPIO_USBCONNECT  (12)   /* USB Connected? */
+#define HX2750_GPIO_CF_DETECT   (13)   /* CF Card Detect? */
+#define HX2750_GPIO_EXTPWR      (14)   /* External Power Detect */
+#define HX2750_GPIO_BATLVL      (15)   /* Battery Level Detect */
+#define HX2750_GPIO_CF_PWR      (17)   /* CF Power? */
+#define HX2750_GPIO_SR_STROBE   (18)   /* Shift Register Strobe */
+#define HX2750_GPIO_CHARGE      (22)   /* Charging Enable (active low) */
+#define HX2750_GPIO_TSC2101_SS  (24)   /* TSC2101 SS# */
+#define HX2750_GPIO_BTPWR       (27)   /* Bluetooth Power? */
+#define HX2750_GPIO_BATTCOVER2  (33)   /* Battery Cover Switch */
+#define HX2750_GPIO_SD_DETECT   (38)   /* MMC Card Detect */
+#define HX2750_GPIO_SR_CLK1     (52)   /* Shift Register Clock */
+#define HX2750_GPIO_SR_CLK2     (53)
+#define HX2750_GPIO_CF_WIFIIRQ  (54)   /* CF Wifi IRQ? */
+#define HX2750_GPIO_GPIO_DIN    (88)   /* Shift Register Data */
+#define HX2750_GPIO_KEYLEFT     (90)   /* Left button */
+#define HX2750_GPIO_KEYRIGHT    (91)   /* Right button */
+#define HX2750_GPIO_KEYCAL      (93)   /* Calander button */
+#define HX2750_GPIO_KEYTASK     (94)   /* Task button */
+#define HX2750_GPIO_KEYSIDE     (95)   /* Side button */
+#define HX2750_GPIO_KEYENTER    (96)   /* Enter Button*/
+#define HX2750_GPIO_KEYCON      (97)   /* Contacts button */
+#define HX2750_GPIO_KEYMAIL     (98)   /* Mail button */
+#define HX2750_GPIO_BIOPWR      (99)   /* BIO Reader Power? */
+#define HX2750_GPIO_KEYUP       (100)  /* Up button */
+#define HX2750_GPIO_KEYDOWN     (101)  /* Down button*/
+#define HX2750_GPIO_SD_READONLY (103)  /* MMC/SD Write Protection */
+#define HX2750_GPIO_LEDMAIL     (106)  /* Green Mail LED */
+#define HX2750_GPIO_HP_JACK     (108)  /* Head Phone Jack Present */
+#define HX2750_GPIO_PENDOWN     (117)  /* Touch Screen Pendown */
+
+
+//#define HX2750_GPIO_     () /* */
+
+/*
+ * HX2750 Interrupts
+ */
+#define HX2750_IRQ_GPIO_EXTPWR      IRQ_GPIO(HX2750_GPIO_EXTPWR)
+#define HX2750_IRQ_GPIO_SD_DETECT   IRQ_GPIO(HX2750_GPIO_SD_DETECT)
+#define HX2750_IRQ_GPIO_PENDOWN     IRQ_GPIO(HX2750_GPIO_PENDOWN)
+#define HX2750_IRQ_GPIO_CF_DETECT   IRQ_GPIO(HX2750_GPIO_CF_DETECT)
+#define HX2750_IRQ_GPIO_CF_IRQ      IRQ_GPIO(HX2750_GPIO_CF_IRQ)
+#define HX2750_IRQ_GPIO_CF_WIFIIRQ  IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ)
+
+/*
+ * HX2750 Extra GPIO Definitions
+ */
+
+#define HX2750_EGPIO_WIFI_PWR	(1 << 11)  /* Wifi power */
+#define HX2750_EGPIO_LCD_PWR	(1 << 10)  /* LCD Power */
+#define HX2750_EGPIO_BL_PWR     (1 << 9)   /* Backlight LED Power */
+#define HX2750_EGPIO_8          (1 << 8)   /* */
+#define HX2750_EGPIO_7          (1 << 7)   /* */
+#define HX2750_EGPIO_SD_PWR     (1 << 6)   /* SD Power */
+#define HX2750_EGPIO_TSC_PWR    (1 << 5)   /* TS Power */
+#define HX2750_EGPIO_CF0_RESET  (1 << 4)   /* CF0 Reset */
+#define HX2750_EGPIO_CF1_RESET  (1 << 3)   /* CF1 Reset */
+#define HX2750_EGPIO_2          (1 << 2)   /* Power/Red LED Related?*/
+#define HX2750_EGPIO_1          (1 << 1)   /* Power/Red LED Related?*/
+#define HX2750_EGPIO_PWRLED     (1 << 0)   /* Power/Red LED Related?*/
+
+
+void hx2750_set_egpio(unsigned int gpio);
+void hx2750_clear_egpio(unsigned int gpio);
+
+
+#endif /* __ASM_ARCH_HX2750_H  */
+
--- linux-2.6.24-rc1.orig/arch/arm/mach-pxa/Makefile
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/Makefile
@@ -22,6 +22,7 @@
 obj-$(CONFIG_MACH_POODLE)	+= poodle.o corgi_ssp.o
 obj-$(CONFIG_MACH_TOSA)		+= tosa.o
 obj-$(CONFIG_MACH_EM_X270)	+= em-x270.o
+obj-$(CONFIG_MACH_HX2750)	+= hx2750.o hx2750_test.o
 
 ifeq ($(CONFIG_MACH_ZYLONITE),y)
   obj-y				+= zylonite.o
--- /dev/null
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/hx2750_test.c
@@ -0,0 +1,433 @@
+/*
+ * HP iPAQ hx2750 Test Development Code
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/input.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/mach/arch.h>
+
+#include <asm/arch/hx2750.h>
+#include <asm/arch/pxa-regs.h>
+
+
+static int prodval;
+
+/*
+ * Sysfs functions
+ */
+static ssize_t test1_show(struct device *dev, char *buf)
+{
+	unsigned long rp;
+
+	asm ("mrc	p15, 0, %0, cr1, cr0;\n" :"=r"(rp) );
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr1, cr1;\n" :"=r"(rp) );
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr2, cr0;\n" :"=r"(rp) );
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr3, cr0;\n" :"=r"(rp) );
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr13, cr0;\n" :"=r"(rp) );
+	printk("%lx\n",rp);
+
+	return sprintf(buf, "%d\n",prodval);
+}
+extern void tsc2101_print_miscdata(struct device *dev);
+extern struct platform_device tsc2101_device;
+
+static ssize_t test1_store(struct device *dev, const char *buf, size_t count)
+{
+	prodval = simple_strtoul(buf, NULL, 10);
+
+ 	tsc2101_print_miscdata(&tsc2101_device.dev);
+
+	return count;
+}
+
+static DEVICE_ATTR(test1, 0644, test1_show, test1_store);
+
+static ssize_t test2_show(struct device *dev, char *buf)
+{
+	printk(KERN_ERR "SSCR0_P2: %08x\n", SSCR0_P2);
+	printk(KERN_ERR "SSCR1_P2: %08x\n", SSCR1_P2);
+	printk(KERN_ERR "SSSR_P2:  %08x\n", SSSR_P2);
+	printk(KERN_ERR "SSITR_P2: %08x\n", SSITR_P2);
+	printk(KERN_ERR "SSDR_P2:  %08x\n", SSDR_P2);
+	printk(KERN_ERR "SSTO_P2:  %08x\n", SSTO_P2);
+	printk(KERN_ERR "SSPSP_P2: %08x\n", SSPSP_P2);
+
+	hx2750_ssp_init2();
+
+	printk(KERN_ERR "SSCR0_P2: %08x\n", SSCR0_P2);
+	printk(KERN_ERR "SSCR1_P2: %08x\n", SSCR1_P2);
+	printk(KERN_ERR "SSSR_P2:  %08x\n", SSSR_P2);
+	printk(KERN_ERR "SSITR_P2: %08x\n", SSITR_P2);
+	printk(KERN_ERR "SSDR_P2:  %08x\n", SSDR_P2);
+	printk(KERN_ERR "SSTO_P2:  %08x\n", SSTO_P2);
+	printk(KERN_ERR "SSPSP_P2: %08x\n", SSPSP_P2);
+
+	return sprintf(buf, "%d\n",0);
+}
+
+static DEVICE_ATTR(test2, 0444, test2_show, NULL);
+
+extern unsigned int hx2750_egpio_current;
+
+static ssize_t setegpio_show(struct device *dev, char *buf)
+{
+	return sprintf(buf, "%x\n",hx2750_egpio_current);
+}
+
+static ssize_t setegpio_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned int val = simple_strtoul(buf, NULL, 10);
+
+	hx2750_set_egpio(1 << val);
+
+	return count;
+}
+
+static DEVICE_ATTR(setegpio, 0644, setegpio_show, setegpio_store);
+
+static ssize_t clregpio_show(struct device *dev, char *buf)
+{
+	return sprintf(buf, "%x\n",hx2750_egpio_current);
+}
+
+static ssize_t gpio_show(struct device *dev, char *buf)
+{
+	int i;
+
+	printk(KERN_ERR "GPIO# D S A INTER\n");
+
+	for (i=0;i<119;i++) {
+		printk(KERN_ERR " %3d: ",i);
+		if (GPDR(i) & GPIO_bit(i))
+			printk("O ");
+		else
+  			printk("I ");
+		printk("%d ",(GPLR(i) & GPIO_bit(i)) != 0);
+		printk("%d ",((GAFR(i) & (0x3 << (((i) & 0xf)*2)))) >> (((i) & 0xf)*2) );
+		if (GEDR(i) & GPIO_bit(i))
+			printk("ED ");
+		if (GRER(i) & GPIO_bit(i))
+			printk("RE ");
+		if (GFER(i) & GPIO_bit(i))
+			printk("FE ");
+
+ 		printk("\n");
+	}
+	return sprintf(buf, "EGPIO: %x\n",hx2750_egpio_current);
+}
+
+static ssize_t clregpio_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned int val = simple_strtoul(buf, NULL, 10);
+
+	hx2750_clear_egpio(1 << val);
+
+	return count;
+}
+
+static DEVICE_ATTR(clregpio, 0644, clregpio_show, clregpio_store);
+
+
+static ssize_t gpioclr_store(struct device *dev, const char *buf, size_t count)
+{
+	int prod;
+	prod = simple_strtoul(buf, NULL, 10);
+
+	GPCR(prod) = GPIO_bit(prod);
+
+	return count;
+}
+
+static DEVICE_ATTR(gpioclr, 0644, gpio_show, gpioclr_store);
+
+static ssize_t gpioset_store(struct device *dev, const char *buf, size_t count)
+{
+	int prod;
+	prod = simple_strtoul(buf, NULL, 10);
+
+	GPSR(prod) = GPIO_bit(prod);
+
+	return count;
+}
+
+static DEVICE_ATTR(gpioset, 0644, gpio_show, gpioset_store);
+
+
+static ssize_t ssp2read_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned int val = simple_strtoul(buf, NULL, 16);
+
+	printk("Read: %08x\n",hx2750_ssp2_read(val));
+
+	return count;
+}
+
+static DEVICE_ATTR(ssp2read, 0200, NULL, ssp2read_store);
+
+static ssize_t ssp2write_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned int val = simple_strtoul(buf, NULL, 16);
+
+	printk("Write: %08x\n",hx2750_ssp2_write(val));
+
+	return count;
+}
+
+static DEVICE_ATTR(ssp2write, 0200, NULL, ssp2write_store);
+
+
+static ssize_t sspr_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned long val,ret;
+	val = simple_strtoul(buf, NULL, 0);
+
+	hx2750_tsc2101_send(1<<15,val,&ret,1);
+
+	printk("Response: %x\n",ret);
+
+	return count;
+}
+
+static DEVICE_ATTR(sspr, 0200, NULL, sspr_store);
+
+static ssize_t sspw_store(struct device *dev, const char *buf, size_t count)
+{
+	int val,ret;
+	sscanf(buf, "%lx %lx", &val, &ret);
+
+	hx2750_tsc2101_send(0,val,&ret,1);
+
+	return count;
+}
+
+static DEVICE_ATTR(sspw, 0200, NULL, sspw_store);
+
+
+extern struct pm_ops pxa_pm_ops;
+extern void pxa_cpu_resume(void);
+extern unsigned long pxa_pm_pspr_value;
+
+static int (*pxa_pm_enter_orig)(suspend_state_t state);
+
+//static struct {
+//	u32 ffier, fflcr, ffmcr, ffspr, ffisr, ffdll, ffdlh;
+//} sys_ctx;
+
+u32 resstruct[20];
+
+static int hx2750_pxa_pm_enter(suspend_state_t state)
+{
+	int i;
+	u32 save[10];
+
+	PWER = 0xC0000003;// | PWER_RTC;
+	PFER = 0x00000003;
+	PRER = 0x00000003;
+
+	PGSR0=0x00000018;
+	PGSR1=0x00000380;
+	PGSR2=0x00800000;
+	PGSR3=0x00500400;
+
+	//PVCR=0x494; or 0x14;
+	//PVCR=0x14;
+	//PCMD0=0x41f;
+	//i=PISR;
+	//PICR=0x00000062;
+
+	//PCFR=0x457;
+	//PCFR=0x70; // Does not resume from sleep
+	PCFR=0x077; // was 0x477
+	PSLR=0xff100004;
+
+	resstruct[0]=0x0000b4e6;
+	resstruct[1]=0x00000001;
+	resstruct[2]=virt_to_phys(pxa_cpu_resume);
+	resstruct[3]=0xffffffff; //value for r0
+
+	resstruct[14]=0x00000078;  //mcr	15, 0, r0, cr1, cr0, {0}
+	resstruct[15]=0x00000000;  //mcr	15, 0, r0, cr1, cr1, {0} 0xffffffff
+	resstruct[16]=0xa0000000;  //mcr	15, 0, r0, cr2, cr0, {0} 0xa0748000
+	resstruct[17]=0x00000001;  //mcr	15, 0, r0, cr3, cr0, {0} 0x00000015
+	resstruct[18]=0x00000000;  //mcr	15, 0, r0, cr13, cr0, {0} 0x00000000
+
+	pxa_pm_pspr_value=virt_to_phys(&resstruct[0]);
+
+	hx2750_send_egpio(3);
+
+	pxa_gpio_mode(87 | GPIO_OUT  | GPIO_DFLT_HIGH);
+
+	//sys_ctx.ffier = FFIER;
+	//sys_ctx.fflcr = FFLCR;
+	//sys_ctx.ffmcr = FFMCR;
+	//sys_ctx.ffspr = FFSPR;
+	//sys_ctx.ffisr = FFISR;
+	//FFLCR |= 0x80;
+	//sys_ctx.ffdll = FFDLL;
+	//sys_ctx.ffdlh = FFDLH;
+	//FFLCR &= 0xef;
+
+	pxa_pm_enter_orig(state);
+
+	//FFMCR = sys_ctx.ffmcr;
+	//FFSPR = sys_ctx.ffspr;
+	//FFLCR = sys_ctx.fflcr;
+	//FFLCR |= 0x80;
+	//FFDLH = sys_ctx.ffdlh;
+	//FFDLL = sys_ctx.ffdll;
+	//FFLCR = sys_ctx.fflcr;
+	//FFISR = sys_ctx.ffisr;
+	//FFLCR = 0x07;
+	//FFIER = sys_ctx.ffier;
+
+	return 0;
+}
+
+static irqreturn_t hx2750_charge_int(int irq, void *dev_id, struct pt_regs *regs)
+{
+	if ((GPLR(HX2750_GPIO_EXTPWR) & GPIO_bit(HX2750_GPIO_EXTPWR)) == 0) {
+		printk("Charging On\n");
+		GPCR(HX2750_GPIO_CHARGE);
+	} else {
+		printk("Charging Off\n");
+		GPSR(HX2750_GPIO_CHARGE);
+	}
+
+	return IRQ_HANDLED;
+}
+
+
+
+
+static irqreturn_t hx2750_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+    printk("Input %d changed.\n", irq-32);
+
+	return IRQ_HANDLED;
+}
+
+
+static int __init hx2750_test_probe(struct device *dev)
+{
+	pxa_gpio_mode(21 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_CHARGE | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(83 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_BIOPWR | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(116 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(118 | GPIO_OUT | GPIO_DFLT_HIGH);
+
+
+	//pxa_gpio_mode(HX2750_GPIO_CF_PWR | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(HX2750_GPIO_CF_PWR | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_BTPWR | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(79 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(85 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(HX2750_GPIO_LEDMAIL | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(107 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(114 | GPIO_OUT | GPIO_DFLT_LOW);
+
+	pxa_gpio_mode(HX2750_GPIO_BATTCOVER1 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_BATTCOVER2 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_CF_IRQ | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_USBCONNECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_CF_DETECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_EXTPWR | GPIO_IN);
+
+	pxa_gpio_mode(HX2750_GPIO_BATLVL | GPIO_IN);
+	//pxa_gpio_mode(HX2750_GPIO_CF_WIFIIRQ | GPIO_IN);
+	pxa_gpio_mode(80 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_HP_JACK | GPIO_IN);
+	pxa_gpio_mode(115 | GPIO_IN);
+	pxa_gpio_mode(119 | GPIO_IN);
+
+	request_irq(IRQ_GPIO(HX2750_GPIO_BATLVL), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+	//request_irq(IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+	request_irq(IRQ_GPIO(80), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+	request_irq(IRQ_GPIO(115), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+	request_irq(IRQ_GPIO(119), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+	request_irq(IRQ_GPIO(HX2750_GPIO_SR_CLK2), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+
+	//request_irq(IRQ_GPIO(10), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+
+	set_irq_type(IRQ_GPIO(HX2750_GPIO_BATLVL),IRQT_BOTHEDGE);
+	//set_irq_type(IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(80),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(115),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(119),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(HX2750_GPIO_SR_CLK2),IRQT_BOTHEDGE);
+
+	//set_irq_type(IRQ_GPIO(10),IRQT_BOTHEDGE);
+
+	printk("hx2750 Test Code Initialized.\n");
+	device_create_file(dev, &dev_attr_test1);
+	device_create_file(dev, &dev_attr_test2);
+	device_create_file(dev, &dev_attr_setegpio);
+	device_create_file(dev, &dev_attr_clregpio);
+	device_create_file(dev, &dev_attr_gpioset);
+	device_create_file(dev, &dev_attr_gpioclr);
+	device_create_file(dev, &dev_attr_sspr);
+	device_create_file(dev, &dev_attr_sspw);
+	device_create_file(dev, &dev_attr_ssp2read);
+	device_create_file(dev, &dev_attr_ssp2write);
+
+	request_irq(HX2750_IRQ_GPIO_EXTPWR, hx2750_charge_int, SA_INTERRUPT, "hx2750_extpwr", NULL);
+	set_irq_type(HX2750_IRQ_GPIO_EXTPWR, IRQT_BOTHEDGE);
+
+	pxa_pm_enter_orig=pxa_pm_ops.enter;
+	pxa_pm_ops.enter=hx2750_pxa_pm_enter;
+
+	return 0;
+}
+
+static struct device_driver hx2750_test_driver = {
+	.name		= "hx2750-test",
+	.bus		= &platform_bus_type,
+	.probe		= hx2750_test_probe,
+//	.remove		= hx2750_bl_remove,
+//	.suspend	= hx2750_bl_suspend,
+//	.resume		= hx2750_bl_resume,
+};
+
+
+static int __init hx2750_test_init(void)
+{
+	return driver_register(&hx2750_test_driver);
+}
+
+
+static void __exit hx2750_test_exit(void)
+{
+ 	driver_unregister(&hx2750_test_driver);
+}
+
+module_init(hx2750_test_init);
+module_exit(hx2750_test_exit);
+
+MODULE_AUTHOR("Richard Purdie <richard@o-hand.com>");
+MODULE_DESCRIPTION("iPAQ hx2750 Backlight Driver");
+MODULE_LICENSE("GPLv2");
--- linux-2.6.24-rc1.orig/arch/arm/mach-pxa/Kconfig
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/Kconfig
@@ -83,6 +83,15 @@
 	bool "Sharp PXA270 models (SL-Cxx00)"
 	select PXA27x
 
+config MACH_HX2750
+	bool "HP iPAQ hx2750"
+	select PXA27x
+	select PXA_KEYS
+	select MFD_TSC2101
+	select PXA_SSP
+	help
+	  This enables support for the HP iPAQ HX2750 handheld.
+
 endchoice
 
 endif
@@ -181,3 +190,4 @@
 	help
 	  Enable support for PXA2xx SSP ports
 endif
+
--- /dev/null
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/hx2750.c
@@ -0,0 +1,450 @@
+/*
+ * Machine definitions for HP iPAQ hx2750
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/input.h>
+#include <linux/irq.h>
+#include <linux/mmc/host.h>
+#include <linux/mfd/tsc2101.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/mach/arch.h>
+
+#include <asm/arch/hx2750.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa_keys.h>
+#include <asm/mach/map.h>
+#include <asm/arch/udc.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/audio.h>
+#include <asm/arch/pxafb.h>
+#include <asm/arch/ssp.h>
+
+#include "generic.h"
+
+
+/*
+ * Keys Support
+ */
+static struct pxa_keys_button hx2750_button_table[] = {
+	{ KEY_POWER, HX2750_GPIO_KEYPWR, PXAKEY_PWR_KEY },
+	{ KEY_LEFT, HX2750_GPIO_KEYLEFT, 0 },
+	{ KEY_RIGHT, HX2750_GPIO_KEYRIGHT, 0 },
+	{ KEY_KP0, HX2750_GPIO_KEYCAL, 0 },
+	{ KEY_KP1, HX2750_GPIO_KEYTASK, 0 },
+	{ KEY_KP2, HX2750_GPIO_KEYSIDE, 0 },
+	{ KEY_ENTER, HX2750_GPIO_KEYENTER, 0 },
+	{ KEY_KP3, HX2750_GPIO_KEYCON, 0 }, //KEY_CONTACTS
+	{ KEY_MAIL, HX2750_GPIO_KEYMAIL, 0 },
+	{ KEY_UP, HX2750_GPIO_KEYUP, 0 },
+	{ KEY_DOWN, HX2750_GPIO_KEYDOWN, 0 },
+};
+
+static struct pxa_keys_platform_data hx2750_pxa_keys_data = {
+	.buttons = hx2750_button_table,
+	.nbuttons = ARRAY_SIZE(hx2750_button_table),
+};
+
+static struct platform_device hx2750_pxa_keys = {
+	.name = "pxa2xx-keys",
+	.dev = {
+		.platform_data = &hx2750_pxa_keys_data,
+	},
+};
+
+
+/*
+ * Backlight Device
+ */
+extern struct platform_device pxafb_device;
+
+static struct platform_device hx2750_bl_device = {
+	.name		= "hx2750-bl",
+	.id		= -1,
+//	.dev	= {
+//		.parent = &pxafb_device.dev,
+//	}
+};
+
+
+/*
+ * UDC/USB
+ */
+static int hx2750_udc_is_connected (void)
+{
+	return GPLR0 & GPIO_bit(HX2750_GPIO_USBCONNECT);
+}
+
+//static void hx2750_udc_command (int cmd)
+//{
+//}
+
+static struct pxa2xx_udc_mach_info hx2750_udc_mach_info = {
+	.udc_is_connected = hx2750_udc_is_connected,
+//	.udc_command      = hx2750_udc_command,
+};
+
+
+/*
+ * SSP Devices Setup
+ */
+static struct ssp_dev hx2750_ssp_dev1;
+static struct ssp_dev hx2750_ssp_dev2;
+static struct ssp_dev hx2750_ssp_dev3;
+
+void hx2750_ssp_init(void)
+{
+	pxa_gpio_mode(HX2750_GPIO_TSC2101_SS | GPIO_OUT | GPIO_DFLT_HIGH);
+
+	if (ssp_init(&hx2750_ssp_dev1, 1, 0))
+		printk(KERN_ERR "Unable to register SSP1 handler!\n");
+	else {
+		ssp_disable(&hx2750_ssp_dev1);
+		ssp_config(&hx2750_ssp_dev1, (SSCR0_Motorola | (SSCR0_DSS & 0x0f )), SSCR1_SPH, 0, SSCR0_SerClkDiv(6));
+		ssp_enable(&hx2750_ssp_dev1);
+		hx2750_set_egpio(HX2750_EGPIO_TSC_PWR);
+	}
+
+//	if (ssp_init(&hx2750_ssp_dev2, 2, 0))
+//		printk(KERN_ERR "Unable to register SSP2 handler!\n");
+//	else {
+//		ssp_disable(&hx2750_ssp_dev2);
+//		ssp_config(&hx2750_ssp_dev2, (SSCR0_TI | (SSCR0_DSS & 0x09 )), 0, 0, SSCR0_SerClkDiv(140));
+//		ssp_enable(&hx2750_ssp_dev2);
+//	}
+//
+	if (ssp_init(&hx2750_ssp_dev3, 3, 0))
+		printk(KERN_ERR "Unable to register SSP3 handler!\n");
+	else {
+		ssp_disable(&hx2750_ssp_dev3);
+		ssp_config(&hx2750_ssp_dev3, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), SSCR1_SPO | SSCR1_SPH, 0, SSCR0_SerClkDiv(166));
+		ssp_enable(&hx2750_ssp_dev3);
+	}
+
+	printk("SSP Devices Initialised\n");
+
+	return;
+}
+
+struct ssp_state ssp1;
+
+void hx2750_ssp_suspend(void)
+{
+	ssp_disable(&hx2750_ssp_dev1);
+	ssp_save_state(&hx2750_ssp_dev1,&ssp1);
+	hx2750_clear_egpio(HX2750_EGPIO_TSC_PWR);
+}
+
+void hx2750_ssp_resume(void)
+{
+	hx2750_set_egpio(HX2750_EGPIO_TSC_PWR);
+	ssp_restore_state(&hx2750_ssp_dev1,&ssp1);
+	ssp_enable(&hx2750_ssp_dev1);
+}
+
+void hx2750_ssp_init2(void)
+{
+	printk("Stage 1: %x\n",CKEN);
+	if (ssp_init(&hx2750_ssp_dev2, 2, 0))
+		printk(KERN_ERR "Unable to register SSP2 handler!\n");
+	else {
+		printk("Stage 2: %x\n",CKEN);
+		ssp_disable(&hx2750_ssp_dev2);
+		printk("Stage 3: %x\n",CKEN);
+		ssp_config(&hx2750_ssp_dev2, (SSCR0_TI | (SSCR0_DSS & 0x09 )) | SSCR0_SSE, 0, 0, SSCR0_SerClkDiv(212));
+		printk("Stage 4: %x\n",CKEN);
+		ssp_enable(&hx2750_ssp_dev2);
+		printk("Stage 5: %x\n",CKEN);
+	}
+	printk("SSP Device2 Initialised\n");
+
+	printk("Sent: 0x3ff\n");
+	ssp_write_word(&hx2750_ssp_dev2,0x3ff);
+
+	return;
+}
+
+void hx2750_ssp2_reset(void)
+{
+	ssp_write_word(&hx2750_ssp_dev2,0x000);
+	ssp_write_word(&hx2750_ssp_dev2,0x000);
+
+}
+
+unsigned long hx2750_ssp2_read(void)
+{
+	u32 ret = 0;
+	ssp_read_word(&hx2750_ssp_dev2, &ret);
+	return ret;
+}
+
+void hx2750_ssp2_write(unsigned long data)
+{
+	ssp_write_word(&hx2750_ssp_dev2, data);
+}
+
+
+/*
+ * Extra hx2750 Specific GPIOs
+ */
+void hx2750_send_egpio(unsigned int val)
+{
+	int i;
+
+	GPCR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+	GPCR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+
+	for (i=0;i<12;i++) {
+		if (val & 0x01)
+			GPSR2 = GPIO_bit(HX2750_GPIO_GPIO_DIN);
+		else
+			GPCR2 = GPIO_bit(HX2750_GPIO_GPIO_DIN);
+		val >>= 1;
+		GPSR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+		GPCR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+	}
+
+	GPSR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+	GPCR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+}
+
+EXPORT_SYMBOL(hx2750_send_egpio);
+
+unsigned int hx2750_egpio_current;
+
+void hx2750_set_egpio(unsigned int gpio)
+{
+	hx2750_egpio_current|=gpio;
+
+	hx2750_send_egpio(hx2750_egpio_current);
+}
+EXPORT_SYMBOL(hx2750_set_egpio);
+
+void hx2750_clear_egpio(unsigned int gpio)
+{
+	hx2750_egpio_current&=~gpio;
+
+	hx2750_send_egpio(hx2750_egpio_current);
+}
+EXPORT_SYMBOL(hx2750_clear_egpio);
+
+
+/*
+ * Touchscreen/Sound/Battery Status
+ */
+void hx2750_tsc2101_send(int read, int command, int *values, int numval)
+{
+	u32 ret = 0;
+	int i;
+
+	GPCR0 = GPIO_bit(HX2750_GPIO_TSC2101_SS);
+
+	ssp_write_word(&hx2750_ssp_dev1, command | read);
+	/* dummy read */
+	ssp_read_word(&hx2750_ssp_dev1, &ret);
+
+	for (i=0; i < numval; i++) {
+		if (read) {
+			ssp_write_word(&hx2750_ssp_dev1, 0);
+			ssp_read_word(&hx2750_ssp_dev1, &values[i]);
+		} else {
+			ssp_write_word(&hx2750_ssp_dev1, values[i]);
+			ssp_read_word(&hx2750_ssp_dev1, &ret);
+		}
+	}
+
+	GPSR0 = GPIO_bit(HX2750_GPIO_TSC2101_SS);
+}
+
+static int hx2750_tsc2101_pendown(void)
+{
+	if ((GPLR(HX2750_GPIO_PENDOWN) & GPIO_bit(HX2750_GPIO_PENDOWN)) == 0)
+		return 1;
+	return 0;
+}
+
+static struct tsc2101_platform_info hx2750_tsc2101_info = {
+	.send     = hx2750_tsc2101_send,
+	.suspend  = hx2750_ssp_suspend,
+	.resume   = hx2750_ssp_resume,
+	.irq      = HX2750_IRQ_GPIO_PENDOWN,
+	.pendown  = hx2750_tsc2101_pendown,
+};
+
+struct platform_device tsc2101_device = {
+	.name 		= "tsc2101",
+	.dev		= {
+ 		.platform_data	= &hx2750_tsc2101_info,
+ 		//.parent = &corgissp_device.dev,
+	},
+	.id 		= -1,
+};
+
+
+/*
+ * MMC/SD Device
+ *
+ * The card detect interrupt isn't debounced so we delay it by 250ms
+ * to give the card a chance to fully insert/eject.
+ */
+static struct pxamci_platform_data hx2750_mci_platform_data;
+
+static int hx2750_mci_init(struct device *dev, irq_handler_t hx2750_detect_int, void *data)
+{
+	int err;
+
+	/*
+	 * setup GPIO for PXA27x MMC controller
+	 */
+	pxa_gpio_mode(GPIO32_MMCCLK_MD);
+	pxa_gpio_mode(GPIO112_MMCCMD_MD);
+	pxa_gpio_mode(GPIO92_MMCDAT0_MD);
+	pxa_gpio_mode(GPIO109_MMCDAT1_MD);
+	pxa_gpio_mode(GPIO110_MMCDAT2_MD);
+	pxa_gpio_mode(GPIO111_MMCDAT3_MD);
+	pxa_gpio_mode(HX2750_GPIO_SD_DETECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_SD_READONLY | GPIO_IN);
+
+	hx2750_mci_platform_data.detect_delay = msecs_to_jiffies(250);
+
+	err = request_irq(HX2750_IRQ_GPIO_SD_DETECT, hx2750_detect_int,
+			IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+			"MMC card detect", data);
+	if (err) {
+		printk(KERN_ERR "hx2750_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static void hx2750_mci_setpower(struct device *dev, unsigned int vdd)
+{
+	struct pxamci_platform_data* p_d = dev->platform_data;
+
+	if (( 1 << vdd) & p_d->ocr_mask)
+		hx2750_set_egpio(HX2750_EGPIO_SD_PWR);
+	else
+		hx2750_clear_egpio(HX2750_EGPIO_SD_PWR);
+}
+
+static void hx2750_mci_exit(struct device *dev, void *data)
+{
+	free_irq(HX2750_IRQ_GPIO_SD_DETECT, data);
+}
+
+static struct pxamci_platform_data hx2750_mci_platform_data = {
+	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
+	.init 		= hx2750_mci_init,
+	.setpower 	= hx2750_mci_setpower,
+	.exit		= hx2750_mci_exit,
+};
+
+
+/*
+ * FrameBuffer
+ */
+static struct pxafb_mode_info hx2750_pxafb_modes = {
+	.pixclock       = 288462,
+	.xres           = 240,
+	.yres           = 320,
+	.bpp            = 16,
+	.hsync_len      = 20,
+	.left_margin    = 42,
+	.right_margin   = 18,
+	.vsync_len	= 4,
+	.upper_margin   = 3,
+	.lower_margin   = 4,
+	.sync           = 0,
+};
+
+static struct pxafb_mach_info hx2750_pxafb_info = {
+	.modes          = &hx2750_pxafb_modes,
+	.num_modes      = 1,
+	.fixed_modes    = 1,
+	.lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+	.lccr3          = LCCR3_PixFlEdg | LCCR3_OutEnH,
+	.pxafb_backlight_power	= NULL,
+};
+
+
+/*
+ * Test Device
+ */
+static struct platform_device hx2750_test_device = {
+	.name		= "hx2750-test",
+	.id		= -1,
+};
+
+
+/* Initialization code */
+static struct platform_device *devices[] __initdata = {
+	&hx2750_bl_device,
+	&hx2750_test_device,
+	&hx2750_pxa_keys,
+	&tsc2101_device,
+};
+
+static void __init hx2750_init( void )
+{
+	PWER = 0xC0000003;// | PWER_RTC;
+	PFER = 0x00000003;
+	PRER = 0x00000003;
+
+	PGSR0=0x00000018;
+	PGSR1=0x00000380;
+	PGSR2=0x00800000;
+	PGSR3=0x00500400;
+
+	//PCFR |= PCFR_OPDE;
+	PCFR=0x77;
+	PSLR=0xff100000;
+	//PCFR=0x10; - does not return from suspend
+
+	//PCFR=  0x00004040;
+	//PSLR=  0xff400f04;
+
+	/* Setup Extra GPIO Bank access */
+	pxa_gpio_mode(HX2750_GPIO_GPIO_DIN | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_SR_CLK1 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(HX2750_GPIO_SR_CLK2 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_SR_STROBE | GPIO_OUT | GPIO_DFLT_LOW);
+
+	/* Init Extra GPIOs - Bootloader reset default is 0x484 */
+	/* This is 0xe84 */
+	hx2750_set_egpio(HX2750_EGPIO_2 | HX2750_EGPIO_7 | HX2750_EGPIO_LCD_PWR | HX2750_EGPIO_BL_PWR | HX2750_EGPIO_WIFI_PWR);
+
+	pxa_set_udc_info(&hx2750_udc_mach_info);
+	pxa_set_mci_info(&hx2750_mci_platform_data);
+	set_pxa_fb_info(&hx2750_pxafb_info);
+	hx2750_ssp_init();
+	platform_add_devices (devices, ARRAY_SIZE (devices));
+}
+
+
+MACHINE_START(HX2750, "HP iPAQ HX2750")
+	.phys_io	= 0x40000000,
+	.io_pg_offst	= (io_p2v(0x40000000) >> 18) & 0xfffc,
+	.boot_params	= 0xa0000100,
+	.map_io		= pxa_map_io,
+        .init_irq 	= pxa_init_irq,
+        .timer		= &pxa_timer,
+	.init_machine 	= hx2750_init,
+MACHINE_END
+
--- linux-2.6.24-rc1.orig/arch/arm/mach-pxa/pm.c
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/pm.c
@@ -17,6 +17,7 @@
 #include <linux/time.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/memory.h>
 #include <asm/system.h>
 #include <asm/arch/pm.h>
@@ -91,6 +92,9 @@
 	.enter		= pxa_pm_enter,
 };
 
+unsigned long pxa_pm_pspr_value;
+extern void pxa_cpu_resume(void);
+
 static int __init pxa_pm_init(void)
 {
 	if (!pxa_cpu_pm_fns) {
@@ -104,6 +108,7 @@
 		return -ENOMEM;
 	}
 
+	pxa_pm_pspr_value=virt_to_phys(pxa_cpu_resume);
 	suspend_set_ops(&pxa_pm_ops);
 	return 0;
 }
--- linux-2.6.24-rc1.orig/arch/arm/mach-pxa/pxa27x.c
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/pxa27x.c
@@ -259,6 +259,8 @@
 	RESTORE(PSTR);
 }
 
+extern unsigned long pxa_pm_pspr_value;
+
 void pxa27x_cpu_pm_enter(suspend_state_t state)
 {
 	extern void pxa_cpu_standby(void);
@@ -281,7 +283,7 @@
 		break;
 	case PM_SUSPEND_MEM:
 		/* set resume return address */
-		PSPR = virt_to_phys(pxa_cpu_resume);
+		PSPR = pxa_pm_pspr_value;
 		pxa27x_cpu_suspend(PWRMODE_SLEEP);
 		break;
 	}
--- linux-2.6.24-rc1.orig/arch/arm/mach-pxa/pxa25x.c
+++ linux-2.6.24-rc1/arch/arm/mach-pxa/pxa25x.c
@@ -200,6 +200,8 @@
 	RESTORE(PSTR);
 }
 
+extern unsigned long pxa_pm_pspr_value;
+
 static void pxa25x_cpu_pm_enter(suspend_state_t state)
 {
 	CKEN = 0;
@@ -207,7 +209,7 @@
 	switch (state) {
 	case PM_SUSPEND_MEM:
 		/* set resume return address */
-		PSPR = virt_to_phys(pxa_cpu_resume);
+		PSPR = pxa_pm_pspr_value;
 		pxa25x_cpu_suspend(PWRMODE_SLEEP);
 		break;
 	}