Blame view

arch/arm/plat-s5p/irq-pm.c 2.02 KB
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  /* linux/arch/arm/plat-s5p/irq-pm.c
   *
   * Copyright (c) 2010 Samsung Electronics Co., Ltd.
   *		http://www.samsung.com
   *
   * Based on arch/arm/plat-s3c24xx/irq-pm.c,
   * Copyright (c) 2003,2004 Simtec Electronics
   *	Ben Dooks <ben@simtec.co.uk>
   *	http://armlinux.simtec.co.uk/
   *
   * 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/module.h>
  #include <linux/interrupt.h>
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  
  #include <plat/cpu.h>
  #include <plat/irqs.h>
  #include <plat/pm.h>
  #include <mach/map.h>
  
  #include <mach/regs-gpio.h>
  #include <mach/regs-irq.h>
  
  /* state for IRQs over sleep */
  
  /* default is to allow for EINT0..EINT31, and IRQ_RTC_TIC, IRQ_RTC_ALARM,
   * as wakeup sources
   *
   * set bit to 1 in allow bitfield to enable the wakeup settings on it
  */
  
  unsigned long s3c_irqwake_intallow	= 0x00000006L;
  unsigned long s3c_irqwake_eintallow	= 0xffffffffL;
bb0b23746   Lennert Buytenhek   ARM: S5P: irq_dat...
38
  int s3c_irq_wake(struct irq_data *data, unsigned int state)
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
39
40
  {
  	unsigned long irqbit;
bb0b23746   Lennert Buytenhek   ARM: S5P: irq_dat...
41
  	switch (data->irq) {
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
42
43
  	case IRQ_RTC_TIC:
  	case IRQ_RTC_ALARM:
bb0b23746   Lennert Buytenhek   ARM: S5P: irq_dat...
44
  		irqbit = 1 << (data->irq + 1 - IRQ_RTC_ALARM);
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
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
  		if (!state)
  			s3c_irqwake_intmask |= irqbit;
  		else
  			s3c_irqwake_intmask &= ~irqbit;
  		break;
  	default:
  		return -ENOENT;
  	}
  	return 0;
  }
  
  static struct sleep_save eint_save[] = {
  	SAVE_ITEM(S5P_EINT_CON(0)),
  	SAVE_ITEM(S5P_EINT_CON(1)),
  	SAVE_ITEM(S5P_EINT_CON(2)),
  	SAVE_ITEM(S5P_EINT_CON(3)),
  
  	SAVE_ITEM(S5P_EINT_FLTCON(0)),
  	SAVE_ITEM(S5P_EINT_FLTCON(1)),
  	SAVE_ITEM(S5P_EINT_FLTCON(2)),
  	SAVE_ITEM(S5P_EINT_FLTCON(3)),
  	SAVE_ITEM(S5P_EINT_FLTCON(4)),
  	SAVE_ITEM(S5P_EINT_FLTCON(5)),
  	SAVE_ITEM(S5P_EINT_FLTCON(6)),
  	SAVE_ITEM(S5P_EINT_FLTCON(7)),
  
  	SAVE_ITEM(S5P_EINT_MASK(0)),
  	SAVE_ITEM(S5P_EINT_MASK(1)),
  	SAVE_ITEM(S5P_EINT_MASK(2)),
  	SAVE_ITEM(S5P_EINT_MASK(3)),
  };
bb072c3cf   Rafael J. Wysocki   ARM / Samsung: Us...
76
  int s3c24xx_irq_suspend(void)
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
77
78
79
80
81
  {
  	s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save));
  
  	return 0;
  }
bb072c3cf   Rafael J. Wysocki   ARM / Samsung: Us...
82
  void s3c24xx_irq_resume(void)
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
83
84
  {
  	s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save));
ea31fd433   Jongpill Lee   ARM: S5PV210: Add...
85
  }