~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/plat-samsung/s5p-irq-pm.c

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  3  *              http://www.samsung.com
  4  *
  5  * Based on arch/arm/plat-s3c24xx/irq-pm.c,
  6  * Copyright (c) 2003,2004 Simtec Electronics
  7  *      Ben Dooks <ben@simtec.co.uk>
  8  *      http://armlinux.simtec.co.uk/
  9  *
 10  * This program is free software; you can redistribute it and/or modify
 11  * it under the terms of the GNU General Public License version 2 as
 12  * published by the Free Software Foundation.
 13 */
 14 
 15 #include <linux/init.h>
 16 #include <linux/module.h>
 17 #include <linux/interrupt.h>
 18 
 19 #include <plat/cpu.h>
 20 #include <plat/irqs.h>
 21 #include <plat/pm.h>
 22 #include <mach/map.h>
 23 
 24 #include <mach/regs-gpio.h>
 25 #include <mach/regs-irq.h>
 26 
 27 /* state for IRQs over sleep */
 28 
 29 /* default is to allow for EINT0..EINT31, and IRQ_RTC_TIC, IRQ_RTC_ALARM,
 30  * as wakeup sources
 31  *
 32  * set bit to 1 in allow bitfield to enable the wakeup settings on it
 33 */
 34 
 35 unsigned long s3c_irqwake_intallow      = 0x00000006L;
 36 unsigned long s3c_irqwake_eintallow     = 0xffffffffL;
 37 
 38 int s3c_irq_wake(struct irq_data *data, unsigned int state)
 39 {
 40         unsigned long irqbit;
 41         unsigned int irq_rtc_tic, irq_rtc_alarm;
 42 
 43 #ifdef CONFIG_ARCH_EXYNOS
 44         if (soc_is_exynos5250()) {
 45                 irq_rtc_tic = EXYNOS5_IRQ_RTC_TIC;
 46                 irq_rtc_alarm = EXYNOS5_IRQ_RTC_ALARM;
 47         } else {
 48                 irq_rtc_tic = EXYNOS4_IRQ_RTC_TIC;
 49                 irq_rtc_alarm = EXYNOS4_IRQ_RTC_ALARM;
 50         }
 51 #else
 52         irq_rtc_tic = IRQ_RTC_TIC;
 53         irq_rtc_alarm = IRQ_RTC_ALARM;
 54 #endif
 55 
 56         if (data->irq == irq_rtc_tic || data->irq == irq_rtc_alarm) {
 57                 irqbit = 1 << (data->irq + 1 - irq_rtc_alarm);
 58 
 59                 if (!state)
 60                         s3c_irqwake_intmask |= irqbit;
 61                 else
 62                         s3c_irqwake_intmask &= ~irqbit;
 63         } else {
 64                 return -ENOENT;
 65         }
 66 
 67         return 0;
 68 }
 69 
 70 static struct sleep_save eint_save[] = {
 71         SAVE_ITEM(S5P_EINT_CON(0)),
 72         SAVE_ITEM(S5P_EINT_CON(1)),
 73         SAVE_ITEM(S5P_EINT_CON(2)),
 74         SAVE_ITEM(S5P_EINT_CON(3)),
 75 
 76         SAVE_ITEM(S5P_EINT_FLTCON(0)),
 77         SAVE_ITEM(S5P_EINT_FLTCON(1)),
 78         SAVE_ITEM(S5P_EINT_FLTCON(2)),
 79         SAVE_ITEM(S5P_EINT_FLTCON(3)),
 80         SAVE_ITEM(S5P_EINT_FLTCON(4)),
 81         SAVE_ITEM(S5P_EINT_FLTCON(5)),
 82         SAVE_ITEM(S5P_EINT_FLTCON(6)),
 83         SAVE_ITEM(S5P_EINT_FLTCON(7)),
 84 
 85         SAVE_ITEM(S5P_EINT_MASK(0)),
 86         SAVE_ITEM(S5P_EINT_MASK(1)),
 87         SAVE_ITEM(S5P_EINT_MASK(2)),
 88         SAVE_ITEM(S5P_EINT_MASK(3)),
 89 };
 90 
 91 int s3c24xx_irq_suspend(void)
 92 {
 93         s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save));
 94 
 95         return 0;
 96 }
 97 
 98 void s3c24xx_irq_resume(void)
 99 {
100         s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save));
101 }
102 
103 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp