aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/hardware/arm_timer.h
blob: c0f4e7bf22de9357da96283d4f22d3eeed33ffba (plain) (blame)
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
#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
#define __ASM_ARM_HARDWARE_ARM_TIMER_H

/*
 * ARM timer implementation, found in Integrator, Versatile and Realview
 * platforms.  Not all platforms support all registers and bits in these
 * registers, so we mark them with A for Integrator AP, C for Integrator
 * CP, V for Versatile and R for Realview.
 *
 * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
 * can have 16-bit or 32-bit selectable via a bit in the control register.
 */
#define TIMER_LOAD	0x00			/* ACVR rw */
#define TIMER_VALUE	0x04			/* ACVR ro */
#define TIMER_CTRL	0x08			/* ACVR rw */
#define TIMER_CTRL_ONESHOT	(1 << 0)	/*  CVR */
#define TIMER_CTRL_32BIT	(1 << 1)	/*  CVR */
#define TIMER_CTRL_DIV1		(0 << 2)	/* ACVR */
#define TIMER_CTRL_DIV16	(1 << 2)	/* ACVR */
#define TIMER_CTRL_DIV256	(2 << 2)	/* ACVR */
#define TIMER_CTRL_IE		(1 << 5)	/*   VR */
#define TIMER_CTRL_PERIODIC	(1 << 6)	/* ACVR */
#define TIMER_CTRL_ENABLE	(1 << 7)	/* ACVR */

#define TIMER_INTCLR	0x0c			/* ACVR wo */
#define TIMER_RIS	0x10			/*  CVR ro */
#define TIMER_MIS	0x14			/*  CVR ro */
#define TIMER_BGLOAD	0x18			/*  CVR rw */

#endif
>
c9b6c8f68ee
2f3f22269bd






4b4f7280d7f

2f3f22269bd


2f3f22269bd
c9b6c8f68ee

78f5f023167
2f3f22269bd



5d1e072b6b9
091aad6af4a

d7f0eea9e43
72ad5d77fb9













d8f3de0d241











d5a64513c6a
d8f3de0d241
d5a64513c6a
d8f3de0d241
3d97e426aa9
d5a64513c6a
fe955682d21
d8f3de0d241



c5f7a1bb65b




26fcaf60fe3
c5f7a1bb65b


d8f3de0d241







d8f3de0d241

c5f7a1bb65b
d8f3de0d241









d8f3de0d241
26fcaf60fe3
d5a64513c6a
d8f3de0d241












42de5532f4a
d551d81d6a7
2a6b69765ad
d8f3de0d241

1da177e4c3f
d8f3de0d241

78f5f023167
d8f3de0d241

















e49f711cc8f
d8f3de0d241
92daa7b53b7

5d1e072b6b9
1da177e4c3f
d8f3de0d241
1da177e4c3f
e2a5b420f71


e2a5b420f71
1da177e4c3f

e9b3aba887f
2c6e33c366b
e9b3aba887f

2c6e33c366b
e9b3aba887f



72ad5d77fb9
2a6b69765ad


e9b3aba887f

e49f711cc8f
e9b3aba887f







1da177e4c3f
2c6e33c366b
e9b3aba887f
1da177e4c3f
50ad147aa09

1da177e4c3f

2c6e33c366b
1da177e4c3f

e9b3aba887f
979f11b060c
1da177e4c3f


e9b3aba887f

1da177e4c3f



e9b3aba887f
f1a2003e22f
979f11b060c

7a63f08b2b9
1da177e4c3f
1da177e4c3f
872d83d00f6
b6dacf63e9f

65df78473ff
c95d47a868f


23b168d425c
872d83d00f6





a3627f67b1d




3d97e426aa9
d5a64513c6a
fe955682d21
a3627f67b1d
2a6b69765ad

1da177e4c3f


2c6e33c366b
eb9289eb20d
e8c9c502690
eb9289eb20d
e8c9c502690









eb9289eb20d

2f55ac072f5
2c6e33c366b

6a7c7eaf71b
2c6e33c366b
618d7fd0d4e
d8f3de0d241











d8f3de0d241

c5f7a1bb65b
d8f3de0d241






2f55ac072f5
d8f3de0d241

c5f7a1bb65b
2c6e33c366b
618d7fd0d4e
d8f3de0d241

1da177e4c3f
e41fb7c58e3






539986482b0





e41fb7c58e3








4fb507b6b76







65df78473ff
a1404495845






45e7798886a
2a9ef8e1a85







539986482b0

d11c78e97e1







ddf6ce45a7b







539986482b0













af48931c486







291a73c9be1







7b330707ddd







bb0c5ed6ec5















89e8ea1278f







731b25a4ad3







e41fb7c58e3

296699de6bd

b0cb1a19d05
bdfe6b7c681








caea99ef339
74f270af0c1
3f4b0ef7f28

72ad5d77fb9
3f4b0ef7f28







a3d25c275d3


a3d25c275d3


a3d25c275d3

c95d47a868f

a3d25c275d3



c7e0831d385






c95d47a868f

bdfe6b7c681





3f4b0ef7f28
dd4c4f17d72
d5a64513c6a
fe955682d21
c7e0831d385

d5a64513c6a
f6bb13aa1ea
fe955682d21
3d97e426aa9
a3d25c275d3

073ef1f6e50
d8f3de0d241

c5f7a1bb65b
2a6b69765ad
d8f3de0d241


d5a64513c6a

d8f3de0d241
caea99ef339
d8f3de0d241






a634cc10164
e49f711cc8f








a634cc10164
3f4b0ef7f28
72ad5d77fb9
dd4c4f17d72
3f4b0ef7f28





d8f3de0d241



073ef1f6e50
d8f3de0d241

c5f7a1bb65b
d5a64513c6a
2a6b69765ad
a3d25c275d3
c7e0831d385
d5a64513c6a

d8f3de0d241
a3d25c275d3
d8f3de0d241
a3d25c275d3
296699de6bd














aa338601581
fd4aff1a28e


2fe2de5f6c2

fd4aff1a28e
















2fe2de5f6c2
fd4aff1a28e



27663c5855b
fd4aff1a28e

ead77594af3
fd4aff1a28e





























761afb869f6
fd4aff1a28e
ad3399c3789

fd4aff1a28e
ad3399c3789


761afb869f6


ad3399c3789




fd4aff1a28e
ad3399c3789
fd4aff1a28e





aa338601581
eb9d0fe40e3
761afb869f6
eb9d0fe40e3









df8db91fc3b
eb9d0fe40e3
0baed8da1ed
eb9d0fe40e3



df8db91fc3b
eb9d0fe40e3


e8b6f970107


df8db91fc3b




eb9d0fe40e3
761afb869f6
fd4aff1a28e
f216cc3748a



3d97e426aa9
f216cc3748a




4d9391557b6
f216cc3748a



96f15efcea9







01eac60bccd
96f15efcea9
















aafbcd165a2
1da177e4c3f
296699de6bd


e2a5b420f71
e41fb7c58e3

296699de6bd
1da177e4c3f



5a50fe709d5


296699de6bd
5a50fe709d5
1da177e4c3f




1da177e4c3f
1da177e4c3f
d8f3de0d241

296699de6bd
a3d25c275d3
b0cb1a19d05
296699de6bd

d8f3de0d241

296699de6bd
f216cc3748a
bdfe6b7c681
3d97e426aa9
bdfe6b7c681




296699de6bd
a3d25c275d3
f216cc3748a







e49f711cc8f




96f15efcea9
1da177e4c3f

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


                                
                                                                           












                                                             
                         
                       


                   

                              

                     

                  
                                           
 





























                                                                            
                                             






                                                        

                                                                            


                               
      

                                                                              
                                               



                                                
                        

                                                   
  













                                                                                











                                                                               
                                                                 
   
                               
 
                                
                                           
                                     



                 




                                                                      
                                  


   







                                                                           

                                                        
 









                                                                        
                   
                                              
 












                                                                            
                                       
                           
 

                                        
 

                                                                          
                                                

















                                                                            
                                                       
 

                                             
                              
 
                     
                                    


                                             
                                        

  
   
                                                                           

                                                              
                                                       



                                                       
                                                     


                             

                                                     
                                                               







                                                                         
   
                                                          
                          
  

                                                                           

                                                                            
                                                       

                                   
                                                 
                  


                               

                             



                                                            
                           
                                                

                                     
                                                              
                      
         
 

                                                                           
 


                                                          
                                                                 





                                                                  




                                                                              
                                
                                              
                                             
 

                              


                                                  
                                                             
 
                       
 









                                                           

 
                                                             

                                          
                                        
                                    
                               











                                                                              

                                            
 






                                                                            
                                                                 

                                          
                                            
                                    
                               

                                  
  






                                                                          





                                                                








                                                                       







                                                                     
         






                                                                     
         







                                                                           

                                    







                                                              







                                                              













                                                                      







                                                              







                                                              







                                                           















                                                                     







                                                              







                                                              

           

                           
                         








                                           
                                       
 

                  
                                                     







                                                               


                                       


                               

                                                                      

                                                          



                                                  






                                                                             

                                                          





                                                                             
                                         
                              
                                              
                                             

 
                              
 
                                       
                                       

 
                                                                     

                                        
                                        
                                 


                                        

                                        
  
 






                                                                              
 








                                                                             
 
                     
                                
                                                    





                                                                



                                                                            
                                                                         

                                            
                                            
                                  
                                 
                                        
                                        

                                        
                                  
  
                               
 














                                                      
                


                                                                                

                                                                      
















                                                                                
                                                                



                                                     
                                        

                                                                          
                                                                   





























                                                                               
                                      
                                                                    

                                   
                                     


                                                                         


                                                                       




                                                                          
                                      
                 





                                 
                      
 
                      









                                                                          
                  
 
                                    



                                                                          
                                                                              


                               


                                                                                




                                                                 
 
                             
 



                                             
                                




                                                                               
                                                   



                                              







                                                               
                                           
















                                                                                      
                                
 


                           
                  

                                              
      



                          


                                                
                     
                                                         




                                                                       
         
 

                                                           
      
 
                         

                                                                           

                                                                           
                                                
                              
                                  
                                                        




                                                                    
         
      







                                                                           




                                                                             
                             

                 
/*
 * sleep.c - ACPI sleep support.
 *
 * Copyright (c) 2005 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
 * Copyright (c) 2004 David Shaohua Li <shaohua.li@intel.com>
 * Copyright (c) 2000-2003 Patrick Mochel
 * Copyright (c) 2003 Open Source Development Lab
 *
 * This file is released under the GPLv2.
 *
 */

#include <linux/delay.h>
#include <linux/irq.h>
#include <linux/dmi.h>
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/reboot.h>
#include <linux/acpi.h>

#include <asm/io.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#include "internal.h"
#include "sleep.h"

static u8 sleep_states[ACPI_S_STATE_COUNT];

static void acpi_sleep_tts_switch(u32 acpi_state)
{
	union acpi_object in_arg = { ACPI_TYPE_INTEGER };
	struct acpi_object_list arg_list = { 1, &in_arg };
	acpi_status status = AE_OK;

	in_arg.integer.value = acpi_state;
	status = acpi_evaluate_object(NULL, "\\_TTS", &arg_list, NULL);
	if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
		/*
		 * OS can't evaluate the _TTS object correctly. Some warning
		 * message will be printed. But it won't break anything.
		 */
		printk(KERN_NOTICE "Failure in evaluating _TTS object\n");
	}
}

static int tts_notify_reboot(struct notifier_block *this,
			unsigned long code, void *x)
{
	acpi_sleep_tts_switch(ACPI_STATE_S5);
	return NOTIFY_DONE;
}

static struct notifier_block tts_notifier = {
	.notifier_call	= tts_notify_reboot,
	.next		= NULL,
	.priority	= 0,
};

static int acpi_sleep_prepare(u32 acpi_state)
{
#ifdef CONFIG_ACPI_SLEEP
	/* do we have a wakeup address for S2 and S3? */
	if (acpi_state == ACPI_STATE_S3) {
		if (!acpi_wakeup_address) {
			return -EFAULT;
		}
		acpi_set_firmware_waking_vector(
				(acpi_physical_address)acpi_wakeup_address);

	}
	ACPI_FLUSH_CPU_CACHE();
#endif
	printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n",
		acpi_state);
	acpi_enable_wakeup_devices(acpi_state);
	acpi_enter_sleep_state_prep(acpi_state);
	return 0;
}

#ifdef CONFIG_ACPI_SLEEP
static u32 acpi_target_sleep_state = ACPI_STATE_S0;

/*
 * The ACPI specification wants us to save NVS memory regions during hibernation
 * and to restore them during the subsequent resume.  Windows does that also for
 * suspend to RAM.  However, it is known that this mechanism does not work on
 * all machines, so we allow the user to disable it with the help of the
 * 'acpi_sleep=nonvs' kernel command line option.
 */
static bool nvs_nosave;

void __init acpi_nvs_nosave(void)
{
	nvs_nosave = true;
}

/*
 * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
 * user to request that behavior by using the 'acpi_old_suspend_ordering'
 * kernel command line option that causes the following variable to be set.
 */
static bool old_suspend_ordering;

void __init acpi_old_suspend_ordering(void)
{
	old_suspend_ordering = true;
}

/**
 * acpi_pm_freeze - Disable the GPEs and suspend EC transactions.
 */
static int acpi_pm_freeze(void)
{
	acpi_disable_all_gpes();
	acpi_os_wait_events_complete(NULL);
	acpi_ec_block_transactions();
	return 0;
}

/**
 * acpi_pre_suspend - Enable wakeup devices, "freeze" EC and save NVS.
 */
static int acpi_pm_pre_suspend(void)
{
	acpi_pm_freeze();
	return suspend_nvs_save();
}

/**
 *	__acpi_pm_prepare - Prepare the platform to enter the target state.
 *
 *	If necessary, set the firmware waking vector and do arch-specific
 *	nastiness to get the wakeup code to the waking vector.
 */
static int __acpi_pm_prepare(void)
{
	int error = acpi_sleep_prepare(acpi_target_sleep_state);
	if (error)
		acpi_target_sleep_state = ACPI_STATE_S0;

	return error;
}

/**
 *	acpi_pm_prepare - Prepare the platform to enter the target sleep
 *		state and disable the GPEs.
 */
static int acpi_pm_prepare(void)
{
	int error = __acpi_pm_prepare();
	if (!error)
		error = acpi_pm_pre_suspend();

	return error;
}

/**
 *	acpi_pm_finish - Instruct the platform to leave a sleep state.
 *
 *	This is called after we wake back up (or if entering the sleep state
 *	failed).
 */
static void acpi_pm_finish(void)
{
	u32 acpi_state = acpi_target_sleep_state;

	acpi_ec_unblock_transactions();
	suspend_nvs_free();

	if (acpi_state == ACPI_STATE_S0)
		return;

	printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n",
		acpi_state);
	acpi_disable_wakeup_devices(acpi_state);
	acpi_leave_sleep_state(acpi_state);

	/* reset firmware waking vector */
	acpi_set_firmware_waking_vector((acpi_physical_address) 0);

	acpi_target_sleep_state = ACPI_STATE_S0;
}

/**
 *	acpi_pm_end - Finish up suspend sequence.
 */
static void acpi_pm_end(void)
{
	/*
	 * This is necessary in case acpi_pm_finish() is not called during a
	 * failing transition to a sleep state.
	 */
	acpi_target_sleep_state = ACPI_STATE_S0;
	acpi_sleep_tts_switch(acpi_target_sleep_state);
}
#else /* !CONFIG_ACPI_SLEEP */
#define acpi_target_sleep_state	ACPI_STATE_S0
#endif /* CONFIG_ACPI_SLEEP */

#ifdef CONFIG_SUSPEND
static u32 acpi_suspend_states[] = {
	[PM_SUSPEND_ON] = ACPI_STATE_S0,
	[PM_SUSPEND_STANDBY] = ACPI_STATE_S1,
	[PM_SUSPEND_MEM] = ACPI_STATE_S3,
	[PM_SUSPEND_MAX] = ACPI_STATE_S5
};

/**
 *	acpi_suspend_begin - Set the target system sleep state to the state
 *		associated with given @pm_state, if supported.
 */
static int acpi_suspend_begin(suspend_state_t pm_state)
{
	u32 acpi_state = acpi_suspend_states[pm_state];
	int error = 0;

	error = nvs_nosave ? 0 : suspend_nvs_alloc();
	if (error)
		return error;

	if (sleep_states[acpi_state]) {
		acpi_target_sleep_state = acpi_state;
		acpi_sleep_tts_switch(acpi_target_sleep_state);
	} else {
		printk(KERN_ERR "ACPI does not support this state: %d\n",
			pm_state);
		error = -ENOSYS;
	}
	return error;
}

/**
 *	acpi_suspend_enter - Actually enter a sleep state.
 *	@pm_state: ignored
 *
 *	Flush caches and go to sleep. For STR we have to call arch-specific
 *	assembly, which in turn call acpi_enter_sleep_state().
 *	It's unfortunate, but it works. Please fix if you're feeling frisky.
 */
static int acpi_suspend_enter(suspend_state_t pm_state)
{
	acpi_status status = AE_OK;
	u32 acpi_state = acpi_target_sleep_state;
	int error;

	ACPI_FLUSH_CPU_CACHE();

	switch (acpi_state) {
	case ACPI_STATE_S1:
		barrier();
		status = acpi_enter_sleep_state(acpi_state);
		break;

	case ACPI_STATE_S3:
		error = acpi_suspend_lowlevel();
		if (error)
			return error;
		pr_info(PREFIX "Low-level resume complete\n");
		break;
	}

	/* This violates the spec but is required for bug compatibility. */
	acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);

	/* Reprogram control registers and execute _BFS */
	acpi_leave_sleep_state_prep(acpi_state);

	/* ACPI 3.0 specs (P62) says that it's the responsibility
	 * of the OSPM to clear the status bit [ implying that the
	 * POWER_BUTTON event should not reach userspace ]
	 */
	if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3))
		acpi_clear_event(ACPI_EVENT_POWER_BUTTON);

	/*
	 * Disable and clear GPE status before interrupt is enabled. Some GPEs
	 * (like wakeup GPE) haven't handler, this can avoid such GPE misfire.
	 * acpi_leave_sleep_state will reenable specific GPEs later
	 */
	acpi_disable_all_gpes();
	/* Allow EC transactions to happen. */
	acpi_ec_unblock_transactions_early();

	suspend_nvs_restore();

	return ACPI_SUCCESS(status) ? 0 : -EFAULT;
}

static int acpi_suspend_state_valid(suspend_state_t pm_state)
{
	u32 acpi_state;

	switch (pm_state) {
	case PM_SUSPEND_ON:
	case PM_SUSPEND_STANDBY:
	case PM_SUSPEND_MEM:
		acpi_state = acpi_suspend_states[pm_state];

		return sleep_states[acpi_state];
	default:
		return 0;
	}
}

static const struct platform_suspend_ops acpi_suspend_ops = {
	.valid = acpi_suspend_state_valid,
	.begin = acpi_suspend_begin,
	.prepare_late = acpi_pm_prepare,
	.enter = acpi_suspend_enter,
	.wake = acpi_pm_finish,
	.end = acpi_pm_end,
};

/**
 *	acpi_suspend_begin_old - Set the target system sleep state to the
 *		state associated with given @pm_state, if supported, and
 *		execute the _PTS control method.  This function is used if the
 *		pre-ACPI 2.0 suspend ordering has been requested.
 */
static int acpi_suspend_begin_old(suspend_state_t pm_state)
{
	int error = acpi_suspend_begin(pm_state);
	if (!error)
		error = __acpi_pm_prepare();

	return error;
}

/*
 * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has
 * been requested.
 */
static const struct platform_suspend_ops acpi_suspend_ops_old = {
	.valid = acpi_suspend_state_valid,
	.begin = acpi_suspend_begin_old,
	.prepare_late = acpi_pm_pre_suspend,
	.enter = acpi_suspend_enter,
	.wake = acpi_pm_finish,
	.end = acpi_pm_end,
	.recover = acpi_pm_finish,
};

static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
{
	old_suspend_ordering = true;
	return 0;
}

static int __init init_nvs_nosave(const struct dmi_system_id *d)
{
	acpi_nvs_nosave();
	return 0;
}

static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
	{
	.callback = init_old_suspend_ordering,
	.ident = "Abit KN9 (nForce4 variant)",
	.matches = {
		DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
		DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
		},
	},
	{
	.callback = init_old_suspend_ordering,
	.ident = "HP xw4600 Workstation",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
		DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
		},
	},
	{
	.callback = init_old_suspend_ordering,
	.ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
	.matches = {
		DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
		DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
		},
	},
	{
	.callback = init_old_suspend_ordering,
	.ident = "Panasonic CF51-2L",
	.matches = {
		DMI_MATCH(DMI_BOARD_VENDOR,
				"Matsushita Electric Industrial Co.,Ltd."),
		DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
		},
	},
	{
	.callback = init_nvs_nosave,
	.ident = "Sony Vaio VGN-FW21E",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
		DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"),
		},
	},
	{
	.callback = init_nvs_nosave,
	.ident = "Sony Vaio VPCEB17FX",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
		DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"),
		},
	},
	{
	.callback = init_nvs_nosave,
	.ident = "Sony Vaio VGN-SR11M",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
		DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
		},
	},
	{
	.callback = init_nvs_nosave,
	.ident = "Everex StepNote Series",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
		DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
		},
	},
	{
	.callback = init_nvs_nosave,