aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c24xx
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2013-02-12 12:59:24 -0500
committerKukjin Kim <kgene.kim@samsung.com>2013-03-05 06:20:38 -0500
commit2286cf467e460eabfd0a188c5c5fb46955dcf024 (patch)
tree395af26fd2846ded9c75538124d6c163cd715a68 /arch/arm/mach-s3c24xx
parentce6c164bf0ea44fad7969e1f1027d4f6cfb30360 (diff)
ARM: S3C24XX: move s3c2440 irqs to common irq code
Will be integrated in the following patch. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c24xx')
-rw-r--r--arch/arm/mach-s3c24xx/Makefile2
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2440.c128
-rw-r--r--arch/arm/mach-s3c24xx/irq.c88
3 files changed, 89 insertions, 129 deletions
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 051b8f99d2fd..90412607fb47 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -31,7 +31,7 @@ obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
31obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o 31obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o
32obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o 32obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o
33 33
34obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o 34obj-$(CONFIG_CPU_S3C2440) += s3c2440.o clock-s3c2440.o
35obj-$(CONFIG_CPU_S3C2442) += s3c2442.o 35obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
36obj-$(CONFIG_CPU_S3C244X) += s3c244x.o clock-s3c244x.o 36obj-$(CONFIG_CPU_S3C244X) += s3c244x.o clock-s3c244x.o
37obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o 37obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2440.c b/arch/arm/mach-s3c24xx/irq-s3c2440.c
deleted file mode 100644
index 4a18cde439cc..000000000000
--- a/arch/arm/mach-s3c24xx/irq-s3c2440.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/* linux/arch/arm/mach-s3c2440/irq.c
2 *
3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20*/
21
22#include <linux/init.h>
23#include <linux/module.h>
24#include <linux/interrupt.h>
25#include <linux/ioport.h>
26#include <linux/device.h>
27#include <linux/io.h>
28
29#include <mach/hardware.h>
30#include <asm/irq.h>
31
32#include <asm/mach/irq.h>
33
34#include <mach/regs-irq.h>
35#include <mach/regs-gpio.h>
36
37#include <plat/cpu.h>
38#include <plat/pm.h>
39#include <plat/irq.h>
40
41/* WDT/AC97 */
42
43static void s3c_irq_demux_wdtac97(unsigned int irq,
44 struct irq_desc *desc)
45{
46 unsigned int subsrc, submsk;
47
48 /* read the current pending interrupts, and the mask
49 * for what it is available */
50
51 subsrc = __raw_readl(S3C2410_SUBSRCPND);
52 submsk = __raw_readl(S3C2410_INTSUBMSK);
53
54 subsrc &= ~submsk;
55 subsrc >>= 13;
56 subsrc &= 3;
57
58 if (subsrc != 0) {
59 if (subsrc & 1) {
60 generic_handle_irq(IRQ_S3C2440_WDT);
61 }
62 if (subsrc & 2) {
63 generic_handle_irq(IRQ_S3C2440_AC97);
64 }
65 }
66}
67
68
69#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
70
71static void
72s3c_irq_wdtac97_mask(struct irq_data *data)
73{
74 s3c_irqsub_mask(data->irq, INTMSK_WDT, 3 << 13);
75}
76
77static void
78s3c_irq_wdtac97_unmask(struct irq_data *data)
79{
80 s3c_irqsub_unmask(data->irq, INTMSK_WDT);
81}
82
83static void
84s3c_irq_wdtac97_ack(struct irq_data *data)
85{
86 s3c_irqsub_maskack(data->irq, INTMSK_WDT, 3 << 13);
87}
88
89static struct irq_chip s3c_irq_wdtac97 = {
90 .irq_mask = s3c_irq_wdtac97_mask,
91 .irq_unmask = s3c_irq_wdtac97_unmask,
92 .irq_ack = s3c_irq_wdtac97_ack,
93};
94
95static int s3c2440_irq_add(struct device *dev, struct subsys_interface *sif)
96{
97 unsigned int irqno;
98
99 printk("S3C2440: IRQ Support\n");
100
101 /* add new chained handler for wdt, ac7 */
102
103 irq_set_chip_and_handler(IRQ_WDT, &s3c_irq_level_chip,
104 handle_level_irq);
105 irq_set_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
106
107 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
108 irq_set_chip_and_handler(irqno, &s3c_irq_wdtac97,
109 handle_level_irq);
110 set_irq_flags(irqno, IRQF_VALID);
111 }
112
113 return 0;
114}
115
116static struct subsys_interface s3c2440_irq_interface = {
117 .name = "s3c2440_irq",
118 .subsys = &s3c2440_subsys,
119 .add_dev = s3c2440_irq_add,
120};
121
122static int s3c2440_irq_init(void)
123{
124 return subsys_interface_register(&s3c2440_irq_interface);
125}
126
127arch_initcall(s3c2440_irq_init);
128
diff --git a/arch/arm/mach-s3c24xx/irq.c b/arch/arm/mach-s3c24xx/irq.c
index 2c59b2d99a81..1804e23baad3 100644
--- a/arch/arm/mach-s3c24xx/irq.c
+++ b/arch/arm/mach-s3c24xx/irq.c
@@ -784,6 +784,94 @@ static struct irq_chip s3c_irq_cam = {
784}; 784};
785 785
786#ifdef CONFIG_CPU_S3C2440 786#ifdef CONFIG_CPU_S3C2440
787/* WDT/AC97 */
788
789static void s3c_irq_demux_wdtac97(unsigned int irq,
790 struct irq_desc *desc)
791{
792 unsigned int subsrc, submsk;
793
794 /* read the current pending interrupts, and the mask
795 * for what it is available */
796
797 subsrc = __raw_readl(S3C2410_SUBSRCPND);
798 submsk = __raw_readl(S3C2410_INTSUBMSK);
799
800 subsrc &= ~submsk;
801 subsrc >>= 13;
802 subsrc &= 3;
803
804 if (subsrc != 0) {
805 if (subsrc & 1) {
806 generic_handle_irq(IRQ_S3C2440_WDT);
807 }
808 if (subsrc & 2) {
809 generic_handle_irq(IRQ_S3C2440_AC97);
810 }
811 }
812}
813
814
815#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
816
817static void
818s3c_irq_wdtac97_mask(struct irq_data *data)
819{
820 s3c_irqsub_mask(data->irq, INTMSK_WDT, 3 << 13);
821}
822
823static void
824s3c_irq_wdtac97_unmask(struct irq_data *data)
825{
826 s3c_irqsub_unmask(data->irq, INTMSK_WDT);
827}
828
829static void
830s3c_irq_wdtac97_ack(struct irq_data *data)
831{
832 s3c_irqsub_maskack(data->irq, INTMSK_WDT, 3 << 13);
833}
834
835static struct irq_chip s3c_irq_wdtac97 = {
836 .irq_mask = s3c_irq_wdtac97_mask,
837 .irq_unmask = s3c_irq_wdtac97_unmask,
838 .irq_ack = s3c_irq_wdtac97_ack,
839};
840
841static int s3c2440_irq_add(struct device *dev, struct subsys_interface *sif)
842{
843 unsigned int irqno;
844
845 printk("S3C2440: IRQ Support\n");
846
847 /* add new chained handler for wdt, ac7 */
848
849 irq_set_chip_and_handler(IRQ_WDT, &s3c_irq_level_chip,
850 handle_level_irq);
851 irq_set_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
852
853 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
854 irq_set_chip_and_handler(irqno, &s3c_irq_wdtac97,
855 handle_level_irq);
856 set_irq_flags(irqno, IRQF_VALID);
857 }
858
859 return 0;
860}
861
862static struct subsys_interface s3c2440_irq_interface = {
863 .name = "s3c2440_irq",
864 .subsys = &s3c2440_subsys,
865 .add_dev = s3c2440_irq_add,
866};
867
868static int s3c2440_irq_init(void)
869{
870 return subsys_interface_register(&s3c2440_irq_interface);
871}
872
873arch_initcall(s3c2440_irq_init);
874
787void __init s3c2440_init_irq(void) 875void __init s3c2440_init_irq(void)
788{ 876{
789 unsigned int irqno; 877 unsigned int irqno;