diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-06-18 18:06:41 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-18 18:06:41 -0400 |
commit | 96ce2385dd2817da549910001a69ac0a2762a1b9 (patch) | |
tree | 18ec36e9e1e8a6b7c19aacb53c256fdb941c4ecd /arch/arm/mach-s3c2410/s3c2440-irq.c | |
parent | 66a9b49a370baac75d90b7da9a2445997a8a9438 (diff) |
[ARM] 3559/1: S3C2442: core and serial port
Patch from Ben Dooks
Core support for the Samsung S3C2442, and the
serial port driver update to allow the serial
port blocks to be used.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2410/s3c2440-irq.c')
-rw-r--r-- | arch/arm/mach-s3c2410/s3c2440-irq.c | 77 |
1 files changed, 2 insertions, 75 deletions
diff --git a/arch/arm/mach-s3c2410/s3c2440-irq.c b/arch/arm/mach-s3c2410/s3c2440-irq.c index 278d0044c85d..acfe3870727b 100644 --- a/arch/arm/mach-s3c2410/s3c2440-irq.c +++ b/arch/arm/mach-s3c2410/s3c2440-irq.c | |||
@@ -100,73 +100,12 @@ static struct irqchip s3c_irq_wdtac97 = { | |||
100 | .ack = s3c_irq_wdtac97_ack, | 100 | .ack = s3c_irq_wdtac97_ack, |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* camera irq */ | ||
104 | |||
105 | static void s3c_irq_demux_cam(unsigned int irq, | ||
106 | struct irqdesc *desc, | ||
107 | struct pt_regs *regs) | ||
108 | { | ||
109 | unsigned int subsrc, submsk; | ||
110 | struct irqdesc *mydesc; | ||
111 | |||
112 | /* read the current pending interrupts, and the mask | ||
113 | * for what it is available */ | ||
114 | |||
115 | subsrc = __raw_readl(S3C2410_SUBSRCPND); | ||
116 | submsk = __raw_readl(S3C2410_INTSUBMSK); | ||
117 | |||
118 | subsrc &= ~submsk; | ||
119 | subsrc >>= 11; | ||
120 | subsrc &= 3; | ||
121 | |||
122 | if (subsrc != 0) { | ||
123 | if (subsrc & 1) { | ||
124 | mydesc = irq_desc + IRQ_S3C2440_CAM_C; | ||
125 | desc_handle_irq(IRQ_S3C2440_CAM_C, mydesc, regs); | ||
126 | } | ||
127 | if (subsrc & 2) { | ||
128 | mydesc = irq_desc + IRQ_S3C2440_CAM_P; | ||
129 | desc_handle_irq(IRQ_S3C2440_CAM_P, mydesc, regs); | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
134 | #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) | ||
135 | |||
136 | static void | ||
137 | s3c_irq_cam_mask(unsigned int irqno) | ||
138 | { | ||
139 | s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11); | ||
140 | } | ||
141 | |||
142 | static void | ||
143 | s3c_irq_cam_unmask(unsigned int irqno) | ||
144 | { | ||
145 | s3c_irqsub_unmask(irqno, INTMSK_CAM); | ||
146 | } | ||
147 | |||
148 | static void | ||
149 | s3c_irq_cam_ack(unsigned int irqno) | ||
150 | { | ||
151 | s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11); | ||
152 | } | ||
153 | |||
154 | static struct irqchip s3c_irq_cam = { | ||
155 | .mask = s3c_irq_cam_mask, | ||
156 | .unmask = s3c_irq_cam_unmask, | ||
157 | .ack = s3c_irq_cam_ack, | ||
158 | }; | ||
159 | |||
160 | static int s3c2440_irq_add(struct sys_device *sysdev) | 103 | static int s3c2440_irq_add(struct sys_device *sysdev) |
161 | { | 104 | { |
162 | unsigned int irqno; | 105 | unsigned int irqno; |
163 | 106 | ||
164 | printk("S3C2440: IRQ Support\n"); | 107 | printk("S3C2440: IRQ Support\n"); |
165 | 108 | ||
166 | set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip); | ||
167 | set_irq_handler(IRQ_NFCON, do_level_IRQ); | ||
168 | set_irq_flags(IRQ_NFCON, IRQF_VALID); | ||
169 | |||
170 | /* add new chained handler for wdt, ac7 */ | 109 | /* add new chained handler for wdt, ac7 */ |
171 | 110 | ||
172 | set_irq_chip(IRQ_WDT, &s3c_irq_level_chip); | 111 | set_irq_chip(IRQ_WDT, &s3c_irq_level_chip); |
@@ -179,18 +118,6 @@ static int s3c2440_irq_add(struct sys_device *sysdev) | |||
179 | set_irq_flags(irqno, IRQF_VALID); | 118 | set_irq_flags(irqno, IRQF_VALID); |
180 | } | 119 | } |
181 | 120 | ||
182 | /* add chained handler for camera */ | ||
183 | |||
184 | set_irq_chip(IRQ_CAM, &s3c_irq_level_chip); | ||
185 | set_irq_handler(IRQ_CAM, do_level_IRQ); | ||
186 | set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam); | ||
187 | |||
188 | for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) { | ||
189 | set_irq_chip(irqno, &s3c_irq_cam); | ||
190 | set_irq_handler(irqno, do_level_IRQ); | ||
191 | set_irq_flags(irqno, IRQF_VALID); | ||
192 | } | ||
193 | |||
194 | return 0; | 121 | return 0; |
195 | } | 122 | } |
196 | 123 | ||
@@ -198,10 +125,10 @@ static struct sysdev_driver s3c2440_irq_driver = { | |||
198 | .add = s3c2440_irq_add, | 125 | .add = s3c2440_irq_add, |
199 | }; | 126 | }; |
200 | 127 | ||
201 | static int s3c24xx_irq_driver(void) | 128 | static int s3c2440_irq_init(void) |
202 | { | 129 | { |
203 | return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); | 130 | return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); |
204 | } | 131 | } |
205 | 132 | ||
206 | arch_initcall(s3c24xx_irq_driver); | 133 | arch_initcall(s3c2440_irq_init); |
207 | 134 | ||