Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm

* 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm: (161 commits)
ARM: pxa: fix building issue of missing physmap.h
ARM: mmp: PXA910 drive strength FAST using wrong value
ARM: mmp: MMP2 drive strength FAST using wrong value
ARM: pxa: fix recursive calls in pxa_low_gpio_chip
AT91: Support for gsia18s board
AT91: Acme Systems FOX Board G20 board files
AT91: board-sam9m10g45ek.c: Remove duplicate inclusion of mach/hardware.h
ARM: pxa: fix suspend/resume array index miscalculation
ARM: pxa: use cpu_has_ipr() consistently in irq.c
ARM: pxa: remove unused variable in clock-pxa3xx.c
ARM: pxa: fix warning in zeus.c
ARM: sa1111: fix typo in sa1111_retrigger_lowirq()
ARM mxs: clkdev related compile fixes
ARM i.MX mx31_3ds: Fix MC13783 regulator names
ARM: plat-stmp3xxx: irq_data conversion.
ARM: plat-spear: irq_data conversion.
ARM: plat-orion: irq_data conversion.
ARM: plat-omap: irq_data conversion.
ARM: plat-nomadik: irq_data conversion.
ARM: plat-mxc: irq_data conversion.
...

Fix up trivial conflict in arch/arm/plat-omap/gpio.c (Lennert
Buytenhek's irq_data conversion clashing with some omap irq updates)

+6534 -2397
+4 -17
arch/arm/Kconfig
··· 26 26 select HAVE_REGS_AND_STACK_ACCESS_API 27 27 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) 28 28 select HAVE_C_RECORDMCOUNT 29 + select HAVE_GENERIC_HARDIRQS 30 + select HAVE_SPARSE_IRQ 29 31 help 30 32 The ARM series is a line of low-power-consumption RISC chip designs 31 33 licensed by ARM Ltd and targeted at embedded applications and ··· 98 96 laptops. It is a bus system similar to PCI or ISA. See 99 97 <file:Documentation/mca.txt> (and especially the web page given 100 98 there) before attempting to build an MCA bus kernel. 101 - 102 - config GENERIC_HARDIRQS 103 - bool 104 - default y 105 99 106 100 config STACKTRACE_SUPPORT 107 101 bool ··· 177 179 178 180 config ARCH_MTD_XIP 179 181 bool 180 - 181 - config GENERIC_HARDIRQS_NO__DO_IRQ 182 - def_bool y 183 182 184 183 config ARM_L1_CACHE_SHIFT_6 185 184 bool ··· 363 368 bool "Freescale MXS-based" 364 369 select GENERIC_CLOCKEVENTS 365 370 select ARCH_REQUIRE_GPIOLIB 366 - select COMMON_CLKDEV 371 + select CLKDEV_LOOKUP 367 372 help 368 373 Support for Freescale MXS-based family of processors 369 374 ··· 766 771 select ARCH_SPARSEMEM_ENABLE 767 772 select GENERIC_GPIO 768 773 select HAVE_CLK 774 + select ARCH_HAS_CPUFREQ 769 775 select GENERIC_CLOCKEVENTS 770 776 select HAVE_S3C_RTC if RTC_CLASS 771 777 select HAVE_S3C2410_I2C if I2C ··· 1447 1451 help 1448 1452 Enable hardware performance counter support for perf events. If 1449 1453 disabled, perf events will use software events only. 1450 - 1451 - config SPARSE_IRQ 1452 - def_bool n 1453 - help 1454 - This enables support for sparse irqs. This is useful in general 1455 - as most CPUs have a fairly sparse array of IRQ vectors, which 1456 - the irq_desc then maps directly on to. Systems with a high 1457 - number of off-chip IRQs will want to treat this as 1458 - experimental until they have been independently verified. 1459 1454 1460 1455 source "mm/Kconfig" 1461 1456
+33 -33
arch/arm/common/gic.c
··· 50 50 51 51 static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly; 52 52 53 - static inline void __iomem *gic_dist_base(unsigned int irq) 53 + static inline void __iomem *gic_dist_base(struct irq_data *d) 54 54 { 55 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 55 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 56 56 return gic_data->dist_base; 57 57 } 58 58 59 - static inline void __iomem *gic_cpu_base(unsigned int irq) 59 + static inline void __iomem *gic_cpu_base(struct irq_data *d) 60 60 { 61 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 61 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 62 62 return gic_data->cpu_base; 63 63 } 64 64 65 - static inline unsigned int gic_irq(unsigned int irq) 65 + static inline unsigned int gic_irq(struct irq_data *d) 66 66 { 67 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 68 - return irq - gic_data->irq_offset; 67 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 68 + return d->irq - gic_data->irq_offset; 69 69 } 70 70 71 71 /* 72 72 * Routines to acknowledge, disable and enable interrupts 73 73 */ 74 - static void gic_ack_irq(unsigned int irq) 74 + static void gic_ack_irq(struct irq_data *d) 75 75 { 76 - 77 76 spin_lock(&irq_controller_lock); 78 - writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI); 77 + writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI); 79 78 spin_unlock(&irq_controller_lock); 80 79 } 81 80 82 - static void gic_mask_irq(unsigned int irq) 81 + static void gic_mask_irq(struct irq_data *d) 83 82 { 84 - u32 mask = 1 << (irq % 32); 83 + u32 mask = 1 << (d->irq % 32); 85 84 86 85 spin_lock(&irq_controller_lock); 87 - writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4); 86 + writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4); 88 87 spin_unlock(&irq_controller_lock); 89 88 } 90 89 91 - static void gic_unmask_irq(unsigned int irq) 90 + static void gic_unmask_irq(struct irq_data *d) 92 91 { 93 - u32 mask = 1 << (irq % 32); 92 + u32 mask = 1 << (d->irq % 32); 94 93 95 94 spin_lock(&irq_controller_lock); 96 - writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_SET + (gic_irq(irq) / 32) * 4); 95 + writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4); 97 96 spin_unlock(&irq_controller_lock); 98 97 } 99 98 100 - static int gic_set_type(unsigned int irq, unsigned int type) 99 + static int gic_set_type(struct irq_data *d, unsigned int type) 101 100 { 102 - void __iomem *base = gic_dist_base(irq); 103 - unsigned int gicirq = gic_irq(irq); 101 + void __iomem *base = gic_dist_base(d); 102 + unsigned int gicirq = gic_irq(d); 104 103 u32 enablemask = 1 << (gicirq % 32); 105 104 u32 enableoff = (gicirq / 32) * 4; 106 105 u32 confmask = 0x2 << ((gicirq % 16) * 2); ··· 142 143 } 143 144 144 145 #ifdef CONFIG_SMP 145 - static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val) 146 + static int 147 + gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force) 146 148 { 147 - void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3); 148 - unsigned int shift = (irq % 4) * 8; 149 + void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); 150 + unsigned int shift = (d->irq % 4) * 8; 149 151 unsigned int cpu = cpumask_first(mask_val); 150 152 u32 val; 151 153 struct irq_desc *desc; 152 154 153 155 spin_lock(&irq_controller_lock); 154 - desc = irq_to_desc(irq); 156 + desc = irq_to_desc(d->irq); 155 157 if (desc == NULL) { 156 158 spin_unlock(&irq_controller_lock); 157 159 return -EINVAL; 158 160 } 159 - desc->node = cpu; 161 + d->node = cpu; 160 162 val = readl(reg) & ~(0xff << shift); 161 163 val |= 1 << (cpu + shift); 162 164 writel(val, reg); ··· 175 175 unsigned long status; 176 176 177 177 /* primary controller ack'ing */ 178 - chip->ack(irq); 178 + chip->irq_ack(&desc->irq_data); 179 179 180 180 spin_lock(&irq_controller_lock); 181 181 status = readl(chip_data->cpu_base + GIC_CPU_INTACK); ··· 193 193 194 194 out: 195 195 /* primary controller unmasking */ 196 - chip->unmask(irq); 196 + chip->irq_unmask(&desc->irq_data); 197 197 } 198 198 199 199 static struct irq_chip gic_chip = { 200 - .name = "GIC", 201 - .ack = gic_ack_irq, 202 - .mask = gic_mask_irq, 203 - .unmask = gic_unmask_irq, 204 - .set_type = gic_set_type, 200 + .name = "GIC", 201 + .irq_ack = gic_ack_irq, 202 + .irq_mask = gic_mask_irq, 203 + .irq_unmask = gic_unmask_irq, 204 + .irq_set_type = gic_set_type, 205 205 #ifdef CONFIG_SMP 206 - .set_affinity = gic_set_cpu, 206 + .irq_set_affinity = gic_set_cpu, 207 207 #endif 208 208 }; 209 209 ··· 337 337 338 338 local_irq_save(flags); 339 339 irq_to_desc(irq)->status |= IRQ_NOPROBE; 340 - gic_unmask_irq(irq); 340 + gic_unmask_irq(irq_get_irq_data(irq)); 341 341 local_irq_restore(flags); 342 342 } 343 343
+9 -5
arch/arm/common/it8152.c
··· 31 31 32 32 #define MAX_SLOTS 21 33 33 34 - static void it8152_mask_irq(unsigned int irq) 34 + static void it8152_mask_irq(struct irq_data *d) 35 35 { 36 + unsigned int irq = d->irq; 37 + 36 38 if (irq >= IT8152_LD_IRQ(0)) { 37 39 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) | 38 40 (1 << (irq - IT8152_LD_IRQ(0)))), ··· 50 48 } 51 49 } 52 50 53 - static void it8152_unmask_irq(unsigned int irq) 51 + static void it8152_unmask_irq(struct irq_data *d) 54 52 { 53 + unsigned int irq = d->irq; 54 + 55 55 if (irq >= IT8152_LD_IRQ(0)) { 56 56 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) & 57 57 ~(1 << (irq - IT8152_LD_IRQ(0)))), ··· 71 67 72 68 static struct irq_chip it8152_irq_chip = { 73 69 .name = "it8152", 74 - .ack = it8152_mask_irq, 75 - .mask = it8152_mask_irq, 76 - .unmask = it8152_unmask_irq, 70 + .irq_ack = it8152_mask_irq, 71 + .irq_mask = it8152_mask_irq, 72 + .irq_unmask = it8152_unmask_irq, 77 73 }; 78 74 79 75 void it8152_init_irq(void)
+12 -12
arch/arm/common/locomo.c
··· 144 144 int req, i; 145 145 146 146 /* Acknowledge the parent IRQ */ 147 - desc->chip->ack(irq); 147 + desc->irq_data.chip->irq_ack(&desc->irq_data); 148 148 149 149 /* check why this interrupt was generated */ 150 150 req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00; ··· 161 161 } 162 162 } 163 163 164 - static void locomo_ack_irq(unsigned int irq) 164 + static void locomo_ack_irq(struct irq_data *d) 165 165 { 166 166 } 167 167 168 - static void locomo_mask_irq(unsigned int irq) 168 + static void locomo_mask_irq(struct irq_data *d) 169 169 { 170 - struct locomo *lchip = get_irq_chip_data(irq); 170 + struct locomo *lchip = irq_data_get_irq_chip_data(d); 171 171 unsigned int r; 172 172 r = locomo_readl(lchip->base + LOCOMO_ICR); 173 - r &= ~(0x0010 << (irq - lchip->irq_base)); 173 + r &= ~(0x0010 << (d->irq - lchip->irq_base)); 174 174 locomo_writel(r, lchip->base + LOCOMO_ICR); 175 175 } 176 176 177 - static void locomo_unmask_irq(unsigned int irq) 177 + static void locomo_unmask_irq(struct irq_data *d) 178 178 { 179 - struct locomo *lchip = get_irq_chip_data(irq); 179 + struct locomo *lchip = irq_data_get_irq_chip_data(d); 180 180 unsigned int r; 181 181 r = locomo_readl(lchip->base + LOCOMO_ICR); 182 - r |= (0x0010 << (irq - lchip->irq_base)); 182 + r |= (0x0010 << (d->irq - lchip->irq_base)); 183 183 locomo_writel(r, lchip->base + LOCOMO_ICR); 184 184 } 185 185 186 186 static struct irq_chip locomo_chip = { 187 - .name = "LOCOMO", 188 - .ack = locomo_ack_irq, 189 - .mask = locomo_mask_irq, 190 - .unmask = locomo_unmask_irq, 187 + .name = "LOCOMO", 188 + .irq_ack = locomo_ack_irq, 189 + .irq_mask = locomo_mask_irq, 190 + .irq_unmask = locomo_unmask_irq, 191 191 }; 192 192 193 193 static void locomo_setup_irq(struct locomo *lchip)
+48 -48
arch/arm/common/sa1111.c
··· 210 210 211 211 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0); 212 212 213 - desc->chip->ack(irq); 213 + desc->irq_data.chip->irq_ack(&desc->irq_data); 214 214 215 215 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); 216 216 ··· 228 228 generic_handle_irq(i + sachip->irq_base); 229 229 230 230 /* For level-based interrupts */ 231 - desc->chip->unmask(irq); 231 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 232 232 } 233 233 234 234 #define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base)) 235 235 #define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32)) 236 236 237 - static void sa1111_ack_irq(unsigned int irq) 237 + static void sa1111_ack_irq(struct irq_data *d) 238 238 { 239 239 } 240 240 241 - static void sa1111_mask_lowirq(unsigned int irq) 241 + static void sa1111_mask_lowirq(struct irq_data *d) 242 242 { 243 - struct sa1111 *sachip = get_irq_chip_data(irq); 243 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 244 244 void __iomem *mapbase = sachip->base + SA1111_INTC; 245 245 unsigned long ie0; 246 246 247 247 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 248 - ie0 &= ~SA1111_IRQMASK_LO(irq); 248 + ie0 &= ~SA1111_IRQMASK_LO(d->irq); 249 249 writel(ie0, mapbase + SA1111_INTEN0); 250 250 } 251 251 252 - static void sa1111_unmask_lowirq(unsigned int irq) 252 + static void sa1111_unmask_lowirq(struct irq_data *d) 253 253 { 254 - struct sa1111 *sachip = get_irq_chip_data(irq); 254 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 255 255 void __iomem *mapbase = sachip->base + SA1111_INTC; 256 256 unsigned long ie0; 257 257 258 258 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 259 - ie0 |= SA1111_IRQMASK_LO(irq); 259 + ie0 |= SA1111_IRQMASK_LO(d->irq); 260 260 sa1111_writel(ie0, mapbase + SA1111_INTEN0); 261 261 } 262 262 ··· 267 267 * be triggered. In fact, its very difficult, if not impossible to get 268 268 * INTSET to re-trigger the interrupt. 269 269 */ 270 - static int sa1111_retrigger_lowirq(unsigned int irq) 270 + static int sa1111_retrigger_lowirq(struct irq_data *d) 271 271 { 272 - struct sa1111 *sachip = get_irq_chip_data(irq); 272 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 273 273 void __iomem *mapbase = sachip->base + SA1111_INTC; 274 - unsigned int mask = SA1111_IRQMASK_LO(irq); 274 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 275 275 unsigned long ip0; 276 276 int i; 277 277 ··· 279 279 for (i = 0; i < 8; i++) { 280 280 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0); 281 281 sa1111_writel(ip0, mapbase + SA1111_INTPOL0); 282 - if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask) 282 + if (sa1111_readl(mapbase + SA1111_INTSTATCLR0) & mask) 283 283 break; 284 284 } 285 285 286 286 if (i == 8) 287 287 printk(KERN_ERR "Danger Will Robinson: failed to " 288 - "re-trigger IRQ%d\n", irq); 288 + "re-trigger IRQ%d\n", d->irq); 289 289 return i == 8 ? -1 : 0; 290 290 } 291 291 292 - static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) 292 + static int sa1111_type_lowirq(struct irq_data *d, unsigned int flags) 293 293 { 294 - struct sa1111 *sachip = get_irq_chip_data(irq); 294 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 295 295 void __iomem *mapbase = sachip->base + SA1111_INTC; 296 - unsigned int mask = SA1111_IRQMASK_LO(irq); 296 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 297 297 unsigned long ip0; 298 298 299 299 if (flags == IRQ_TYPE_PROBE) ··· 313 313 return 0; 314 314 } 315 315 316 - static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) 316 + static int sa1111_wake_lowirq(struct irq_data *d, unsigned int on) 317 317 { 318 - struct sa1111 *sachip = get_irq_chip_data(irq); 318 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 319 319 void __iomem *mapbase = sachip->base + SA1111_INTC; 320 - unsigned int mask = SA1111_IRQMASK_LO(irq); 320 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 321 321 unsigned long we0; 322 322 323 323 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); ··· 332 332 333 333 static struct irq_chip sa1111_low_chip = { 334 334 .name = "SA1111-l", 335 - .ack = sa1111_ack_irq, 336 - .mask = sa1111_mask_lowirq, 337 - .unmask = sa1111_unmask_lowirq, 338 - .retrigger = sa1111_retrigger_lowirq, 339 - .set_type = sa1111_type_lowirq, 340 - .set_wake = sa1111_wake_lowirq, 335 + .irq_ack = sa1111_ack_irq, 336 + .irq_mask = sa1111_mask_lowirq, 337 + .irq_unmask = sa1111_unmask_lowirq, 338 + .irq_retrigger = sa1111_retrigger_lowirq, 339 + .irq_set_type = sa1111_type_lowirq, 340 + .irq_set_wake = sa1111_wake_lowirq, 341 341 }; 342 342 343 - static void sa1111_mask_highirq(unsigned int irq) 343 + static void sa1111_mask_highirq(struct irq_data *d) 344 344 { 345 - struct sa1111 *sachip = get_irq_chip_data(irq); 345 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 346 346 void __iomem *mapbase = sachip->base + SA1111_INTC; 347 347 unsigned long ie1; 348 348 349 349 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 350 - ie1 &= ~SA1111_IRQMASK_HI(irq); 350 + ie1 &= ~SA1111_IRQMASK_HI(d->irq); 351 351 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 352 352 } 353 353 354 - static void sa1111_unmask_highirq(unsigned int irq) 354 + static void sa1111_unmask_highirq(struct irq_data *d) 355 355 { 356 - struct sa1111 *sachip = get_irq_chip_data(irq); 356 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 357 357 void __iomem *mapbase = sachip->base + SA1111_INTC; 358 358 unsigned long ie1; 359 359 360 360 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 361 - ie1 |= SA1111_IRQMASK_HI(irq); 361 + ie1 |= SA1111_IRQMASK_HI(d->irq); 362 362 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 363 363 } 364 364 ··· 369 369 * be triggered. In fact, its very difficult, if not impossible to get 370 370 * INTSET to re-trigger the interrupt. 371 371 */ 372 - static int sa1111_retrigger_highirq(unsigned int irq) 372 + static int sa1111_retrigger_highirq(struct irq_data *d) 373 373 { 374 - struct sa1111 *sachip = get_irq_chip_data(irq); 374 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 375 375 void __iomem *mapbase = sachip->base + SA1111_INTC; 376 - unsigned int mask = SA1111_IRQMASK_HI(irq); 376 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 377 377 unsigned long ip1; 378 378 int i; 379 379 ··· 387 387 388 388 if (i == 8) 389 389 printk(KERN_ERR "Danger Will Robinson: failed to " 390 - "re-trigger IRQ%d\n", irq); 390 + "re-trigger IRQ%d\n", d->irq); 391 391 return i == 8 ? -1 : 0; 392 392 } 393 393 394 - static int sa1111_type_highirq(unsigned int irq, unsigned int flags) 394 + static int sa1111_type_highirq(struct irq_data *d, unsigned int flags) 395 395 { 396 - struct sa1111 *sachip = get_irq_chip_data(irq); 396 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 397 397 void __iomem *mapbase = sachip->base + SA1111_INTC; 398 - unsigned int mask = SA1111_IRQMASK_HI(irq); 398 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 399 399 unsigned long ip1; 400 400 401 401 if (flags == IRQ_TYPE_PROBE) ··· 415 415 return 0; 416 416 } 417 417 418 - static int sa1111_wake_highirq(unsigned int irq, unsigned int on) 418 + static int sa1111_wake_highirq(struct irq_data *d, unsigned int on) 419 419 { 420 - struct sa1111 *sachip = get_irq_chip_data(irq); 420 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 421 421 void __iomem *mapbase = sachip->base + SA1111_INTC; 422 - unsigned int mask = SA1111_IRQMASK_HI(irq); 422 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 423 423 unsigned long we1; 424 424 425 425 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); ··· 434 434 435 435 static struct irq_chip sa1111_high_chip = { 436 436 .name = "SA1111-h", 437 - .ack = sa1111_ack_irq, 438 - .mask = sa1111_mask_highirq, 439 - .unmask = sa1111_unmask_highirq, 440 - .retrigger = sa1111_retrigger_highirq, 441 - .set_type = sa1111_type_highirq, 442 - .set_wake = sa1111_wake_highirq, 437 + .irq_ack = sa1111_ack_irq, 438 + .irq_mask = sa1111_mask_highirq, 439 + .irq_unmask = sa1111_unmask_highirq, 440 + .irq_retrigger = sa1111_retrigger_highirq, 441 + .irq_set_type = sa1111_type_highirq, 442 + .irq_set_wake = sa1111_wake_highirq, 443 443 }; 444 444 445 445 static void sa1111_setup_irq(struct sa1111 *sachip)
+16 -16
arch/arm/common/vic.c
··· 204 204 static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } 205 205 #endif /* CONFIG_PM */ 206 206 207 - static void vic_ack_irq(unsigned int irq) 207 + static void vic_ack_irq(struct irq_data *d) 208 208 { 209 - void __iomem *base = get_irq_chip_data(irq); 210 - irq &= 31; 209 + void __iomem *base = irq_data_get_irq_chip_data(d); 210 + unsigned int irq = d->irq & 31; 211 211 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 212 212 /* moreover, clear the soft-triggered, in case it was the reason */ 213 213 writel(1 << irq, base + VIC_INT_SOFT_CLEAR); 214 214 } 215 215 216 - static void vic_mask_irq(unsigned int irq) 216 + static void vic_mask_irq(struct irq_data *d) 217 217 { 218 - void __iomem *base = get_irq_chip_data(irq); 219 - irq &= 31; 218 + void __iomem *base = irq_data_get_irq_chip_data(d); 219 + unsigned int irq = d->irq & 31; 220 220 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 221 221 } 222 222 223 - static void vic_unmask_irq(unsigned int irq) 223 + static void vic_unmask_irq(struct irq_data *d) 224 224 { 225 - void __iomem *base = get_irq_chip_data(irq); 226 - irq &= 31; 225 + void __iomem *base = irq_data_get_irq_chip_data(d); 226 + unsigned int irq = d->irq & 31; 227 227 writel(1 << irq, base + VIC_INT_ENABLE); 228 228 } 229 229 ··· 242 242 return NULL; 243 243 } 244 244 245 - static int vic_set_wake(unsigned int irq, unsigned int on) 245 + static int vic_set_wake(struct irq_data *d, unsigned int on) 246 246 { 247 - struct vic_device *v = vic_from_irq(irq); 248 - unsigned int off = irq & 31; 247 + struct vic_device *v = vic_from_irq(d->irq); 248 + unsigned int off = d->irq & 31; 249 249 u32 bit = 1 << off; 250 250 251 251 if (!v) ··· 267 267 268 268 static struct irq_chip vic_chip = { 269 269 .name = "VIC", 270 - .ack = vic_ack_irq, 271 - .mask = vic_mask_irq, 272 - .unmask = vic_unmask_irq, 273 - .set_wake = vic_set_wake, 270 + .irq_ack = vic_ack_irq, 271 + .irq_mask = vic_mask_irq, 272 + .irq_unmask = vic_unmask_irq, 273 + .irq_set_wake = vic_set_wake, 274 274 }; 275 275 276 276 static void __init vic_disable(void __iomem *base)
+14 -14
arch/arm/kernel/ecard.c
··· 443 443 * 444 444 * They are not meant to be called directly, but via enable/disable_irq. 445 445 */ 446 - static void ecard_irq_unmask(unsigned int irqnr) 446 + static void ecard_irq_unmask(struct irq_data *d) 447 447 { 448 - ecard_t *ec = slot_to_ecard(irqnr - 32); 448 + ecard_t *ec = slot_to_ecard(d->irq - 32); 449 449 450 450 if (ec) { 451 451 if (!ec->ops) 452 452 ec->ops = &ecard_default_ops; 453 453 454 454 if (ec->claimed && ec->ops->irqenable) 455 - ec->ops->irqenable(ec, irqnr); 455 + ec->ops->irqenable(ec, d->irq); 456 456 else 457 457 printk(KERN_ERR "ecard: rejecting request to " 458 - "enable IRQs for %d\n", irqnr); 458 + "enable IRQs for %d\n", d->irq); 459 459 } 460 460 } 461 461 462 - static void ecard_irq_mask(unsigned int irqnr) 462 + static void ecard_irq_mask(struct irq_data *d) 463 463 { 464 - ecard_t *ec = slot_to_ecard(irqnr - 32); 464 + ecard_t *ec = slot_to_ecard(d->irq - 32); 465 465 466 466 if (ec) { 467 467 if (!ec->ops) 468 468 ec->ops = &ecard_default_ops; 469 469 470 470 if (ec->ops && ec->ops->irqdisable) 471 - ec->ops->irqdisable(ec, irqnr); 471 + ec->ops->irqdisable(ec, d->irq); 472 472 } 473 473 } 474 474 475 475 static struct irq_chip ecard_chip = { 476 - .name = "ECARD", 477 - .ack = ecard_irq_mask, 478 - .mask = ecard_irq_mask, 479 - .unmask = ecard_irq_unmask, 476 + .name = "ECARD", 477 + .irq_ack = ecard_irq_mask, 478 + .irq_mask = ecard_irq_mask, 479 + .irq_unmask = ecard_irq_unmask, 480 480 }; 481 481 482 482 void ecard_enablefiq(unsigned int fiqnr) ··· 551 551 printk(KERN_ERR "\nInterrupt lockup detected - " 552 552 "disabling all expansion card interrupts\n"); 553 553 554 - desc->chip->mask(IRQ_EXPANSIONCARD); 554 + desc->irq_data.chip->irq_mask(&desc->irq_data); 555 555 ecard_dump_irq_state(); 556 556 } 557 557 } else ··· 574 574 ecard_t *ec; 575 575 int called = 0; 576 576 577 - desc->chip->mask(irq); 577 + desc->irq_data.chip->irq_mask(&desc->irq_data); 578 578 for (ec = cards; ec; ec = ec->next) { 579 579 int pending; 580 580 ··· 591 591 called ++; 592 592 } 593 593 } 594 - desc->chip->unmask(irq); 594 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 595 595 596 596 if (called == 0) 597 597 ecard_check_lockup(desc);
+10 -7
arch/arm/kernel/irq.c
··· 88 88 seq_printf(p, "%*d: ", prec, i); 89 89 for_each_present_cpu(cpu) 90 90 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); 91 - seq_printf(p, " %10s", desc->chip->name ? : "-"); 91 + seq_printf(p, " %10s", desc->irq_data.chip->name ? : "-"); 92 92 seq_printf(p, " %s", action->name); 93 93 for (action = action->next; action; action = action->next) 94 94 seq_printf(p, ", %s", action->name); ··· 181 181 182 182 static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu) 183 183 { 184 - pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->node, cpu); 184 + pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->irq_data.node, cpu); 185 185 186 186 raw_spin_lock_irq(&desc->lock); 187 - desc->chip->set_affinity(irq, cpumask_of(cpu)); 187 + desc->irq_data.chip->irq_set_affinity(&desc->irq_data, 188 + cpumask_of(cpu), false); 188 189 raw_spin_unlock_irq(&desc->lock); 189 190 } 190 191 ··· 200 199 struct irq_desc *desc; 201 200 202 201 for_each_irq_desc(i, desc) { 203 - if (desc->node == cpu) { 204 - unsigned int newcpu = cpumask_any_and(desc->affinity, 202 + struct irq_data *d = &desc->irq_data; 203 + 204 + if (d->node == cpu) { 205 + unsigned int newcpu = cpumask_any_and(d->affinity, 205 206 cpu_online_mask); 206 207 if (newcpu >= nr_cpu_ids) { 207 208 if (printk_ratelimit()) 208 209 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n", 209 210 i, cpu); 210 211 211 - cpumask_setall(desc->affinity); 212 - newcpu = cpumask_any_and(desc->affinity, 212 + cpumask_setall(d->affinity); 213 + newcpu = cpumask_any_and(d->affinity, 213 214 cpu_online_mask); 214 215 } 215 216
+9 -9
arch/arm/mach-aaec2000/core.c
··· 68 68 /* 69 69 * Interrupt handling routines 70 70 */ 71 - static void aaec2000_int_ack(unsigned int irq) 71 + static void aaec2000_int_ack(struct irq_data *d) 72 72 { 73 - IRQ_INTSR = 1 << irq; 73 + IRQ_INTSR = 1 << d->irq; 74 74 } 75 75 76 - static void aaec2000_int_mask(unsigned int irq) 76 + static void aaec2000_int_mask(struct irq_data *d) 77 77 { 78 - IRQ_INTENC |= (1 << irq); 78 + IRQ_INTENC |= (1 << d->irq); 79 79 } 80 80 81 - static void aaec2000_int_unmask(unsigned int irq) 81 + static void aaec2000_int_unmask(struct irq_data *d) 82 82 { 83 - IRQ_INTENS |= (1 << irq); 83 + IRQ_INTENS |= (1 << d->irq); 84 84 } 85 85 86 86 static struct irq_chip aaec2000_irq_chip = { 87 - .ack = aaec2000_int_ack, 88 - .mask = aaec2000_int_mask, 89 - .unmask = aaec2000_int_unmask, 87 + .irq_ack = aaec2000_int_ack, 88 + .irq_mask = aaec2000_int_mask, 89 + .irq_unmask = aaec2000_int_unmask, 90 90 }; 91 91 92 92 void __init aaec2000_init_irq(void)
+13
arch/arm/mach-at91/Kconfig
··· 362 362 Select this if you are using a Eukrea Electromatique's 363 363 CPU9G20 Board <http://www.eukrea.com/> 364 364 365 + config MACH_ACMENETUSFOXG20 366 + bool "Acme Systems srl FOX Board G20" 367 + help 368 + Select this if you are using Acme Systems 369 + FOX Board G20 <http://www.acmesystems.it> 370 + 365 371 config MACH_PORTUXG20 366 372 bool "taskit PortuxG20" 367 373 help ··· 387 381 Select this if you are using taskit's Stamp9G20 CPU module on this 388 382 carrier board, beeing the decentralized unit of a building automation 389 383 system; featuring nvram, eth-switch, iso-rs485, display, io 384 + 385 + config MACH_GSIA18S 386 + bool "GS_IA18_S board" 387 + help 388 + This enables support for the GS_IA18_S board 389 + produced by GeoSIG Ltd company. This is an internet accelerograph. 390 + <http://www.geosig.com> 390 391 endif 391 392 392 393 if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20)
+2
arch/arm/mach-at91/Makefile
··· 63 63 # AT91SAM9G20 board-specific support 64 64 obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o 65 65 obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o 66 + obj-$(CONFIG_MACH_ACMENETUSFOXG20) += board-foxg20.o 66 67 obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o 67 68 obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o 68 69 obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o 70 + obj-$(CONFIG_MACH_GSIA18S) += board-gsia18s.o board-stamp9g20.o 69 71 70 72 # AT91SAM9260/AT91SAM9G20 board-specific support 71 73 obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o
+274
arch/arm/mach-at91/board-foxg20.c
··· 1 + /* 2 + * Copyright (C) 2005 SAN People 3 + * Copyright (C) 2008 Atmel 4 + * Copyright (C) 2010 Lee McLoughlin - lee@lmmrtech.com 5 + * Copyright (C) 2010 Sergio Tanzilli - tanzilli@acmesystems.it 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 + */ 21 + 22 + #include <linux/types.h> 23 + #include <linux/init.h> 24 + #include <linux/mm.h> 25 + #include <linux/module.h> 26 + #include <linux/platform_device.h> 27 + #include <linux/spi/spi.h> 28 + #include <linux/spi/at73c213.h> 29 + #include <linux/gpio.h> 30 + #include <linux/gpio_keys.h> 31 + #include <linux/input.h> 32 + #include <linux/clk.h> 33 + #include <linux/w1-gpio.h> 34 + 35 + #include <mach/hardware.h> 36 + #include <asm/setup.h> 37 + #include <asm/mach-types.h> 38 + #include <asm/irq.h> 39 + 40 + #include <asm/mach/arch.h> 41 + #include <asm/mach/map.h> 42 + #include <asm/mach/irq.h> 43 + 44 + #include <mach/board.h> 45 + #include <mach/at91sam9_smc.h> 46 + 47 + #include "sam9_smc.h" 48 + #include "generic.h" 49 + 50 + /* 51 + * The FOX Board G20 hardware comes as the "Netus G20" board with 52 + * just the cpu, ram, dataflash and two header connectors. 53 + * This is plugged into the FOX Board which provides the ethernet, 54 + * usb, rtc, leds, switch, ... 55 + * 56 + * For more info visit: http://www.acmesystems.it/foxg20 57 + */ 58 + 59 + 60 + static void __init foxg20_map_io(void) 61 + { 62 + /* Initialize processor: 18.432 MHz crystal */ 63 + at91sam9260_initialize(18432000); 64 + 65 + /* DBGU on ttyS0. (Rx & Tx only) */ 66 + at91_register_uart(0, 0, 0); 67 + 68 + /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ 69 + at91_register_uart(AT91SAM9260_ID_US0, 1, 70 + ATMEL_UART_CTS 71 + | ATMEL_UART_RTS 72 + | ATMEL_UART_DTR 73 + | ATMEL_UART_DSR 74 + | ATMEL_UART_DCD 75 + | ATMEL_UART_RI); 76 + 77 + /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ 78 + at91_register_uart(AT91SAM9260_ID_US1, 2, 79 + ATMEL_UART_CTS 80 + | ATMEL_UART_RTS); 81 + 82 + /* USART2 on ttyS3. (Rx & Tx only) */ 83 + at91_register_uart(AT91SAM9260_ID_US2, 3, 0); 84 + 85 + /* USART3 on ttyS4. (Rx, Tx, RTS, CTS) */ 86 + at91_register_uart(AT91SAM9260_ID_US3, 4, 87 + ATMEL_UART_CTS 88 + | ATMEL_UART_RTS); 89 + 90 + /* USART4 on ttyS5. (Rx & Tx only) */ 91 + at91_register_uart(AT91SAM9260_ID_US4, 5, 0); 92 + 93 + /* USART5 on ttyS6. (Rx & Tx only) */ 94 + at91_register_uart(AT91SAM9260_ID_US5, 6, 0); 95 + 96 + /* set serial console to ttyS0 (ie, DBGU) */ 97 + at91_set_serial_console(0); 98 + 99 + /* Set the internal pull-up resistor on DRXD */ 100 + at91_set_A_periph(AT91_PIN_PB14, 1); 101 + 102 + } 103 + 104 + static void __init foxg20_init_irq(void) 105 + { 106 + at91sam9260_init_interrupts(NULL); 107 + } 108 + 109 + 110 + /* 111 + * USB Host port 112 + */ 113 + static struct at91_usbh_data __initdata foxg20_usbh_data = { 114 + .ports = 2, 115 + }; 116 + 117 + /* 118 + * USB Device port 119 + */ 120 + static struct at91_udc_data __initdata foxg20_udc_data = { 121 + .vbus_pin = AT91_PIN_PC6, 122 + .pullup_pin = 0, /* pull-up driven by UDC */ 123 + }; 124 + 125 + 126 + /* 127 + * SPI devices. 128 + */ 129 + static struct spi_board_info foxg20_spi_devices[] = { 130 + #if !defined(CONFIG_MMC_AT91) 131 + { 132 + .modalias = "mtd_dataflash", 133 + .chip_select = 1, 134 + .max_speed_hz = 15 * 1000 * 1000, 135 + .bus_num = 0, 136 + }, 137 + #endif 138 + }; 139 + 140 + 141 + /* 142 + * MACB Ethernet device 143 + */ 144 + static struct at91_eth_data __initdata foxg20_macb_data = { 145 + .phy_irq_pin = AT91_PIN_PA7, 146 + .is_rmii = 1, 147 + }; 148 + 149 + /* 150 + * MCI (SD/MMC) 151 + * det_pin, wp_pin and vcc_pin are not connected 152 + */ 153 + static struct at91_mmc_data __initdata foxg20_mmc_data = { 154 + .slot_b = 1, 155 + .wire4 = 1, 156 + }; 157 + 158 + 159 + /* 160 + * LEDs 161 + */ 162 + static struct gpio_led foxg20_leds[] = { 163 + { /* user led, red */ 164 + .name = "user_led", 165 + .gpio = AT91_PIN_PC7, 166 + .active_low = 0, 167 + .default_trigger = "heartbeat", 168 + }, 169 + }; 170 + 171 + 172 + /* 173 + * GPIO Buttons 174 + */ 175 + #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 176 + static struct gpio_keys_button foxg20_buttons[] = { 177 + { 178 + .gpio = AT91_PIN_PC4, 179 + .code = BTN_1, 180 + .desc = "Button 1", 181 + .active_low = 1, 182 + .wakeup = 1, 183 + }, 184 + }; 185 + 186 + static struct gpio_keys_platform_data foxg20_button_data = { 187 + .buttons = foxg20_buttons, 188 + .nbuttons = ARRAY_SIZE(foxg20_buttons), 189 + }; 190 + 191 + static struct platform_device foxg20_button_device = { 192 + .name = "gpio-keys", 193 + .id = -1, 194 + .num_resources = 0, 195 + .dev = { 196 + .platform_data = &foxg20_button_data, 197 + } 198 + }; 199 + 200 + static void __init foxg20_add_device_buttons(void) 201 + { 202 + at91_set_gpio_input(AT91_PIN_PC4, 1); /* btn1 */ 203 + at91_set_deglitch(AT91_PIN_PC4, 1); 204 + 205 + platform_device_register(&foxg20_button_device); 206 + } 207 + #else 208 + static void __init foxg20_add_device_buttons(void) {} 209 + #endif 210 + 211 + 212 + #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) 213 + static struct w1_gpio_platform_data w1_gpio_pdata = { 214 + /* If you choose to use a pin other than PB16 it needs to be 3.3V */ 215 + .pin = AT91_PIN_PB16, 216 + .is_open_drain = 1, 217 + }; 218 + 219 + static struct platform_device w1_device = { 220 + .name = "w1-gpio", 221 + .id = -1, 222 + .dev.platform_data = &w1_gpio_pdata, 223 + }; 224 + 225 + static void __init at91_add_device_w1(void) 226 + { 227 + at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); 228 + at91_set_multi_drive(w1_gpio_pdata.pin, 1); 229 + platform_device_register(&w1_device); 230 + } 231 + 232 + #endif 233 + 234 + 235 + static struct i2c_board_info __initdata foxg20_i2c_devices[] = { 236 + { 237 + I2C_BOARD_INFO("24c512", 0x50), 238 + }, 239 + }; 240 + 241 + 242 + static void __init foxg20_board_init(void) 243 + { 244 + /* Serial */ 245 + at91_add_device_serial(); 246 + /* USB Host */ 247 + at91_add_device_usbh(&foxg20_usbh_data); 248 + /* USB Device */ 249 + at91_add_device_udc(&foxg20_udc_data); 250 + /* SPI */ 251 + at91_add_device_spi(foxg20_spi_devices, ARRAY_SIZE(foxg20_spi_devices)); 252 + /* Ethernet */ 253 + at91_add_device_eth(&foxg20_macb_data); 254 + /* MMC */ 255 + at91_add_device_mmc(0, &foxg20_mmc_data); 256 + /* I2C */ 257 + at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); 258 + /* LEDs */ 259 + at91_gpio_leds(foxg20_leds, ARRAY_SIZE(foxg20_leds)); 260 + /* Push Buttons */ 261 + foxg20_add_device_buttons(); 262 + #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) 263 + at91_add_device_w1(); 264 + #endif 265 + } 266 + 267 + MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") 268 + /* Maintainer: Sergio Tanzilli */ 269 + .boot_params = AT91_SDRAM_BASE + 0x100, 270 + .timer = &at91sam926x_timer, 271 + .map_io = foxg20_map_io, 272 + .init_irq = foxg20_init_irq, 273 + .init_machine = foxg20_board_init, 274 + MACHINE_END
+584
arch/arm/mach-at91/board-gsia18s.c
··· 1 + /* 2 + * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> 3 + * taskit GmbH 4 + * 2010 Igor Plyatov <plyatov@gmail.com> 5 + * GeoSIG Ltd 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 + */ 21 + 22 + #include <linux/platform_device.h> 23 + #include <linux/gpio.h> 24 + #include <linux/w1-gpio.h> 25 + #include <linux/i2c.h> 26 + #include <linux/i2c/pcf857x.h> 27 + #include <linux/gpio_keys.h> 28 + #include <linux/input.h> 29 + 30 + #include <asm/mach-types.h> 31 + #include <asm/mach/arch.h> 32 + 33 + #include <mach/board.h> 34 + #include <mach/at91sam9_smc.h> 35 + #include <mach/gsia18s.h> 36 + #include <mach/stamp9g20.h> 37 + 38 + #include "sam9_smc.h" 39 + #include "generic.h" 40 + 41 + static void __init gsia18s_map_io(void) 42 + { 43 + stamp9g20_map_io(); 44 + 45 + /* 46 + * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI). 47 + * Used for Internal Analog Modem. 48 + */ 49 + at91_register_uart(AT91SAM9260_ID_US0, 1, 50 + ATMEL_UART_CTS | ATMEL_UART_RTS | 51 + ATMEL_UART_DTR | ATMEL_UART_DSR | 52 + ATMEL_UART_DCD | ATMEL_UART_RI); 53 + /* 54 + * USART1 on ttyS2 (Rx, Tx, CTS, RTS). 55 + * Used for GPS or WiFi or Data stream. 56 + */ 57 + at91_register_uart(AT91SAM9260_ID_US1, 2, 58 + ATMEL_UART_CTS | ATMEL_UART_RTS); 59 + /* 60 + * USART2 on ttyS3 (Rx, Tx, CTS, RTS). 61 + * Used for External Modem. 62 + */ 63 + at91_register_uart(AT91SAM9260_ID_US2, 3, 64 + ATMEL_UART_CTS | ATMEL_UART_RTS); 65 + /* 66 + * USART3 on ttyS4 (Rx, Tx, RTS). 67 + * Used for RS-485. 68 + */ 69 + at91_register_uart(AT91SAM9260_ID_US3, 4, ATMEL_UART_RTS); 70 + 71 + /* 72 + * USART4 on ttyS5 (Rx, Tx). 73 + * Used for TRX433 Radio Module. 74 + */ 75 + at91_register_uart(AT91SAM9260_ID_US4, 5, 0); 76 + } 77 + 78 + static void __init init_irq(void) 79 + { 80 + at91sam9260_init_interrupts(NULL); 81 + } 82 + 83 + /* 84 + * Two USB Host ports 85 + */ 86 + static struct at91_usbh_data __initdata usbh_data = { 87 + .ports = 2, 88 + }; 89 + 90 + /* 91 + * USB Device port 92 + */ 93 + static struct at91_udc_data __initdata udc_data = { 94 + .vbus_pin = AT91_PIN_PA22, 95 + .pullup_pin = 0, /* pull-up driven by UDC */ 96 + }; 97 + 98 + /* 99 + * MACB Ethernet device 100 + */ 101 + static struct at91_eth_data __initdata macb_data = { 102 + .phy_irq_pin = AT91_PIN_PA28, 103 + .is_rmii = 1, 104 + }; 105 + 106 + /* 107 + * LEDs and GPOs 108 + */ 109 + static struct gpio_led gpio_leds[] = { 110 + { 111 + .name = "gpo:spi1reset", 112 + .gpio = AT91_PIN_PC1, 113 + .active_low = 0, 114 + .default_trigger = "none", 115 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 116 + }, 117 + { 118 + .name = "gpo:trig_net_out", 119 + .gpio = AT91_PIN_PB20, 120 + .active_low = 0, 121 + .default_trigger = "none", 122 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 123 + }, 124 + { 125 + .name = "gpo:trig_net_dir", 126 + .gpio = AT91_PIN_PB19, 127 + .active_low = 0, 128 + .default_trigger = "none", 129 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 130 + }, 131 + { 132 + .name = "gpo:charge_dis", 133 + .gpio = AT91_PIN_PC2, 134 + .active_low = 0, 135 + .default_trigger = "none", 136 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 137 + }, 138 + { 139 + .name = "led:event", 140 + .gpio = AT91_PIN_PB17, 141 + .active_low = 1, 142 + .default_trigger = "none", 143 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 144 + }, 145 + { 146 + .name = "led:lan", 147 + .gpio = AT91_PIN_PB18, 148 + .active_low = 1, 149 + .default_trigger = "none", 150 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 151 + }, 152 + { 153 + .name = "led:error", 154 + .gpio = AT91_PIN_PB16, 155 + .active_low = 1, 156 + .default_trigger = "none", 157 + .default_state = LEDS_GPIO_DEFSTATE_ON, 158 + } 159 + }; 160 + 161 + static struct gpio_led_platform_data gpio_led_info = { 162 + .leds = gpio_leds, 163 + .num_leds = ARRAY_SIZE(gpio_leds), 164 + }; 165 + 166 + static struct platform_device leds = { 167 + .name = "leds-gpio", 168 + .id = 0, 169 + .dev = { 170 + .platform_data = &gpio_led_info, 171 + } 172 + }; 173 + 174 + static void __init gsia18s_leds_init(void) 175 + { 176 + platform_device_register(&leds); 177 + } 178 + 179 + /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ 180 + static struct gpio_led pcf_gpio_leds1[] = { 181 + { /* bit 0 */ 182 + .name = "gpo:hdc_power", 183 + .gpio = PCF_GPIO_HDC_POWER, 184 + .active_low = 0, 185 + .default_trigger = "none", 186 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 187 + }, 188 + { /* bit 1 */ 189 + .name = "gpo:wifi_setup", 190 + .gpio = PCF_GPIO_WIFI_SETUP, 191 + .active_low = 1, 192 + .default_trigger = "none", 193 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 194 + }, 195 + { /* bit 2 */ 196 + .name = "gpo:wifi_enable", 197 + .gpio = PCF_GPIO_WIFI_ENABLE, 198 + .active_low = 1, 199 + .default_trigger = "none", 200 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 201 + }, 202 + { /* bit 3 */ 203 + .name = "gpo:wifi_reset", 204 + .gpio = PCF_GPIO_WIFI_RESET, 205 + .active_low = 1, 206 + .default_trigger = "none", 207 + .default_state = LEDS_GPIO_DEFSTATE_ON, 208 + }, 209 + /* bit 4 used as GPI */ 210 + { /* bit 5 */ 211 + .name = "gpo:gps_setup", 212 + .gpio = PCF_GPIO_GPS_SETUP, 213 + .active_low = 1, 214 + .default_trigger = "none", 215 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 216 + }, 217 + { /* bit 6 */ 218 + .name = "gpo:gps_standby", 219 + .gpio = PCF_GPIO_GPS_STANDBY, 220 + .active_low = 0, 221 + .default_trigger = "none", 222 + .default_state = LEDS_GPIO_DEFSTATE_ON, 223 + }, 224 + { /* bit 7 */ 225 + .name = "gpo:gps_power", 226 + .gpio = PCF_GPIO_GPS_POWER, 227 + .active_low = 0, 228 + .default_trigger = "none", 229 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 230 + } 231 + }; 232 + 233 + static struct gpio_led_platform_data pcf_gpio_led_info1 = { 234 + .leds = pcf_gpio_leds1, 235 + .num_leds = ARRAY_SIZE(pcf_gpio_leds1), 236 + }; 237 + 238 + static struct platform_device pcf_leds1 = { 239 + .name = "leds-gpio", /* GS_IA18-CB_board */ 240 + .id = 1, 241 + .dev = { 242 + .platform_data = &pcf_gpio_led_info1, 243 + } 244 + }; 245 + 246 + /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 247 + static struct gpio_led pcf_gpio_leds2[] = { 248 + { /* bit 0 */ 249 + .name = "gpo:alarm_1", 250 + .gpio = PCF_GPIO_ALARM1, 251 + .active_low = 1, 252 + .default_trigger = "none", 253 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 254 + }, 255 + { /* bit 1 */ 256 + .name = "gpo:alarm_2", 257 + .gpio = PCF_GPIO_ALARM2, 258 + .active_low = 1, 259 + .default_trigger = "none", 260 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 261 + }, 262 + { /* bit 2 */ 263 + .name = "gpo:alarm_3", 264 + .gpio = PCF_GPIO_ALARM3, 265 + .active_low = 1, 266 + .default_trigger = "none", 267 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 268 + }, 269 + { /* bit 3 */ 270 + .name = "gpo:alarm_4", 271 + .gpio = PCF_GPIO_ALARM4, 272 + .active_low = 1, 273 + .default_trigger = "none", 274 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 275 + }, 276 + /* bits 4, 5, 6 not used */ 277 + { /* bit 7 */ 278 + .name = "gpo:alarm_v_relay_on", 279 + .gpio = PCF_GPIO_ALARM_V_RELAY_ON, 280 + .active_low = 0, 281 + .default_trigger = "none", 282 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 283 + }, 284 + }; 285 + 286 + static struct gpio_led_platform_data pcf_gpio_led_info2 = { 287 + .leds = pcf_gpio_leds2, 288 + .num_leds = ARRAY_SIZE(pcf_gpio_leds2), 289 + }; 290 + 291 + static struct platform_device pcf_leds2 = { 292 + .name = "leds-gpio", 293 + .id = 2, 294 + .dev = { 295 + .platform_data = &pcf_gpio_led_info2, 296 + } 297 + }; 298 + 299 + /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 300 + static struct gpio_led pcf_gpio_leds3[] = { 301 + { /* bit 0 */ 302 + .name = "gpo:modem_power", 303 + .gpio = PCF_GPIO_MODEM_POWER, 304 + .active_low = 1, 305 + .default_trigger = "none", 306 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 307 + }, 308 + /* bits 1 and 2 not used */ 309 + { /* bit 3 */ 310 + .name = "gpo:modem_reset", 311 + .gpio = PCF_GPIO_MODEM_RESET, 312 + .active_low = 1, 313 + .default_trigger = "none", 314 + .default_state = LEDS_GPIO_DEFSTATE_ON, 315 + }, 316 + /* bits 4, 5 and 6 not used */ 317 + { /* bit 7 */ 318 + .name = "gpo:trx_reset", 319 + .gpio = PCF_GPIO_TRX_RESET, 320 + .active_low = 1, 321 + .default_trigger = "none", 322 + .default_state = LEDS_GPIO_DEFSTATE_ON, 323 + } 324 + }; 325 + 326 + static struct gpio_led_platform_data pcf_gpio_led_info3 = { 327 + .leds = pcf_gpio_leds3, 328 + .num_leds = ARRAY_SIZE(pcf_gpio_leds3), 329 + }; 330 + 331 + static struct platform_device pcf_leds3 = { 332 + .name = "leds-gpio", 333 + .id = 3, 334 + .dev = { 335 + .platform_data = &pcf_gpio_led_info3, 336 + } 337 + }; 338 + 339 + static void __init gsia18s_pcf_leds_init(void) 340 + { 341 + platform_device_register(&pcf_leds1); 342 + platform_device_register(&pcf_leds2); 343 + platform_device_register(&pcf_leds3); 344 + } 345 + 346 + /* 347 + * SPI busses. 348 + */ 349 + static struct spi_board_info gsia18s_spi_devices[] = { 350 + { /* User accessible spi0, cs0 used for communication with MSP RTC */ 351 + .modalias = "spidev", 352 + .bus_num = 0, 353 + .chip_select = 0, 354 + .max_speed_hz = 580000, 355 + .mode = SPI_MODE_1, 356 + }, 357 + { /* User accessible spi1, cs0 used for communication with int. DSP */ 358 + .modalias = "spidev", 359 + .bus_num = 1, 360 + .chip_select = 0, 361 + .max_speed_hz = 5600000, 362 + .mode = SPI_MODE_0, 363 + }, 364 + { /* User accessible spi1, cs1 used for communication with ext. DSP */ 365 + .modalias = "spidev", 366 + .bus_num = 1, 367 + .chip_select = 1, 368 + .max_speed_hz = 5600000, 369 + .mode = SPI_MODE_0, 370 + }, 371 + { /* User accessible spi1, cs2 used for communication with ext. DSP */ 372 + .modalias = "spidev", 373 + .bus_num = 1, 374 + .chip_select = 2, 375 + .max_speed_hz = 5600000, 376 + .mode = SPI_MODE_0, 377 + }, 378 + { /* User accessible spi1, cs3 used for communication with ext. DSP */ 379 + .modalias = "spidev", 380 + .bus_num = 1, 381 + .chip_select = 3, 382 + .max_speed_hz = 5600000, 383 + .mode = SPI_MODE_0, 384 + } 385 + }; 386 + 387 + /* 388 + * GPI Buttons 389 + */ 390 + static struct gpio_keys_button buttons[] = { 391 + { 392 + .gpio = GPIO_TRIG_NET_IN, 393 + .code = BTN_1, 394 + .desc = "TRIG_NET_IN", 395 + .type = EV_KEY, 396 + .active_low = 0, 397 + .wakeup = 1, 398 + }, 399 + { /* SW80 on the GS_IA18_S-MN board*/ 400 + .gpio = GPIO_CARD_UNMOUNT_0, 401 + .code = BTN_2, 402 + .desc = "Card umount 0", 403 + .type = EV_KEY, 404 + .active_low = 1, 405 + .wakeup = 1, 406 + }, 407 + { /* SW79 on the GS_IA18_S-MN board*/ 408 + .gpio = GPIO_CARD_UNMOUNT_1, 409 + .code = BTN_3, 410 + .desc = "Card umount 1", 411 + .type = EV_KEY, 412 + .active_low = 1, 413 + .wakeup = 1, 414 + }, 415 + { /* SW280 on the GS_IA18-CB board*/ 416 + .gpio = GPIO_KEY_POWER, 417 + .code = KEY_POWER, 418 + .desc = "Power Off Button", 419 + .type = EV_KEY, 420 + .active_low = 0, 421 + .wakeup = 1, 422 + } 423 + }; 424 + 425 + static struct gpio_keys_platform_data button_data = { 426 + .buttons = buttons, 427 + .nbuttons = ARRAY_SIZE(buttons), 428 + }; 429 + 430 + static struct platform_device button_device = { 431 + .name = "gpio-keys", 432 + .id = -1, 433 + .num_resources = 0, 434 + .dev = { 435 + .platform_data = &button_data, 436 + } 437 + }; 438 + 439 + static void __init gsia18s_add_device_buttons(void) 440 + { 441 + at91_set_gpio_input(GPIO_TRIG_NET_IN, 1); 442 + at91_set_deglitch(GPIO_TRIG_NET_IN, 1); 443 + at91_set_gpio_input(GPIO_CARD_UNMOUNT_0, 1); 444 + at91_set_deglitch(GPIO_CARD_UNMOUNT_0, 1); 445 + at91_set_gpio_input(GPIO_CARD_UNMOUNT_1, 1); 446 + at91_set_deglitch(GPIO_CARD_UNMOUNT_1, 1); 447 + at91_set_gpio_input(GPIO_KEY_POWER, 0); 448 + at91_set_deglitch(GPIO_KEY_POWER, 1); 449 + 450 + platform_device_register(&button_device); 451 + } 452 + 453 + /* 454 + * I2C 455 + */ 456 + static int pcf8574x_0x20_setup(struct i2c_client *client, int gpio, 457 + unsigned int ngpio, void *context) 458 + { 459 + int status; 460 + 461 + status = gpio_request(gpio + PCF_GPIO_ETH_DETECT, "eth_det"); 462 + if (status < 0) { 463 + pr_err("error: can't request GPIO%d\n", 464 + gpio + PCF_GPIO_ETH_DETECT); 465 + return status; 466 + } 467 + status = gpio_direction_input(gpio + PCF_GPIO_ETH_DETECT); 468 + if (status < 0) { 469 + pr_err("error: can't setup GPIO%d as input\n", 470 + gpio + PCF_GPIO_ETH_DETECT); 471 + return status; 472 + } 473 + status = gpio_export(gpio + PCF_GPIO_ETH_DETECT, false); 474 + if (status < 0) { 475 + pr_err("error: can't export GPIO%d\n", 476 + gpio + PCF_GPIO_ETH_DETECT); 477 + return status; 478 + } 479 + status = gpio_sysfs_set_active_low(gpio + PCF_GPIO_ETH_DETECT, 1); 480 + if (status < 0) { 481 + pr_err("error: gpio_sysfs_set active_low(GPIO%d, 1)\n", 482 + gpio + PCF_GPIO_ETH_DETECT); 483 + return status; 484 + } 485 + 486 + return 0; 487 + } 488 + 489 + static int pcf8574x_0x20_teardown(struct i2c_client *client, int gpio, 490 + unsigned ngpio, void *context) 491 + { 492 + gpio_free(gpio + PCF_GPIO_ETH_DETECT); 493 + return 0; 494 + } 495 + 496 + static struct pcf857x_platform_data pcf20_pdata = { 497 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE0, 498 + .n_latch = (1 << 4), 499 + .setup = pcf8574x_0x20_setup, 500 + .teardown = pcf8574x_0x20_teardown, 501 + }; 502 + 503 + static struct pcf857x_platform_data pcf22_pdata = { 504 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE1, 505 + }; 506 + 507 + static struct pcf857x_platform_data pcf24_pdata = { 508 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE2, 509 + }; 510 + 511 + static struct i2c_board_info __initdata gsia18s_i2c_devices[] = { 512 + { /* U1 on the GS_IA18-CB_V3 board */ 513 + I2C_BOARD_INFO("pcf8574", 0x20), 514 + .platform_data = &pcf20_pdata, 515 + }, 516 + { /* U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 517 + I2C_BOARD_INFO("pcf8574", 0x22), 518 + .platform_data = &pcf22_pdata, 519 + }, 520 + { /* U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 521 + I2C_BOARD_INFO("pcf8574", 0x24), 522 + .platform_data = &pcf24_pdata, 523 + }, 524 + { /* U161 on the GS_IA18_S-MN board */ 525 + I2C_BOARD_INFO("24c1024", 0x50), 526 + }, 527 + { /* U162 on the GS_IA18_S-MN board */ 528 + I2C_BOARD_INFO("24c01", 0x53), 529 + }, 530 + }; 531 + 532 + /* 533 + * Compact Flash 534 + */ 535 + static struct at91_cf_data __initdata gsia18s_cf1_data = { 536 + .irq_pin = AT91_PIN_PA27, 537 + .det_pin = AT91_PIN_PB30, 538 + .rst_pin = AT91_PIN_PB31, 539 + .chipselect = 5, 540 + .flags = AT91_CF_TRUE_IDE, 541 + }; 542 + 543 + /* Power Off by RTC */ 544 + static void gsia18s_power_off(void) 545 + { 546 + pr_notice("Power supply will be switched off automatically now or after 60 seconds without ArmDAS.\n"); 547 + at91_set_gpio_output(AT91_PIN_PA25, 1); 548 + /* Spin to death... */ 549 + while (1) 550 + ; 551 + } 552 + 553 + static int __init gsia18s_power_off_init(void) 554 + { 555 + pm_power_off = gsia18s_power_off; 556 + return 0; 557 + } 558 + 559 + /* ---------------------------------------------------------------------------*/ 560 + 561 + static void __init gsia18s_board_init(void) 562 + { 563 + stamp9g20_board_init(); 564 + at91_add_device_usbh(&usbh_data); 565 + at91_add_device_udc(&udc_data); 566 + at91_add_device_eth(&macb_data); 567 + gsia18s_leds_init(); 568 + gsia18s_pcf_leds_init(); 569 + gsia18s_add_device_buttons(); 570 + at91_add_device_i2c(gsia18s_i2c_devices, 571 + ARRAY_SIZE(gsia18s_i2c_devices)); 572 + at91_add_device_cf(&gsia18s_cf1_data); 573 + at91_add_device_spi(gsia18s_spi_devices, 574 + ARRAY_SIZE(gsia18s_spi_devices)); 575 + gsia18s_power_off_init(); 576 + } 577 + 578 + MACHINE_START(GSIA18S, "GS_IA18_S") 579 + .boot_params = AT91_SDRAM_BASE + 0x100, 580 + .timer = &at91sam926x_timer, 581 + .map_io = gsia18s_map_io, 582 + .init_irq = init_irq, 583 + .init_machine = gsia18s_board_init, 584 + MACHINE_END
-1
arch/arm/mach-at91/board-sam9m10g45ek.c
··· 37 37 #include <asm/mach/map.h> 38 38 #include <asm/mach/irq.h> 39 39 40 - #include <mach/hardware.h> 41 40 #include <mach/board.h> 42 41 #include <mach/gpio.h> 43 42 #include <mach/at91sam9_smc.h>
+17 -17
arch/arm/mach-at91/gpio.c
··· 274 274 static u32 wakeups[MAX_GPIO_BANKS]; 275 275 static u32 backups[MAX_GPIO_BANKS]; 276 276 277 - static int gpio_irq_set_wake(unsigned pin, unsigned state) 277 + static int gpio_irq_set_wake(struct irq_data *d, unsigned state) 278 278 { 279 - unsigned mask = pin_to_mask(pin); 280 - unsigned bank = (pin - PIN_BASE) / 32; 279 + unsigned mask = pin_to_mask(d->irq); 280 + unsigned bank = (d->irq - PIN_BASE) / 32; 281 281 282 282 if (unlikely(bank >= MAX_GPIO_BANKS)) 283 283 return -EINVAL; ··· 344 344 * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. 345 345 */ 346 346 347 - static void gpio_irq_mask(unsigned pin) 347 + static void gpio_irq_mask(struct irq_data *d) 348 348 { 349 - void __iomem *pio = pin_to_controller(pin); 350 - unsigned mask = pin_to_mask(pin); 349 + void __iomem *pio = pin_to_controller(d->irq); 350 + unsigned mask = pin_to_mask(d->irq); 351 351 352 352 if (pio) 353 353 __raw_writel(mask, pio + PIO_IDR); 354 354 } 355 355 356 - static void gpio_irq_unmask(unsigned pin) 356 + static void gpio_irq_unmask(struct irq_data *d) 357 357 { 358 - void __iomem *pio = pin_to_controller(pin); 359 - unsigned mask = pin_to_mask(pin); 358 + void __iomem *pio = pin_to_controller(d->irq); 359 + unsigned mask = pin_to_mask(d->irq); 360 360 361 361 if (pio) 362 362 __raw_writel(mask, pio + PIO_IER); 363 363 } 364 364 365 - static int gpio_irq_type(unsigned pin, unsigned type) 365 + static int gpio_irq_type(struct irq_data *d, unsigned type) 366 366 { 367 367 switch (type) { 368 368 case IRQ_TYPE_NONE: ··· 375 375 376 376 static struct irq_chip gpio_irqchip = { 377 377 .name = "GPIO", 378 - .mask = gpio_irq_mask, 379 - .unmask = gpio_irq_unmask, 380 - .set_type = gpio_irq_type, 381 - .set_wake = gpio_irq_set_wake, 378 + .irq_mask = gpio_irq_mask, 379 + .irq_unmask = gpio_irq_unmask, 380 + .irq_set_type = gpio_irq_type, 381 + .irq_set_wake = gpio_irq_set_wake, 382 382 }; 383 383 384 384 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) ··· 393 393 pio = at91_gpio->regbase; 394 394 395 395 /* temporarily mask (level sensitive) parent IRQ */ 396 - desc->chip->ack(irq); 396 + desc->irq_data.chip->irq_ack(&desc->irq_data); 397 397 for (;;) { 398 398 /* Reading ISR acks pending (edge triggered) GPIO interrupts. 399 399 * When there none are pending, we're finished unless we need ··· 419 419 * another IRQ must be generated before it actually gets 420 420 * here to be disabled on the GPIO controller. 421 421 */ 422 - gpio_irq_mask(pin); 422 + gpio_irq_mask(irq_get_irq_data(pin)); 423 423 } 424 424 else 425 425 generic_handle_irq(pin); ··· 429 429 isr >>= 1; 430 430 } 431 431 } 432 - desc->chip->unmask(irq); 432 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 433 433 /* now it may re-trigger */ 434 434 } 435 435
+33
arch/arm/mach-at91/include/mach/gsia18s.h
··· 1 + /* Buttons */ 2 + #define GPIO_TRIG_NET_IN AT91_PIN_PB21 3 + #define GPIO_CARD_UNMOUNT_0 AT91_PIN_PB13 4 + #define GPIO_CARD_UNMOUNT_1 AT91_PIN_PB12 5 + #define GPIO_KEY_POWER AT91_PIN_PA25 6 + 7 + /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ 8 + #define GS_IA18_S_PCF_GPIO_BASE0 NR_BUILTIN_GPIO 9 + #define PCF_GPIO_HDC_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 0) 10 + #define PCF_GPIO_WIFI_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 1) 11 + #define PCF_GPIO_WIFI_ENABLE (GS_IA18_S_PCF_GPIO_BASE0 + 2) 12 + #define PCF_GPIO_WIFI_RESET (GS_IA18_S_PCF_GPIO_BASE0 + 3) 13 + #define PCF_GPIO_ETH_DETECT 4 /* this is a GPI */ 14 + #define PCF_GPIO_GPS_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 5) 15 + #define PCF_GPIO_GPS_STANDBY (GS_IA18_S_PCF_GPIO_BASE0 + 6) 16 + #define PCF_GPIO_GPS_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 7) 17 + 18 + /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 19 + #define GS_IA18_S_PCF_GPIO_BASE1 (GS_IA18_S_PCF_GPIO_BASE0 + 8) 20 + #define PCF_GPIO_ALARM1 (GS_IA18_S_PCF_GPIO_BASE1 + 0) 21 + #define PCF_GPIO_ALARM2 (GS_IA18_S_PCF_GPIO_BASE1 + 1) 22 + #define PCF_GPIO_ALARM3 (GS_IA18_S_PCF_GPIO_BASE1 + 2) 23 + #define PCF_GPIO_ALARM4 (GS_IA18_S_PCF_GPIO_BASE1 + 3) 24 + /* bits 4, 5, 6 not used */ 25 + #define PCF_GPIO_ALARM_V_RELAY_ON (GS_IA18_S_PCF_GPIO_BASE1 + 7) 26 + 27 + /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 28 + #define GS_IA18_S_PCF_GPIO_BASE2 (GS_IA18_S_PCF_GPIO_BASE1 + 8) 29 + #define PCF_GPIO_MODEM_POWER (GS_IA18_S_PCF_GPIO_BASE2 + 0) 30 + #define PCF_GPIO_MODEM_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 3) 31 + /* bits 1, 2, 4, 5 not used */ 32 + #define PCF_GPIO_TRX_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 6) 33 + /* bit 7 not used */
+18 -18
arch/arm/mach-at91/irq.c
··· 34 34 #include <asm/mach/map.h> 35 35 36 36 37 - static void at91_aic_mask_irq(unsigned int irq) 37 + static void at91_aic_mask_irq(struct irq_data *d) 38 38 { 39 39 /* Disable interrupt on AIC */ 40 - at91_sys_write(AT91_AIC_IDCR, 1 << irq); 40 + at91_sys_write(AT91_AIC_IDCR, 1 << d->irq); 41 41 } 42 42 43 - static void at91_aic_unmask_irq(unsigned int irq) 43 + static void at91_aic_unmask_irq(struct irq_data *d) 44 44 { 45 45 /* Enable interrupt on AIC */ 46 - at91_sys_write(AT91_AIC_IECR, 1 << irq); 46 + at91_sys_write(AT91_AIC_IECR, 1 << d->irq); 47 47 } 48 48 49 49 unsigned int at91_extern_irq; 50 50 51 51 #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) 52 52 53 - static int at91_aic_set_type(unsigned irq, unsigned type) 53 + static int at91_aic_set_type(struct irq_data *d, unsigned type) 54 54 { 55 55 unsigned int smr, srctype; 56 56 ··· 62 62 srctype = AT91_AIC_SRCTYPE_RISING; 63 63 break; 64 64 case IRQ_TYPE_LEVEL_LOW: 65 - if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ 65 + if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 66 66 srctype = AT91_AIC_SRCTYPE_LOW; 67 67 else 68 68 return -EINVAL; 69 69 break; 70 70 case IRQ_TYPE_EDGE_FALLING: 71 - if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ 71 + if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 72 72 srctype = AT91_AIC_SRCTYPE_FALLING; 73 73 else 74 74 return -EINVAL; ··· 77 77 return -EINVAL; 78 78 } 79 79 80 - smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE; 81 - at91_sys_write(AT91_AIC_SMR(irq), smr | srctype); 80 + smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; 81 + at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype); 82 82 return 0; 83 83 } 84 84 ··· 87 87 static u32 wakeups; 88 88 static u32 backups; 89 89 90 - static int at91_aic_set_wake(unsigned irq, unsigned value) 90 + static int at91_aic_set_wake(struct irq_data *d, unsigned value) 91 91 { 92 - if (unlikely(irq >= 32)) 92 + if (unlikely(d->irq >= 32)) 93 93 return -EINVAL; 94 94 95 95 if (value) 96 - wakeups |= (1 << irq); 96 + wakeups |= (1 << d->irq); 97 97 else 98 - wakeups &= ~(1 << irq); 98 + wakeups &= ~(1 << d->irq); 99 99 100 100 return 0; 101 101 } ··· 119 119 120 120 static struct irq_chip at91_aic_chip = { 121 121 .name = "AIC", 122 - .ack = at91_aic_mask_irq, 123 - .mask = at91_aic_mask_irq, 124 - .unmask = at91_aic_unmask_irq, 125 - .set_type = at91_aic_set_type, 126 - .set_wake = at91_aic_set_wake, 122 + .irq_ack = at91_aic_mask_irq, 123 + .irq_mask = at91_aic_mask_irq, 124 + .irq_unmask = at91_aic_unmask_irq, 125 + .irq_set_type = at91_aic_set_type, 126 + .irq_set_wake = at91_aic_set_wake, 127 127 }; 128 128 129 129 /*
+21 -21
arch/arm/mach-bcmring/irq.c
··· 30 30 #include <mach/csp/intcHw_reg.h> 31 31 #include <mach/csp/mm_io.h> 32 32 33 - static void bcmring_mask_irq0(unsigned int irq) 33 + static void bcmring_mask_irq0(struct irq_data *d) 34 34 { 35 - writel(1 << (irq - IRQ_INTC0_START), 35 + writel(1 << (d->irq - IRQ_INTC0_START), 36 36 MM_IO_BASE_INTC0 + INTCHW_INTENCLEAR); 37 37 } 38 38 39 - static void bcmring_unmask_irq0(unsigned int irq) 39 + static void bcmring_unmask_irq0(struct irq_data *d) 40 40 { 41 - writel(1 << (irq - IRQ_INTC0_START), 41 + writel(1 << (d->irq - IRQ_INTC0_START), 42 42 MM_IO_BASE_INTC0 + INTCHW_INTENABLE); 43 43 } 44 44 45 - static void bcmring_mask_irq1(unsigned int irq) 45 + static void bcmring_mask_irq1(struct irq_data *d) 46 46 { 47 - writel(1 << (irq - IRQ_INTC1_START), 47 + writel(1 << (d->irq - IRQ_INTC1_START), 48 48 MM_IO_BASE_INTC1 + INTCHW_INTENCLEAR); 49 49 } 50 50 51 - static void bcmring_unmask_irq1(unsigned int irq) 51 + static void bcmring_unmask_irq1(struct irq_data *d) 52 52 { 53 - writel(1 << (irq - IRQ_INTC1_START), 53 + writel(1 << (d->irq - IRQ_INTC1_START), 54 54 MM_IO_BASE_INTC1 + INTCHW_INTENABLE); 55 55 } 56 56 57 - static void bcmring_mask_irq2(unsigned int irq) 57 + static void bcmring_mask_irq2(struct irq_data *d) 58 58 { 59 - writel(1 << (irq - IRQ_SINTC_START), 59 + writel(1 << (d->irq - IRQ_SINTC_START), 60 60 MM_IO_BASE_SINTC + INTCHW_INTENCLEAR); 61 61 } 62 62 63 - static void bcmring_unmask_irq2(unsigned int irq) 63 + static void bcmring_unmask_irq2(struct irq_data *d) 64 64 { 65 - writel(1 << (irq - IRQ_SINTC_START), 65 + writel(1 << (d->irq - IRQ_SINTC_START), 66 66 MM_IO_BASE_SINTC + INTCHW_INTENABLE); 67 67 } 68 68 69 69 static struct irq_chip bcmring_irq0_chip = { 70 70 .name = "ARM-INTC0", 71 - .ack = bcmring_mask_irq0, 72 - .mask = bcmring_mask_irq0, /* mask a specific interrupt, blocking its delivery. */ 73 - .unmask = bcmring_unmask_irq0, /* unmaks an interrupt */ 71 + .irq_ack = bcmring_mask_irq0, 72 + .irq_mask = bcmring_mask_irq0, /* mask a specific interrupt, blocking its delivery. */ 73 + .irq_unmask = bcmring_unmask_irq0, /* unmaks an interrupt */ 74 74 }; 75 75 76 76 static struct irq_chip bcmring_irq1_chip = { 77 77 .name = "ARM-INTC1", 78 - .ack = bcmring_mask_irq1, 79 - .mask = bcmring_mask_irq1, 80 - .unmask = bcmring_unmask_irq1, 78 + .irq_ack = bcmring_mask_irq1, 79 + .irq_mask = bcmring_mask_irq1, 80 + .irq_unmask = bcmring_unmask_irq1, 81 81 }; 82 82 83 83 static struct irq_chip bcmring_irq2_chip = { 84 84 .name = "ARM-SINTC", 85 - .ack = bcmring_mask_irq2, 86 - .mask = bcmring_mask_irq2, 87 - .unmask = bcmring_unmask_irq2, 85 + .irq_ack = bcmring_mask_irq2, 86 + .irq_mask = bcmring_mask_irq2, 87 + .irq_unmask = bcmring_unmask_irq2, 88 88 }; 89 89 90 90 static void vic_init(void __iomem *base, struct irq_chip *chip,
+20 -20
arch/arm/mach-clps711x/irq.c
··· 27 27 28 28 #include <asm/hardware/clps7111.h> 29 29 30 - static void int1_mask(unsigned int irq) 30 + static void int1_mask(struct irq_data *d) 31 31 { 32 32 u32 intmr1; 33 33 34 34 intmr1 = clps_readl(INTMR1); 35 - intmr1 &= ~(1 << irq); 35 + intmr1 &= ~(1 << d->irq); 36 36 clps_writel(intmr1, INTMR1); 37 37 } 38 38 39 - static void int1_ack(unsigned int irq) 39 + static void int1_ack(struct irq_data *d) 40 40 { 41 41 u32 intmr1; 42 42 43 43 intmr1 = clps_readl(INTMR1); 44 - intmr1 &= ~(1 << irq); 44 + intmr1 &= ~(1 << d->irq); 45 45 clps_writel(intmr1, INTMR1); 46 46 47 - switch (irq) { 47 + switch (d->irq) { 48 48 case IRQ_CSINT: clps_writel(0, COEOI); break; 49 49 case IRQ_TC1OI: clps_writel(0, TC1EOI); break; 50 50 case IRQ_TC2OI: clps_writel(0, TC2EOI); break; ··· 54 54 } 55 55 } 56 56 57 - static void int1_unmask(unsigned int irq) 57 + static void int1_unmask(struct irq_data *d) 58 58 { 59 59 u32 intmr1; 60 60 61 61 intmr1 = clps_readl(INTMR1); 62 - intmr1 |= 1 << irq; 62 + intmr1 |= 1 << d->irq; 63 63 clps_writel(intmr1, INTMR1); 64 64 } 65 65 66 66 static struct irq_chip int1_chip = { 67 - .ack = int1_ack, 68 - .mask = int1_mask, 69 - .unmask = int1_unmask, 67 + .irq_ack = int1_ack, 68 + .irq_mask = int1_mask, 69 + .irq_unmask = int1_unmask, 70 70 }; 71 71 72 - static void int2_mask(unsigned int irq) 72 + static void int2_mask(struct irq_data *d) 73 73 { 74 74 u32 intmr2; 75 75 76 76 intmr2 = clps_readl(INTMR2); 77 - intmr2 &= ~(1 << (irq - 16)); 77 + intmr2 &= ~(1 << (d->irq - 16)); 78 78 clps_writel(intmr2, INTMR2); 79 79 } 80 80 81 - static void int2_ack(unsigned int irq) 81 + static void int2_ack(struct irq_data *d) 82 82 { 83 83 u32 intmr2; 84 84 85 85 intmr2 = clps_readl(INTMR2); 86 - intmr2 &= ~(1 << (irq - 16)); 86 + intmr2 &= ~(1 << (d->irq - 16)); 87 87 clps_writel(intmr2, INTMR2); 88 88 89 - switch (irq) { 89 + switch (d->irq) { 90 90 case IRQ_KBDINT: clps_writel(0, KBDEOI); break; 91 91 } 92 92 } 93 93 94 - static void int2_unmask(unsigned int irq) 94 + static void int2_unmask(struct irq_data *d) 95 95 { 96 96 u32 intmr2; 97 97 98 98 intmr2 = clps_readl(INTMR2); 99 - intmr2 |= 1 << (irq - 16); 99 + intmr2 |= 1 << (d->irq - 16); 100 100 clps_writel(intmr2, INTMR2); 101 101 } 102 102 103 103 static struct irq_chip int2_chip = { 104 - .ack = int2_ack, 105 - .mask = int2_mask, 106 - .unmask = int2_unmask, 104 + .irq_ack = int2_ack, 105 + .irq_mask = int2_mask, 106 + .irq_unmask = int2_unmask, 107 107 }; 108 108 109 109 void __init clps711x_init_irq(void)
+15 -15
arch/arm/mach-davinci/cp_intc.c
··· 26 26 __raw_writel(value, davinci_intc_base + offset); 27 27 } 28 28 29 - static void cp_intc_ack_irq(unsigned int irq) 29 + static void cp_intc_ack_irq(struct irq_data *d) 30 30 { 31 - cp_intc_write(irq, CP_INTC_SYS_STAT_IDX_CLR); 31 + cp_intc_write(d->irq, CP_INTC_SYS_STAT_IDX_CLR); 32 32 } 33 33 34 34 /* Disable interrupt */ 35 - static void cp_intc_mask_irq(unsigned int irq) 35 + static void cp_intc_mask_irq(struct irq_data *d) 36 36 { 37 37 /* XXX don't know why we need to disable nIRQ here... */ 38 38 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); 39 - cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_CLR); 39 + cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_CLR); 40 40 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); 41 41 } 42 42 43 43 /* Enable interrupt */ 44 - static void cp_intc_unmask_irq(unsigned int irq) 44 + static void cp_intc_unmask_irq(struct irq_data *d) 45 45 { 46 - cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_SET); 46 + cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_SET); 47 47 } 48 48 49 - static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type) 49 + static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type) 50 50 { 51 - unsigned reg = BIT_WORD(irq); 52 - unsigned mask = BIT_MASK(irq); 51 + unsigned reg = BIT_WORD(d->irq); 52 + unsigned mask = BIT_MASK(d->irq); 53 53 unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); 54 54 unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); 55 55 ··· 85 85 * generic drivers which call {enable|disable}_irq_wake for 86 86 * wake up interrupt sources (eg RTC on DA850). 87 87 */ 88 - static int cp_intc_set_wake(unsigned int irq, unsigned int on) 88 + static int cp_intc_set_wake(struct irq_data *d, unsigned int on) 89 89 { 90 90 return 0; 91 91 } 92 92 93 93 static struct irq_chip cp_intc_irq_chip = { 94 94 .name = "cp_intc", 95 - .ack = cp_intc_ack_irq, 96 - .mask = cp_intc_mask_irq, 97 - .unmask = cp_intc_unmask_irq, 98 - .set_type = cp_intc_set_irq_type, 99 - .set_wake = cp_intc_set_wake, 95 + .irq_ack = cp_intc_ack_irq, 96 + .irq_mask = cp_intc_mask_irq, 97 + .irq_unmask = cp_intc_unmask_irq, 98 + .irq_set_type = cp_intc_set_irq_type, 99 + .irq_set_wake = cp_intc_set_wake, 100 100 }; 101 101 102 102 void __init cp_intc_init(void)
+23 -23
arch/arm/mach-davinci/gpio.c
··· 205 205 * serve as EDMA event triggers. 206 206 */ 207 207 208 - static void gpio_irq_disable(unsigned irq) 208 + static void gpio_irq_disable(struct irq_data *d) 209 209 { 210 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 211 - u32 mask = (u32) get_irq_data(irq); 210 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 211 + u32 mask = (u32) irq_data_get_irq_data(d); 212 212 213 213 __raw_writel(mask, &g->clr_falling); 214 214 __raw_writel(mask, &g->clr_rising); 215 215 } 216 216 217 - static void gpio_irq_enable(unsigned irq) 217 + static void gpio_irq_enable(struct irq_data *d) 218 218 { 219 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 220 - u32 mask = (u32) get_irq_data(irq); 221 - unsigned status = irq_desc[irq].status; 219 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 220 + u32 mask = (u32) irq_data_get_irq_data(d); 221 + unsigned status = irq_desc[d->irq].status; 222 222 223 223 status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING; 224 224 if (!status) ··· 230 230 __raw_writel(mask, &g->set_rising); 231 231 } 232 232 233 - static int gpio_irq_type(unsigned irq, unsigned trigger) 233 + static int gpio_irq_type(struct irq_data *d, unsigned trigger) 234 234 { 235 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 236 - u32 mask = (u32) get_irq_data(irq); 235 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 236 + u32 mask = (u32) irq_data_get_irq_data(d); 237 237 238 238 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 239 239 return -EINVAL; 240 240 241 - irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; 242 - irq_desc[irq].status |= trigger; 241 + irq_desc[d->irq].status &= ~IRQ_TYPE_SENSE_MASK; 242 + irq_desc[d->irq].status |= trigger; 243 243 244 244 /* don't enable the IRQ if it's currently disabled */ 245 - if (irq_desc[irq].depth == 0) { 245 + if (irq_desc[d->irq].depth == 0) { 246 246 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) 247 247 ? &g->set_falling : &g->clr_falling); 248 248 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) ··· 253 253 254 254 static struct irq_chip gpio_irqchip = { 255 255 .name = "GPIO", 256 - .enable = gpio_irq_enable, 257 - .disable = gpio_irq_disable, 258 - .set_type = gpio_irq_type, 256 + .irq_enable = gpio_irq_enable, 257 + .irq_disable = gpio_irq_disable, 258 + .irq_set_type = gpio_irq_type, 259 259 }; 260 260 261 261 static void ··· 269 269 mask <<= 16; 270 270 271 271 /* temporarily mask (level sensitive) parent IRQ */ 272 - desc->chip->mask(irq); 273 - desc->chip->ack(irq); 272 + desc->irq_data.chip->irq_mask(&desc->irq_data); 273 + desc->irq_data.chip->irq_ack(&desc->irq_data); 274 274 while (1) { 275 275 u32 status; 276 276 int n; ··· 293 293 status >>= res; 294 294 } 295 295 } 296 - desc->chip->unmask(irq); 296 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 297 297 /* now it may re-trigger */ 298 298 } 299 299 ··· 320 320 return -ENODEV; 321 321 } 322 322 323 - static int gpio_irq_type_unbanked(unsigned irq, unsigned trigger) 323 + static int gpio_irq_type_unbanked(struct irq_data *d, unsigned trigger) 324 324 { 325 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 326 - u32 mask = (u32) get_irq_data(irq); 325 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 326 + u32 mask = (u32) irq_data_get_irq_data(d); 327 327 328 328 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 329 329 return -EINVAL; ··· 397 397 irq = bank_irq; 398 398 gpio_irqchip_unbanked = *get_irq_desc_chip(irq_to_desc(irq)); 399 399 gpio_irqchip_unbanked.name = "GPIO-AINTC"; 400 - gpio_irqchip_unbanked.set_type = gpio_irq_type_unbanked; 400 + gpio_irqchip_unbanked.irq_set_type = gpio_irq_type_unbanked; 401 401 402 402 /* default trigger: both edges */ 403 403 g = gpio2regs(0);
+13 -13
arch/arm/mach-davinci/irq.c
··· 53 53 } 54 54 55 55 /* Disable interrupt */ 56 - static void davinci_mask_irq(unsigned int irq) 56 + static void davinci_mask_irq(struct irq_data *d) 57 57 { 58 58 unsigned int mask; 59 59 u32 l; 60 60 61 - mask = 1 << IRQ_BIT(irq); 61 + mask = 1 << IRQ_BIT(d->irq); 62 62 63 - if (irq > 31) { 63 + if (d->irq > 31) { 64 64 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 65 65 l &= ~mask; 66 66 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 72 72 } 73 73 74 74 /* Enable interrupt */ 75 - static void davinci_unmask_irq(unsigned int irq) 75 + static void davinci_unmask_irq(struct irq_data *d) 76 76 { 77 77 unsigned int mask; 78 78 u32 l; 79 79 80 - mask = 1 << IRQ_BIT(irq); 80 + mask = 1 << IRQ_BIT(d->irq); 81 81 82 - if (irq > 31) { 82 + if (d->irq > 31) { 83 83 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 84 84 l |= mask; 85 85 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 91 91 } 92 92 93 93 /* EOI interrupt */ 94 - static void davinci_ack_irq(unsigned int irq) 94 + static void davinci_ack_irq(struct irq_data *d) 95 95 { 96 96 unsigned int mask; 97 97 98 - mask = 1 << IRQ_BIT(irq); 98 + mask = 1 << IRQ_BIT(d->irq); 99 99 100 - if (irq > 31) 100 + if (d->irq > 31) 101 101 davinci_irq_writel(mask, IRQ_REG1_OFFSET); 102 102 else 103 103 davinci_irq_writel(mask, IRQ_REG0_OFFSET); 104 104 } 105 105 106 106 static struct irq_chip davinci_irq_chip_0 = { 107 - .name = "AINTC", 108 - .ack = davinci_ack_irq, 109 - .mask = davinci_mask_irq, 110 - .unmask = davinci_unmask_irq, 107 + .name = "AINTC", 108 + .irq_ack = davinci_ack_irq, 109 + .irq_mask = davinci_mask_irq, 110 + .irq_unmask = davinci_unmask_irq, 111 111 }; 112 112 113 113 /* ARM Interrupt Controller Initialization */
+9 -9
arch/arm/mach-dove/irq.c
··· 36 36 } 37 37 } 38 38 39 - static void pmu_irq_mask(unsigned int irq) 39 + static void pmu_irq_mask(struct irq_data *d) 40 40 { 41 - int pin = irq_to_pmu(irq); 41 + int pin = irq_to_pmu(d->irq); 42 42 u32 u; 43 43 44 44 u = readl(PMU_INTERRUPT_MASK); ··· 46 46 writel(u, PMU_INTERRUPT_MASK); 47 47 } 48 48 49 - static void pmu_irq_unmask(unsigned int irq) 49 + static void pmu_irq_unmask(struct irq_data *d) 50 50 { 51 - int pin = irq_to_pmu(irq); 51 + int pin = irq_to_pmu(d->irq); 52 52 u32 u; 53 53 54 54 u = readl(PMU_INTERRUPT_MASK); ··· 56 56 writel(u, PMU_INTERRUPT_MASK); 57 57 } 58 58 59 - static void pmu_irq_ack(unsigned int irq) 59 + static void pmu_irq_ack(struct irq_data *d) 60 60 { 61 - int pin = irq_to_pmu(irq); 61 + int pin = irq_to_pmu(d->irq); 62 62 u32 u; 63 63 64 64 u = ~(1 << (pin & 31)); ··· 67 67 68 68 static struct irq_chip pmu_irq_chip = { 69 69 .name = "pmu_irq", 70 - .mask = pmu_irq_mask, 71 - .unmask = pmu_irq_unmask, 72 - .ack = pmu_irq_ack, 70 + .irq_mask = pmu_irq_mask, 71 + .irq_unmask = pmu_irq_unmask, 72 + .irq_ack = pmu_irq_ack, 73 73 }; 74 74 75 75 static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
+7 -7
arch/arm/mach-ebsa110/core.c
··· 35 35 #define IRQ_STAT 0xff000000 /* read */ 36 36 #define IRQ_MCLR 0xff000000 /* write */ 37 37 38 - static void ebsa110_mask_irq(unsigned int irq) 38 + static void ebsa110_mask_irq(struct irq_data *d) 39 39 { 40 - __raw_writeb(1 << irq, IRQ_MCLR); 40 + __raw_writeb(1 << d->irq, IRQ_MCLR); 41 41 } 42 42 43 - static void ebsa110_unmask_irq(unsigned int irq) 43 + static void ebsa110_unmask_irq(struct irq_data *d) 44 44 { 45 - __raw_writeb(1 << irq, IRQ_MSET); 45 + __raw_writeb(1 << d->irq, IRQ_MSET); 46 46 } 47 47 48 48 static struct irq_chip ebsa110_irq_chip = { 49 - .ack = ebsa110_mask_irq, 50 - .mask = ebsa110_mask_irq, 51 - .unmask = ebsa110_unmask_irq, 49 + .irq_ack = ebsa110_mask_irq, 50 + .irq_mask = ebsa110_mask_irq, 51 + .irq_unmask = ebsa110_unmask_irq, 52 52 }; 53 53 54 54 static void __init ebsa110_init_irq(void)
+18 -18
arch/arm/mach-ep93xx/gpio.c
··· 112 112 generic_handle_irq(gpio_irq); 113 113 } 114 114 115 - static void ep93xx_gpio_irq_ack(unsigned int irq) 115 + static void ep93xx_gpio_irq_ack(struct irq_data *d) 116 116 { 117 - int line = irq_to_gpio(irq); 117 + int line = irq_to_gpio(d->irq); 118 118 int port = line >> 3; 119 119 int port_mask = 1 << (line & 7); 120 120 121 - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 121 + if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 122 122 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 123 123 ep93xx_gpio_update_int_params(port); 124 124 } ··· 126 126 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 127 127 } 128 128 129 - static void ep93xx_gpio_irq_mask_ack(unsigned int irq) 129 + static void ep93xx_gpio_irq_mask_ack(struct irq_data *d) 130 130 { 131 - int line = irq_to_gpio(irq); 131 + int line = irq_to_gpio(d->irq); 132 132 int port = line >> 3; 133 133 int port_mask = 1 << (line & 7); 134 134 135 - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 135 + if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 136 136 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 137 137 138 138 gpio_int_unmasked[port] &= ~port_mask; ··· 141 141 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 142 142 } 143 143 144 - static void ep93xx_gpio_irq_mask(unsigned int irq) 144 + static void ep93xx_gpio_irq_mask(struct irq_data *d) 145 145 { 146 - int line = irq_to_gpio(irq); 146 + int line = irq_to_gpio(d->irq); 147 147 int port = line >> 3; 148 148 149 149 gpio_int_unmasked[port] &= ~(1 << (line & 7)); 150 150 ep93xx_gpio_update_int_params(port); 151 151 } 152 152 153 - static void ep93xx_gpio_irq_unmask(unsigned int irq) 153 + static void ep93xx_gpio_irq_unmask(struct irq_data *d) 154 154 { 155 - int line = irq_to_gpio(irq); 155 + int line = irq_to_gpio(d->irq); 156 156 int port = line >> 3; 157 157 158 158 gpio_int_unmasked[port] |= 1 << (line & 7); ··· 164 164 * edge (1) triggered, while gpio_int_type2 controls whether it 165 165 * triggers on low/falling (0) or high/rising (1). 166 166 */ 167 - static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type) 167 + static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type) 168 168 { 169 - struct irq_desc *desc = irq_desc + irq; 170 - const int gpio = irq_to_gpio(irq); 169 + struct irq_desc *desc = irq_desc + d->irq; 170 + const int gpio = irq_to_gpio(d->irq); 171 171 const int port = gpio >> 3; 172 172 const int port_mask = 1 << (gpio & 7); 173 173 ··· 220 220 221 221 static struct irq_chip ep93xx_gpio_irq_chip = { 222 222 .name = "GPIO", 223 - .ack = ep93xx_gpio_irq_ack, 224 - .mask_ack = ep93xx_gpio_irq_mask_ack, 225 - .mask = ep93xx_gpio_irq_mask, 226 - .unmask = ep93xx_gpio_irq_unmask, 227 - .set_type = ep93xx_gpio_irq_type, 223 + .irq_ack = ep93xx_gpio_irq_ack, 224 + .irq_mask_ack = ep93xx_gpio_irq_mask_ack, 225 + .irq_mask = ep93xx_gpio_irq_mask, 226 + .irq_unmask = ep93xx_gpio_irq_unmask, 227 + .irq_set_type = ep93xx_gpio_irq_type, 228 228 }; 229 229 230 230 void __init ep93xx_gpio_init_irq(void)
+7 -7
arch/arm/mach-footbridge/common.c
··· 75 75 IRQ_MASK_PCI_PERR, /* 19 */ 76 76 }; 77 77 78 - static void fb_mask_irq(unsigned int irq) 78 + static void fb_mask_irq(struct irq_data *d) 79 79 { 80 - *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(irq)]; 80 + *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(d->irq)]; 81 81 } 82 82 83 - static void fb_unmask_irq(unsigned int irq) 83 + static void fb_unmask_irq(struct irq_data *d) 84 84 { 85 - *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(irq)]; 85 + *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(d->irq)]; 86 86 } 87 87 88 88 static struct irq_chip fb_chip = { 89 - .ack = fb_mask_irq, 90 - .mask = fb_mask_irq, 91 - .unmask = fb_unmask_irq, 89 + .irq_ack = fb_mask_irq, 90 + .irq_mask = fb_mask_irq, 91 + .irq_unmask = fb_unmask_irq, 92 92 }; 93 93 94 94 static void __init __fb_init_irq(void)
+18 -18
arch/arm/mach-footbridge/isa-irq.c
··· 30 30 31 31 #include "common.h" 32 32 33 - static void isa_mask_pic_lo_irq(unsigned int irq) 33 + static void isa_mask_pic_lo_irq(struct irq_data *d) 34 34 { 35 - unsigned int mask = 1 << (irq & 7); 35 + unsigned int mask = 1 << (d->irq & 7); 36 36 37 37 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 38 38 } 39 39 40 - static void isa_ack_pic_lo_irq(unsigned int irq) 40 + static void isa_ack_pic_lo_irq(struct irq_data *d) 41 41 { 42 - unsigned int mask = 1 << (irq & 7); 42 + unsigned int mask = 1 << (d->irq & 7); 43 43 44 44 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 45 45 outb(0x20, PIC_LO); 46 46 } 47 47 48 - static void isa_unmask_pic_lo_irq(unsigned int irq) 48 + static void isa_unmask_pic_lo_irq(struct irq_data *d) 49 49 { 50 - unsigned int mask = 1 << (irq & 7); 50 + unsigned int mask = 1 << (d->irq & 7); 51 51 52 52 outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO); 53 53 } 54 54 55 55 static struct irq_chip isa_lo_chip = { 56 - .ack = isa_ack_pic_lo_irq, 57 - .mask = isa_mask_pic_lo_irq, 58 - .unmask = isa_unmask_pic_lo_irq, 56 + .irq_ack = isa_ack_pic_lo_irq, 57 + .irq_mask = isa_mask_pic_lo_irq, 58 + .irq_unmask = isa_unmask_pic_lo_irq, 59 59 }; 60 60 61 - static void isa_mask_pic_hi_irq(unsigned int irq) 61 + static void isa_mask_pic_hi_irq(struct irq_data *d) 62 62 { 63 - unsigned int mask = 1 << (irq & 7); 63 + unsigned int mask = 1 << (d->irq & 7); 64 64 65 65 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 66 66 } 67 67 68 - static void isa_ack_pic_hi_irq(unsigned int irq) 68 + static void isa_ack_pic_hi_irq(struct irq_data *d) 69 69 { 70 - unsigned int mask = 1 << (irq & 7); 70 + unsigned int mask = 1 << (d->irq & 7); 71 71 72 72 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 73 73 outb(0x62, PIC_LO); 74 74 outb(0x20, PIC_HI); 75 75 } 76 76 77 - static void isa_unmask_pic_hi_irq(unsigned int irq) 77 + static void isa_unmask_pic_hi_irq(struct irq_data *d) 78 78 { 79 - unsigned int mask = 1 << (irq & 7); 79 + unsigned int mask = 1 << (d->irq & 7); 80 80 81 81 outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI); 82 82 } 83 83 84 84 static struct irq_chip isa_hi_chip = { 85 - .ack = isa_ack_pic_hi_irq, 86 - .mask = isa_mask_pic_hi_irq, 87 - .unmask = isa_unmask_pic_hi_irq, 85 + .irq_ack = isa_ack_pic_hi_irq, 86 + .irq_mask = isa_mask_pic_hi_irq, 87 + .irq_unmask = isa_unmask_pic_hi_irq, 88 88 }; 89 89 90 90 static void
+13 -13
arch/arm/mach-gemini/gpio.c
··· 54 54 __raw_writel(reg, base + GPIO_INT_EN); 55 55 } 56 56 57 - static void gpio_ack_irq(unsigned int irq) 57 + static void gpio_ack_irq(struct irq_data *d) 58 58 { 59 - unsigned int gpio = irq_to_gpio(irq); 59 + unsigned int gpio = irq_to_gpio(d->irq); 60 60 unsigned int base = GPIO_BASE(gpio / 32); 61 61 62 62 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR); 63 63 } 64 64 65 - static void gpio_mask_irq(unsigned int irq) 65 + static void gpio_mask_irq(struct irq_data *d) 66 66 { 67 - unsigned int gpio = irq_to_gpio(irq); 67 + unsigned int gpio = irq_to_gpio(d->irq); 68 68 unsigned int base = GPIO_BASE(gpio / 32); 69 69 70 70 _set_gpio_irqenable(base, gpio % 32, 0); 71 71 } 72 72 73 - static void gpio_unmask_irq(unsigned int irq) 73 + static void gpio_unmask_irq(struct irq_data *d) 74 74 { 75 - unsigned int gpio = irq_to_gpio(irq); 75 + unsigned int gpio = irq_to_gpio(d->irq); 76 76 unsigned int base = GPIO_BASE(gpio / 32); 77 77 78 78 _set_gpio_irqenable(base, gpio % 32, 1); 79 79 } 80 80 81 - static int gpio_set_irq_type(unsigned int irq, unsigned int type) 81 + static int gpio_set_irq_type(struct irq_data *d, unsigned int type) 82 82 { 83 - unsigned int gpio = irq_to_gpio(irq); 83 + unsigned int gpio = irq_to_gpio(d->irq); 84 84 unsigned int gpio_mask = 1 << (gpio % 32); 85 85 unsigned int base = GPIO_BASE(gpio / 32); 86 86 unsigned int reg_both, reg_level, reg_type; ··· 120 120 __raw_writel(reg_level, base + GPIO_INT_LEVEL); 121 121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); 122 122 123 - gpio_ack_irq(irq); 123 + gpio_ack_irq(d->irq); 124 124 125 125 return 0; 126 126 } ··· 146 146 147 147 static struct irq_chip gpio_irq_chip = { 148 148 .name = "GPIO", 149 - .ack = gpio_ack_irq, 150 - .mask = gpio_mask_irq, 151 - .unmask = gpio_unmask_irq, 152 - .set_type = gpio_set_irq_type, 149 + .irq_ack = gpio_ack_irq, 150 + .irq_mask = gpio_mask_irq, 151 + .irq_unmask = gpio_unmask_irq, 152 + .irq_set_type = gpio_set_irq_type, 153 153 }; 154 154 155 155 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+10 -10
arch/arm/mach-gemini/irq.c
··· 32 32 #define FIQ_LEVEL(base_addr) (base_addr + 0x30) 33 33 #define FIQ_STATUS(base_addr) (base_addr + 0x34) 34 34 35 - static void gemini_ack_irq(unsigned int irq) 35 + static void gemini_ack_irq(struct irq_data *d) 36 36 { 37 - __raw_writel(1 << irq, IRQ_CLEAR(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 37 + __raw_writel(1 << d->irq, IRQ_CLEAR(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 38 38 } 39 39 40 - static void gemini_mask_irq(unsigned int irq) 40 + static void gemini_mask_irq(struct irq_data *d) 41 41 { 42 42 unsigned int mask; 43 43 44 44 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 45 - mask &= ~(1 << irq); 45 + mask &= ~(1 << d->irq); 46 46 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 47 47 } 48 48 49 - static void gemini_unmask_irq(unsigned int irq) 49 + static void gemini_unmask_irq(struct irq_data *d) 50 50 { 51 51 unsigned int mask; 52 52 53 53 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 54 - mask |= (1 << irq); 54 + mask |= (1 << d->irq); 55 55 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 56 56 } 57 57 58 58 static struct irq_chip gemini_irq_chip = { 59 - .name = "INTC", 60 - .ack = gemini_ack_irq, 61 - .mask = gemini_mask_irq, 62 - .unmask = gemini_unmask_irq, 59 + .name = "INTC", 60 + .irq_ack = gemini_ack_irq, 61 + .irq_mask = gemini_mask_irq, 62 + .irq_unmask = gemini_unmask_irq, 63 63 }; 64 64 65 65 static struct resource irq_resource = {
+19 -19
arch/arm/mach-h720x/common.c
··· 52 52 /* 53 53 * mask Global irq's 54 54 */ 55 - static void mask_global_irq (unsigned int irq ) 55 + static void mask_global_irq(struct irq_data *d) 56 56 { 57 - CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << irq); 57 + CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << d->irq); 58 58 } 59 59 60 60 /* 61 61 * unmask Global irq's 62 62 */ 63 - static void unmask_global_irq (unsigned int irq ) 63 + static void unmask_global_irq(struct irq_data *d) 64 64 { 65 - CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << irq); 65 + CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << d->irq); 66 66 } 67 67 68 68 ··· 70 70 * ack GPIO irq's 71 71 * Ack only for edge triggered int's valid 72 72 */ 73 - static void inline ack_gpio_irq(u32 irq) 73 + static void inline ack_gpio_irq(struct irq_data *d) 74 74 { 75 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 76 - u32 bit = IRQ_TO_BIT(irq); 75 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 76 + u32 bit = IRQ_TO_BIT(d->irq); 77 77 if ( (CPU_REG (reg_base, GPIO_EDGE) & bit)) 78 78 CPU_REG (reg_base, GPIO_CLR) = bit; 79 79 } ··· 81 81 /* 82 82 * mask GPIO irq's 83 83 */ 84 - static void inline mask_gpio_irq(u32 irq) 84 + static void inline mask_gpio_irq(struct irq_data *d) 85 85 { 86 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 87 - u32 bit = IRQ_TO_BIT(irq); 86 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 87 + u32 bit = IRQ_TO_BIT(d->irq); 88 88 CPU_REG (reg_base, GPIO_MASK) &= ~bit; 89 89 } 90 90 91 91 /* 92 92 * unmask GPIO irq's 93 93 */ 94 - static void inline unmask_gpio_irq(u32 irq) 94 + static void inline unmask_gpio_irq(struct irq_data *d) 95 95 { 96 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 97 - u32 bit = IRQ_TO_BIT(irq); 96 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 97 + u32 bit = IRQ_TO_BIT(d->irq); 98 98 CPU_REG (reg_base, GPIO_MASK) |= bit; 99 99 } 100 100 ··· 170 170 #endif 171 171 172 172 static struct irq_chip h720x_global_chip = { 173 - .ack = mask_global_irq, 174 - .mask = mask_global_irq, 175 - .unmask = unmask_global_irq, 173 + .irq_ack = mask_global_irq, 174 + .irq_mask = mask_global_irq, 175 + .irq_unmask = unmask_global_irq, 176 176 }; 177 177 178 178 static struct irq_chip h720x_gpio_chip = { 179 - .ack = ack_gpio_irq, 180 - .mask = mask_gpio_irq, 181 - .unmask = unmask_gpio_irq, 179 + .irq_ack = ack_gpio_irq, 180 + .irq_mask = mask_gpio_irq, 181 + .irq_unmask = unmask_gpio_irq, 182 182 }; 183 183 184 184 /*
+7 -7
arch/arm/mach-h720x/cpu-h7202.c
··· 141 141 /* 142 142 * mask multiplexed timer IRQs 143 143 */ 144 - static void inline mask_timerx_irq (u32 irq) 144 + static void inline mask_timerx_irq(struct irq_data *d) 145 145 { 146 146 unsigned int bit; 147 - bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); 147 + bit = 2 << ((d->irq == IRQ_TIMER64B) ? 4 : (d->irq - IRQ_TIMER1)); 148 148 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) &= ~bit; 149 149 } 150 150 151 151 /* 152 152 * unmask multiplexed timer IRQs 153 153 */ 154 - static void inline unmask_timerx_irq (u32 irq) 154 + static void inline unmask_timerx_irq(struct irq_data *d) 155 155 { 156 156 unsigned int bit; 157 - bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); 157 + bit = 2 << ((d->irq == IRQ_TIMER64B) ? 4 : (d->irq - IRQ_TIMER1)); 158 158 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) |= bit; 159 159 } 160 160 161 161 static struct irq_chip h7202_timerx_chip = { 162 - .ack = mask_timerx_irq, 163 - .mask = mask_timerx_irq, 164 - .unmask = unmask_timerx_irq, 162 + .irq_ack = mask_timerx_irq, 163 + .irq_mask = mask_timerx_irq, 164 + .irq_unmask = unmask_timerx_irq, 165 165 }; 166 166 167 167 static struct irqaction h7202_timer_irq = {
+1
arch/arm/mach-imx/Kconfig
··· 243 243 select IMX_HAVE_PLATFORM_MXC_EHCI 244 244 select IMX_HAVE_PLATFORM_MXC_MMC 245 245 select IMX_HAVE_PLATFORM_SPI_IMX 246 + select MXC_DEBUG_BOARD 246 247 select MXC_ULPI if USB_ULPI 247 248 help 248 249 Include support for MX27PDK platform. This includes specific
+8 -2
arch/arm/mach-imx/mach-mx27_3ds.c
··· 37 37 #include <mach/common.h> 38 38 #include <mach/iomux-mx27.h> 39 39 #include <mach/ulpi.h> 40 + #include <mach/irqs.h> 41 + #include <mach/3ds_debugboard.h> 40 42 41 43 #include "devices-imx27.h" 42 44 43 45 #define SD1_EN_GPIO (GPIO_PORTB + 25) 44 46 #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) 45 47 #define SPI2_SS0 (GPIO_PORTD + 21) 48 + #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28) 46 49 47 50 static const int mx27pdk_pins[] __initconst = { 48 51 /* UART1 */ ··· 218 215 219 216 static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { 220 217 { 221 - .id = MC13783_REGU_VMMC1, 218 + .id = MC13783_REG_VMMC1, 222 219 .init_data = &vmmc1_init, 223 220 }, { 224 - .id = MC13783_REGU_VGEN, 221 + .id = MC13783_REG_VGEN, 225 222 .init_data = &vgen_init, 226 223 }, 227 224 }; ··· 279 276 imx27_add_spi_imx1(&spi2_pdata); 280 277 spi_register_board_info(mx27_3ds_spi_devs, 281 278 ARRAY_SIZE(mx27_3ds_spi_devs)); 279 + 280 + if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 281 + pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 282 282 } 283 283 284 284 static void __init mx27pdk_timer_init(void)
+8 -8
arch/arm/mach-integrator/integrator_ap.c
··· 156 156 157 157 #define INTEGRATOR_SC_VALID_INT 0x003fffff 158 158 159 - static void sc_mask_irq(unsigned int irq) 159 + static void sc_mask_irq(struct irq_data *d) 160 160 { 161 - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); 161 + writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); 162 162 } 163 163 164 - static void sc_unmask_irq(unsigned int irq) 164 + static void sc_unmask_irq(struct irq_data *d) 165 165 { 166 - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET); 166 + writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_SET); 167 167 } 168 168 169 169 static struct irq_chip sc_chip = { 170 - .name = "SC", 171 - .ack = sc_mask_irq, 172 - .mask = sc_mask_irq, 173 - .unmask = sc_unmask_irq, 170 + .name = "SC", 171 + .irq_ack = sc_mask_irq, 172 + .irq_mask = sc_mask_irq, 173 + .irq_unmask = sc_unmask_irq, 174 174 }; 175 175 176 176 static void __init ap_init_irq(void)
+24 -24
arch/arm/mach-integrator/integrator_cp.c
··· 146 146 #define sic_writel __raw_writel 147 147 #define sic_readl __raw_readl 148 148 149 - static void cic_mask_irq(unsigned int irq) 149 + static void cic_mask_irq(struct irq_data *d) 150 150 { 151 - irq -= IRQ_CIC_START; 151 + unsigned int irq = d->irq - IRQ_CIC_START; 152 152 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 153 153 } 154 154 155 - static void cic_unmask_irq(unsigned int irq) 155 + static void cic_unmask_irq(struct irq_data *d) 156 156 { 157 - irq -= IRQ_CIC_START; 157 + unsigned int irq = d->irq - IRQ_CIC_START; 158 158 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET); 159 159 } 160 160 161 161 static struct irq_chip cic_chip = { 162 - .name = "CIC", 163 - .ack = cic_mask_irq, 164 - .mask = cic_mask_irq, 165 - .unmask = cic_unmask_irq, 162 + .name = "CIC", 163 + .irq_ack = cic_mask_irq, 164 + .irq_mask = cic_mask_irq, 165 + .irq_unmask = cic_unmask_irq, 166 166 }; 167 167 168 - static void pic_mask_irq(unsigned int irq) 168 + static void pic_mask_irq(struct irq_data *d) 169 169 { 170 - irq -= IRQ_PIC_START; 170 + unsigned int irq = d->irq - IRQ_PIC_START; 171 171 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 172 172 } 173 173 174 - static void pic_unmask_irq(unsigned int irq) 174 + static void pic_unmask_irq(struct irq_data *d) 175 175 { 176 - irq -= IRQ_PIC_START; 176 + unsigned int irq = d->irq - IRQ_PIC_START; 177 177 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET); 178 178 } 179 179 180 180 static struct irq_chip pic_chip = { 181 - .name = "PIC", 182 - .ack = pic_mask_irq, 183 - .mask = pic_mask_irq, 184 - .unmask = pic_unmask_irq, 181 + .name = "PIC", 182 + .irq_ack = pic_mask_irq, 183 + .irq_mask = pic_mask_irq, 184 + .irq_unmask = pic_unmask_irq, 185 185 }; 186 186 187 - static void sic_mask_irq(unsigned int irq) 187 + static void sic_mask_irq(struct irq_data *d) 188 188 { 189 - irq -= IRQ_SIC_START; 189 + unsigned int irq = d->irq - IRQ_SIC_START; 190 190 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 191 191 } 192 192 193 - static void sic_unmask_irq(unsigned int irq) 193 + static void sic_unmask_irq(struct irq_data *d) 194 194 { 195 - irq -= IRQ_SIC_START; 195 + unsigned int irq = d->irq - IRQ_SIC_START; 196 196 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET); 197 197 } 198 198 199 199 static struct irq_chip sic_chip = { 200 - .name = "SIC", 201 - .ack = sic_mask_irq, 202 - .mask = sic_mask_irq, 203 - .unmask = sic_unmask_irq, 200 + .name = "SIC", 201 + .irq_ack = sic_mask_irq, 202 + .irq_mask = sic_mask_irq, 203 + .irq_unmask = sic_unmask_irq, 204 204 }; 205 205 206 206 static void
+32 -32
arch/arm/mach-iop13xx/irq.c
··· 123 123 124 124 /* 0 = Interrupt Masked and 1 = Interrupt not masked */ 125 125 static void 126 - iop13xx_irq_mask0 (unsigned int irq) 126 + iop13xx_irq_mask0 (struct irq_data *d) 127 127 { 128 - write_intctl_0(read_intctl_0() & ~(1 << (irq - 0))); 128 + write_intctl_0(read_intctl_0() & ~(1 << (d->irq - 0))); 129 129 } 130 130 131 131 static void 132 - iop13xx_irq_mask1 (unsigned int irq) 132 + iop13xx_irq_mask1 (struct irq_data *d) 133 133 { 134 - write_intctl_1(read_intctl_1() & ~(1 << (irq - 32))); 134 + write_intctl_1(read_intctl_1() & ~(1 << (d->irq - 32))); 135 135 } 136 136 137 137 static void 138 - iop13xx_irq_mask2 (unsigned int irq) 138 + iop13xx_irq_mask2 (struct irq_data *d) 139 139 { 140 - write_intctl_2(read_intctl_2() & ~(1 << (irq - 64))); 140 + write_intctl_2(read_intctl_2() & ~(1 << (d->irq - 64))); 141 141 } 142 142 143 143 static void 144 - iop13xx_irq_mask3 (unsigned int irq) 144 + iop13xx_irq_mask3 (struct irq_data *d) 145 145 { 146 - write_intctl_3(read_intctl_3() & ~(1 << (irq - 96))); 146 + write_intctl_3(read_intctl_3() & ~(1 << (d->irq - 96))); 147 147 } 148 148 149 149 static void 150 - iop13xx_irq_unmask0(unsigned int irq) 150 + iop13xx_irq_unmask0(struct irq_data *d) 151 151 { 152 - write_intctl_0(read_intctl_0() | (1 << (irq - 0))); 152 + write_intctl_0(read_intctl_0() | (1 << (d->irq - 0))); 153 153 } 154 154 155 155 static void 156 - iop13xx_irq_unmask1(unsigned int irq) 156 + iop13xx_irq_unmask1(struct irq_data *d) 157 157 { 158 - write_intctl_1(read_intctl_1() | (1 << (irq - 32))); 158 + write_intctl_1(read_intctl_1() | (1 << (d->irq - 32))); 159 159 } 160 160 161 161 static void 162 - iop13xx_irq_unmask2(unsigned int irq) 162 + iop13xx_irq_unmask2(struct irq_data *d) 163 163 { 164 - write_intctl_2(read_intctl_2() | (1 << (irq - 64))); 164 + write_intctl_2(read_intctl_2() | (1 << (d->irq - 64))); 165 165 } 166 166 167 167 static void 168 - iop13xx_irq_unmask3(unsigned int irq) 168 + iop13xx_irq_unmask3(struct irq_data *d) 169 169 { 170 - write_intctl_3(read_intctl_3() | (1 << (irq - 96))); 170 + write_intctl_3(read_intctl_3() | (1 << (d->irq - 96))); 171 171 } 172 172 173 173 static struct irq_chip iop13xx_irqchip1 = { 174 - .name = "IOP13xx-1", 175 - .ack = iop13xx_irq_mask0, 176 - .mask = iop13xx_irq_mask0, 177 - .unmask = iop13xx_irq_unmask0, 174 + .name = "IOP13xx-1", 175 + .irq_ack = iop13xx_irq_mask0, 176 + .irq_mask = iop13xx_irq_mask0, 177 + .irq_unmask = iop13xx_irq_unmask0, 178 178 }; 179 179 180 180 static struct irq_chip iop13xx_irqchip2 = { 181 - .name = "IOP13xx-2", 182 - .ack = iop13xx_irq_mask1, 183 - .mask = iop13xx_irq_mask1, 184 - .unmask = iop13xx_irq_unmask1, 181 + .name = "IOP13xx-2", 182 + .irq_ack = iop13xx_irq_mask1, 183 + .irq_mask = iop13xx_irq_mask1, 184 + .irq_unmask = iop13xx_irq_unmask1, 185 185 }; 186 186 187 187 static struct irq_chip iop13xx_irqchip3 = { 188 - .name = "IOP13xx-3", 189 - .ack = iop13xx_irq_mask2, 190 - .mask = iop13xx_irq_mask2, 191 - .unmask = iop13xx_irq_unmask2, 188 + .name = "IOP13xx-3", 189 + .irq_ack = iop13xx_irq_mask2, 190 + .irq_mask = iop13xx_irq_mask2, 191 + .irq_unmask = iop13xx_irq_unmask2, 192 192 }; 193 193 194 194 static struct irq_chip iop13xx_irqchip4 = { 195 - .name = "IOP13xx-4", 196 - .ack = iop13xx_irq_mask3, 197 - .mask = iop13xx_irq_mask3, 198 - .unmask = iop13xx_irq_unmask3, 195 + .name = "IOP13xx-4", 196 + .irq_ack = iop13xx_irq_mask3, 197 + .irq_mask = iop13xx_irq_mask3, 198 + .irq_unmask = iop13xx_irq_unmask3, 199 199 }; 200 200 201 201 extern void iop_init_cp6_handler(void);
+2 -2
arch/arm/mach-iop13xx/msi.c
··· 156 156 destroy_irq(irq); 157 157 } 158 158 159 - static void iop13xx_msi_nop(unsigned int irq) 159 + static void iop13xx_msi_nop(struct irq_data *d) 160 160 { 161 161 return; 162 162 } 163 163 164 164 static struct irq_chip iop13xx_msi_chip = { 165 165 .name = "PCI-MSI", 166 - .ack = iop13xx_msi_nop, 166 + .irq_ack = iop13xx_msi_nop, 167 167 .irq_enable = unmask_msi_irq, 168 168 .irq_disable = mask_msi_irq, 169 169 .irq_mask = mask_msi_irq,
+8 -8
arch/arm/mach-iop32x/irq.c
··· 32 32 } 33 33 34 34 static void 35 - iop32x_irq_mask(unsigned int irq) 35 + iop32x_irq_mask(struct irq_data *d) 36 36 { 37 - iop32x_mask &= ~(1 << irq); 37 + iop32x_mask &= ~(1 << d->irq); 38 38 intctl_write(iop32x_mask); 39 39 } 40 40 41 41 static void 42 - iop32x_irq_unmask(unsigned int irq) 42 + iop32x_irq_unmask(struct irq_data *d) 43 43 { 44 - iop32x_mask |= 1 << irq; 44 + iop32x_mask |= 1 << d->irq; 45 45 intctl_write(iop32x_mask); 46 46 } 47 47 48 48 struct irq_chip ext_chip = { 49 - .name = "IOP32x", 50 - .ack = iop32x_irq_mask, 51 - .mask = iop32x_irq_mask, 52 - .unmask = iop32x_irq_unmask, 49 + .name = "IOP32x", 50 + .irq_ack = iop32x_irq_mask, 51 + .irq_mask = iop32x_irq_mask, 52 + .irq_unmask = iop32x_irq_unmask, 53 53 }; 54 54 55 55 void __init iop32x_init_irq(void)
+16 -16
arch/arm/mach-iop33x/irq.c
··· 53 53 } 54 54 55 55 static void 56 - iop33x_irq_mask1 (unsigned int irq) 56 + iop33x_irq_mask1 (struct irq_data *d) 57 57 { 58 - iop33x_mask0 &= ~(1 << irq); 58 + iop33x_mask0 &= ~(1 << d->irq); 59 59 intctl0_write(iop33x_mask0); 60 60 } 61 61 62 62 static void 63 - iop33x_irq_mask2 (unsigned int irq) 63 + iop33x_irq_mask2 (struct irq_data *d) 64 64 { 65 - iop33x_mask1 &= ~(1 << (irq - 32)); 65 + iop33x_mask1 &= ~(1 << (d->irq - 32)); 66 66 intctl1_write(iop33x_mask1); 67 67 } 68 68 69 69 static void 70 - iop33x_irq_unmask1(unsigned int irq) 70 + iop33x_irq_unmask1(struct irq_data *d) 71 71 { 72 - iop33x_mask0 |= 1 << irq; 72 + iop33x_mask0 |= 1 << d->irq; 73 73 intctl0_write(iop33x_mask0); 74 74 } 75 75 76 76 static void 77 - iop33x_irq_unmask2(unsigned int irq) 77 + iop33x_irq_unmask2(struct irq_data *d) 78 78 { 79 - iop33x_mask1 |= (1 << (irq - 32)); 79 + iop33x_mask1 |= (1 << (d->irq - 32)); 80 80 intctl1_write(iop33x_mask1); 81 81 } 82 82 83 83 struct irq_chip iop33x_irqchip1 = { 84 - .name = "IOP33x-1", 85 - .ack = iop33x_irq_mask1, 86 - .mask = iop33x_irq_mask1, 87 - .unmask = iop33x_irq_unmask1, 84 + .name = "IOP33x-1", 85 + .irq_ack = iop33x_irq_mask1, 86 + .irq_mask = iop33x_irq_mask1, 87 + .irq_unmask = iop33x_irq_unmask1, 88 88 }; 89 89 90 90 struct irq_chip iop33x_irqchip2 = { 91 - .name = "IOP33x-2", 92 - .ack = iop33x_irq_mask2, 93 - .mask = iop33x_irq_mask2, 94 - .unmask = iop33x_irq_unmask2, 91 + .name = "IOP33x-2", 92 + .irq_ack = iop33x_irq_mask2, 93 + .irq_mask = iop33x_irq_mask2, 94 + .irq_unmask = iop33x_irq_unmask2, 95 95 }; 96 96 97 97 void __init iop33x_init_irq(void)
+38 -32
arch/arm/mach-ixp2000/core.c
··· 309 309 } 310 310 } 311 311 312 - static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type) 312 + static int ixp2000_GPIO_irq_type(struct irq_data *d, unsigned int type) 313 313 { 314 - int line = irq - IRQ_IXP2000_GPIO0; 314 + int line = d->irq - IRQ_IXP2000_GPIO0; 315 315 316 316 /* 317 317 * First, configure this GPIO line as an input. ··· 342 342 return 0; 343 343 } 344 344 345 - static void ixp2000_GPIO_irq_mask_ack(unsigned int irq) 345 + static void ixp2000_GPIO_irq_mask_ack(struct irq_data *d) 346 346 { 347 + unsigned int irq = d->irq; 348 + 347 349 ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 348 350 349 351 ixp2000_reg_write(IXP2000_GPIO_EDSR, (1 << (irq - IRQ_IXP2000_GPIO0))); ··· 353 351 ixp2000_reg_wrb(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0))); 354 352 } 355 353 356 - static void ixp2000_GPIO_irq_mask(unsigned int irq) 354 + static void ixp2000_GPIO_irq_mask(struct irq_data *d) 357 355 { 356 + unsigned int irq = d->irq; 357 + 358 358 ixp2000_reg_wrb(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 359 359 } 360 360 361 - static void ixp2000_GPIO_irq_unmask(unsigned int irq) 361 + static void ixp2000_GPIO_irq_unmask(struct irq_data *d) 362 362 { 363 + unsigned int irq = d->irq; 364 + 363 365 ixp2000_reg_write(IXP2000_GPIO_INSR, (1 << (irq - IRQ_IXP2000_GPIO0))); 364 366 } 365 367 366 368 static struct irq_chip ixp2000_GPIO_irq_chip = { 367 - .ack = ixp2000_GPIO_irq_mask_ack, 368 - .mask = ixp2000_GPIO_irq_mask, 369 - .unmask = ixp2000_GPIO_irq_unmask, 370 - .set_type = ixp2000_GPIO_irq_type, 369 + .irq_ack = ixp2000_GPIO_irq_mask_ack, 370 + .irq_mask = ixp2000_GPIO_irq_mask, 371 + .irq_unmask = ixp2000_GPIO_irq_unmask, 372 + .irq_set_type = ixp2000_GPIO_irq_type, 371 373 }; 372 374 373 - static void ixp2000_pci_irq_mask(unsigned int irq) 375 + static void ixp2000_pci_irq_mask(struct irq_data *d) 374 376 { 375 377 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 376 - if (irq == IRQ_IXP2000_PCIA) 378 + if (d->irq == IRQ_IXP2000_PCIA) 377 379 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 26))); 378 - else if (irq == IRQ_IXP2000_PCIB) 380 + else if (d->irq == IRQ_IXP2000_PCIB) 379 381 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 27))); 380 382 } 381 383 382 - static void ixp2000_pci_irq_unmask(unsigned int irq) 384 + static void ixp2000_pci_irq_unmask(struct irq_data *d) 383 385 { 384 386 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 385 - if (irq == IRQ_IXP2000_PCIA) 387 + if (d->irq == IRQ_IXP2000_PCIA) 386 388 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 26))); 387 - else if (irq == IRQ_IXP2000_PCIB) 389 + else if (d->irq == IRQ_IXP2000_PCIB) 388 390 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27))); 389 391 } 390 392 ··· 407 401 } 408 402 } 409 403 410 - static void ixp2000_err_irq_mask(unsigned int irq) 404 + static void ixp2000_err_irq_mask(struct irq_data *d) 411 405 { 412 406 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR, 413 - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 407 + (1 << (d->irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 414 408 } 415 409 416 - static void ixp2000_err_irq_unmask(unsigned int irq) 410 + static void ixp2000_err_irq_unmask(struct irq_data *d) 417 411 { 418 412 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET, 419 - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 413 + (1 << (d->irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 420 414 } 421 415 422 416 static struct irq_chip ixp2000_err_irq_chip = { 423 - .ack = ixp2000_err_irq_mask, 424 - .mask = ixp2000_err_irq_mask, 425 - .unmask = ixp2000_err_irq_unmask 417 + .irq_ack = ixp2000_err_irq_mask, 418 + .irq_mask = ixp2000_err_irq_mask, 419 + .irq_unmask = ixp2000_err_irq_unmask 426 420 }; 427 421 428 422 static struct irq_chip ixp2000_pci_irq_chip = { 429 - .ack = ixp2000_pci_irq_mask, 430 - .mask = ixp2000_pci_irq_mask, 431 - .unmask = ixp2000_pci_irq_unmask 423 + .irq_ack = ixp2000_pci_irq_mask, 424 + .irq_mask = ixp2000_pci_irq_mask, 425 + .irq_unmask = ixp2000_pci_irq_unmask 432 426 }; 433 427 434 - static void ixp2000_irq_mask(unsigned int irq) 428 + static void ixp2000_irq_mask(struct irq_data *d) 435 429 { 436 - ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << irq)); 430 + ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << d->irq)); 437 431 } 438 432 439 - static void ixp2000_irq_unmask(unsigned int irq) 433 + static void ixp2000_irq_unmask(struct irq_data *d) 440 434 { 441 - ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq)); 435 + ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << d->irq)); 442 436 } 443 437 444 438 static struct irq_chip ixp2000_irq_chip = { 445 - .ack = ixp2000_irq_mask, 446 - .mask = ixp2000_irq_mask, 447 - .unmask = ixp2000_irq_unmask 439 + .irq_ack = ixp2000_irq_mask, 440 + .irq_mask = ixp2000_irq_mask, 441 + .irq_unmask = ixp2000_irq_unmask 448 442 }; 449 443 450 444 void __init ixp2000_init_irq(void)
+9 -9
arch/arm/mach-ixp2000/ixdp2x00.c
··· 63 63 }; 64 64 #endif 65 65 66 - static void ixdp2x00_irq_mask(unsigned int irq) 66 + static void ixdp2x00_irq_mask(struct irq_data *d) 67 67 { 68 68 unsigned long dummy; 69 69 static struct slowport_cfg old_cfg; ··· 78 78 #endif 79 79 80 80 dummy = *board_irq_mask; 81 - dummy |= IXP2000_BOARD_IRQ_MASK(irq); 81 + dummy |= IXP2000_BOARD_IRQ_MASK(d->irq); 82 82 ixp2000_reg_wrb(board_irq_mask, dummy); 83 83 84 84 #ifdef CONFIG_ARCH_IXDP2400 ··· 87 87 #endif 88 88 } 89 89 90 - static void ixdp2x00_irq_unmask(unsigned int irq) 90 + static void ixdp2x00_irq_unmask(struct irq_data *d) 91 91 { 92 92 unsigned long dummy; 93 93 static struct slowport_cfg old_cfg; ··· 98 98 #endif 99 99 100 100 dummy = *board_irq_mask; 101 - dummy &= ~IXP2000_BOARD_IRQ_MASK(irq); 101 + dummy &= ~IXP2000_BOARD_IRQ_MASK(d->irq); 102 102 ixp2000_reg_wrb(board_irq_mask, dummy); 103 103 104 104 if (machine_is_ixdp2400()) ··· 111 111 static struct slowport_cfg old_cfg; 112 112 int i; 113 113 114 - desc->chip->mask(irq); 114 + desc->irq_data.chip->irq_mask(&desc->irq_data); 115 115 116 116 #ifdef CONFIG_ARCH_IXDP2400 117 117 if (machine_is_ixdp2400()) ··· 133 133 } 134 134 } 135 135 136 - desc->chip->unmask(irq); 136 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 137 137 } 138 138 139 139 static struct irq_chip ixdp2x00_cpld_irq_chip = { 140 - .ack = ixdp2x00_irq_mask, 141 - .mask = ixdp2x00_irq_mask, 142 - .unmask = ixdp2x00_irq_unmask 140 + .irq_ack = ixdp2x00_irq_mask, 141 + .irq_mask = ixdp2x00_irq_mask, 142 + .irq_unmask = ixdp2x00_irq_unmask 143 143 }; 144 144 145 145 void __init ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_of_irqs)
+9 -9
arch/arm/mach-ixp2000/ixdp2x01.c
··· 48 48 /************************************************************************* 49 49 * IXDP2x01 IRQ Handling 50 50 *************************************************************************/ 51 - static void ixdp2x01_irq_mask(unsigned int irq) 51 + static void ixdp2x01_irq_mask(struct irq_data *d) 52 52 { 53 53 ixp2000_reg_wrb(IXDP2X01_INT_MASK_SET_REG, 54 - IXP2000_BOARD_IRQ_MASK(irq)); 54 + IXP2000_BOARD_IRQ_MASK(d->irq)); 55 55 } 56 56 57 - static void ixdp2x01_irq_unmask(unsigned int irq) 57 + static void ixdp2x01_irq_unmask(struct irq_data *d) 58 58 { 59 59 ixp2000_reg_write(IXDP2X01_INT_MASK_CLR_REG, 60 - IXP2000_BOARD_IRQ_MASK(irq)); 60 + IXP2000_BOARD_IRQ_MASK(d->irq)); 61 61 } 62 62 63 63 static u32 valid_irq_mask; ··· 67 67 u32 ex_interrupt; 68 68 int i; 69 69 70 - desc->chip->mask(irq); 70 + desc->irq_data.chip->irq_mask(&desc->irq_data); 71 71 72 72 ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask; 73 73 ··· 83 83 } 84 84 } 85 85 86 - desc->chip->unmask(irq); 86 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 87 87 } 88 88 89 89 static struct irq_chip ixdp2x01_irq_chip = { 90 - .mask = ixdp2x01_irq_mask, 91 - .ack = ixdp2x01_irq_mask, 92 - .unmask = ixdp2x01_irq_unmask 90 + .irq_mask = ixdp2x01_irq_mask, 91 + .irq_ack = ixdp2x01_irq_mask, 92 + .irq_unmask = ixdp2x01_irq_unmask 93 93 }; 94 94 95 95 /*
+31 -24
arch/arm/mach-ixp23xx/core.c
··· 111 111 112 112 static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type); 113 113 114 - static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type) 114 + static int ixp23xx_irq_set_type(struct irq_data *d, unsigned int type) 115 115 { 116 - int line = irq - IRQ_IXP23XX_GPIO6 + 6; 116 + int line = d->irq - IRQ_IXP23XX_GPIO6 + 6; 117 117 u32 int_style; 118 118 enum ixp23xx_irq_type irq_type; 119 119 volatile u32 *int_reg; ··· 149 149 return -EINVAL; 150 150 } 151 151 152 - ixp23xx_config_irq(irq, irq_type); 152 + ixp23xx_config_irq(d->irq, irq_type); 153 153 154 154 if (line >= 8) { /* pins 8-15 */ 155 155 line -= 8; ··· 173 173 return 0; 174 174 } 175 175 176 - static void ixp23xx_irq_mask(unsigned int irq) 176 + static void ixp23xx_irq_mask(struct irq_data *d) 177 177 { 178 178 volatile unsigned long *intr_reg; 179 + unsigned int irq = d->irq; 179 180 180 181 if (irq >= 56) 181 182 irq += 8; ··· 185 184 *intr_reg &= ~(1 << (irq % 32)); 186 185 } 187 186 188 - static void ixp23xx_irq_ack(unsigned int irq) 187 + static void ixp23xx_irq_ack(struct irq_data *d) 189 188 { 190 - int line = irq - IRQ_IXP23XX_GPIO6 + 6; 189 + int line = d->irq - IRQ_IXP23XX_GPIO6 + 6; 191 190 192 191 if ((line < 6) || (line > 15)) 193 192 return; ··· 199 198 * Level triggered interrupts on GPIO lines can only be cleared when the 200 199 * interrupt condition disappears. 201 200 */ 202 - static void ixp23xx_irq_level_unmask(unsigned int irq) 201 + static void ixp23xx_irq_level_unmask(struct irq_data *d) 203 202 { 204 203 volatile unsigned long *intr_reg; 204 + unsigned int irq = d->irq; 205 205 206 - ixp23xx_irq_ack(irq); 206 + ixp23xx_irq_ack(d); 207 207 208 208 if (irq >= 56) 209 209 irq += 8; ··· 213 211 *intr_reg |= (1 << (irq % 32)); 214 212 } 215 213 216 - static void ixp23xx_irq_edge_unmask(unsigned int irq) 214 + static void ixp23xx_irq_edge_unmask(struct irq_data *d) 217 215 { 218 216 volatile unsigned long *intr_reg; 217 + unsigned int irq = d->irq; 219 218 220 219 if (irq >= 56) 221 220 irq += 8; ··· 226 223 } 227 224 228 225 static struct irq_chip ixp23xx_irq_level_chip = { 229 - .ack = ixp23xx_irq_mask, 230 - .mask = ixp23xx_irq_mask, 231 - .unmask = ixp23xx_irq_level_unmask, 232 - .set_type = ixp23xx_irq_set_type 226 + .irq_ack = ixp23xx_irq_mask, 227 + .irq_mask = ixp23xx_irq_mask, 228 + .irq_unmask = ixp23xx_irq_level_unmask, 229 + .irq_set_type = ixp23xx_irq_set_type 233 230 }; 234 231 235 232 static struct irq_chip ixp23xx_irq_edge_chip = { 236 - .ack = ixp23xx_irq_ack, 237 - .mask = ixp23xx_irq_mask, 238 - .unmask = ixp23xx_irq_edge_unmask, 239 - .set_type = ixp23xx_irq_set_type 233 + .irq_ack = ixp23xx_irq_ack, 234 + .irq_mask = ixp23xx_irq_mask, 235 + .irq_unmask = ixp23xx_irq_edge_unmask, 236 + .irq_set_type = ixp23xx_irq_set_type 240 237 }; 241 238 242 - static void ixp23xx_pci_irq_mask(unsigned int irq) 239 + static void ixp23xx_pci_irq_mask(struct irq_data *d) 243 240 { 241 + unsigned int irq = d->irq; 242 + 244 243 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq)); 245 244 } 246 245 247 - static void ixp23xx_pci_irq_unmask(unsigned int irq) 246 + static void ixp23xx_pci_irq_unmask(struct irq_data *d) 248 247 { 248 + unsigned int irq = d->irq; 249 + 249 250 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq)); 250 251 } 251 252 ··· 263 256 264 257 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS; 265 258 266 - desc->chip->ack(irq); 259 + desc->irq_data.chip->irq_ack(&desc->irq_data); 267 260 268 261 /* See which PCI_INTA, or PCI_INTB interrupted */ 269 262 if (pci_interrupt & (1 << 26)) { ··· 276 269 277 270 generic_handle_irq(irqno); 278 271 279 - desc->chip->unmask(irq); 272 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 280 273 } 281 274 282 275 static struct irq_chip ixp23xx_pci_irq_chip = { 283 - .ack = ixp23xx_pci_irq_mask, 284 - .mask = ixp23xx_pci_irq_mask, 285 - .unmask = ixp23xx_pci_irq_unmask 276 + .irq_ack = ixp23xx_pci_irq_mask, 277 + .irq_mask = ixp23xx_pci_irq_mask, 278 + .irq_unmask = ixp23xx_pci_irq_unmask 286 279 }; 287 280 288 281 static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type)
+18 -18
arch/arm/mach-ixp23xx/ixdp2351.c
··· 48 48 /* 49 49 * IXDP2351 Interrupt Handling 50 50 */ 51 - static void ixdp2351_inta_mask(unsigned int irq) 51 + static void ixdp2351_inta_mask(struct irq_data *d) 52 52 { 53 - *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(irq); 53 + *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(d->irq); 54 54 } 55 55 56 - static void ixdp2351_inta_unmask(unsigned int irq) 56 + static void ixdp2351_inta_unmask(struct irq_data *d) 57 57 { 58 - *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(irq); 58 + *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(d->irq); 59 59 } 60 60 61 61 static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc) ··· 64 64 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID; 65 65 int i; 66 66 67 - desc->chip->mask(irq); 67 + desc->irq_data.chip->irq_mask(&desc->irq_data); 68 68 69 69 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) { 70 70 if (ex_interrupt & (1 << i)) { ··· 74 74 } 75 75 } 76 76 77 - desc->chip->unmask(irq); 77 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 78 78 } 79 79 80 80 static struct irq_chip ixdp2351_inta_chip = { 81 - .ack = ixdp2351_inta_mask, 82 - .mask = ixdp2351_inta_mask, 83 - .unmask = ixdp2351_inta_unmask 81 + .irq_ack = ixdp2351_inta_mask, 82 + .irq_mask = ixdp2351_inta_mask, 83 + .irq_unmask = ixdp2351_inta_unmask 84 84 }; 85 85 86 - static void ixdp2351_intb_mask(unsigned int irq) 86 + static void ixdp2351_intb_mask(struct irq_data *d) 87 87 { 88 - *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(irq); 88 + *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(d->irq); 89 89 } 90 90 91 - static void ixdp2351_intb_unmask(unsigned int irq) 91 + static void ixdp2351_intb_unmask(struct irq_data *d) 92 92 { 93 - *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(irq); 93 + *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(d->irq); 94 94 } 95 95 96 96 static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc) ··· 99 99 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID; 100 100 int i; 101 101 102 - desc->chip->ack(irq); 102 + desc->irq_data.chip->irq_ack(&desc->irq_data); 103 103 104 104 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) { 105 105 if (ex_interrupt & (1 << i)) { ··· 109 109 } 110 110 } 111 111 112 - desc->chip->unmask(irq); 112 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 113 113 } 114 114 115 115 static struct irq_chip ixdp2351_intb_chip = { 116 - .ack = ixdp2351_intb_mask, 117 - .mask = ixdp2351_intb_mask, 118 - .unmask = ixdp2351_intb_unmask 116 + .irq_ack = ixdp2351_intb_mask, 117 + .irq_mask = ixdp2351_intb_mask, 118 + .irq_unmask = ixdp2351_intb_unmask 119 119 }; 120 120 121 121 void __init ixdp2351_init_irq(void)
+21 -21
arch/arm/mach-ixp4xx/common.c
··· 128 128 } 129 129 EXPORT_SYMBOL(irq_to_gpio); 130 130 131 - static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) 131 + static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) 132 132 { 133 - int line = irq2gpio[irq]; 133 + int line = irq2gpio[d->irq]; 134 134 u32 int_style; 135 135 enum ixp4xx_irq_type irq_type; 136 136 volatile u32 *int_reg; ··· 167 167 } 168 168 169 169 if (irq_type == IXP4XX_IRQ_EDGE) 170 - ixp4xx_irq_edge |= (1 << irq); 170 + ixp4xx_irq_edge |= (1 << d->irq); 171 171 else 172 - ixp4xx_irq_edge &= ~(1 << irq); 172 + ixp4xx_irq_edge &= ~(1 << d->irq); 173 173 174 174 if (line >= 8) { /* pins 8-15 */ 175 175 line -= 8; ··· 188 188 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 189 189 190 190 /* Configure the line as an input */ 191 - gpio_line_config(irq2gpio[irq], IXP4XX_GPIO_IN); 191 + gpio_line_config(irq2gpio[d->irq], IXP4XX_GPIO_IN); 192 192 193 193 return 0; 194 194 } 195 195 196 - static void ixp4xx_irq_mask(unsigned int irq) 196 + static void ixp4xx_irq_mask(struct irq_data *d) 197 197 { 198 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) 199 - *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); 198 + if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 199 + *IXP4XX_ICMR2 &= ~(1 << (d->irq - 32)); 200 200 else 201 - *IXP4XX_ICMR &= ~(1 << irq); 201 + *IXP4XX_ICMR &= ~(1 << d->irq); 202 202 } 203 203 204 - static void ixp4xx_irq_ack(unsigned int irq) 204 + static void ixp4xx_irq_ack(struct irq_data *d) 205 205 { 206 - int line = (irq < 32) ? irq2gpio[irq] : -1; 206 + int line = (d->irq < 32) ? irq2gpio[d->irq] : -1; 207 207 208 208 if (line >= 0) 209 209 *IXP4XX_GPIO_GPISR = (1 << line); ··· 213 213 * Level triggered interrupts on GPIO lines can only be cleared when the 214 214 * interrupt condition disappears. 215 215 */ 216 - static void ixp4xx_irq_unmask(unsigned int irq) 216 + static void ixp4xx_irq_unmask(struct irq_data *d) 217 217 { 218 - if (!(ixp4xx_irq_edge & (1 << irq))) 219 - ixp4xx_irq_ack(irq); 218 + if (!(ixp4xx_irq_edge & (1 << d->irq))) 219 + ixp4xx_irq_ack(d); 220 220 221 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) 222 - *IXP4XX_ICMR2 |= (1 << (irq - 32)); 221 + if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 222 + *IXP4XX_ICMR2 |= (1 << (d->irq - 32)); 223 223 else 224 - *IXP4XX_ICMR |= (1 << irq); 224 + *IXP4XX_ICMR |= (1 << d->irq); 225 225 } 226 226 227 227 static struct irq_chip ixp4xx_irq_chip = { 228 228 .name = "IXP4xx", 229 - .ack = ixp4xx_irq_ack, 230 - .mask = ixp4xx_irq_mask, 231 - .unmask = ixp4xx_irq_unmask, 232 - .set_type = ixp4xx_set_irq_type, 229 + .irq_ack = ixp4xx_irq_ack, 230 + .irq_mask = ixp4xx_irq_mask, 231 + .irq_unmask = ixp4xx_irq_unmask, 232 + .irq_set_type = ixp4xx_set_irq_type, 233 233 }; 234 234 235 235 void __init ixp4xx_init_irq(void)
+22 -21
arch/arm/mach-ks8695/irq.c
··· 34 34 #include <mach/regs-irq.h> 35 35 #include <mach/regs-gpio.h> 36 36 37 - static void ks8695_irq_mask(unsigned int irqno) 37 + static void ks8695_irq_mask(struct irq_data *d) 38 38 { 39 39 unsigned long inten; 40 40 41 41 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 42 - inten &= ~(1 << irqno); 42 + inten &= ~(1 << d->irq); 43 43 44 44 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 45 45 } 46 46 47 - static void ks8695_irq_unmask(unsigned int irqno) 47 + static void ks8695_irq_unmask(struct irq_data *d) 48 48 { 49 49 unsigned long inten; 50 50 51 51 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 52 - inten |= (1 << irqno); 52 + inten |= (1 << d->irq); 53 53 54 54 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 55 55 } 56 56 57 - static void ks8695_irq_ack(unsigned int irqno) 57 + static void ks8695_irq_ack(struct irq_data *d) 58 58 { 59 - __raw_writel((1 << irqno), KS8695_IRQ_VA + KS8695_INTST); 59 + __raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST); 60 60 } 61 61 62 62 ··· 64 64 static struct irq_chip ks8695_irq_edge_chip; 65 65 66 66 67 - static int ks8695_irq_set_type(unsigned int irqno, unsigned int type) 67 + static int ks8695_irq_set_type(struct irq_data *d, unsigned int type) 68 68 { 69 69 unsigned long ctrl, mode; 70 70 unsigned short level_triggered = 0; ··· 93 93 return -EINVAL; 94 94 } 95 95 96 - switch (irqno) { 96 + switch (d->irq) { 97 97 case KS8695_IRQ_EXTERN0: 98 98 ctrl &= ~IOPC_IOEINT0TM; 99 99 ctrl |= IOPC_IOEINT0_MODE(mode); ··· 115 115 } 116 116 117 117 if (level_triggered) { 118 - set_irq_chip(irqno, &ks8695_irq_level_chip); 119 - set_irq_handler(irqno, handle_level_irq); 118 + set_irq_chip(d->irq, &ks8695_irq_level_chip); 119 + set_irq_handler(d->irq, handle_level_irq); 120 120 } 121 121 else { 122 - set_irq_chip(irqno, &ks8695_irq_edge_chip); 123 - set_irq_handler(irqno, handle_edge_irq); 122 + set_irq_chip(d->irq, &ks8695_irq_edge_chip); 123 + set_irq_handler(d->irq, handle_edge_irq); 124 124 } 125 125 126 126 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC); ··· 128 128 } 129 129 130 130 static struct irq_chip ks8695_irq_level_chip = { 131 - .ack = ks8695_irq_mask, 132 - .mask = ks8695_irq_mask, 133 - .unmask = ks8695_irq_unmask, 134 - .set_type = ks8695_irq_set_type, 131 + .irq_ack = ks8695_irq_mask, 132 + .irq_mask = ks8695_irq_mask, 133 + .irq_unmask = ks8695_irq_unmask, 134 + .irq_set_type = ks8695_irq_set_type, 135 135 }; 136 136 137 137 static struct irq_chip ks8695_irq_edge_chip = { 138 - .ack = ks8695_irq_ack, 139 - .mask = ks8695_irq_mask, 140 - .unmask = ks8695_irq_unmask, 141 - .set_type = ks8695_irq_set_type, 138 + .irq_ack = ks8695_irq_ack, 139 + .irq_mask = ks8695_irq_mask, 140 + .irq_unmask = ks8695_irq_unmask, 141 + .irq_set_type = ks8695_irq_set_type, 142 142 }; 143 143 144 144 void __init ks8695_init_irq(void) ··· 164 164 165 165 /* Edge-triggered interrupts */ 166 166 default: 167 - ks8695_irq_ack(irq); /* clear pending bit */ 167 + /* clear pending bit */ 168 + ks8695_irq_ack(irq_get_irq_data(irq)); 168 169 set_irq_chip(irq, &ks8695_irq_edge_chip); 169 170 set_irq_handler(irq, handle_edge_irq); 170 171 }
+10 -10
arch/arm/mach-lh7a40x/arch-kev7a400.c
··· 46 46 47 47 static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */ 48 48 49 - static void kev7a400_ack_cpld_irq (u32 irq) 49 + static void kev7a400_ack_cpld_irq(struct irq_data *d) 50 50 { 51 - CPLD_CL_INT = 1 << (irq - IRQ_KEV7A400_CPLD); 51 + CPLD_CL_INT = 1 << (d->irq - IRQ_KEV7A400_CPLD); 52 52 } 53 53 54 - static void kev7a400_mask_cpld_irq (u32 irq) 54 + static void kev7a400_mask_cpld_irq(struct irq_data *d) 55 55 { 56 - CPLD_IRQ_mask &= ~(1 << (irq - IRQ_KEV7A400_CPLD)); 56 + CPLD_IRQ_mask &= ~(1 << (d->irq - IRQ_KEV7A400_CPLD)); 57 57 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 58 58 } 59 59 60 - static void kev7a400_unmask_cpld_irq (u32 irq) 60 + static void kev7a400_unmask_cpld_irq(struct irq_data *d) 61 61 { 62 - CPLD_IRQ_mask |= 1 << (irq - IRQ_KEV7A400_CPLD); 62 + CPLD_IRQ_mask |= 1 << (d->irq - IRQ_KEV7A400_CPLD); 63 63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 64 64 } 65 65 66 66 static struct irq_chip kev7a400_cpld_chip = { 67 - .name = "CPLD", 68 - .ack = kev7a400_ack_cpld_irq, 69 - .mask = kev7a400_mask_cpld_irq, 70 - .unmask = kev7a400_unmask_cpld_irq, 67 + .name = "CPLD", 68 + .irq_ack = kev7a400_ack_cpld_irq, 69 + .irq_mask = kev7a400_mask_cpld_irq, 70 + .irq_unmask = kev7a400_unmask_cpld_irq, 71 71 }; 72 72 73 73
+13 -12
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
··· 159 159 #endif 160 160 } 161 161 162 - static void lh7a40x_ack_cpld_irq (u32 irq) 162 + static void lh7a40x_ack_cpld_irq(struct irq_data *d) 163 163 { 164 164 /* CPLD doesn't have ack capability, but some devices may */ 165 165 ··· 167 167 /* The touch control *must* mask the interrupt because the 168 168 * interrupt bit is read by the driver to determine if the pen 169 169 * is still down. */ 170 - if (irq == IRQ_TOUCH) 170 + if (d->irq == IRQ_TOUCH) 171 171 CPLD_INTERRUPTS |= CPLD_INTMASK_TOUCH; 172 172 #endif 173 173 } 174 174 175 - static void lh7a40x_mask_cpld_irq (u32 irq) 175 + static void lh7a40x_mask_cpld_irq(struct irq_data *d) 176 176 { 177 - switch (irq) { 177 + switch (d->irq) { 178 178 case IRQ_LPD7A40X_ETH_INT: 179 179 CPLD_INTERRUPTS |= CPLD_INTMASK_ETHERNET; 180 180 break; ··· 186 186 } 187 187 } 188 188 189 - static void lh7a40x_unmask_cpld_irq (u32 irq) 189 + static void lh7a40x_unmask_cpld_irq(struct irq_data *d) 190 190 { 191 - switch (irq) { 191 + switch (d->irq) { 192 192 case IRQ_LPD7A40X_ETH_INT: 193 193 CPLD_INTERRUPTS &= ~CPLD_INTMASK_ETHERNET; 194 194 break; ··· 201 201 } 202 202 203 203 static struct irq_chip lpd7a40x_cpld_chip = { 204 - .name = "CPLD", 205 - .ack = lh7a40x_ack_cpld_irq, 206 - .mask = lh7a40x_mask_cpld_irq, 207 - .unmask = lh7a40x_unmask_cpld_irq, 204 + .name = "CPLD", 205 + .irq_ack = lh7a40x_ack_cpld_irq, 206 + .irq_mask = lh7a40x_mask_cpld_irq, 207 + .irq_unmask = lh7a40x_unmask_cpld_irq, 208 208 }; 209 209 210 210 static void lpd7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 211 211 { 212 212 unsigned int mask = CPLD_INTERRUPTS; 213 213 214 - desc->chip->ack (irq); 214 + desc->irq_data.chip->irq_ack(&desc->irq_data); 215 215 216 216 if ((mask & (1<<0)) == 0) /* WLAN */ 217 217 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 221 221 generic_handle_irq(IRQ_TOUCH); 222 222 #endif 223 223 224 - desc->chip->unmask (irq); /* Level-triggered need this */ 224 + /* Level-triggered need this */ 225 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 225 226 } 226 227 227 228
+15 -15
arch/arm/mach-lh7a40x/irq-lh7a400.c
··· 21 21 22 22 /* CPU IRQ handling */ 23 23 24 - static void lh7a400_mask_irq (u32 irq) 24 + static void lh7a400_mask_irq(struct irq_data *d) 25 25 { 26 - INTC_INTENC = (1 << irq); 26 + INTC_INTENC = (1 << d->irq); 27 27 } 28 28 29 - static void lh7a400_unmask_irq (u32 irq) 29 + static void lh7a400_unmask_irq(struct irq_data *d) 30 30 { 31 - INTC_INTENS = (1 << irq); 31 + INTC_INTENS = (1 << d->irq); 32 32 } 33 33 34 - static void lh7a400_ack_gpio_irq (u32 irq) 34 + static void lh7a400_ack_gpio_irq(struct irq_data *d) 35 35 { 36 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 37 - INTC_INTENC = (1 << irq); 36 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 37 + INTC_INTENC = (1 << d->irq); 38 38 } 39 39 40 40 static struct irq_chip lh7a400_internal_chip = { 41 - .name = "MPU", 42 - .ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */ 43 - .mask = lh7a400_mask_irq, 44 - .unmask = lh7a400_unmask_irq, 41 + .name = "MPU", 42 + .irq_ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */ 43 + .irq_mask = lh7a400_mask_irq, 44 + .irq_unmask = lh7a400_unmask_irq, 45 45 }; 46 46 47 47 static struct irq_chip lh7a400_gpio_chip = { 48 - .name = "GPIO", 49 - .ack = lh7a400_ack_gpio_irq, 50 - .mask = lh7a400_mask_irq, 51 - .unmask = lh7a400_unmask_irq, 48 + .name = "GPIO", 49 + .irq_ack = lh7a400_ack_gpio_irq, 50 + .irq_mask = lh7a400_mask_irq, 51 + .irq_unmask = lh7a400_unmask_irq, 52 52 }; 53 53 54 54
+30 -30
arch/arm/mach-lh7a40x/irq-lh7a404.c
··· 43 43 44 44 /* CPU IRQ handling */ 45 45 46 - static void lh7a404_vic1_mask_irq (u32 irq) 46 + static void lh7a404_vic1_mask_irq(struct irq_data *d) 47 47 { 48 - VIC1_INTENCLR = (1 << irq); 48 + VIC1_INTENCLR = (1 << d->irq); 49 49 } 50 50 51 - static void lh7a404_vic1_unmask_irq (u32 irq) 51 + static void lh7a404_vic1_unmask_irq(struct irq_data *d) 52 52 { 53 - VIC1_INTEN = (1 << irq); 53 + VIC1_INTEN = (1 << d->irq); 54 54 } 55 55 56 - static void lh7a404_vic2_mask_irq (u32 irq) 56 + static void lh7a404_vic2_mask_irq(struct irq_data *d) 57 57 { 58 - VIC2_INTENCLR = (1 << (irq - 32)); 58 + VIC2_INTENCLR = (1 << (d->irq - 32)); 59 59 } 60 60 61 - static void lh7a404_vic2_unmask_irq (u32 irq) 61 + static void lh7a404_vic2_unmask_irq(struct irq_data *d) 62 62 { 63 - VIC2_INTEN = (1 << (irq - 32)); 63 + VIC2_INTEN = (1 << (d->irq - 32)); 64 64 } 65 65 66 - static void lh7a404_vic1_ack_gpio_irq (u32 irq) 66 + static void lh7a404_vic1_ack_gpio_irq(struct irq_data *d) 67 67 { 68 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 69 - VIC1_INTENCLR = (1 << irq); 68 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 69 + VIC1_INTENCLR = (1 << d->irq); 70 70 } 71 71 72 - static void lh7a404_vic2_ack_gpio_irq (u32 irq) 72 + static void lh7a404_vic2_ack_gpio_irq(struct irq_data *d) 73 73 { 74 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 75 - VIC2_INTENCLR = (1 << irq); 74 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 75 + VIC2_INTENCLR = (1 << d->irq); 76 76 } 77 77 78 78 static struct irq_chip lh7a404_vic1_chip = { 79 - .name = "VIC1", 80 - .ack = lh7a404_vic1_mask_irq, /* Because level-triggered */ 81 - .mask = lh7a404_vic1_mask_irq, 82 - .unmask = lh7a404_vic1_unmask_irq, 79 + .name = "VIC1", 80 + .irq_ack = lh7a404_vic1_mask_irq, /* Because level-triggered */ 81 + .irq_mask = lh7a404_vic1_mask_irq, 82 + .irq_unmask = lh7a404_vic1_unmask_irq, 83 83 }; 84 84 85 85 static struct irq_chip lh7a404_vic2_chip = { 86 - .name = "VIC2", 87 - .ack = lh7a404_vic2_mask_irq, /* Because level-triggered */ 88 - .mask = lh7a404_vic2_mask_irq, 89 - .unmask = lh7a404_vic2_unmask_irq, 86 + .name = "VIC2", 87 + .irq_ack = lh7a404_vic2_mask_irq, /* Because level-triggered */ 88 + .irq_mask = lh7a404_vic2_mask_irq, 89 + .irq_unmask = lh7a404_vic2_unmask_irq, 90 90 }; 91 91 92 92 static struct irq_chip lh7a404_gpio_vic1_chip = { 93 - .name = "GPIO-VIC1", 94 - .ack = lh7a404_vic1_ack_gpio_irq, 95 - .mask = lh7a404_vic1_mask_irq, 96 - .unmask = lh7a404_vic1_unmask_irq, 93 + .name = "GPIO-VIC1", 94 + .irq_ack = lh7a404_vic1_ack_gpio_irq, 95 + .irq_mask = lh7a404_vic1_mask_irq, 96 + .irq_unmask = lh7a404_vic1_unmask_irq, 97 97 }; 98 98 99 99 static struct irq_chip lh7a404_gpio_vic2_chip = { 100 - .name = "GPIO-VIC2", 101 - .ack = lh7a404_vic2_ack_gpio_irq, 102 - .mask = lh7a404_vic2_mask_irq, 103 - .unmask = lh7a404_vic2_unmask_irq, 100 + .name = "GPIO-VIC2", 101 + .irq_ack = lh7a404_vic2_ack_gpio_irq, 102 + .irq_mask = lh7a404_vic2_mask_irq, 103 + .irq_unmask = lh7a404_vic2_unmask_irq, 104 104 }; 105 105 106 106 /* IRQ initialization */
+11 -11
arch/arm/mach-lh7a40x/irq-lpd7a40x.c
··· 20 20 21 21 #include "common.h" 22 22 23 - static void lh7a40x_ack_cpld_irq (u32 irq) 23 + static void lh7a40x_ack_cpld_irq(struct irq_data *d) 24 24 { 25 25 /* CPLD doesn't have ack capability */ 26 26 } 27 27 28 - static void lh7a40x_mask_cpld_irq (u32 irq) 28 + static void lh7a40x_mask_cpld_irq(struct irq_data *d) 29 29 { 30 - switch (irq) { 30 + switch (d->irq) { 31 31 case IRQ_LPD7A40X_ETH_INT: 32 32 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4; 33 33 break; ··· 37 37 } 38 38 } 39 39 40 - static void lh7a40x_unmask_cpld_irq (u32 irq) 40 + static void lh7a40x_unmask_cpld_irq(struct irq_data *d) 41 41 { 42 - switch (irq) { 42 + switch (d->irq) { 43 43 case IRQ_LPD7A40X_ETH_INT: 44 44 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4; 45 45 break; ··· 50 50 } 51 51 52 52 static struct irq_chip lh7a40x_cpld_chip = { 53 - .name = "CPLD", 54 - .ack = lh7a40x_ack_cpld_irq, 55 - .mask = lh7a40x_mask_cpld_irq, 56 - .unmask = lh7a40x_unmask_cpld_irq, 53 + .name = "CPLD", 54 + .irq_ack = lh7a40x_ack_cpld_irq, 55 + .irq_mask = lh7a40x_mask_cpld_irq, 56 + .irq_unmask = lh7a40x_unmask_cpld_irq, 57 57 }; 58 58 59 59 static void lh7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 60 60 { 61 61 unsigned int mask = CPLD_INTERRUPTS; 62 62 63 - desc->chip->ack (irq); 63 + desc->irq_data.chip->ack (irq); 64 64 65 65 if ((mask & 0x1) == 0) /* WLAN */ 66 66 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 68 68 if ((mask & 0x2) == 0) /* Touch */ 69 69 generic_handle_irq(IRQ_LPD7A400_TS); 70 70 71 - desc->chip->unmask (irq); /* Level-triggered need this */ 71 + desc->irq_data.chip->unmask (irq); /* Level-triggered need this */ 72 72 } 73 73 74 74
+28 -28
arch/arm/mach-lpc32xx/irq.c
··· 191 191 } 192 192 } 193 193 194 - static void lpc32xx_mask_irq(unsigned int irq) 194 + static void lpc32xx_mask_irq(struct irq_data *d) 195 195 { 196 196 unsigned int reg, ctrl, mask; 197 197 198 - get_controller(irq, &ctrl, &mask); 198 + get_controller(d->irq, &ctrl, &mask); 199 199 200 200 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) & ~mask; 201 201 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 202 202 } 203 203 204 - static void lpc32xx_unmask_irq(unsigned int irq) 204 + static void lpc32xx_unmask_irq(struct irq_data *d) 205 205 { 206 206 unsigned int reg, ctrl, mask; 207 207 208 - get_controller(irq, &ctrl, &mask); 208 + get_controller(d->irq, &ctrl, &mask); 209 209 210 210 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) | mask; 211 211 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 212 212 } 213 213 214 - static void lpc32xx_ack_irq(unsigned int irq) 214 + static void lpc32xx_ack_irq(struct irq_data *d) 215 215 { 216 216 unsigned int ctrl, mask; 217 217 218 - get_controller(irq, &ctrl, &mask); 218 + get_controller(d->irq, &ctrl, &mask); 219 219 220 220 __raw_writel(mask, LPC32XX_INTC_RAW_STAT(ctrl)); 221 221 222 222 /* Also need to clear pending wake event */ 223 - if (lpc32xx_events[irq].mask != 0) 224 - __raw_writel(lpc32xx_events[irq].mask, 225 - lpc32xx_events[irq].event_group->rawstat_reg); 223 + if (lpc32xx_events[d->irq].mask != 0) 224 + __raw_writel(lpc32xx_events[d->irq].mask, 225 + lpc32xx_events[d->irq].event_group->rawstat_reg); 226 226 } 227 227 228 228 static void __lpc32xx_set_irq_type(unsigned int irq, int use_high_level, ··· 261 261 } 262 262 } 263 263 264 - static int lpc32xx_set_irq_type(unsigned int irq, unsigned int type) 264 + static int lpc32xx_set_irq_type(struct irq_data *d, unsigned int type) 265 265 { 266 266 switch (type) { 267 267 case IRQ_TYPE_EDGE_RISING: 268 268 /* Rising edge sensitive */ 269 - __lpc32xx_set_irq_type(irq, 1, 1); 269 + __lpc32xx_set_irq_type(d->irq, 1, 1); 270 270 break; 271 271 272 272 case IRQ_TYPE_EDGE_FALLING: 273 273 /* Falling edge sensitive */ 274 - __lpc32xx_set_irq_type(irq, 0, 1); 274 + __lpc32xx_set_irq_type(d->irq, 0, 1); 275 275 break; 276 276 277 277 case IRQ_TYPE_LEVEL_LOW: 278 278 /* Low level sensitive */ 279 - __lpc32xx_set_irq_type(irq, 0, 0); 279 + __lpc32xx_set_irq_type(d->irq, 0, 0); 280 280 break; 281 281 282 282 case IRQ_TYPE_LEVEL_HIGH: 283 283 /* High level sensitive */ 284 - __lpc32xx_set_irq_type(irq, 1, 0); 284 + __lpc32xx_set_irq_type(d->irq, 1, 0); 285 285 break; 286 286 287 287 /* Other modes are not supported */ ··· 290 290 } 291 291 292 292 /* Ok to use the level handler for all types */ 293 - set_irq_handler(irq, handle_level_irq); 293 + set_irq_handler(d->irq, handle_level_irq); 294 294 295 295 return 0; 296 296 } 297 297 298 - static int lpc32xx_irq_wake(unsigned int irqno, unsigned int state) 298 + static int lpc32xx_irq_wake(struct irq_data *d, unsigned int state) 299 299 { 300 300 unsigned long eventreg; 301 301 302 - if (lpc32xx_events[irqno].mask != 0) { 303 - eventreg = __raw_readl(lpc32xx_events[irqno]. 302 + if (lpc32xx_events[d->irq].mask != 0) { 303 + eventreg = __raw_readl(lpc32xx_events[d->irq]. 304 304 event_group->enab_reg); 305 305 306 306 if (state) 307 - eventreg |= lpc32xx_events[irqno].mask; 307 + eventreg |= lpc32xx_events[d->irq].mask; 308 308 else 309 - eventreg &= ~lpc32xx_events[irqno].mask; 309 + eventreg &= ~lpc32xx_events[d->irq].mask; 310 310 311 311 __raw_writel(eventreg, 312 - lpc32xx_events[irqno].event_group->enab_reg); 312 + lpc32xx_events[d->irq].event_group->enab_reg); 313 313 314 314 return 0; 315 315 } 316 316 317 317 /* Clear event */ 318 - __raw_writel(lpc32xx_events[irqno].mask, 319 - lpc32xx_events[irqno].event_group->rawstat_reg); 318 + __raw_writel(lpc32xx_events[d->irq].mask, 319 + lpc32xx_events[d->irq].event_group->rawstat_reg); 320 320 321 321 return -ENODEV; 322 322 } ··· 336 336 } 337 337 338 338 static struct irq_chip lpc32xx_irq_chip = { 339 - .ack = lpc32xx_ack_irq, 340 - .mask = lpc32xx_mask_irq, 341 - .unmask = lpc32xx_unmask_irq, 342 - .set_type = lpc32xx_set_irq_type, 343 - .set_wake = lpc32xx_irq_wake 339 + .irq_ack = lpc32xx_ack_irq, 340 + .irq_mask = lpc32xx_mask_irq, 341 + .irq_unmask = lpc32xx_unmask_irq, 342 + .irq_set_type = lpc32xx_set_irq_type, 343 + .irq_set_wake = lpc32xx_irq_wake 344 344 }; 345 345 346 346 static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)
+1 -1
arch/arm/mach-mmp/include/mach/mfp-mmp2.h
··· 6 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 - #define MFP_DRIVE_FAST (0x8 << 13) 9 + #define MFP_DRIVE_FAST (0x6 << 13) 10 10 11 11 /* GPIO */ 12 12 #define GPIO0_GPIO MFP_CFG(GPIO0, AF0)
+1 -1
arch/arm/mach-mmp/include/mach/mfp-pxa910.h
··· 6 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 - #define MFP_DRIVE_FAST (0x8 << 13) 9 + #define MFP_DRIVE_FAST (0x6 << 13) 10 10 11 11 /* UART2 */ 12 12 #define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6)
+24 -22
arch/arm/mach-mmp/irq-mmp2.c
··· 20 20 21 21 #include "common.h" 22 22 23 - static void icu_mask_irq(unsigned int irq) 23 + static void icu_mask_irq(struct irq_data *d) 24 24 { 25 - uint32_t r = __raw_readl(ICU_INT_CONF(irq)); 25 + uint32_t r = __raw_readl(ICU_INT_CONF(d->irq)); 26 26 27 27 r &= ~ICU_INT_ROUTE_PJ4_IRQ; 28 - __raw_writel(r, ICU_INT_CONF(irq)); 28 + __raw_writel(r, ICU_INT_CONF(d->irq)); 29 29 } 30 30 31 - static void icu_unmask_irq(unsigned int irq) 31 + static void icu_unmask_irq(struct irq_data *d) 32 32 { 33 - uint32_t r = __raw_readl(ICU_INT_CONF(irq)); 33 + uint32_t r = __raw_readl(ICU_INT_CONF(d->irq)); 34 34 35 35 r |= ICU_INT_ROUTE_PJ4_IRQ; 36 - __raw_writel(r, ICU_INT_CONF(irq)); 36 + __raw_writel(r, ICU_INT_CONF(d->irq)); 37 37 } 38 38 39 39 static struct irq_chip icu_irq_chip = { 40 40 .name = "icu_irq", 41 - .mask = icu_mask_irq, 42 - .mask_ack = icu_mask_irq, 43 - .unmask = icu_unmask_irq, 41 + .irq_mask = icu_mask_irq, 42 + .irq_mask_ack = icu_mask_irq, 43 + .irq_unmask = icu_unmask_irq, 44 44 }; 45 45 46 - static void pmic_irq_ack(unsigned int irq) 46 + static void pmic_irq_ack(struct irq_data *d) 47 47 { 48 - if (irq == IRQ_MMP2_PMIC) 48 + if (d->irq == IRQ_MMP2_PMIC) 49 49 mmp2_clear_pmic_int(); 50 50 } 51 51 52 52 #define SECOND_IRQ_MASK(_name_, irq_base, prefix) \ 53 - static void _name_##_mask_irq(unsigned int irq) \ 53 + static void _name_##_mask_irq(struct irq_data *d) \ 54 54 { \ 55 55 uint32_t r; \ 56 - r = __raw_readl(prefix##_MASK) | (1 << (irq - irq_base)); \ 56 + r = __raw_readl(prefix##_MASK) | (1 << (d->irq - irq_base)); \ 57 57 __raw_writel(r, prefix##_MASK); \ 58 58 } 59 59 60 60 #define SECOND_IRQ_UNMASK(_name_, irq_base, prefix) \ 61 - static void _name_##_unmask_irq(unsigned int irq) \ 61 + static void _name_##_unmask_irq(struct irq_data *d) \ 62 62 { \ 63 63 uint32_t r; \ 64 - r = __raw_readl(prefix##_MASK) & ~(1 << (irq - irq_base)); \ 64 + r = __raw_readl(prefix##_MASK) & ~(1 << (d->irq - irq_base)); \ 65 65 __raw_writel(r, prefix##_MASK); \ 66 66 } 67 67 ··· 88 88 SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \ 89 89 static struct irq_chip _name_##_irq_chip = { \ 90 90 .name = #_name_, \ 91 - .mask = _name_##_mask_irq, \ 92 - .unmask = _name_##_unmask_irq, \ 91 + .irq_mask = _name_##_mask_irq, \ 92 + .irq_unmask = _name_##_unmask_irq, \ 93 93 } 94 94 95 95 SECOND_IRQ_CHIP(pmic, IRQ_MMP2_PMIC_BASE, MMP2_ICU_INT4); ··· 103 103 int irq; 104 104 105 105 for (irq = start; num > 0; irq++, num--) { 106 + struct irq_data *d = irq_get_irq_data(irq); 107 + 106 108 /* mask and clear the IRQ */ 107 - chip->mask(irq); 108 - if (chip->ack) 109 - chip->ack(irq); 109 + chip->irq_mask(d); 110 + if (chip->irq_ack) 111 + chip->irq_ack(d); 110 112 111 113 set_irq_chip(irq, chip); 112 114 set_irq_flags(irq, IRQF_VALID); ··· 121 119 int irq; 122 120 123 121 for (irq = 0; irq < IRQ_MMP2_MUX_BASE; irq++) { 124 - icu_mask_irq(irq); 122 + icu_mask_irq(irq_get_irq_data(irq)); 125 123 set_irq_chip(irq, &icu_irq_chip); 126 124 set_irq_flags(irq, IRQF_VALID); 127 125 ··· 141 139 /* NOTE: IRQ_MMP2_PMIC requires the PMIC MFPR register 142 140 * to be written to clear the interrupt 143 141 */ 144 - pmic_irq_chip.ack = pmic_irq_ack; 142 + pmic_irq_chip.irq_ack = pmic_irq_ack; 145 143 146 144 init_mux_irq(&pmic_irq_chip, IRQ_MMP2_PMIC_BASE, 2); 147 145 init_mux_irq(&rtc_irq_chip, IRQ_MMP2_RTC_BASE, 2);
+9 -9
arch/arm/mach-mmp/irq-pxa168.c
··· 25 25 #define PRIORITY_DEFAULT 0x1 26 26 #define PRIORITY_NONE 0x0 /* means IRQ disabled */ 27 27 28 - static void icu_mask_irq(unsigned int irq) 28 + static void icu_mask_irq(struct irq_data *d) 29 29 { 30 - __raw_writel(PRIORITY_NONE, ICU_INT_CONF(irq)); 30 + __raw_writel(PRIORITY_NONE, ICU_INT_CONF(d->irq)); 31 31 } 32 32 33 - static void icu_unmask_irq(unsigned int irq) 33 + static void icu_unmask_irq(struct irq_data *d) 34 34 { 35 - __raw_writel(IRQ_ROUTE_TO_AP | PRIORITY_DEFAULT, ICU_INT_CONF(irq)); 35 + __raw_writel(IRQ_ROUTE_TO_AP | PRIORITY_DEFAULT, ICU_INT_CONF(d->irq)); 36 36 } 37 37 38 38 static struct irq_chip icu_irq_chip = { 39 - .name = "icu_irq", 40 - .ack = icu_mask_irq, 41 - .mask = icu_mask_irq, 42 - .unmask = icu_unmask_irq, 39 + .name = "icu_irq", 40 + .irq_ack = icu_mask_irq, 41 + .irq_mask = icu_mask_irq, 42 + .irq_unmask = icu_unmask_irq, 43 43 }; 44 44 45 45 void __init icu_init_irq(void) ··· 47 47 int irq; 48 48 49 49 for (irq = 0; irq < 64; irq++) { 50 - icu_mask_irq(irq); 50 + icu_mask_irq(irq_get_irq_data(irq)); 51 51 set_irq_chip(irq, &icu_irq_chip); 52 52 set_irq_handler(irq, handle_level_irq); 53 53 set_irq_flags(irq, IRQF_VALID);
+21 -21
arch/arm/mach-msm/board-trout-gpio.c
··· 113 113 TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0), 114 114 }; 115 115 116 - static void trout_gpio_irq_ack(unsigned int irq) 116 + static void trout_gpio_irq_ack(struct irq_data *d) 117 117 { 118 - int bank = TROUT_INT_TO_BANK(irq); 119 - uint8_t mask = TROUT_INT_TO_MASK(irq); 118 + int bank = TROUT_INT_TO_BANK(d->irq); 119 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 120 120 int reg = TROUT_BANK_TO_STAT_REG(bank); 121 - /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", irq);*/ 121 + /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", d->irq);*/ 122 122 writeb(mask, TROUT_CPLD_BASE + reg); 123 123 } 124 124 125 - static void trout_gpio_irq_mask(unsigned int irq) 125 + static void trout_gpio_irq_mask(struct irq_data *d) 126 126 { 127 127 unsigned long flags; 128 128 uint8_t reg_val; 129 - int bank = TROUT_INT_TO_BANK(irq); 130 - uint8_t mask = TROUT_INT_TO_MASK(irq); 129 + int bank = TROUT_INT_TO_BANK(d->irq); 130 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 131 131 int reg = TROUT_BANK_TO_MASK_REG(bank); 132 132 133 133 local_irq_save(flags); 134 134 reg_val = trout_int_mask[bank] |= mask; 135 135 /*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n", 136 - irq, bank, reg_val);*/ 136 + d->irq, bank, reg_val);*/ 137 137 writeb(reg_val, TROUT_CPLD_BASE + reg); 138 138 local_irq_restore(flags); 139 139 } 140 140 141 - static void trout_gpio_irq_unmask(unsigned int irq) 141 + static void trout_gpio_irq_unmask(struct irq_data *d) 142 142 { 143 143 unsigned long flags; 144 144 uint8_t reg_val; 145 - int bank = TROUT_INT_TO_BANK(irq); 146 - uint8_t mask = TROUT_INT_TO_MASK(irq); 145 + int bank = TROUT_INT_TO_BANK(d->irq); 146 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 147 147 int reg = TROUT_BANK_TO_MASK_REG(bank); 148 148 149 149 local_irq_save(flags); 150 150 reg_val = trout_int_mask[bank] &= ~mask; 151 151 /*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n", 152 - irq, bank, reg_val);*/ 152 + d->irq, bank, reg_val);*/ 153 153 writeb(reg_val, TROUT_CPLD_BASE + reg); 154 154 local_irq_restore(flags); 155 155 } 156 156 157 - int trout_gpio_irq_set_wake(unsigned int irq, unsigned int on) 157 + int trout_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 158 158 { 159 159 unsigned long flags; 160 - int bank = TROUT_INT_TO_BANK(irq); 161 - uint8_t mask = TROUT_INT_TO_MASK(irq); 160 + int bank = TROUT_INT_TO_BANK(d->irq); 161 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 162 162 163 163 local_irq_save(flags); 164 164 if(on) ··· 198 198 } 199 199 int_base += TROUT_INT_BANK0_COUNT; 200 200 } 201 - desc->chip->ack(irq); 201 + desc->irq_data.chip->irq_ack(&desc->irq_data); 202 202 } 203 203 204 204 static struct irq_chip trout_gpio_irq_chip = { 205 - .name = "troutgpio", 206 - .ack = trout_gpio_irq_ack, 207 - .mask = trout_gpio_irq_mask, 208 - .unmask = trout_gpio_irq_unmask, 209 - .set_wake = trout_gpio_irq_set_wake, 205 + .name = "troutgpio", 206 + .irq_ack = trout_gpio_irq_ack, 207 + .irq_mask = trout_gpio_irq_mask, 208 + .irq_unmask = trout_gpio_irq_unmask, 209 + .irq_set_wake = trout_gpio_irq_set_wake, 210 210 }; 211 211 212 212 /*
+24 -24
arch/arm/mach-msm/gpio.c
··· 225 225 #endif 226 226 }; 227 227 228 - static void msm_gpio_irq_ack(unsigned int irq) 228 + static void msm_gpio_irq_ack(struct irq_data *d) 229 229 { 230 230 unsigned long irq_flags; 231 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 231 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 232 232 spin_lock_irqsave(&msm_chip->lock, irq_flags); 233 233 msm_gpio_clear_detect_status(msm_chip, 234 - irq - gpio_to_irq(msm_chip->chip.base)); 234 + d->irq - gpio_to_irq(msm_chip->chip.base)); 235 235 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 236 236 } 237 237 238 - static void msm_gpio_irq_mask(unsigned int irq) 238 + static void msm_gpio_irq_mask(struct irq_data *d) 239 239 { 240 240 unsigned long irq_flags; 241 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 242 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 241 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 242 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 243 243 244 244 spin_lock_irqsave(&msm_chip->lock, irq_flags); 245 245 /* level triggered interrupts are also latched */ ··· 250 250 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 251 251 } 252 252 253 - static void msm_gpio_irq_unmask(unsigned int irq) 253 + static void msm_gpio_irq_unmask(struct irq_data *d) 254 254 { 255 255 unsigned long irq_flags; 256 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 257 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 256 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 257 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 258 258 259 259 spin_lock_irqsave(&msm_chip->lock, irq_flags); 260 260 /* level triggered interrupts are also latched */ ··· 265 265 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 266 266 } 267 267 268 - static int msm_gpio_irq_set_wake(unsigned int irq, unsigned int on) 268 + static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 269 269 { 270 270 unsigned long irq_flags; 271 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 272 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 271 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 272 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 273 273 274 274 spin_lock_irqsave(&msm_chip->lock, irq_flags); 275 275 ··· 282 282 return 0; 283 283 } 284 284 285 - static int msm_gpio_irq_set_type(unsigned int irq, unsigned int flow_type) 285 + static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type) 286 286 { 287 287 unsigned long irq_flags; 288 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 289 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 288 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 289 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 290 290 unsigned val, mask = BIT(offset); 291 291 292 292 spin_lock_irqsave(&msm_chip->lock, irq_flags); 293 293 val = readl(msm_chip->regs.int_edge); 294 294 if (flow_type & IRQ_TYPE_EDGE_BOTH) { 295 295 writel(val | mask, msm_chip->regs.int_edge); 296 - irq_desc[irq].handle_irq = handle_edge_irq; 296 + irq_desc[d->irq].handle_irq = handle_edge_irq; 297 297 } else { 298 298 writel(val & ~mask, msm_chip->regs.int_edge); 299 - irq_desc[irq].handle_irq = handle_level_irq; 299 + irq_desc[d->irq].handle_irq = handle_level_irq; 300 300 } 301 301 if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { 302 302 msm_chip->both_edge_detect |= mask; ··· 333 333 msm_chip->chip.base + j); 334 334 } 335 335 } 336 - desc->chip->ack(irq); 336 + desc->irq_data.chip->irq_ack(&desc->irq_data); 337 337 } 338 338 339 339 static struct irq_chip msm_gpio_irq_chip = { 340 - .name = "msmgpio", 341 - .ack = msm_gpio_irq_ack, 342 - .mask = msm_gpio_irq_mask, 343 - .unmask = msm_gpio_irq_unmask, 344 - .set_wake = msm_gpio_irq_set_wake, 345 - .set_type = msm_gpio_irq_set_type, 340 + .name = "msmgpio", 341 + .irq_ack = msm_gpio_irq_ack, 342 + .irq_mask = msm_gpio_irq_mask, 343 + .irq_unmask = msm_gpio_irq_unmask, 344 + .irq_set_wake = msm_gpio_irq_set_wake, 345 + .irq_set_type = msm_gpio_irq_set_type, 346 346 }; 347 347 348 348 static int __init msm_init_gpio(void)
+32 -33
arch/arm/mach-msm/irq-vic.c
··· 226 226 writel(val, base + (i * 4)); 227 227 } 228 228 229 - static void msm_irq_ack(unsigned int irq) 229 + static void msm_irq_ack(struct irq_data *d) 230 230 { 231 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, irq); 232 - irq = 1 << (irq & 31); 233 - writel(irq, reg); 231 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq); 232 + writel(1 << (d->irq & 31), reg); 234 233 } 235 234 236 - static void msm_irq_mask(unsigned int irq) 235 + static void msm_irq_mask(struct irq_data *d) 237 236 { 238 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, irq); 239 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 240 - uint32_t mask = 1UL << (irq & 31); 241 - int smsm_irq = msm_irq_to_smsm[irq]; 237 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, d->irq); 238 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 239 + uint32_t mask = 1UL << (d->irq & 31); 240 + int smsm_irq = msm_irq_to_smsm[d->irq]; 242 241 243 242 msm_irq_shadow_reg[index].int_en[0] &= ~mask; 244 243 writel(mask, reg); ··· 249 250 } 250 251 } 251 252 252 - static void msm_irq_unmask(unsigned int irq) 253 + static void msm_irq_unmask(struct irq_data *d) 253 254 { 254 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, irq); 255 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 256 - uint32_t mask = 1UL << (irq & 31); 257 - int smsm_irq = msm_irq_to_smsm[irq]; 255 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, d->irq); 256 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 257 + uint32_t mask = 1UL << (d->irq & 31); 258 + int smsm_irq = msm_irq_to_smsm[d->irq]; 258 259 259 260 msm_irq_shadow_reg[index].int_en[0] |= mask; 260 261 writel(mask, reg); ··· 267 268 } 268 269 } 269 270 270 - static int msm_irq_set_wake(unsigned int irq, unsigned int on) 271 + static int msm_irq_set_wake(struct irq_data *d, unsigned int on) 271 272 { 272 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 273 - uint32_t mask = 1UL << (irq & 31); 274 - int smsm_irq = msm_irq_to_smsm[irq]; 273 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 274 + uint32_t mask = 1UL << (d->irq & 31); 275 + int smsm_irq = msm_irq_to_smsm[d->irq]; 275 276 276 277 if (smsm_irq == 0) { 277 - printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", irq); 278 + printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", d->irq); 278 279 return -EINVAL; 279 280 } 280 281 if (on) ··· 293 294 return 0; 294 295 } 295 296 296 - static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 297 + static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type) 297 298 { 298 - void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, irq); 299 - void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, irq); 300 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 301 - int b = 1 << (irq & 31); 299 + void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, d->irq); 300 + void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, d->irq); 301 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 302 + int b = 1 << (d->irq & 31); 302 303 uint32_t polarity; 303 304 uint32_t type; 304 305 ··· 313 314 type = msm_irq_shadow_reg[index].int_type; 314 315 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 315 316 type |= b; 316 - irq_desc[irq].handle_irq = handle_edge_irq; 317 + irq_desc[d->irq].handle_irq = handle_edge_irq; 317 318 } 318 319 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 319 320 type &= ~b; 320 - irq_desc[irq].handle_irq = handle_level_irq; 321 + irq_desc[d->irq].handle_irq = handle_level_irq; 321 322 } 322 323 writel(type, treg); 323 324 msm_irq_shadow_reg[index].int_type = type; ··· 325 326 } 326 327 327 328 static struct irq_chip msm_irq_chip = { 328 - .name = "msm", 329 - .disable = msm_irq_mask, 330 - .ack = msm_irq_ack, 331 - .mask = msm_irq_mask, 332 - .unmask = msm_irq_unmask, 333 - .set_wake = msm_irq_set_wake, 334 - .set_type = msm_irq_set_type, 329 + .name = "msm", 330 + .irq_disable = msm_irq_mask, 331 + .irq_ack = msm_irq_ack, 332 + .irq_mask = msm_irq_mask, 333 + .irq_unmask = msm_irq_unmask, 334 + .irq_set_wake = msm_irq_set_wake, 335 + .irq_set_type = msm_irq_set_type, 335 336 }; 336 337 337 338 void __init msm_init_irq(void)
+22 -23
arch/arm/mach-msm/irq.c
··· 64 64 #define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4)) 65 65 #define VIC_VECTADDR(n) VIC_REG(0x0400+((n) * 4)) 66 66 67 - static void msm_irq_ack(unsigned int irq) 67 + static void msm_irq_ack(struct irq_data *d) 68 68 { 69 - void __iomem *reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0); 70 - irq = 1 << (irq & 31); 71 - writel(irq, reg); 69 + void __iomem *reg = VIC_INT_CLEAR0 + ((d->irq & 32) ? 4 : 0); 70 + writel(1 << (d->irq & 31), reg); 72 71 } 73 72 74 - static void msm_irq_mask(unsigned int irq) 73 + static void msm_irq_mask(struct irq_data *d) 75 74 { 76 - void __iomem *reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0); 77 - writel(1 << (irq & 31), reg); 75 + void __iomem *reg = VIC_INT_ENCLEAR0 + ((d->irq & 32) ? 4 : 0); 76 + writel(1 << (d->irq & 31), reg); 78 77 } 79 78 80 - static void msm_irq_unmask(unsigned int irq) 79 + static void msm_irq_unmask(struct irq_data *d) 81 80 { 82 - void __iomem *reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0); 83 - writel(1 << (irq & 31), reg); 81 + void __iomem *reg = VIC_INT_ENSET0 + ((d->irq & 32) ? 4 : 0); 82 + writel(1 << (d->irq & 31), reg); 84 83 } 85 84 86 - static int msm_irq_set_wake(unsigned int irq, unsigned int on) 85 + static int msm_irq_set_wake(struct irq_data *d, unsigned int on) 87 86 { 88 87 return -EINVAL; 89 88 } 90 89 91 - static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 90 + static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type) 92 91 { 93 - void __iomem *treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0); 94 - void __iomem *preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0); 95 - int b = 1 << (irq & 31); 92 + void __iomem *treg = VIC_INT_TYPE0 + ((d->irq & 32) ? 4 : 0); 93 + void __iomem *preg = VIC_INT_POLARITY0 + ((d->irq & 32) ? 4 : 0); 94 + int b = 1 << (d->irq & 31); 96 95 97 96 if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) 98 97 writel(readl(preg) | b, preg); ··· 100 101 101 102 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 102 103 writel(readl(treg) | b, treg); 103 - irq_desc[irq].handle_irq = handle_edge_irq; 104 + irq_desc[d->irq].handle_irq = handle_edge_irq; 104 105 } 105 106 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 106 107 writel(readl(treg) & (~b), treg); 107 - irq_desc[irq].handle_irq = handle_level_irq; 108 + irq_desc[d->irq].handle_irq = handle_level_irq; 108 109 } 109 110 return 0; 110 111 } 111 112 112 113 static struct irq_chip msm_irq_chip = { 113 - .name = "msm", 114 - .ack = msm_irq_ack, 115 - .mask = msm_irq_mask, 116 - .unmask = msm_irq_unmask, 117 - .set_wake = msm_irq_set_wake, 118 - .set_type = msm_irq_set_type, 114 + .name = "msm", 115 + .irq_ack = msm_irq_ack, 116 + .irq_mask = msm_irq_mask, 117 + .irq_unmask = msm_irq_unmask, 118 + .irq_set_wake = msm_irq_set_wake, 119 + .irq_set_type = msm_irq_set_type, 119 120 }; 120 121 121 122 void __init msm_init_irq(void)
+19 -20
arch/arm/mach-msm/sirc.c
··· 42 42 43 43 /* Mask off the given interrupt. Keep the int_enable mask in sync with 44 44 the enable reg, so it can be restored after power collapse. */ 45 - static void sirc_irq_mask(unsigned int irq) 45 + static void sirc_irq_mask(struct irq_data *d) 46 46 { 47 47 unsigned int mask; 48 48 49 - 50 - mask = 1 << (irq - FIRST_SIRC_IRQ); 49 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 51 50 writel(mask, sirc_regs.int_enable_clear); 52 51 int_enable &= ~mask; 53 52 return; ··· 54 55 55 56 /* Unmask the given interrupt. Keep the int_enable mask in sync with 56 57 the enable reg, so it can be restored after power collapse. */ 57 - static void sirc_irq_unmask(unsigned int irq) 58 + static void sirc_irq_unmask(struct irq_data *d) 58 59 { 59 60 unsigned int mask; 60 61 61 - mask = 1 << (irq - FIRST_SIRC_IRQ); 62 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 62 63 writel(mask, sirc_regs.int_enable_set); 63 64 int_enable |= mask; 64 65 return; 65 66 } 66 67 67 - static void sirc_irq_ack(unsigned int irq) 68 + static void sirc_irq_ack(struct irq_data *d) 68 69 { 69 70 unsigned int mask; 70 71 71 - mask = 1 << (irq - FIRST_SIRC_IRQ); 72 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 72 73 writel(mask, sirc_regs.int_clear); 73 74 return; 74 75 } 75 76 76 - static int sirc_irq_set_wake(unsigned int irq, unsigned int on) 77 + static int sirc_irq_set_wake(struct irq_data *d, unsigned int on) 77 78 { 78 79 unsigned int mask; 79 80 80 81 /* Used to set the interrupt enable mask during power collapse. */ 81 - mask = 1 << (irq - FIRST_SIRC_IRQ); 82 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 82 83 if (on) 83 84 wake_enable |= mask; 84 85 else ··· 87 88 return 0; 88 89 } 89 90 90 - static int sirc_irq_set_type(unsigned int irq, unsigned int flow_type) 91 + static int sirc_irq_set_type(struct irq_data *d, unsigned int flow_type) 91 92 { 92 93 unsigned int mask; 93 94 unsigned int val; 94 95 95 - mask = 1 << (irq - FIRST_SIRC_IRQ); 96 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 96 97 val = readl(sirc_regs.int_polarity); 97 98 98 99 if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING)) ··· 105 106 val = readl(sirc_regs.int_type); 106 107 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 107 108 val |= mask; 108 - irq_desc[irq].handle_irq = handle_edge_irq; 109 + irq_desc[d->irq].handle_irq = handle_edge_irq; 109 110 } else { 110 111 val &= ~mask; 111 - irq_desc[irq].handle_irq = handle_level_irq; 112 + irq_desc[d->irq].handle_irq = handle_level_irq; 112 113 } 113 114 114 115 writel(val, sirc_regs.int_type); ··· 138 139 ; 139 140 generic_handle_irq(sirq+FIRST_SIRC_IRQ); 140 141 141 - desc->chip->ack(irq); 142 + desc->irq_data.chip->irq_ack(&desc->irq_data); 142 143 } 143 144 144 145 static struct irq_chip sirc_irq_chip = { 145 - .name = "sirc", 146 - .ack = sirc_irq_ack, 147 - .mask = sirc_irq_mask, 148 - .unmask = sirc_irq_unmask, 149 - .set_wake = sirc_irq_set_wake, 150 - .set_type = sirc_irq_set_type, 146 + .name = "sirc", 147 + .irq_ack = sirc_irq_ack, 148 + .irq_mask = sirc_irq_mask, 149 + .irq_unmask = sirc_irq_unmask, 150 + .irq_set_wake = sirc_irq_set_wake, 151 + .irq_set_type = sirc_irq_set_type, 151 152 }; 152 153 153 154 void __init msm_init_sirc(void)
+2 -2
arch/arm/mach-mx3/mach-mx31_3ds.c
··· 147 147 .init_data = &pwgtx_init, 148 148 }, { 149 149 150 - .id = MC13783_REGU_GPO1, /* Turn on 1.8V */ 150 + .id = MC13783_REG_GPO1, /* Turn on 1.8V */ 151 151 .init_data = &gpo_init, 152 152 }, { 153 - .id = MC13783_REGU_GPO3, /* Turn on 3.3V */ 153 + .id = MC13783_REG_GPO3, /* Turn on 3.3V */ 154 154 .init_data = &gpo_init, 155 155 }, 156 156 };
+9 -9
arch/arm/mach-mx3/mach-mx31ads.c
··· 162 162 * Disable an expio pin's interrupt by setting the bit in the imr. 163 163 * @param irq an expio virtual irq number 164 164 */ 165 - static void expio_mask_irq(u32 irq) 165 + static void expio_mask_irq(struct irq_data *d) 166 166 { 167 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 167 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 168 168 /* mask the interrupt */ 169 169 __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG); 170 170 __raw_readw(PBC_INTMASK_CLEAR_REG); ··· 174 174 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr. 175 175 * @param irq an expanded io virtual irq number 176 176 */ 177 - static void expio_ack_irq(u32 irq) 177 + static void expio_ack_irq(struct irq_data *d) 178 178 { 179 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 179 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 180 180 /* clear the interrupt status */ 181 181 __raw_writew(1 << expio, PBC_INTSTATUS_REG); 182 182 } ··· 185 185 * Enable a expio pin's interrupt by clearing the bit in the imr. 186 186 * @param irq a expio virtual irq number 187 187 */ 188 - static void expio_unmask_irq(u32 irq) 188 + static void expio_unmask_irq(struct irq_data *d) 189 189 { 190 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 190 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 191 191 /* unmask the interrupt */ 192 192 __raw_writew(1 << expio, PBC_INTMASK_SET_REG); 193 193 } 194 194 195 195 static struct irq_chip expio_irq_chip = { 196 196 .name = "EXPIO(CPLD)", 197 - .ack = expio_ack_irq, 198 - .mask = expio_mask_irq, 199 - .unmask = expio_unmask_irq, 197 + .irq_ack = expio_ack_irq, 198 + .irq_mask = expio_mask_irq, 199 + .irq_unmask = expio_unmask_irq, 200 200 }; 201 201 202 202 static void __init mx31ads_init_expio(void)
+20
arch/arm/mach-mx5/Kconfig
··· 50 50 config MACH_MX51_3DS 51 51 bool "Support MX51PDK (3DS)" 52 52 select SOC_IMX51 53 + select IMX_HAVE_PLATFORM_IMX_KEYPAD 53 54 select IMX_HAVE_PLATFORM_IMX_UART 54 55 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 55 56 select IMX_HAVE_PLATFORM_SPI_IMX ··· 78 77 config MACH_EUKREA_MBIMX51_BASEBOARD 79 78 prompt "Eukrea MBIMX51 development board" 80 79 bool 80 + select IMX_HAVE_PLATFORM_IMX_KEYPAD 81 81 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 82 82 help 83 83 This adds board specific devices that can be found on Eukrea's ··· 126 124 bool "Support MX53 EVK platforms" 127 125 select SOC_IMX53 128 126 select IMX_HAVE_PLATFORM_IMX_UART 127 + select IMX_HAVE_PLATFORM_IMX_I2C 128 + select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 129 + select IMX_HAVE_PLATFORM_SPI_IMX 129 130 help 130 131 Include support for MX53 EVK platform. This includes specific 131 132 configurations for the board and its peripherals. 132 133 134 + config MACH_MX53_SMD 135 + bool "Support MX53 SMD platforms" 136 + select SOC_IMX53 137 + select IMX_HAVE_PLATFORM_IMX_UART 138 + help 139 + Include support for MX53 SMD platform. This includes specific 140 + configurations for the board and its peripherals. 141 + 142 + config MACH_MX53_LOCO 143 + bool "Support MX53 LOCO platforms" 144 + select SOC_IMX53 145 + select IMX_HAVE_PLATFORM_IMX_UART 146 + help 147 + Include support for MX53 LOCO platform. This includes specific 148 + configurations for the board and its peripherals. 133 149 134 150 config MACH_MX50_RDP 135 151 bool "Support MX50 reference design platform"
+2
arch/arm/mach-mx5/Makefile
··· 10 10 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 11 11 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o 12 12 obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o 13 + obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o 14 + obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o 13 15 obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o 14 16 obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 15 17 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
+2 -3
arch/arm/mach-mx5/board-mx51_3ds.c
··· 12 12 13 13 #include <linux/irq.h> 14 14 #include <linux/platform_device.h> 15 - #include <linux/input/matrix_keypad.h> 16 15 #include <linux/spi/spi.h> 17 16 18 17 #include <asm/mach-types.h> ··· 119 120 KEY(3, 5, KEY_BACK) 120 121 }; 121 122 122 - static struct matrix_keymap_data mx51_3ds_map_data = { 123 + static const struct matrix_keymap_data mx51_3ds_map_data __initconst = { 123 124 .keymap = mx51_3ds_board_keymap, 124 125 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap), 125 126 }; 126 127 127 128 static void mxc_init_keypad(void) 128 129 { 129 - mxc_register_device(&mxc_keypad_device, &mx51_3ds_map_data); 130 + imx51_add_imx_keypad(&mx51_3ds_map_data); 130 131 } 131 132 #else 132 133 static inline void mxc_init_keypad(void)
+74
arch/arm/mach-mx5/board-mx53_evk.c
··· 21 21 22 22 #include <linux/init.h> 23 23 #include <linux/clk.h> 24 + #include <linux/fec.h> 25 + #include <linux/delay.h> 26 + #include <linux/gpio.h> 27 + #include <linux/spi/flash.h> 28 + #include <linux/spi/spi.h> 24 29 #include <mach/common.h> 25 30 #include <mach/hardware.h> 26 31 #include <asm/mach-types.h> ··· 33 28 #include <asm/mach/time.h> 34 29 #include <mach/imx-uart.h> 35 30 #include <mach/iomux-mx53.h> 31 + 32 + #define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6) 33 + #define EVK_ECSPI1_CS0 IMX_GPIO_NR(2, 30) 34 + #define EVK_ECSPI1_CS1 IMX_GPIO_NR(3, 19) 36 35 37 36 #include "crm_regs.h" 38 37 #include "devices-imx53.h" ··· 56 47 MX53_PAD_ATA_CS_1__UART3_RXD, 57 48 MX53_PAD_ATA_DA_1__UART3_CTS, 58 49 MX53_PAD_ATA_DA_2__UART3_RTS, 50 + 51 + MX53_PAD_EIM_D16__CSPI1_SCLK, 52 + MX53_PAD_EIM_D17__CSPI1_MISO, 53 + MX53_PAD_EIM_D18__CSPI1_MOSI, 54 + 55 + /* ecspi chip select lines */ 56 + MX53_PAD_EIM_EB2__GPIO_2_30, 57 + MX53_PAD_EIM_D19__GPIO_3_19, 59 58 }; 60 59 61 60 static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { ··· 77 60 imx53_add_imx_uart(2, &mx53_evk_uart_pdata); 78 61 } 79 62 63 + static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = { 64 + .bitrate = 100000, 65 + }; 66 + 67 + static inline void mx53_evk_fec_reset(void) 68 + { 69 + int ret; 70 + 71 + /* reset FEC PHY */ 72 + ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); 73 + if (ret) { 74 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 75 + return; 76 + } 77 + gpio_direction_output(SMD_FEC_PHY_RST, 0); 78 + gpio_set_value(SMD_FEC_PHY_RST, 0); 79 + msleep(1); 80 + gpio_set_value(SMD_FEC_PHY_RST, 1); 81 + } 82 + 83 + static struct fec_platform_data mx53_evk_fec_pdata = { 84 + .phy = PHY_INTERFACE_MODE_RMII, 85 + }; 86 + 87 + static struct spi_board_info mx53_evk_spi_board_info[] __initdata = { 88 + { 89 + .modalias = "mtd_dataflash", 90 + .max_speed_hz = 25000000, 91 + .bus_num = 0, 92 + .chip_select = 1, 93 + .mode = SPI_MODE_0, 94 + .platform_data = NULL, 95 + }, 96 + }; 97 + 98 + static int mx53_evk_spi_cs[] = { 99 + EVK_ECSPI1_CS0, 100 + EVK_ECSPI1_CS1, 101 + }; 102 + 103 + static const struct spi_imx_master mx53_evk_spi_data __initconst = { 104 + .chipselect = mx53_evk_spi_cs, 105 + .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs), 106 + }; 107 + 80 108 static void __init mx53_evk_board_init(void) 81 109 { 82 110 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, 83 111 ARRAY_SIZE(mx53_evk_pads)); 84 112 mx53_evk_init_uart(); 113 + mx53_evk_fec_reset(); 114 + imx53_add_fec(&mx53_evk_fec_pdata); 115 + 116 + imx53_add_imx_i2c(0, &mx53_evk_i2c_data); 117 + imx53_add_imx_i2c(1, &mx53_evk_i2c_data); 118 + 119 + imx53_add_sdhci_esdhc_imx(0, NULL); 120 + imx53_add_sdhci_esdhc_imx(1, NULL); 121 + 122 + spi_register_board_info(mx53_evk_spi_board_info, 123 + ARRAY_SIZE(mx53_evk_spi_board_info)); 124 + imx53_add_ecspi(0, &mx53_evk_spi_data); 85 125 } 86 126 87 127 static void __init mx53_evk_timer_init(void)
+111
arch/arm/mach-mx5/board-mx53_loco.c
··· 1 + /* 2 + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. 3 + */ 4 + 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 along 17 + * with this program; if not, write to the Free Software Foundation, Inc., 18 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 + */ 20 + 21 + #include <linux/init.h> 22 + #include <linux/clk.h> 23 + #include <linux/fec.h> 24 + #include <linux/delay.h> 25 + #include <linux/gpio.h> 26 + 27 + #include <mach/common.h> 28 + #include <mach/hardware.h> 29 + #include <mach/imx-uart.h> 30 + #include <mach/iomux-mx53.h> 31 + 32 + #include <asm/mach-types.h> 33 + #include <asm/mach/arch.h> 34 + #include <asm/mach/time.h> 35 + 36 + #include "crm_regs.h" 37 + #include "devices-imx53.h" 38 + 39 + #define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) 40 + 41 + static iomux_v3_cfg_t mx53_loco_pads[] = { 42 + MX53_PAD_CSI0_D10__UART1_TXD, 43 + MX53_PAD_CSI0_D11__UART1_RXD, 44 + MX53_PAD_ATA_DIOW__UART1_TXD, 45 + MX53_PAD_ATA_DMACK__UART1_RXD, 46 + 47 + MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 48 + MX53_PAD_ATA_DMARQ__UART2_TXD, 49 + MX53_PAD_ATA_DIOR__UART2_RTS, 50 + MX53_PAD_ATA_INTRQ__UART2_CTS, 51 + 52 + MX53_PAD_ATA_CS_0__UART3_TXD, 53 + MX53_PAD_ATA_CS_1__UART3_RXD, 54 + MX53_PAD_ATA_DA_1__UART3_CTS, 55 + MX53_PAD_ATA_DA_2__UART3_RTS, 56 + }; 57 + 58 + static const struct imxuart_platform_data mx53_loco_uart_data __initconst = { 59 + .flags = IMXUART_HAVE_RTSCTS, 60 + }; 61 + 62 + static inline void mx53_loco_init_uart(void) 63 + { 64 + imx53_add_imx_uart(0, &mx53_loco_uart_data); 65 + imx53_add_imx_uart(1, &mx53_loco_uart_data); 66 + imx53_add_imx_uart(2, &mx53_loco_uart_data); 67 + } 68 + 69 + static inline void mx53_loco_fec_reset(void) 70 + { 71 + int ret; 72 + 73 + /* reset FEC PHY */ 74 + ret = gpio_request(LOCO_FEC_PHY_RST, "fec-phy-reset"); 75 + if (ret) { 76 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 77 + return; 78 + } 79 + gpio_direction_output(LOCO_FEC_PHY_RST, 0); 80 + msleep(1); 81 + gpio_set_value(LOCO_FEC_PHY_RST, 1); 82 + } 83 + 84 + static struct fec_platform_data mx53_loco_fec_data = { 85 + .phy = PHY_INTERFACE_MODE_RMII, 86 + }; 87 + 88 + static void __init mx53_loco_board_init(void) 89 + { 90 + mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, 91 + ARRAY_SIZE(mx53_loco_pads)); 92 + mx53_loco_init_uart(); 93 + mx53_loco_fec_reset(); 94 + imx53_add_fec(&mx53_loco_fec_data); 95 + } 96 + 97 + static void __init mx53_loco_timer_init(void) 98 + { 99 + mx53_clocks_init(32768, 24000000, 0, 0); 100 + } 101 + 102 + static struct sys_timer mx53_loco_timer = { 103 + .init = mx53_loco_timer_init, 104 + }; 105 + 106 + MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board") 107 + .map_io = mx53_map_io, 108 + .init_irq = mx53_init_irq, 109 + .init_machine = mx53_loco_board_init, 110 + .timer = &mx53_loco_timer, 111 + MACHINE_END
+111
arch/arm/mach-mx5/board-mx53_smd.c
··· 1 + /* 2 + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. 3 + */ 4 + 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 along 17 + * with this program; if not, write to the Free Software Foundation, Inc., 18 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 + */ 20 + 21 + #include <linux/init.h> 22 + #include <linux/clk.h> 23 + #include <linux/fec.h> 24 + #include <linux/delay.h> 25 + #include <linux/gpio.h> 26 + 27 + #include <mach/common.h> 28 + #include <mach/hardware.h> 29 + #include <mach/imx-uart.h> 30 + #include <mach/iomux-mx53.h> 31 + 32 + #include <asm/mach-types.h> 33 + #include <asm/mach/arch.h> 34 + #include <asm/mach/time.h> 35 + 36 + #include "crm_regs.h" 37 + #include "devices-imx53.h" 38 + 39 + #define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6) 40 + 41 + static iomux_v3_cfg_t mx53_smd_pads[] = { 42 + MX53_PAD_CSI0_D10__UART1_TXD, 43 + MX53_PAD_CSI0_D11__UART1_RXD, 44 + MX53_PAD_ATA_DIOW__UART1_TXD, 45 + MX53_PAD_ATA_DMACK__UART1_RXD, 46 + 47 + MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 48 + MX53_PAD_ATA_DMARQ__UART2_TXD, 49 + MX53_PAD_ATA_DIOR__UART2_RTS, 50 + MX53_PAD_ATA_INTRQ__UART2_CTS, 51 + 52 + MX53_PAD_ATA_CS_0__UART3_TXD, 53 + MX53_PAD_ATA_CS_1__UART3_RXD, 54 + MX53_PAD_ATA_DA_1__UART3_CTS, 55 + MX53_PAD_ATA_DA_2__UART3_RTS, 56 + }; 57 + 58 + static const struct imxuart_platform_data mx53_smd_uart_data __initconst = { 59 + .flags = IMXUART_HAVE_RTSCTS, 60 + }; 61 + 62 + static inline void mx53_smd_init_uart(void) 63 + { 64 + imx53_add_imx_uart(0, &mx53_smd_uart_data); 65 + imx53_add_imx_uart(1, &mx53_smd_uart_data); 66 + imx53_add_imx_uart(2, &mx53_smd_uart_data); 67 + } 68 + 69 + static inline void mx53_smd_fec_reset(void) 70 + { 71 + int ret; 72 + 73 + /* reset FEC PHY */ 74 + ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); 75 + if (ret) { 76 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 77 + return; 78 + } 79 + gpio_direction_output(SMD_FEC_PHY_RST, 0); 80 + msleep(1); 81 + gpio_set_value(SMD_FEC_PHY_RST, 1); 82 + } 83 + 84 + static struct fec_platform_data mx53_smd_fec_data = { 85 + .phy = PHY_INTERFACE_MODE_RMII, 86 + }; 87 + 88 + static void __init mx53_smd_board_init(void) 89 + { 90 + mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, 91 + ARRAY_SIZE(mx53_smd_pads)); 92 + mx53_smd_init_uart(); 93 + mx53_smd_fec_reset(); 94 + imx53_add_fec(&mx53_smd_fec_data); 95 + } 96 + 97 + static void __init mx53_smd_timer_init(void) 98 + { 99 + mx53_clocks_init(32768, 24000000, 22579200, 0); 100 + } 101 + 102 + static struct sys_timer mx53_smd_timer = { 103 + .init = mx53_smd_timer_init, 104 + }; 105 + 106 + MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board") 107 + .map_io = mx53_map_io, 108 + .init_irq = mx53_init_irq, 109 + .init_machine = mx53_smd_board_init, 110 + .timer = &mx53_smd_timer, 111 + MACHINE_END
+16 -2
arch/arm/mach-mx5/clock-mx51-mx53.c
··· 1191 1191 DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, 1192 1192 NULL, NULL, &ipg_clk, &gpt_ipg_clk); 1193 1193 1194 + DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET, 1195 + NULL, NULL, &ipg_clk, NULL); 1196 + DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET, 1197 + NULL, NULL, &ipg_clk, NULL); 1198 + 1194 1199 /* I2C */ 1195 1200 DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, 1196 1201 NULL, NULL, &ipg_clk, NULL); ··· 1288 1283 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1289 1284 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1290 1285 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1286 + _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) 1287 + _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) 1291 1288 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1292 1289 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1293 1290 _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) ··· 1302 1295 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk) 1303 1296 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) 1304 1297 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) 1305 - _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) 1298 + _REGISTER_CLOCK("imx-keypad", NULL, kpp_clk) 1306 1299 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) 1307 1300 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1308 1301 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) ··· 1333 1326 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1334 1327 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1335 1328 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1329 + _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1330 + _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1331 + _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1332 + _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1333 + _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) 1334 + _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) 1335 + _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) 1336 1336 }; 1337 1337 1338 1338 static void clk_tree_init(void) ··· 1377 1363 1378 1364 clk_tree_init(); 1379 1365 1380 - clk_set_parent(&uart_root_clk, &pll3_sw_clk); 1381 1366 clk_enable(&cpu_clk); 1382 1367 clk_enable(&main_bus_clk); 1383 1368 ··· 1419 1406 1420 1407 clk_tree_init(); 1421 1408 1409 + clk_set_parent(&uart_root_clk, &pll3_sw_clk); 1422 1410 clk_enable(&cpu_clk); 1423 1411 clk_enable(&main_bus_clk); 1424 1412
+8
arch/arm/mach-mx5/devices-imx51.h
··· 47 47 extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; 48 48 #define imx51_add_imx2_wdt(id, pdata) \ 49 49 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) 50 + 51 + extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst; 52 + #define imx51_add_mxc_pwm(id) \ 53 + imx_add_mxc_pwm(&imx51_mxc_pwm_data[id]) 54 + 55 + extern const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst; 56 + #define imx51_add_imx_keypad(pdata) \ 57 + imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
+18
arch/arm/mach-mx5/devices-imx53.h
··· 8 8 #include <mach/mx53.h> 9 9 #include <mach/devices-common.h> 10 10 11 + extern const struct imx_fec_data imx53_fec_data __initconst; 12 + #define imx53_add_fec(pdata) \ 13 + imx_add_fec(&imx53_fec_data, pdata) 14 + 11 15 extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst; 12 16 #define imx53_add_imx_uart(id, pdata) \ 13 17 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata) 18 + 19 + 20 + extern const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst; 21 + #define imx53_add_imx_i2c(id, pdata) \ 22 + imx_add_imx_i2c(&imx53_imx_i2c_data[id], pdata) 23 + 24 + extern const struct imx_sdhci_esdhc_imx_data 25 + imx53_sdhci_esdhc_imx_data[] __initconst; 26 + #define imx53_add_sdhci_esdhc_imx(id, pdata) \ 27 + imx_add_sdhci_esdhc_imx(&imx53_sdhci_esdhc_imx_data[id], pdata) 28 + 29 + extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst; 30 + #define imx53_add_ecspi(id, pdata) \ 31 + imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
-19
arch/arm/mach-mx5/devices.c
··· 120 120 }, 121 121 }; 122 122 123 - static struct resource mxc_kpp_resources[] = { 124 - { 125 - .start = MX51_MXC_INT_KPP, 126 - .end = MX51_MXC_INT_KPP, 127 - .flags = IORESOURCE_IRQ, 128 - } , { 129 - .start = MX51_KPP_BASE_ADDR, 130 - .end = MX51_KPP_BASE_ADDR + 0x8 - 1, 131 - .flags = IORESOURCE_MEM, 132 - }, 133 - }; 134 - 135 - struct platform_device mxc_keypad_device = { 136 - .name = "imx-keypad", 137 - .id = 0, 138 - .num_resources = ARRAY_SIZE(mxc_kpp_resources), 139 - .resource = mxc_kpp_resources, 140 - }; 141 - 142 123 static struct mxc_gpio_port mxc_gpio_ports[] = { 143 124 { 144 125 .chip.label = "gpio-0",
-1
arch/arm/mach-mx5/devices.h
··· 3 3 extern struct platform_device mxc_usbh2_device; 4 4 extern struct platform_device mxc_usbdr_udc_device; 5 5 extern struct platform_device mxc_hsi2c_device; 6 - extern struct platform_device mxc_keypad_device;
+2 -3
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
··· 21 21 #include <linux/fsl_devices.h> 22 22 #include <linux/i2c/tsc2007.h> 23 23 #include <linux/leds.h> 24 - #include <linux/input/matrix_keypad.h> 25 24 26 25 #include <mach/common.h> 27 26 #include <mach/hardware.h> ··· 156 157 KEY(3, 3, KEY_ENTER), 157 158 }; 158 159 159 - static struct matrix_keymap_data mbimx51_map_data = { 160 + static const struct matrix_keymap_data mbimx51_map_data __initconst = { 160 161 .keymap = mbimx51_keymap, 161 162 .keymap_size = ARRAY_SIZE(mbimx51_keymap), 162 163 }; ··· 208 209 209 210 platform_add_devices(devices, ARRAY_SIZE(devices)); 210 211 211 - mxc_register_device(&mxc_keypad_device, &mbimx51_map_data); 212 + imx51_add_imx_keypad(&mbimx51_map_data); 212 213 213 214 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); 214 215 gpio_direction_input(MBIMX51_TSC2007_GPIO);
+2 -2
arch/arm/mach-mxs/Kconfig
··· 15 15 config MACH_MX23EVK 16 16 bool "Support MX23EVK Platform" 17 17 select SOC_IMX23 18 - select MXS_HAVE_PLATFORM_DUART 18 + select MXS_HAVE_AMBA_DUART 19 19 default y 20 20 help 21 21 Include support for MX23EVK platform. This includes specific ··· 24 24 config MACH_MX28EVK 25 25 bool "Support MX28EVK Platform" 26 26 select SOC_IMX28 27 - select MXS_HAVE_PLATFORM_DUART 27 + select MXS_HAVE_AMBA_DUART 28 28 select MXS_HAVE_PLATFORM_FEC 29 29 default y 30 30 help
+11 -2
arch/arm/mach-mxs/clock-mx23.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 #include <linux/jiffies.h> 24 + #include <linux/clkdev.h> 24 25 25 26 #include <asm/clkdev.h> 26 27 #include <asm/div64.h> ··· 438 437 }, 439 438 440 439 static struct clk_lookup lookups[] = { 441 - _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) 440 + /* for amba bus driver */ 441 + _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk) 442 + /* for amba-pl011 driver */ 443 + _REGISTER_CLOCK("duart", NULL, uart_clk) 442 444 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 443 445 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 444 - _REGISTER_CLOCK(NULL, "xclk", xbus_clk) 445 446 _REGISTER_CLOCK(NULL, "usb", usb_clk) 446 447 _REGISTER_CLOCK(NULL, "audio", audio_clk) 447 448 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) ··· 520 517 int __init mx23_clocks_init(void) 521 518 { 522 519 clk_misc_init(); 520 + 521 + clk_enable(&cpu_clk); 522 + clk_enable(&hbus_clk); 523 + clk_enable(&xbus_clk); 524 + clk_enable(&emi_clk); 525 + clk_enable(&uart_clk); 523 526 524 527 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 525 528
+13 -1
arch/arm/mach-mxs/clock-mx28.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 23 #include <linux/jiffies.h> 24 + #include <linux/clkdev.h> 24 25 25 26 #include <asm/clkdev.h> 26 27 #include <asm/div64.h> ··· 603 602 }, 604 603 605 604 static struct clk_lookup lookups[] = { 606 - _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) 605 + /* for amba bus driver */ 606 + _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk) 607 + /* for amba-pl011 driver */ 608 + _REGISTER_CLOCK("duart", NULL, uart_clk) 609 + _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) 610 + _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) 607 611 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 608 612 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 609 613 _REGISTER_CLOCK("pll2", NULL, pll2_clk) ··· 731 725 int __init mx28_clocks_init(void) 732 726 { 733 727 clk_misc_init(); 728 + 729 + clk_enable(&cpu_clk); 730 + clk_enable(&hbus_clk); 731 + clk_enable(&xbus_clk); 732 + clk_enable(&emi_clk); 733 + clk_enable(&uart_clk); 734 734 735 735 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 736 736
+2 -2
arch/arm/mach-mxs/devices-mx23.h
··· 11 11 #include <mach/mx23.h> 12 12 #include <mach/devices-common.h> 13 13 14 - extern const struct mxs_duart_data mx23_duart_data __initconst; 14 + extern const struct amba_device mx23_duart_device __initconst; 15 15 #define mx23_add_duart() \ 16 - mxs_add_duart(&mx23_duart_data) 16 + mxs_add_duart(&mx23_duart_device)
+2 -2
arch/arm/mach-mxs/devices-mx28.h
··· 11 11 #include <mach/mx28.h> 12 12 #include <mach/devices-common.h> 13 13 14 - extern const struct mxs_duart_data mx28_duart_data __initconst; 14 + extern const struct amba_device mx28_duart_device __initconst; 15 15 #define mx28_add_duart() \ 16 - mxs_add_duart(&mx28_duart_data) 16 + mxs_add_duart(&mx28_duart_device) 17 17 18 18 extern const struct mxs_fec_data mx28_fec_data[] __initconst; 19 19 #define mx28_add_fec(id, pdata) \
+15 -2
arch/arm/mach-mxs/devices.c
··· 19 19 #include <linux/kernel.h> 20 20 #include <linux/slab.h> 21 21 #include <linux/init.h> 22 - #include <linux/err.h> 23 22 #include <linux/platform_device.h> 24 - #include <mach/common.h> 23 + #include <linux/amba/bus.h> 25 24 26 25 struct platform_device *__init mxs_add_platform_device_dmamask( 27 26 const char *name, int id, ··· 71 72 } 72 73 73 74 return pdev; 75 + } 76 + 77 + int __init mxs_add_amba_device(const struct amba_device *dev) 78 + { 79 + struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL); 80 + 81 + if (!adev) { 82 + pr_err("%s: failed to allocate memory", __func__); 83 + return -ENOMEM; 84 + } 85 + 86 + *adev = *dev; 87 + 88 + return amba_device_register(adev, &iomem_resource); 74 89 }
+2 -1
arch/arm/mach-mxs/devices/Kconfig
··· 1 - config MXS_HAVE_PLATFORM_DUART 1 + config MXS_HAVE_AMBA_DUART 2 2 bool 3 + select ARM_AMBA 3 4 4 5 config MXS_HAVE_PLATFORM_FEC 5 6 bool
+1 -1
arch/arm/mach-mxs/devices/Makefile
··· 1 - obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o 1 + obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o 2 2 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
+40
arch/arm/mach-mxs/devices/amba-duart.c
··· 1 + /* 2 + * Copyright (C) 2009-2010 Pengutronix 3 + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 + * 5 + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. 6 + * 7 + * This program is free software; you can redistribute it and/or modify it under 8 + * the terms of the GNU General Public License version 2 as published by the 9 + * Free Software Foundation. 10 + */ 11 + #include <asm/irq.h> 12 + #include <mach/mx23.h> 13 + #include <mach/mx28.h> 14 + #include <mach/devices-common.h> 15 + 16 + #define MXS_AMBA_DUART_DEVICE(name, soc) \ 17 + const struct amba_device name##_device __initconst = { \ 18 + .dev = { \ 19 + .init_name = "duart", \ 20 + }, \ 21 + .res = { \ 22 + .start = soc ## _DUART_BASE_ADDR, \ 23 + .end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1, \ 24 + .flags = IORESOURCE_MEM, \ 25 + }, \ 26 + .irq = {soc ## _INT_DUART, NO_IRQ}, \ 27 + } 28 + 29 + #ifdef CONFIG_SOC_IMX23 30 + MXS_AMBA_DUART_DEVICE(mx23_duart, MX23); 31 + #endif 32 + 33 + #ifdef CONFIG_SOC_IMX28 34 + MXS_AMBA_DUART_DEVICE(mx28_duart, MX28); 35 + #endif 36 + 37 + int __init mxs_add_duart(const struct amba_device *dev) 38 + { 39 + return mxs_add_amba_device(dev); 40 + }
-48
arch/arm/mach-mxs/devices/platform-duart.c
··· 1 - /* 2 - * Copyright (C) 2009-2010 Pengutronix 3 - * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 - * 5 - * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. 6 - * 7 - * This program is free software; you can redistribute it and/or modify it under 8 - * the terms of the GNU General Public License version 2 as published by the 9 - * Free Software Foundation. 10 - */ 11 - #include <mach/mx23.h> 12 - #include <mach/mx28.h> 13 - #include <mach/devices-common.h> 14 - 15 - #define mxs_duart_data_entry(soc) \ 16 - { \ 17 - .iobase = soc ## _DUART_BASE_ADDR, \ 18 - .irq = soc ## _INT_DUART, \ 19 - } 20 - 21 - #ifdef CONFIG_SOC_IMX23 22 - const struct mxs_duart_data mx23_duart_data __initconst = 23 - mxs_duart_data_entry(MX23); 24 - #endif 25 - 26 - #ifdef CONFIG_SOC_IMX28 27 - const struct mxs_duart_data mx28_duart_data __initconst = 28 - mxs_duart_data_entry(MX28); 29 - #endif 30 - 31 - struct platform_device *__init mxs_add_duart( 32 - const struct mxs_duart_data *data) 33 - { 34 - struct resource res[] = { 35 - { 36 - .start = data->iobase, 37 - .end = data->iobase + SZ_8K - 1, 38 - .flags = IORESOURCE_MEM, 39 - }, { 40 - .start = data->irq, 41 - .end = data->irq, 42 - .flags = IORESOURCE_IRQ, 43 - }, 44 - }; 45 - 46 - return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res), 47 - NULL, 0); 48 - }
+1 -1
arch/arm/mach-mxs/devices/platform-fec.c
··· 45 45 }, 46 46 }; 47 47 48 - return mxs_add_platform_device("fec", data->id, 48 + return mxs_add_platform_device("imx28-fec", data->id, 49 49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 50 50 }
+4 -7
arch/arm/mach-mxs/include/mach/devices-common.h
··· 9 9 #include <linux/kernel.h> 10 10 #include <linux/platform_device.h> 11 11 #include <linux/init.h> 12 + #include <linux/amba/bus.h> 12 13 13 14 struct platform_device *mxs_add_platform_device_dmamask( 14 15 const char *name, int id, ··· 25 24 name, id, res, num_resources, data, size_data, 0); 26 25 } 27 26 27 + int __init mxs_add_amba_device(const struct amba_device *dev); 28 + 28 29 /* duart */ 29 - struct mxs_duart_data { 30 - resource_size_t iobase; 31 - resource_size_t iosize; 32 - resource_size_t irq; 33 - }; 34 - struct platform_device *__init mxs_add_duart( 35 - const struct mxs_duart_data *data); 30 + int __init mxs_add_duart(const struct amba_device *dev); 36 31 37 32 /* fec */ 38 33 #include <linux/fec.h>
+23 -3
arch/arm/mach-mxs/mach-mx28evk.c
··· 57 57 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 58 58 MX28_PAD_ENET_CLK__CLKCTRL_ENET | 59 59 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 60 + /* fec1 */ 61 + MX28_PAD_ENET0_CRS__ENET1_RX_EN | 62 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 63 + MX28_PAD_ENET0_RXD2__ENET1_RXD0 | 64 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 65 + MX28_PAD_ENET0_RXD3__ENET1_RXD1 | 66 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 67 + MX28_PAD_ENET0_COL__ENET1_TX_EN | 68 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 69 + MX28_PAD_ENET0_TXD2__ENET1_TXD0 | 70 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 71 + MX28_PAD_ENET0_TXD3__ENET1_TXD1 | 72 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 60 73 /* phy power line */ 61 74 MX28_PAD_SSP1_DATA3__GPIO_2_15 | 62 75 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), ··· 119 106 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); 120 107 } 121 108 122 - static const struct fec_platform_data mx28_fec_pdata __initconst = { 123 - .phy = PHY_INTERFACE_MODE_RMII, 109 + static struct fec_platform_data mx28_fec_pdata[] = { 110 + { 111 + /* fec0 */ 112 + .phy = PHY_INTERFACE_MODE_RMII, 113 + }, { 114 + /* fec1 */ 115 + .phy = PHY_INTERFACE_MODE_RMII, 116 + }, 124 117 }; 125 118 126 119 static void __init mx28evk_init(void) ··· 136 117 mx28_add_duart(); 137 118 138 119 mx28evk_fec_reset(); 139 - mx28_add_fec(0, &mx28_fec_pdata); 120 + mx28_add_fec(0, &mx28_fec_pdata[0]); 121 + mx28_add_fec(1, &mx28_fec_pdata[1]); 140 122 } 141 123 142 124 static void __init mx28evk_timer_init(void)
+15 -15
arch/arm/mach-netx/generic.c
··· 88 88 } 89 89 90 90 static int 91 - netx_hif_irq_type(unsigned int _irq, unsigned int type) 91 + netx_hif_irq_type(struct irq_data *d, unsigned int type) 92 92 { 93 93 unsigned int val, irq; 94 94 95 95 val = readl(NETX_DPMAS_IF_CONF1); 96 96 97 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 97 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 98 98 99 99 if (type & IRQ_TYPE_EDGE_RISING) { 100 100 DEBUG_IRQ("rising edges\n"); ··· 119 119 } 120 120 121 121 static void 122 - netx_hif_ack_irq(unsigned int _irq) 122 + netx_hif_ack_irq(struct irq_data *d) 123 123 { 124 124 unsigned int val, irq; 125 125 126 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 126 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 127 127 writel((1 << 24) << irq, NETX_DPMAS_INT_STAT); 128 128 129 129 val = readl(NETX_DPMAS_INT_EN); 130 130 val &= ~((1 << 24) << irq); 131 131 writel(val, NETX_DPMAS_INT_EN); 132 132 133 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 133 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 134 134 } 135 135 136 136 static void 137 - netx_hif_mask_irq(unsigned int _irq) 137 + netx_hif_mask_irq(struct irq_data *d) 138 138 { 139 139 unsigned int val, irq; 140 140 141 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 141 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 142 142 val = readl(NETX_DPMAS_INT_EN); 143 143 val &= ~((1 << 24) << irq); 144 144 writel(val, NETX_DPMAS_INT_EN); 145 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 145 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 146 146 } 147 147 148 148 static void 149 - netx_hif_unmask_irq(unsigned int _irq) 149 + netx_hif_unmask_irq(struct irq_data *d) 150 150 { 151 151 unsigned int val, irq; 152 152 153 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 153 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 154 154 val = readl(NETX_DPMAS_INT_EN); 155 155 val |= (1 << 24) << irq; 156 156 writel(val, NETX_DPMAS_INT_EN); 157 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 157 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 158 158 } 159 159 160 160 static struct irq_chip netx_hif_chip = { 161 - .ack = netx_hif_ack_irq, 162 - .mask = netx_hif_mask_irq, 163 - .unmask = netx_hif_unmask_irq, 164 - .set_type = netx_hif_irq_type, 161 + .irq_ack = netx_hif_ack_irq, 162 + .irq_mask = netx_hif_mask_irq, 163 + .irq_unmask = netx_hif_unmask_irq, 164 + .irq_set_type = netx_hif_irq_type, 165 165 }; 166 166 167 167 void __init netx_init_irq(void)
+14 -14
arch/arm/mach-ns9xxx/board-a9m9750dev.c
··· 37 37 ARRAY_SIZE(board_a9m9750dev_io_desc)); 38 38 } 39 39 40 - static void a9m9750dev_fpga_ack_irq(unsigned int irq) 40 + static void a9m9750dev_fpga_ack_irq(struct irq_data *d) 41 41 { 42 42 /* nothing */ 43 43 } 44 44 45 - static void a9m9750dev_fpga_mask_irq(unsigned int irq) 45 + static void a9m9750dev_fpga_mask_irq(struct irq_data *d) 46 46 { 47 47 u8 ier; 48 48 49 49 ier = __raw_readb(FPGA_IER); 50 50 51 - ier &= ~(1 << (irq - FPGA_IRQ(0))); 51 + ier &= ~(1 << (d->irq - FPGA_IRQ(0))); 52 52 53 53 __raw_writeb(ier, FPGA_IER); 54 54 } 55 55 56 - static void a9m9750dev_fpga_maskack_irq(unsigned int irq) 56 + static void a9m9750dev_fpga_maskack_irq(struct irq_data *d) 57 57 { 58 - a9m9750dev_fpga_mask_irq(irq); 59 - a9m9750dev_fpga_ack_irq(irq); 58 + a9m9750dev_fpga_mask_irq(d); 59 + a9m9750dev_fpga_ack_irq(d); 60 60 } 61 61 62 - static void a9m9750dev_fpga_unmask_irq(unsigned int irq) 62 + static void a9m9750dev_fpga_unmask_irq(struct irq_data *d) 63 63 { 64 64 u8 ier; 65 65 66 66 ier = __raw_readb(FPGA_IER); 67 67 68 - ier |= 1 << (irq - FPGA_IRQ(0)); 68 + ier |= 1 << (d->irq - FPGA_IRQ(0)); 69 69 70 70 __raw_writeb(ier, FPGA_IER); 71 71 } 72 72 73 73 static struct irq_chip a9m9750dev_fpga_chip = { 74 - .ack = a9m9750dev_fpga_ack_irq, 75 - .mask = a9m9750dev_fpga_mask_irq, 76 - .mask_ack = a9m9750dev_fpga_maskack_irq, 77 - .unmask = a9m9750dev_fpga_unmask_irq, 74 + .irq_ack = a9m9750dev_fpga_ack_irq, 75 + .irq_mask = a9m9750dev_fpga_mask_irq, 76 + .irq_mask_ack = a9m9750dev_fpga_maskack_irq, 77 + .irq_unmask = a9m9750dev_fpga_unmask_irq, 78 78 }; 79 79 80 80 static void a9m9750dev_fpga_demux_handler(unsigned int irq, ··· 82 82 { 83 83 u8 stat = __raw_readb(FPGA_ISR); 84 84 85 - desc->chip->mask_ack(irq); 85 + desc->irq_data.chip->irq_mask_ack(&desc->irq_data); 86 86 87 87 while (stat != 0) { 88 88 int irqno = fls(stat) - 1; ··· 92 92 generic_handle_irq(FPGA_IRQ(irqno)); 93 93 } 94 94 95 - desc->chip->unmask(irq); 95 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 96 96 } 97 97 98 98 void __init board_a9m9750dev_init_irq(void)
+14 -14
arch/arm/mach-ns9xxx/irq.c
··· 22 22 #define irq2prio(i) (i) 23 23 #define prio2irq(p) (p) 24 24 25 - static void ns9xxx_mask_irq(unsigned int irq) 25 + static void ns9xxx_mask_irq(struct irq_data *d) 26 26 { 27 27 /* XXX: better use cpp symbols */ 28 - int prio = irq2prio(irq); 28 + int prio = irq2prio(d->irq); 29 29 u32 ic = __raw_readl(SYS_IC(prio / 4)); 30 30 ic &= ~(1 << (7 + 8 * (3 - (prio & 3)))); 31 31 __raw_writel(ic, SYS_IC(prio / 4)); 32 32 } 33 33 34 - static void ns9xxx_ack_irq(unsigned int irq) 34 + static void ns9xxx_ack_irq(struct irq_data *d) 35 35 { 36 36 __raw_writel(0, SYS_ISRADDR); 37 37 } 38 38 39 - static void ns9xxx_maskack_irq(unsigned int irq) 39 + static void ns9xxx_maskack_irq(struct irq_data *d) 40 40 { 41 - ns9xxx_mask_irq(irq); 42 - ns9xxx_ack_irq(irq); 41 + ns9xxx_mask_irq(d); 42 + ns9xxx_ack_irq(d); 43 43 } 44 44 45 - static void ns9xxx_unmask_irq(unsigned int irq) 45 + static void ns9xxx_unmask_irq(struct irq_data *d) 46 46 { 47 47 /* XXX: better use cpp symbols */ 48 - int prio = irq2prio(irq); 48 + int prio = irq2prio(d->irq); 49 49 u32 ic = __raw_readl(SYS_IC(prio / 4)); 50 50 ic |= 1 << (7 + 8 * (3 - (prio & 3))); 51 51 __raw_writel(ic, SYS_IC(prio / 4)); 52 52 } 53 53 54 54 static struct irq_chip ns9xxx_chip = { 55 - .ack = ns9xxx_ack_irq, 56 - .mask = ns9xxx_mask_irq, 57 - .mask_ack = ns9xxx_maskack_irq, 58 - .unmask = ns9xxx_unmask_irq, 55 + .irq_ack = ns9xxx_ack_irq, 56 + .irq_mask = ns9xxx_mask_irq, 57 + .irq_mask_ack = ns9xxx_maskack_irq, 58 + .irq_unmask = ns9xxx_unmask_irq, 59 59 }; 60 60 61 61 #if 0 ··· 92 92 93 93 if (desc->status & IRQ_DISABLED) 94 94 out_mask: 95 - desc->chip->mask(irq); 95 + desc->irq_data.chip->irq_mask(&desc->irq_data); 96 96 97 97 /* ack unconditionally to unmask lower prio irqs */ 98 - desc->chip->ack(irq); 98 + desc->irq_data.chip->irq_ack(&desc->irq_data); 99 99 100 100 raw_spin_unlock(&desc->lock); 101 101 }
+8 -8
arch/arm/mach-nuc93x/irq.c
··· 25 25 #include <mach/hardware.h> 26 26 #include <mach/regs-irq.h> 27 27 28 - static void nuc93x_irq_mask(unsigned int irq) 28 + static void nuc93x_irq_mask(struct irq_data *d) 29 29 { 30 - __raw_writel(1 << irq, REG_AIC_MDCR); 30 + __raw_writel(1 << d->irq, REG_AIC_MDCR); 31 31 } 32 32 33 33 /* ··· 35 35 * to REG_AIC_EOSCR for ACK 36 36 */ 37 37 38 - static void nuc93x_irq_ack(unsigned int irq) 38 + static void nuc93x_irq_ack(struct irq_data *d) 39 39 { 40 40 __raw_writel(0x01, REG_AIC_EOSCR); 41 41 } 42 42 43 - static void nuc93x_irq_unmask(unsigned int irq) 43 + static void nuc93x_irq_unmask(struct irq_data *d) 44 44 { 45 - __raw_writel(1 << irq, REG_AIC_MECR); 45 + __raw_writel(1 << d->irq, REG_AIC_MECR); 46 46 47 47 } 48 48 49 49 static struct irq_chip nuc93x_irq_chip = { 50 - .ack = nuc93x_irq_ack, 51 - .mask = nuc93x_irq_mask, 52 - .unmask = nuc93x_irq_unmask, 50 + .irq_ack = nuc93x_irq_ack, 51 + .irq_mask = nuc93x_irq_mask, 52 + .irq_unmask = nuc93x_irq_unmask, 53 53 }; 54 54 55 55 void __init nuc93x_init_irq(void)
+5 -3
arch/arm/mach-omap1/ams-delta-fiq.c
··· 49 49 50 50 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 51 if (irq_desc) 52 - irq_chip = irq_desc->chip; 52 + irq_chip = irq_desc->irq_data.chip; 53 53 54 54 /* 55 55 * For each handled GPIO interrupt, keep calling its interrupt handler ··· 62 62 63 63 while (irq_counter[gpio] < fiq_count) { 64 64 if (gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { 65 + struct irq_data *d = irq_get_irq_data(irq_num); 66 + 65 67 /* 66 68 * It looks like handle_edge_irq() that 67 69 * OMAP GPIO edge interrupts default to, 68 70 * expects interrupt already unmasked. 69 71 */ 70 - if (irq_chip && irq_chip->unmask) 71 - irq_chip->unmask(irq_num); 72 + if (irq_chip && irq_chip->irq_unmask) 73 + irq_chip->irq_unmask(d); 72 74 } 73 75 generic_handle_irq(irq_num); 74 76
+14 -14
arch/arm/mach-omap1/fpga.c
··· 30 30 #include <plat/fpga.h> 31 31 #include <mach/gpio.h> 32 32 33 - static void fpga_mask_irq(unsigned int irq) 33 + static void fpga_mask_irq(struct irq_data *d) 34 34 { 35 - irq -= OMAP_FPGA_IRQ_BASE; 35 + unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 36 36 37 37 if (irq < 8) 38 38 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) ··· 58 58 } 59 59 60 60 61 - static void fpga_ack_irq(unsigned int irq) 61 + static void fpga_ack_irq(struct irq_data *d) 62 62 { 63 63 /* Don't need to explicitly ACK FPGA interrupts */ 64 64 } 65 65 66 - static void fpga_unmask_irq(unsigned int irq) 66 + static void fpga_unmask_irq(struct irq_data *d) 67 67 { 68 - irq -= OMAP_FPGA_IRQ_BASE; 68 + unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 69 69 70 70 if (irq < 8) 71 71 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), ··· 78 78 | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2); 79 79 } 80 80 81 - static void fpga_mask_ack_irq(unsigned int irq) 81 + static void fpga_mask_ack_irq(struct irq_data *d) 82 82 { 83 - fpga_mask_irq(irq); 84 - fpga_ack_irq(irq); 83 + fpga_mask_irq(d); 84 + fpga_ack_irq(d); 85 85 } 86 86 87 87 void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) ··· 105 105 106 106 static struct irq_chip omap_fpga_irq_ack = { 107 107 .name = "FPGA-ack", 108 - .ack = fpga_mask_ack_irq, 109 - .mask = fpga_mask_irq, 110 - .unmask = fpga_unmask_irq, 108 + .irq_ack = fpga_mask_ack_irq, 109 + .irq_mask = fpga_mask_irq, 110 + .irq_unmask = fpga_unmask_irq, 111 111 }; 112 112 113 113 114 114 static struct irq_chip omap_fpga_irq = { 115 115 .name = "FPGA", 116 - .ack = fpga_ack_irq, 117 - .mask = fpga_mask_irq, 118 - .unmask = fpga_unmask_irq, 116 + .irq_ack = fpga_ack_irq, 117 + .irq_mask = fpga_mask_irq, 118 + .irq_unmask = fpga_unmask_irq, 119 119 }; 120 120 121 121 /*
+22 -22
arch/arm/mach-omap1/irq.c
··· 70 70 omap_writel(value, irq_banks[bank].base_reg + offset); 71 71 } 72 72 73 - static void omap_ack_irq(unsigned int irq) 73 + static void omap_ack_irq(struct irq_data *d) 74 74 { 75 - if (irq > 31) 75 + if (d->irq > 31) 76 76 omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET); 77 77 78 78 omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET); 79 79 } 80 80 81 - static void omap_mask_irq(unsigned int irq) 81 + static void omap_mask_irq(struct irq_data *d) 82 82 { 83 - int bank = IRQ_BANK(irq); 83 + int bank = IRQ_BANK(d->irq); 84 84 u32 l; 85 85 86 86 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 87 - l |= 1 << IRQ_BIT(irq); 87 + l |= 1 << IRQ_BIT(d->irq); 88 88 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 89 89 } 90 90 91 - static void omap_unmask_irq(unsigned int irq) 91 + static void omap_unmask_irq(struct irq_data *d) 92 92 { 93 - int bank = IRQ_BANK(irq); 93 + int bank = IRQ_BANK(d->irq); 94 94 u32 l; 95 95 96 96 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 97 - l &= ~(1 << IRQ_BIT(irq)); 97 + l &= ~(1 << IRQ_BIT(d->irq)); 98 98 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 99 99 } 100 100 101 - static void omap_mask_ack_irq(unsigned int irq) 101 + static void omap_mask_ack_irq(struct irq_data *d) 102 102 { 103 - omap_mask_irq(irq); 104 - omap_ack_irq(irq); 103 + omap_mask_irq(d); 104 + omap_ack_irq(d); 105 105 } 106 106 107 - static int omap_wake_irq(unsigned int irq, unsigned int enable) 107 + static int omap_wake_irq(struct irq_data *d, unsigned int enable) 108 108 { 109 - int bank = IRQ_BANK(irq); 109 + int bank = IRQ_BANK(d->irq); 110 110 111 111 if (enable) 112 - irq_banks[bank].wake_enable |= IRQ_BIT(irq); 112 + irq_banks[bank].wake_enable |= IRQ_BIT(d->irq); 113 113 else 114 - irq_banks[bank].wake_enable &= ~IRQ_BIT(irq); 114 + irq_banks[bank].wake_enable &= ~IRQ_BIT(d->irq); 115 115 116 116 return 0; 117 117 } ··· 168 168 169 169 static struct irq_chip omap_irq_chip = { 170 170 .name = "MPU", 171 - .ack = omap_mask_ack_irq, 172 - .mask = omap_mask_irq, 173 - .unmask = omap_unmask_irq, 174 - .set_wake = omap_wake_irq, 171 + .irq_ack = omap_mask_ack_irq, 172 + .irq_mask = omap_mask_irq, 173 + .irq_unmask = omap_unmask_irq, 174 + .irq_set_wake = omap_wake_irq, 175 175 }; 176 176 177 177 void __init omap_init_irq(void) ··· 239 239 /* Unmask level 2 handler */ 240 240 241 241 if (cpu_is_omap7xx()) 242 - omap_unmask_irq(INT_7XX_IH2_IRQ); 242 + omap_unmask_irq(irq_get_irq_data(INT_7XX_IH2_IRQ)); 243 243 else if (cpu_is_omap15xx()) 244 - omap_unmask_irq(INT_1510_IH2_IRQ); 244 + omap_unmask_irq(irq_get_irq_data(INT_1510_IH2_IRQ)); 245 245 else if (cpu_is_omap16xx()) 246 - omap_unmask_irq(INT_1610_IH2_IRQ); 246 + omap_unmask_irq(irq_get_irq_data(INT_1610_IH2_IRQ)); 247 247 }
+12 -10
arch/arm/mach-omap2/irq.c
··· 100 100 } 101 101 102 102 /* XXX: FIQ and additional INTC support (only MPU at the moment) */ 103 - static void omap_ack_irq(unsigned int irq) 103 + static void omap_ack_irq(struct irq_data *d) 104 104 { 105 105 intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL); 106 106 } 107 107 108 - static void omap_mask_irq(unsigned int irq) 108 + static void omap_mask_irq(struct irq_data *d) 109 109 { 110 + unsigned int irq = d->irq; 110 111 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 111 112 112 113 if (cpu_is_omap34xx()) { ··· 129 128 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset); 130 129 } 131 130 132 - static void omap_unmask_irq(unsigned int irq) 131 + static void omap_unmask_irq(struct irq_data *d) 133 132 { 133 + unsigned int irq = d->irq; 134 134 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 135 135 136 136 irq &= (IRQ_BITS_PER_REG - 1); ··· 139 137 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset); 140 138 } 141 139 142 - static void omap_mask_ack_irq(unsigned int irq) 140 + static void omap_mask_ack_irq(struct irq_data *d) 143 141 { 144 - omap_mask_irq(irq); 145 - omap_ack_irq(irq); 142 + omap_mask_irq(d); 143 + omap_ack_irq(d); 146 144 } 147 145 148 146 static struct irq_chip omap_irq_chip = { 149 - .name = "INTC", 150 - .ack = omap_mask_ack_irq, 151 - .mask = omap_mask_irq, 152 - .unmask = omap_unmask_irq, 147 + .name = "INTC", 148 + .irq_ack = omap_mask_ack_irq, 149 + .irq_mask = omap_mask_irq, 150 + .irq_unmask = omap_unmask_irq, 153 151 }; 154 152 155 153 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
+33 -29
arch/arm/mach-pnx4008/irq.c
··· 36 36 37 37 static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; 38 38 39 - static void pnx4008_mask_irq(unsigned int irq) 39 + static void pnx4008_mask_irq(struct irq_data *d) 40 40 { 41 - __raw_writel(__raw_readl(INTC_ER(irq)) & ~INTC_BIT(irq), INTC_ER(irq)); /* mask interrupt */ 41 + __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ 42 42 } 43 43 44 - static void pnx4008_unmask_irq(unsigned int irq) 44 + static void pnx4008_unmask_irq(struct irq_data *d) 45 45 { 46 - __raw_writel(__raw_readl(INTC_ER(irq)) | INTC_BIT(irq), INTC_ER(irq)); /* unmask interrupt */ 46 + __raw_writel(__raw_readl(INTC_ER(d->irq)) | INTC_BIT(d->irq), INTC_ER(d->irq)); /* unmask interrupt */ 47 47 } 48 48 49 - static void pnx4008_mask_ack_irq(unsigned int irq) 49 + static void pnx4008_mask_ack_irq(struct irq_data *d) 50 50 { 51 - __raw_writel(__raw_readl(INTC_ER(irq)) & ~INTC_BIT(irq), INTC_ER(irq)); /* mask interrupt */ 52 - __raw_writel(INTC_BIT(irq), INTC_SR(irq)); /* clear interrupt status */ 51 + __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ 52 + __raw_writel(INTC_BIT(d->irq), INTC_SR(d->irq)); /* clear interrupt status */ 53 53 } 54 54 55 - static int pnx4008_set_irq_type(unsigned int irq, unsigned int type) 55 + static int pnx4008_set_irq_type(struct irq_data *d, unsigned int type) 56 56 { 57 57 switch (type) { 58 58 case IRQ_TYPE_EDGE_RISING: 59 - __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ 60 - __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /*rising edge */ 61 - set_irq_handler(irq, handle_edge_irq); 59 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ 60 + __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /*rising edge */ 61 + set_irq_handler(d->irq, handle_edge_irq); 62 62 break; 63 63 case IRQ_TYPE_EDGE_FALLING: 64 - __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ 65 - __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*falling edge */ 66 - set_irq_handler(irq, handle_edge_irq); 64 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ 65 + __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*falling edge */ 66 + set_irq_handler(d->irq, handle_edge_irq); 67 67 break; 68 68 case IRQ_TYPE_LEVEL_LOW: 69 - __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ 70 - __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*low level */ 71 - set_irq_handler(irq, handle_level_irq); 69 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ 70 + __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*low level */ 71 + set_irq_handler(d->irq, handle_level_irq); 72 72 break; 73 73 case IRQ_TYPE_LEVEL_HIGH: 74 - __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ 75 - __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /* high level */ 76 - set_irq_handler(irq, handle_level_irq); 74 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ 75 + __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /* high level */ 76 + set_irq_handler(d->irq, handle_level_irq); 77 77 break; 78 78 79 79 /* IRQ_TYPE_EDGE_BOTH is not supported */ ··· 85 85 } 86 86 87 87 static struct irq_chip pnx4008_irq_chip = { 88 - .ack = pnx4008_mask_ack_irq, 89 - .mask = pnx4008_mask_irq, 90 - .unmask = pnx4008_unmask_irq, 91 - .set_type = pnx4008_set_irq_type, 88 + .irq_ack = pnx4008_mask_ack_irq, 89 + .irq_mask = pnx4008_mask_irq, 90 + .irq_unmask = pnx4008_unmask_irq, 91 + .irq_set_type = pnx4008_set_irq_type, 92 92 }; 93 93 94 94 void __init pnx4008_init_irq(void) ··· 99 99 for (i = 0; i < NR_IRQS; i++) { 100 100 set_irq_flags(i, IRQF_VALID); 101 101 set_irq_chip(i, &pnx4008_irq_chip); 102 - pnx4008_set_irq_type(i, pnx4008_irq_type[i]); 102 + pnx4008_set_irq_type(irq_get_irq_data(i), pnx4008_irq_type[i]); 103 103 } 104 104 105 105 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */ 106 - pnx4008_set_irq_type(SUB1_IRQ_N, pnx4008_irq_type[SUB1_IRQ_N]); 107 - pnx4008_set_irq_type(SUB2_IRQ_N, pnx4008_irq_type[SUB2_IRQ_N]); 108 - pnx4008_set_irq_type(SUB1_FIQ_N, pnx4008_irq_type[SUB1_FIQ_N]); 109 - pnx4008_set_irq_type(SUB2_FIQ_N, pnx4008_irq_type[SUB2_FIQ_N]); 106 + pnx4008_set_irq_type(irq_get_irq_data(SUB1_IRQ_N), 107 + pnx4008_irq_type[SUB1_IRQ_N]); 108 + pnx4008_set_irq_type(irq_get_irq_data(SUB2_IRQ_N), 109 + pnx4008_irq_type[SUB2_IRQ_N]); 110 + pnx4008_set_irq_type(irq_get_irq_data(SUB1_FIQ_N), 111 + pnx4008_irq_type[SUB1_FIQ_N]); 112 + pnx4008_set_irq_type(irq_get_irq_data(SUB2_FIQ_N), 113 + pnx4008_irq_type[SUB2_FIQ_N]); 110 114 111 115 /* mask all others */ 112 116 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) |
+14 -9
arch/arm/mach-pxa/balloon3.c
··· 477 477 /****************************************************************************** 478 478 * FPGA IRQ 479 479 ******************************************************************************/ 480 - static void balloon3_mask_irq(unsigned int irq) 480 + static void balloon3_mask_irq(struct irq_data *d) 481 481 { 482 - int balloon3_irq = (irq - BALLOON3_IRQ(0)); 482 + int balloon3_irq = (d->irq - BALLOON3_IRQ(0)); 483 483 balloon3_irq_enabled &= ~(1 << balloon3_irq); 484 484 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 485 485 } 486 486 487 - static void balloon3_unmask_irq(unsigned int irq) 487 + static void balloon3_unmask_irq(struct irq_data *d) 488 488 { 489 - int balloon3_irq = (irq - BALLOON3_IRQ(0)); 489 + int balloon3_irq = (d->irq - BALLOON3_IRQ(0)); 490 490 balloon3_irq_enabled |= (1 << balloon3_irq); 491 491 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 492 492 } 493 493 494 494 static struct irq_chip balloon3_irq_chip = { 495 495 .name = "FPGA", 496 - .ack = balloon3_mask_irq, 497 - .mask = balloon3_mask_irq, 498 - .unmask = balloon3_unmask_irq, 496 + .irq_ack = balloon3_mask_irq, 497 + .irq_mask = balloon3_mask_irq, 498 + .irq_unmask = balloon3_unmask_irq, 499 499 }; 500 500 501 501 static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 504 504 balloon3_irq_enabled; 505 505 do { 506 506 /* clear useless edge notification */ 507 - if (desc->chip->ack) 508 - desc->chip->ack(BALLOON3_AUX_NIRQ); 507 + if (desc->irq_data.chip->irq_ack) { 508 + struct irq_data *d; 509 + 510 + d = irq_get_irq_data(BALLOON3_AUX_NIRQ); 511 + desc->irq_data.chip->irq_ack(d); 512 + } 513 + 509 514 while (pending) { 510 515 irq = BALLOON3_IRQ(0) + __ffs(pending); 511 516 generic_handle_irq(irq);
-1
arch/arm/mach-pxa/clock-pxa3xx.c
··· 115 115 { 116 116 unsigned long acsr = ACSR; 117 117 unsigned long memclkcfg = __raw_readl(MEMCLKCFG); 118 - unsigned int smcfs = (acsr >> 23) & 0x7; 119 118 120 119 return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] / 121 120 df_clkdiv[(memclkcfg >> 16) & 0x3];
+1 -1
arch/arm/mach-pxa/cm-x2xx-pci.c
··· 59 59 static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 60 60 { 61 61 /* clear our parent irq */ 62 - desc->chip->ack(irq); 62 + desc->irq_data.chip->irq_ack(&desc->irq_data); 63 63 64 64 it8152_irq_demux(irq, desc); 65 65 }
+3 -1
arch/arm/mach-pxa/generic.h
··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 12 + struct irq_data; 12 13 struct sys_timer; 13 14 14 15 extern struct sys_timer pxa_timer; 15 16 extern void __init pxa_init_irq(int irq_nr, 16 - int (*set_wake)(unsigned int, unsigned int)); 17 + int (*set_wake)(struct irq_data *, 18 + unsigned int)); 17 19 extern void __init pxa25x_init_irq(void); 18 20 #ifdef CONFIG_CPU_PXA26x 19 21 extern void __init pxa26x_init_irq(void);
+35 -48
arch/arm/mach-pxa/irq.c
··· 53 53 return !cpu_is_pxa25x(); 54 54 } 55 55 56 - static void pxa_mask_irq(unsigned int irq) 56 + static inline void __iomem *irq_base(int i) 57 57 { 58 - void __iomem *base = get_irq_chip_data(irq); 58 + static unsigned long phys_base[] = { 59 + 0x40d00000, 60 + 0x40d0009c, 61 + 0x40d00130, 62 + }; 63 + 64 + return (void __iomem *)io_p2v(phys_base[i]); 65 + } 66 + 67 + static void pxa_mask_irq(struct irq_data *d) 68 + { 69 + void __iomem *base = irq_data_get_irq_chip_data(d); 59 70 uint32_t icmr = __raw_readl(base + ICMR); 60 71 61 - icmr &= ~(1 << IRQ_BIT(irq)); 72 + icmr &= ~(1 << IRQ_BIT(d->irq)); 62 73 __raw_writel(icmr, base + ICMR); 63 74 } 64 75 65 - static void pxa_unmask_irq(unsigned int irq) 76 + static void pxa_unmask_irq(struct irq_data *d) 66 77 { 67 - void __iomem *base = get_irq_chip_data(irq); 78 + void __iomem *base = irq_data_get_irq_chip_data(d); 68 79 uint32_t icmr = __raw_readl(base + ICMR); 69 80 70 - icmr |= 1 << IRQ_BIT(irq); 81 + icmr |= 1 << IRQ_BIT(d->irq); 71 82 __raw_writel(icmr, base + ICMR); 72 83 } 73 84 74 85 static struct irq_chip pxa_internal_irq_chip = { 75 86 .name = "SC", 76 - .ack = pxa_mask_irq, 77 - .mask = pxa_mask_irq, 78 - .unmask = pxa_unmask_irq, 87 + .irq_ack = pxa_mask_irq, 88 + .irq_mask = pxa_mask_irq, 89 + .irq_unmask = pxa_unmask_irq, 79 90 }; 80 91 81 92 /* 82 93 * GPIO IRQs for GPIO 0 and 1 83 94 */ 84 - static int pxa_set_low_gpio_type(unsigned int irq, unsigned int type) 95 + static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type) 85 96 { 86 - int gpio = irq - IRQ_GPIO0; 97 + int gpio = d->irq - IRQ_GPIO0; 87 98 88 99 if (__gpio_is_occupied(gpio)) { 89 100 pr_err("%s failed: GPIO is configured\n", __func__); ··· 114 103 return 0; 115 104 } 116 105 117 - static void pxa_ack_low_gpio(unsigned int irq) 106 + static void pxa_ack_low_gpio(struct irq_data *d) 118 107 { 119 - GEDR0 = (1 << (irq - IRQ_GPIO0)); 120 - } 121 - 122 - static void pxa_mask_low_gpio(unsigned int irq) 123 - { 124 - struct irq_desc *desc = irq_to_desc(irq); 125 - 126 - desc->chip->mask(irq); 127 - } 128 - 129 - static void pxa_unmask_low_gpio(unsigned int irq) 130 - { 131 - struct irq_desc *desc = irq_to_desc(irq); 132 - 133 - desc->chip->unmask(irq); 108 + GEDR0 = (1 << (d->irq - IRQ_GPIO0)); 134 109 } 135 110 136 111 static struct irq_chip pxa_low_gpio_chip = { 137 112 .name = "GPIO-l", 138 - .ack = pxa_ack_low_gpio, 139 - .mask = pxa_mask_low_gpio, 140 - .unmask = pxa_unmask_low_gpio, 141 - .set_type = pxa_set_low_gpio_type, 113 + .irq_ack = pxa_ack_low_gpio, 114 + .irq_mask = pxa_mask_irq, 115 + .irq_unmask = pxa_unmask_irq, 116 + .irq_set_type = pxa_set_low_gpio_type, 142 117 }; 143 118 144 119 static void __init pxa_init_low_gpio_irq(set_wake_t fn) ··· 138 141 139 142 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) { 140 143 set_irq_chip(irq, &pxa_low_gpio_chip); 144 + set_irq_chip_data(irq, irq_base(0)); 141 145 set_irq_handler(irq, handle_edge_irq); 142 146 set_irq_flags(irq, IRQF_VALID); 143 147 } 144 148 145 - pxa_low_gpio_chip.set_wake = fn; 146 - } 147 - 148 - static inline void __iomem *irq_base(int i) 149 - { 150 - static unsigned long phys_base[] = { 151 - 0x40d00000, 152 - 0x40d0009c, 153 - 0x40d00130, 154 - }; 155 - 156 - return (void __iomem *)io_p2v(phys_base[i >> 5]); 149 + pxa_low_gpio_chip.irq_set_wake = fn; 157 150 } 158 151 159 152 void __init pxa_init_irq(int irq_nr, set_wake_t fn) ··· 155 168 pxa_internal_irq_nr = irq_nr; 156 169 157 170 for (n = 0; n < irq_nr; n += 32) { 158 - void __iomem *base = irq_base(n); 171 + void __iomem *base = irq_base(n >> 5); 159 172 160 173 __raw_writel(0, base + ICMR); /* disable all IRQs */ 161 174 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ ··· 175 188 /* only unmasked interrupts kick us out of idle */ 176 189 __raw_writel(1, irq_base(0) + ICCR); 177 190 178 - pxa_internal_irq_chip.set_wake = fn; 191 + pxa_internal_irq_chip.irq_set_wake = fn; 179 192 pxa_init_low_gpio_irq(fn); 180 193 } 181 194 ··· 187 200 { 188 201 int i; 189 202 190 - for (i = 0; i < pxa_internal_irq_nr; i += 32) { 203 + for (i = 0; i < pxa_internal_irq_nr / 32; i++) { 191 204 void __iomem *base = irq_base(i); 192 205 193 206 saved_icmr[i] = __raw_readl(base + ICMR); ··· 206 219 { 207 220 int i; 208 221 209 - for (i = 0; i < pxa_internal_irq_nr; i += 32) { 222 + for (i = 0; i < pxa_internal_irq_nr / 32; i++) { 210 223 void __iomem *base = irq_base(i); 211 224 212 225 __raw_writel(saved_icmr[i], base + ICMR); 213 226 __raw_writel(0, base + ICLR); 214 227 } 215 228 216 - if (!cpu_is_pxa25x()) 229 + if (cpu_has_ipr()) 217 230 for (i = 0; i < pxa_internal_irq_nr; i++) 218 231 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); 219 232
+9 -8
arch/arm/mach-pxa/lpd270.c
··· 95 95 96 96 static unsigned int lpd270_irq_enabled; 97 97 98 - static void lpd270_mask_irq(unsigned int irq) 98 + static void lpd270_mask_irq(struct irq_data *d) 99 99 { 100 - int lpd270_irq = irq - LPD270_IRQ(0); 100 + int lpd270_irq = d->irq - LPD270_IRQ(0); 101 101 102 102 __raw_writew(~(1 << lpd270_irq), LPD270_INT_STATUS); 103 103 ··· 105 105 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); 106 106 } 107 107 108 - static void lpd270_unmask_irq(unsigned int irq) 108 + static void lpd270_unmask_irq(struct irq_data *d) 109 109 { 110 - int lpd270_irq = irq - LPD270_IRQ(0); 110 + int lpd270_irq = d->irq - LPD270_IRQ(0); 111 111 112 112 lpd270_irq_enabled |= 1 << lpd270_irq; 113 113 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); ··· 115 115 116 116 static struct irq_chip lpd270_irq_chip = { 117 117 .name = "CPLD", 118 - .ack = lpd270_mask_irq, 119 - .mask = lpd270_mask_irq, 120 - .unmask = lpd270_unmask_irq, 118 + .irq_ack = lpd270_mask_irq, 119 + .irq_mask = lpd270_mask_irq, 120 + .irq_unmask = lpd270_unmask_irq, 121 121 }; 122 122 123 123 static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 126 126 127 127 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; 128 128 do { 129 - desc->chip->ack(irq); /* clear useless edge notification */ 129 + /* clear useless edge notification */ 130 + desc->irq_data.chip->irq_ack(&desc->irq_data); 130 131 if (likely(pending)) { 131 132 irq = LPD270_IRQ(0) + __ffs(pending); 132 133 generic_handle_irq(irq);
+9 -8
arch/arm/mach-pxa/lubbock.c
··· 122 122 123 123 static unsigned long lubbock_irq_enabled; 124 124 125 - static void lubbock_mask_irq(unsigned int irq) 125 + static void lubbock_mask_irq(struct irq_data *d) 126 126 { 127 - int lubbock_irq = (irq - LUBBOCK_IRQ(0)); 127 + int lubbock_irq = (d->irq - LUBBOCK_IRQ(0)); 128 128 LUB_IRQ_MASK_EN = (lubbock_irq_enabled &= ~(1 << lubbock_irq)); 129 129 } 130 130 131 - static void lubbock_unmask_irq(unsigned int irq) 131 + static void lubbock_unmask_irq(struct irq_data *d) 132 132 { 133 - int lubbock_irq = (irq - LUBBOCK_IRQ(0)); 133 + int lubbock_irq = (d->irq - LUBBOCK_IRQ(0)); 134 134 /* the irq can be acknowledged only if deasserted, so it's done here */ 135 135 LUB_IRQ_SET_CLR &= ~(1 << lubbock_irq); 136 136 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq)); ··· 138 138 139 139 static struct irq_chip lubbock_irq_chip = { 140 140 .name = "FPGA", 141 - .ack = lubbock_mask_irq, 142 - .mask = lubbock_mask_irq, 143 - .unmask = lubbock_unmask_irq, 141 + .irq_ack = lubbock_mask_irq, 142 + .irq_mask = lubbock_mask_irq, 143 + .irq_unmask = lubbock_unmask_irq, 144 144 }; 145 145 146 146 static void lubbock_irq_handler(unsigned int irq, struct irq_desc *desc) 147 147 { 148 148 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 149 149 do { 150 - desc->chip->ack(irq); /* clear our parent irq */ 150 + /* clear our parent irq */ 151 + desc->irq_data.chip->irq_ack(&desc->irq_data); 151 152 if (likely(pending)) { 152 153 irq = LUBBOCK_IRQ(0) + __ffs(pending); 153 154 generic_handle_irq(irq);
+9 -8
arch/arm/mach-pxa/mainstone.c
··· 123 123 124 124 static unsigned long mainstone_irq_enabled; 125 125 126 - static void mainstone_mask_irq(unsigned int irq) 126 + static void mainstone_mask_irq(struct irq_data *d) 127 127 { 128 - int mainstone_irq = (irq - MAINSTONE_IRQ(0)); 128 + int mainstone_irq = (d->irq - MAINSTONE_IRQ(0)); 129 129 MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq)); 130 130 } 131 131 132 - static void mainstone_unmask_irq(unsigned int irq) 132 + static void mainstone_unmask_irq(struct irq_data *d) 133 133 { 134 - int mainstone_irq = (irq - MAINSTONE_IRQ(0)); 134 + int mainstone_irq = (d->irq - MAINSTONE_IRQ(0)); 135 135 /* the irq can be acknowledged only if deasserted, so it's done here */ 136 136 MST_INTSETCLR &= ~(1 << mainstone_irq); 137 137 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq)); ··· 139 139 140 140 static struct irq_chip mainstone_irq_chip = { 141 141 .name = "FPGA", 142 - .ack = mainstone_mask_irq, 143 - .mask = mainstone_mask_irq, 144 - .unmask = mainstone_unmask_irq, 142 + .irq_ack = mainstone_mask_irq, 143 + .irq_mask = mainstone_mask_irq, 144 + .irq_unmask = mainstone_unmask_irq, 145 145 }; 146 146 147 147 static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc) 148 148 { 149 149 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; 150 150 do { 151 - desc->chip->ack(irq); /* clear useless edge notification */ 151 + /* clear useless edge notification */ 152 + desc->irq_data.chip->irq_ack(&desc->irq_data); 152 153 if (likely(pending)) { 153 154 irq = MAINSTONE_IRQ(0) + __ffs(pending); 154 155 generic_handle_irq(irq);
+8 -7
arch/arm/mach-pxa/pcm990-baseboard.c
··· 241 241 242 242 static unsigned long pcm990_irq_enabled; 243 243 244 - static void pcm990_mask_ack_irq(unsigned int irq) 244 + static void pcm990_mask_ack_irq(struct irq_data *d) 245 245 { 246 - int pcm990_irq = (irq - PCM027_IRQ(0)); 246 + int pcm990_irq = (d->irq - PCM027_IRQ(0)); 247 247 PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq)); 248 248 } 249 249 250 - static void pcm990_unmask_irq(unsigned int irq) 250 + static void pcm990_unmask_irq(struct irq_data *d) 251 251 { 252 - int pcm990_irq = (irq - PCM027_IRQ(0)); 252 + int pcm990_irq = (d->irq - PCM027_IRQ(0)); 253 253 /* the irq can be acknowledged only if deasserted, so it's done here */ 254 254 PCM990_INTSETCLR |= 1 << pcm990_irq; 255 255 PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq)); 256 256 } 257 257 258 258 static struct irq_chip pcm990_irq_chip = { 259 - .mask_ack = pcm990_mask_ack_irq, 260 - .unmask = pcm990_unmask_irq, 259 + .irq_mask_ack = pcm990_mask_ack_irq, 260 + .irq_unmask = pcm990_unmask_irq, 261 261 }; 262 262 263 263 static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 265 265 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 266 266 267 267 do { 268 - desc->chip->ack(irq); /* clear our parent IRQ */ 268 + /* clear our parent IRQ */ 269 + desc->irq_data.chip->irq_ack(&desc->irq_data); 269 270 if (likely(pending)) { 270 271 irq = PCM027_IRQ(0) + __ffs(pending); 271 272 generic_handle_irq(irq);
+4 -3
arch/arm/mach-pxa/pxa25x.c
··· 22 22 #include <linux/platform_device.h> 23 23 #include <linux/suspend.h> 24 24 #include <linux/sysdev.h> 25 + #include <linux/irq.h> 25 26 26 27 #include <asm/mach/map.h> 27 28 #include <mach/hardware.h> ··· 283 282 /* PXA25x: supports wakeup from GPIO0..GPIO15 and RTC alarm 284 283 */ 285 284 286 - static int pxa25x_set_wake(unsigned int irq, unsigned int on) 285 + static int pxa25x_set_wake(struct irq_data *d, unsigned int on) 287 286 { 288 - int gpio = IRQ_TO_GPIO(irq); 287 + int gpio = IRQ_TO_GPIO(d->irq); 289 288 uint32_t mask = 0; 290 289 291 290 if (gpio >= 0 && gpio < 85) 292 291 return gpio_set_wake(gpio, on); 293 292 294 - if (irq == IRQ_RTCAlrm) { 293 + if (d->irq == IRQ_RTCAlrm) { 295 294 mask = PWER_RTC; 296 295 goto set_pwer; 297 296 }
+5 -4
arch/arm/mach-pxa/pxa27x.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/sysdev.h> 20 20 #include <linux/io.h> 21 + #include <linux/irq.h> 21 22 22 23 #include <asm/mach/map.h> 23 24 #include <mach/hardware.h> ··· 344 343 /* PXA27x: Various gpios can issue wakeup events. This logic only 345 344 * handles the simple cases, not the WEMUX2 and WEMUX3 options 346 345 */ 347 - static int pxa27x_set_wake(unsigned int irq, unsigned int on) 346 + static int pxa27x_set_wake(struct irq_data *d, unsigned int on) 348 347 { 349 - int gpio = IRQ_TO_GPIO(irq); 348 + int gpio = IRQ_TO_GPIO(d->irq); 350 349 uint32_t mask; 351 350 352 351 if (gpio >= 0 && gpio < 128) 353 352 return gpio_set_wake(gpio, on); 354 353 355 - if (irq == IRQ_KEYPAD) 354 + if (d->irq == IRQ_KEYPAD) 356 355 return keypad_set_wake(on); 357 356 358 - switch (irq) { 357 + switch (d->irq) { 359 358 case IRQ_RTCAlrm: 360 359 mask = PWER_RTC; 361 360 break;
+18 -18
arch/arm/mach-pxa/pxa3xx.c
··· 229 229 pxa_cpu_pm_fns = &pxa3xx_cpu_pm_fns; 230 230 } 231 231 232 - static int pxa3xx_set_wake(unsigned int irq, unsigned int on) 232 + static int pxa3xx_set_wake(struct irq_data *d, unsigned int on) 233 233 { 234 234 unsigned long flags, mask = 0; 235 235 236 - switch (irq) { 236 + switch (d->irq) { 237 237 case IRQ_SSP3: 238 238 mask = ADXER_MFP_WSSP3; 239 239 break; ··· 322 322 #define pxa3xx_set_wake NULL 323 323 #endif 324 324 325 - static void pxa_ack_ext_wakeup(unsigned int irq) 325 + static void pxa_ack_ext_wakeup(struct irq_data *d) 326 326 { 327 - PECR |= PECR_IS(irq - IRQ_WAKEUP0); 327 + PECR |= PECR_IS(d->irq - IRQ_WAKEUP0); 328 328 } 329 329 330 - static void pxa_mask_ext_wakeup(unsigned int irq) 330 + static void pxa_mask_ext_wakeup(struct irq_data *d) 331 331 { 332 - ICMR2 &= ~(1 << ((irq - PXA_IRQ(0)) & 0x1f)); 333 - PECR &= ~PECR_IE(irq - IRQ_WAKEUP0); 332 + ICMR2 &= ~(1 << ((d->irq - PXA_IRQ(0)) & 0x1f)); 333 + PECR &= ~PECR_IE(d->irq - IRQ_WAKEUP0); 334 334 } 335 335 336 - static void pxa_unmask_ext_wakeup(unsigned int irq) 336 + static void pxa_unmask_ext_wakeup(struct irq_data *d) 337 337 { 338 - ICMR2 |= 1 << ((irq - PXA_IRQ(0)) & 0x1f); 339 - PECR |= PECR_IE(irq - IRQ_WAKEUP0); 338 + ICMR2 |= 1 << ((d->irq - PXA_IRQ(0)) & 0x1f); 339 + PECR |= PECR_IE(d->irq - IRQ_WAKEUP0); 340 340 } 341 341 342 - static int pxa_set_ext_wakeup_type(unsigned int irq, unsigned int flow_type) 342 + static int pxa_set_ext_wakeup_type(struct irq_data *d, unsigned int flow_type) 343 343 { 344 344 if (flow_type & IRQ_TYPE_EDGE_RISING) 345 - PWER |= 1 << (irq - IRQ_WAKEUP0); 345 + PWER |= 1 << (d->irq - IRQ_WAKEUP0); 346 346 347 347 if (flow_type & IRQ_TYPE_EDGE_FALLING) 348 - PWER |= 1 << (irq - IRQ_WAKEUP0 + 2); 348 + PWER |= 1 << (d->irq - IRQ_WAKEUP0 + 2); 349 349 350 350 return 0; 351 351 } 352 352 353 353 static struct irq_chip pxa_ext_wakeup_chip = { 354 354 .name = "WAKEUP", 355 - .ack = pxa_ack_ext_wakeup, 356 - .mask = pxa_mask_ext_wakeup, 357 - .unmask = pxa_unmask_ext_wakeup, 358 - .set_type = pxa_set_ext_wakeup_type, 355 + .irq_ack = pxa_ack_ext_wakeup, 356 + .irq_mask = pxa_mask_ext_wakeup, 357 + .irq_unmask = pxa_unmask_ext_wakeup, 358 + .irq_set_type = pxa_set_ext_wakeup_type, 359 359 }; 360 360 361 361 static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) ··· 368 368 set_irq_flags(irq, IRQF_VALID); 369 369 } 370 370 371 - pxa_ext_wakeup_chip.set_wake = fn; 371 + pxa_ext_wakeup_chip.irq_set_wake = fn; 372 372 } 373 373 374 374 void __init pxa3xx_init_irq(void)
+1
arch/arm/mach-pxa/spitz.c
··· 25 25 #include <linux/spi/corgi_lcd.h> 26 26 #include <linux/spi/pxa2xx_spi.h> 27 27 #include <linux/mtd/sharpsl.h> 28 + #include <linux/mtd/physmap.h> 28 29 #include <linux/input/matrix_keypad.h> 29 30 #include <linux/regulator/machine.h> 30 31 #include <linux/io.h>
+11 -11
arch/arm/mach-pxa/viper.c
··· 249 249 return viper_isa_irqs[bit] + PXA_ISA_IRQ(0); 250 250 } 251 251 252 - static void viper_ack_irq(unsigned int irq) 252 + static void viper_ack_irq(struct irq_data *d) 253 253 { 254 - int viper_irq = viper_irq_to_bitmask(irq); 254 + int viper_irq = viper_irq_to_bitmask(d->irq); 255 255 256 256 if (viper_irq & 0xff) 257 257 VIPER_LO_IRQ_STATUS = viper_irq; ··· 259 259 VIPER_HI_IRQ_STATUS = (viper_irq >> 8); 260 260 } 261 261 262 - static void viper_mask_irq(unsigned int irq) 262 + static void viper_mask_irq(struct irq_data *d) 263 263 { 264 - viper_irq_enabled_mask &= ~(viper_irq_to_bitmask(irq)); 264 + viper_irq_enabled_mask &= ~(viper_irq_to_bitmask(d->irq)); 265 265 } 266 266 267 - static void viper_unmask_irq(unsigned int irq) 267 + static void viper_unmask_irq(struct irq_data *d) 268 268 { 269 - viper_irq_enabled_mask |= viper_irq_to_bitmask(irq); 269 + viper_irq_enabled_mask |= viper_irq_to_bitmask(d->irq); 270 270 } 271 271 272 272 static inline unsigned long viper_irq_pending(void) ··· 283 283 do { 284 284 /* we're in a chained irq handler, 285 285 * so ack the interrupt by hand */ 286 - desc->chip->ack(irq); 286 + desc->irq_data.chip->irq_ack(&desc->irq_data); 287 287 288 288 if (likely(pending)) { 289 289 irq = viper_bit_to_irq(__ffs(pending)); ··· 294 294 } 295 295 296 296 static struct irq_chip viper_irq_chip = { 297 - .name = "ISA", 298 - .ack = viper_ack_irq, 299 - .mask = viper_mask_irq, 300 - .unmask = viper_unmask_irq 297 + .name = "ISA", 298 + .irq_ack = viper_ack_irq, 299 + .irq_mask = viper_mask_irq, 300 + .irq_unmask = viper_unmask_irq 301 301 }; 302 302 303 303 static void __init viper_init_irq(void)
+13 -13
arch/arm/mach-pxa/zeus.c
··· 83 83 return zeus_isa_irqs[bit] + PXA_ISA_IRQ(0); 84 84 } 85 85 86 - static void zeus_ack_irq(unsigned int irq) 86 + static void zeus_ack_irq(struct irq_data *d) 87 87 { 88 - __raw_writew(zeus_irq_to_bitmask(irq), ZEUS_CPLD_ISA_IRQ); 88 + __raw_writew(zeus_irq_to_bitmask(d->irq), ZEUS_CPLD_ISA_IRQ); 89 89 } 90 90 91 - static void zeus_mask_irq(unsigned int irq) 91 + static void zeus_mask_irq(struct irq_data *d) 92 92 { 93 - zeus_irq_enabled_mask &= ~(zeus_irq_to_bitmask(irq)); 93 + zeus_irq_enabled_mask &= ~(zeus_irq_to_bitmask(d->irq)); 94 94 } 95 95 96 - static void zeus_unmask_irq(unsigned int irq) 96 + static void zeus_unmask_irq(struct irq_data *d) 97 97 { 98 - zeus_irq_enabled_mask |= zeus_irq_to_bitmask(irq); 98 + zeus_irq_enabled_mask |= zeus_irq_to_bitmask(d->irq); 99 99 } 100 100 101 101 static inline unsigned long zeus_irq_pending(void) ··· 111 111 do { 112 112 /* we're in a chained irq handler, 113 113 * so ack the interrupt by hand */ 114 - desc->chip->ack(gpio_to_irq(ZEUS_ISA_GPIO)); 114 + desc->irq_data.chip->irq_ack(&desc->irq_data); 115 115 116 116 if (likely(pending)) { 117 117 irq = zeus_bit_to_irq(__ffs(pending)); ··· 122 122 } 123 123 124 124 static struct irq_chip zeus_irq_chip = { 125 - .name = "ISA", 126 - .ack = zeus_ack_irq, 127 - .mask = zeus_mask_irq, 128 - .unmask = zeus_unmask_irq, 125 + .name = "ISA", 126 + .irq_ack = zeus_ack_irq, 127 + .irq_mask = zeus_mask_irq, 128 + .irq_unmask = zeus_unmask_irq, 129 129 }; 130 130 131 131 static void __init zeus_init_irq(void) ··· 830 830 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); 831 831 832 832 /* Fix timings for dm9000s (CS1/CS2)*/ 833 - msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16); 834 - msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc; 833 + msc0 = (__raw_readl(MSC0) & 0x0000ffff) | (dm9000_msc << 16); 834 + msc1 = (__raw_readl(MSC1) & 0xffff0000) | dm9000_msc; 835 835 __raw_writel(msc0, MSC0); 836 836 __raw_writel(msc1, MSC1); 837 837
+30 -30
arch/arm/mach-rpc/irq.c
··· 6 6 #include <asm/hardware/iomd.h> 7 7 #include <asm/irq.h> 8 8 9 - static void iomd_ack_irq_a(unsigned int irq) 9 + static void iomd_ack_irq_a(struct irq_data *d) 10 10 { 11 11 unsigned int val, mask; 12 12 13 - mask = 1 << irq; 13 + mask = 1 << d->irq; 14 14 val = iomd_readb(IOMD_IRQMASKA); 15 15 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 16 16 iomd_writeb(mask, IOMD_IRQCLRA); 17 17 } 18 18 19 - static void iomd_mask_irq_a(unsigned int irq) 19 + static void iomd_mask_irq_a(struct irq_data *d) 20 20 { 21 21 unsigned int val, mask; 22 22 23 - mask = 1 << irq; 23 + mask = 1 << d->irq; 24 24 val = iomd_readb(IOMD_IRQMASKA); 25 25 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 26 26 } 27 27 28 - static void iomd_unmask_irq_a(unsigned int irq) 28 + static void iomd_unmask_irq_a(struct irq_data *d) 29 29 { 30 30 unsigned int val, mask; 31 31 32 - mask = 1 << irq; 32 + mask = 1 << d->irq; 33 33 val = iomd_readb(IOMD_IRQMASKA); 34 34 iomd_writeb(val | mask, IOMD_IRQMASKA); 35 35 } 36 36 37 37 static struct irq_chip iomd_a_chip = { 38 - .ack = iomd_ack_irq_a, 39 - .mask = iomd_mask_irq_a, 40 - .unmask = iomd_unmask_irq_a, 38 + .irq_ack = iomd_ack_irq_a, 39 + .irq_mask = iomd_mask_irq_a, 40 + .irq_unmask = iomd_unmask_irq_a, 41 41 }; 42 42 43 - static void iomd_mask_irq_b(unsigned int irq) 43 + static void iomd_mask_irq_b(struct irq_data *d) 44 44 { 45 45 unsigned int val, mask; 46 46 47 - mask = 1 << (irq & 7); 47 + mask = 1 << (d->irq & 7); 48 48 val = iomd_readb(IOMD_IRQMASKB); 49 49 iomd_writeb(val & ~mask, IOMD_IRQMASKB); 50 50 } 51 51 52 - static void iomd_unmask_irq_b(unsigned int irq) 52 + static void iomd_unmask_irq_b(struct irq_data *d) 53 53 { 54 54 unsigned int val, mask; 55 55 56 - mask = 1 << (irq & 7); 56 + mask = 1 << (d->irq & 7); 57 57 val = iomd_readb(IOMD_IRQMASKB); 58 58 iomd_writeb(val | mask, IOMD_IRQMASKB); 59 59 } 60 60 61 61 static struct irq_chip iomd_b_chip = { 62 - .ack = iomd_mask_irq_b, 63 - .mask = iomd_mask_irq_b, 64 - .unmask = iomd_unmask_irq_b, 62 + .irq_ack = iomd_mask_irq_b, 63 + .irq_mask = iomd_mask_irq_b, 64 + .irq_unmask = iomd_unmask_irq_b, 65 65 }; 66 66 67 - static void iomd_mask_irq_dma(unsigned int irq) 67 + static void iomd_mask_irq_dma(struct irq_data *d) 68 68 { 69 69 unsigned int val, mask; 70 70 71 - mask = 1 << (irq & 7); 71 + mask = 1 << (d->irq & 7); 72 72 val = iomd_readb(IOMD_DMAMASK); 73 73 iomd_writeb(val & ~mask, IOMD_DMAMASK); 74 74 } 75 75 76 - static void iomd_unmask_irq_dma(unsigned int irq) 76 + static void iomd_unmask_irq_dma(struct irq_data *d) 77 77 { 78 78 unsigned int val, mask; 79 79 80 - mask = 1 << (irq & 7); 80 + mask = 1 << (d->irq & 7); 81 81 val = iomd_readb(IOMD_DMAMASK); 82 82 iomd_writeb(val | mask, IOMD_DMAMASK); 83 83 } 84 84 85 85 static struct irq_chip iomd_dma_chip = { 86 - .ack = iomd_mask_irq_dma, 87 - .mask = iomd_mask_irq_dma, 88 - .unmask = iomd_unmask_irq_dma, 86 + .irq_ack = iomd_mask_irq_dma, 87 + .irq_mask = iomd_mask_irq_dma, 88 + .irq_unmask = iomd_unmask_irq_dma, 89 89 }; 90 90 91 - static void iomd_mask_irq_fiq(unsigned int irq) 91 + static void iomd_mask_irq_fiq(struct irq_data *d) 92 92 { 93 93 unsigned int val, mask; 94 94 95 - mask = 1 << (irq & 7); 95 + mask = 1 << (d->irq & 7); 96 96 val = iomd_readb(IOMD_FIQMASK); 97 97 iomd_writeb(val & ~mask, IOMD_FIQMASK); 98 98 } 99 99 100 - static void iomd_unmask_irq_fiq(unsigned int irq) 100 + static void iomd_unmask_irq_fiq(struct irq_data *d) 101 101 { 102 102 unsigned int val, mask; 103 103 104 - mask = 1 << (irq & 7); 104 + mask = 1 << (d->irq & 7); 105 105 val = iomd_readb(IOMD_FIQMASK); 106 106 iomd_writeb(val | mask, IOMD_FIQMASK); 107 107 } 108 108 109 109 static struct irq_chip iomd_fiq_chip = { 110 - .ack = iomd_mask_irq_fiq, 111 - .mask = iomd_mask_irq_fiq, 112 - .unmask = iomd_unmask_irq_fiq, 110 + .irq_ack = iomd_mask_irq_fiq, 111 + .irq_mask = iomd_mask_irq_fiq, 112 + .irq_unmask = iomd_unmask_irq_fiq, 113 113 }; 114 114 115 115 void __init rpc_init_irq(void)
+11 -11
arch/arm/mach-s3c2410/bast-irq.c
··· 75 75 static unsigned char bast_pc104_irqs[] = { 3, 5, 7, 10 }; 76 76 77 77 static void 78 - bast_pc104_mask(unsigned int irqno) 78 + bast_pc104_mask(struct irq_data *data) 79 79 { 80 80 unsigned long temp; 81 81 82 82 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 83 - temp &= ~bast_pc104_irqmasks[irqno]; 83 + temp &= ~bast_pc104_irqmasks[data->irq]; 84 84 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 85 85 } 86 86 87 87 static void 88 - bast_pc104_maskack(unsigned int irqno) 88 + bast_pc104_maskack(struct irq_data *data) 89 89 { 90 90 struct irq_desc *desc = irq_desc + IRQ_ISA; 91 91 92 - bast_pc104_mask(irqno); 93 - desc->chip->ack(IRQ_ISA); 92 + bast_pc104_mask(data); 93 + desc->irq_data.chip->irq_ack(&desc->irq_data); 94 94 } 95 95 96 96 static void 97 - bast_pc104_unmask(unsigned int irqno) 97 + bast_pc104_unmask(struct irq_data *data) 98 98 { 99 99 unsigned long temp; 100 100 101 101 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 102 - temp |= bast_pc104_irqmasks[irqno]; 102 + temp |= bast_pc104_irqmasks[data->irq]; 103 103 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 104 104 } 105 105 106 106 static struct irq_chip bast_pc104_chip = { 107 - .mask = bast_pc104_mask, 108 - .unmask = bast_pc104_unmask, 109 - .ack = bast_pc104_maskack 107 + .irq_mask = bast_pc104_mask, 108 + .irq_unmask = bast_pc104_unmask, 109 + .irq_ack = bast_pc104_maskack 110 110 }; 111 111 112 112 static void ··· 123 123 /* ack if we get an irq with nothing (ie, startup) */ 124 124 125 125 desc = irq_desc + IRQ_ISA; 126 - desc->chip->ack(IRQ_ISA); 126 + desc->irq_data.chip->irq_ack(&desc->irq_data); 127 127 } else { 128 128 /* handle the IRQ */ 129 129
+2 -2
arch/arm/mach-s3c2410/include/mach/irqs.h
··· 152 152 153 153 #define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */ 154 154 155 - #define IRQ_HSMMC0 IRQ_S3C2443_HSMMC 156 - #define IRQ_HSMMC1 IRQ_S3C2416_HSMMC0 155 + #define IRQ_HSMMC0 IRQ_S3C2416_HSMMC0 156 + #define IRQ_HSMMC1 IRQ_S3C2443_HSMMC 157 157 158 158 #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) 159 159 #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15)
+2 -2
arch/arm/mach-s3c2410/include/mach/map.h
··· 112 112 #define S3C_PA_IIC S3C2410_PA_IIC 113 113 #define S3C_PA_UART S3C24XX_PA_UART 114 114 #define S3C_PA_USBHOST S3C2410_PA_USBHOST 115 - #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 116 - #define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0 115 + #define S3C_PA_HSMMC0 S3C2416_PA_HSMMC0 116 + #define S3C_PA_HSMMC1 S3C2443_PA_HSMMC 117 117 #define S3C_PA_WDT S3C2410_PA_WATCHDOG 118 118 #define S3C_PA_NAND S3C24XX_PA_NAND 119 119
+1
arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
··· 86 86 #define S3C2443_HCLKCON_LCDC (1<<9) 87 87 #define S3C2443_HCLKCON_USBH (1<<11) 88 88 #define S3C2443_HCLKCON_USBD (1<<12) 89 + #define S3C2416_HCLKCON_HSMMC0 (1<<15) 89 90 #define S3C2443_HCLKCON_HSMMC (1<<16) 90 91 #define S3C2443_HCLKCON_CFC (1<<17) 91 92 #define S3C2443_HCLKCON_SSMC (1<<18)
+25 -25
arch/arm/mach-s3c2412/irq.c
··· 49 49 */ 50 50 51 51 static void 52 - s3c2412_irq_mask(unsigned int irqno) 52 + s3c2412_irq_mask(struct irq_data *data) 53 53 { 54 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 54 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 55 55 unsigned long mask; 56 56 57 57 mask = __raw_readl(S3C2410_INTMSK); ··· 62 62 } 63 63 64 64 static inline void 65 - s3c2412_irq_ack(unsigned int irqno) 65 + s3c2412_irq_ack(struct irq_data *data) 66 66 { 67 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 67 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 68 68 69 69 __raw_writel(bitval, S3C2412_EINTPEND); 70 70 __raw_writel(bitval, S3C2410_SRCPND); ··· 72 72 } 73 73 74 74 static inline void 75 - s3c2412_irq_maskack(unsigned int irqno) 75 + s3c2412_irq_maskack(struct irq_data *data) 76 76 { 77 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 77 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 78 78 unsigned long mask; 79 79 80 80 mask = __raw_readl(S3C2410_INTMSK); ··· 89 89 } 90 90 91 91 static void 92 - s3c2412_irq_unmask(unsigned int irqno) 92 + s3c2412_irq_unmask(struct irq_data *data) 93 93 { 94 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 94 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 95 95 unsigned long mask; 96 96 97 97 mask = __raw_readl(S3C2412_EINTMASK); ··· 102 102 } 103 103 104 104 static struct irq_chip s3c2412_irq_eint0t4 = { 105 - .ack = s3c2412_irq_ack, 106 - .mask = s3c2412_irq_mask, 107 - .unmask = s3c2412_irq_unmask, 108 - .set_wake = s3c_irq_wake, 109 - .set_type = s3c_irqext_type, 105 + .irq_ack = s3c2412_irq_ack, 106 + .irq_mask = s3c2412_irq_mask, 107 + .irq_unmask = s3c2412_irq_unmask, 108 + .irq_set_wake = s3c_irq_wake, 109 + .irq_set_type = s3c_irqext_type, 110 110 }; 111 111 112 112 #define INTBIT(x) (1 << ((x) - S3C2410_IRQSUB(0))) ··· 132 132 #define INTMSK_CFSDI (1UL << (IRQ_S3C2412_CFSDI - IRQ_EINT0)) 133 133 #define SUBMSK_CFSDI INTMSK_SUB(IRQ_S3C2412_SDI, IRQ_S3C2412_CF) 134 134 135 - static void s3c2412_irq_cfsdi_mask(unsigned int irqno) 135 + static void s3c2412_irq_cfsdi_mask(struct irq_data *data) 136 136 { 137 - s3c_irqsub_mask(irqno, INTMSK_CFSDI, SUBMSK_CFSDI); 137 + s3c_irqsub_mask(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI); 138 138 } 139 139 140 - static void s3c2412_irq_cfsdi_unmask(unsigned int irqno) 140 + static void s3c2412_irq_cfsdi_unmask(struct irq_data *data) 141 141 { 142 - s3c_irqsub_unmask(irqno, INTMSK_CFSDI); 142 + s3c_irqsub_unmask(data->irq, INTMSK_CFSDI); 143 143 } 144 144 145 - static void s3c2412_irq_cfsdi_ack(unsigned int irqno) 145 + static void s3c2412_irq_cfsdi_ack(struct irq_data *data) 146 146 { 147 - s3c_irqsub_maskack(irqno, INTMSK_CFSDI, SUBMSK_CFSDI); 147 + s3c_irqsub_maskack(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI); 148 148 } 149 149 150 150 static struct irq_chip s3c2412_irq_cfsdi = { 151 151 .name = "s3c2412-cfsdi", 152 - .ack = s3c2412_irq_cfsdi_ack, 153 - .mask = s3c2412_irq_cfsdi_mask, 154 - .unmask = s3c2412_irq_cfsdi_unmask, 152 + .irq_ack = s3c2412_irq_cfsdi_ack, 153 + .irq_mask = s3c2412_irq_cfsdi_mask, 154 + .irq_unmask = s3c2412_irq_cfsdi_unmask, 155 155 }; 156 156 157 - static int s3c2412_irq_rtc_wake(unsigned int irqno, unsigned int state) 157 + static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state) 158 158 { 159 159 unsigned long pwrcfg; 160 160 ··· 165 165 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ; 166 166 __raw_writel(pwrcfg, S3C2412_PWRCFG); 167 167 168 - return s3c_irq_chip.set_wake(irqno, state); 168 + return s3c_irq_chip.irq_set_wake(data, state); 169 169 } 170 170 171 171 static struct irq_chip s3c2412_irq_rtc_chip; ··· 193 193 /* change RTC IRQ's set wake method */ 194 194 195 195 s3c2412_irq_rtc_chip = s3c_irq_chip; 196 - s3c2412_irq_rtc_chip.set_wake = s3c2412_irq_rtc_wake; 196 + s3c2412_irq_rtc_chip.irq_set_wake = s3c2412_irq_rtc_wake; 197 197 198 198 set_irq_chip(IRQ_RTC, &s3c2412_irq_rtc_chip); 199 199
+12
arch/arm/mach-s3c2416/Kconfig
··· 31 31 help 32 32 Internal config node to apply S3C2416 power management 33 33 34 + config S3C2416_SETUP_SDHCI 35 + bool 36 + select S3C2416_SETUP_SDHCI_GPIO 37 + help 38 + Internal helper functions for S3C2416 based SDHCI systems 39 + 40 + config S3C2416_SETUP_SDHCI_GPIO 41 + bool 42 + help 43 + Common setup code for SDHCI gpio. 44 + 34 45 menu "S3C2416 Machines" 35 46 36 47 config MACH_SMDK2416 ··· 53 42 select S3C_DEV_HSMMC1 54 43 select S3C_DEV_NAND 55 44 select S3C_DEV_USB_HOST 45 + select S3C2416_SETUP_SDHCI 56 46 select S3C2416_PM if PM 57 47 help 58 48 Say Y here if you are using an SMDK2416
+4
arch/arm/mach-s3c2416/Makefile
··· 14 14 obj-$(CONFIG_S3C2416_PM) += pm.o 15 15 #obj-$(CONFIG_S3C2416_DMA) += dma.o 16 16 17 + # Device setup 18 + obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o 19 + obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o 20 + 17 21 # Machine support 18 22 19 23 obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
+13 -5
arch/arm/mach-s3c2416/clock.c
··· 38 38 [7] = 8, 39 39 }; 40 40 41 - /* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */ 42 41 static struct clksrc_clk hsmmc_div[] = { 43 42 [0] = { 44 43 .clk = { 45 44 .name = "hsmmc-div", 46 - .id = 1, 45 + .id = 0, 47 46 .parent = &clk_esysclk.clk, 48 47 }, 49 48 .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 }, ··· 50 51 [1] = { 51 52 .clk = { 52 53 .name = "hsmmc-div", 53 - .id = 0, 54 + .id = 1, 54 55 .parent = &clk_esysclk.clk, 55 56 }, 56 57 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 60 61 static struct clksrc_clk hsmmc_mux[] = { 61 62 [0] = { 62 63 .clk = { 63 - .id = 1, 64 + .id = 0, 64 65 .name = "hsmmc-if", 65 66 .ctrlbit = (1 << 6), 66 67 .enable = s3c2443_clkcon_enable_s, ··· 76 77 }, 77 78 [1] = { 78 79 .clk = { 79 - .id = 0, 80 + .id = 1, 80 81 .name = "hsmmc-if", 81 82 .ctrlbit = (1 << 12), 82 83 .enable = s3c2443_clkcon_enable_s, ··· 92 93 }, 93 94 }; 94 95 96 + static struct clk hsmmc0_clk = { 97 + .name = "hsmmc", 98 + .id = 0, 99 + .parent = &clk_h, 100 + .enable = s3c2443_clkcon_enable_h, 101 + .ctrlbit = S3C2416_HCLKCON_HSMMC0, 102 + }; 95 103 96 104 static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0) 97 105 { ··· 135 129 136 130 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 137 131 s3c_register_clksrc(clksrcs[ptr], 1); 132 + 133 + s3c24xx_register_clock(&hsmmc0_clk); 138 134 139 135 s3c_pwmclk_init(); 140 136
+36 -40
arch/arm/mach-s3c2416/irq.c
··· 77 77 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 78 78 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 79 79 80 - static void s3c2416_irq_wdtac97_mask(unsigned int irqno) 80 + static void s3c2416_irq_wdtac97_mask(struct irq_data *data) 81 81 { 82 - s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 82 + s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 83 83 } 84 84 85 - static void s3c2416_irq_wdtac97_unmask(unsigned int irqno) 85 + static void s3c2416_irq_wdtac97_unmask(struct irq_data *data) 86 86 { 87 - s3c_irqsub_unmask(irqno, INTMSK_WDTAC97); 87 + s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97); 88 88 } 89 89 90 - static void s3c2416_irq_wdtac97_ack(unsigned int irqno) 90 + static void s3c2416_irq_wdtac97_ack(struct irq_data *data) 91 91 { 92 - s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 92 + s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 93 93 } 94 94 95 95 static struct irq_chip s3c2416_irq_wdtac97 = { 96 - .mask = s3c2416_irq_wdtac97_mask, 97 - .unmask = s3c2416_irq_wdtac97_unmask, 98 - .ack = s3c2416_irq_wdtac97_ack, 96 + .irq_mask = s3c2416_irq_wdtac97_mask, 97 + .irq_unmask = s3c2416_irq_wdtac97_unmask, 98 + .irq_ack = s3c2416_irq_wdtac97_ack, 99 99 }; 100 - 101 100 102 101 /* LCD sub interrupts */ 103 102 ··· 108 109 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 109 110 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 110 111 111 - static void s3c2416_irq_lcd_mask(unsigned int irqno) 112 + static void s3c2416_irq_lcd_mask(struct irq_data *data) 112 113 { 113 - s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD); 114 + s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD); 114 115 } 115 116 116 - static void s3c2416_irq_lcd_unmask(unsigned int irqno) 117 + static void s3c2416_irq_lcd_unmask(struct irq_data *data) 117 118 { 118 - s3c_irqsub_unmask(irqno, INTMSK_LCD); 119 + s3c_irqsub_unmask(data->irq, INTMSK_LCD); 119 120 } 120 121 121 - static void s3c2416_irq_lcd_ack(unsigned int irqno) 122 + static void s3c2416_irq_lcd_ack(struct irq_data *data) 122 123 { 123 - s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD); 124 + s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD); 124 125 } 125 126 126 127 static struct irq_chip s3c2416_irq_lcd = { 127 - .mask = s3c2416_irq_lcd_mask, 128 - .unmask = s3c2416_irq_lcd_unmask, 129 - .ack = s3c2416_irq_lcd_ack, 128 + .irq_mask = s3c2416_irq_lcd_mask, 129 + .irq_unmask = s3c2416_irq_lcd_unmask, 130 + .irq_ack = s3c2416_irq_lcd_ack, 130 131 }; 131 - 132 132 133 133 /* DMA sub interrupts */ 134 134 ··· 140 142 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 141 143 142 144 143 - static void s3c2416_irq_dma_mask(unsigned int irqno) 145 + static void s3c2416_irq_dma_mask(struct irq_data *data) 144 146 { 145 - s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA); 147 + s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA); 146 148 } 147 149 148 - static void s3c2416_irq_dma_unmask(unsigned int irqno) 150 + static void s3c2416_irq_dma_unmask(struct irq_data *data) 149 151 { 150 - s3c_irqsub_unmask(irqno, INTMSK_DMA); 152 + s3c_irqsub_unmask(data->irq, INTMSK_DMA); 151 153 } 152 154 153 - static void s3c2416_irq_dma_ack(unsigned int irqno) 155 + static void s3c2416_irq_dma_ack(struct irq_data *data) 154 156 { 155 - s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA); 157 + s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA); 156 158 } 157 159 158 160 static struct irq_chip s3c2416_irq_dma = { 159 - .mask = s3c2416_irq_dma_mask, 160 - .unmask = s3c2416_irq_dma_unmask, 161 - .ack = s3c2416_irq_dma_ack, 161 + .irq_mask = s3c2416_irq_dma_mask, 162 + .irq_unmask = s3c2416_irq_dma_unmask, 163 + .irq_ack = s3c2416_irq_dma_ack, 162 164 }; 163 - 164 165 165 166 /* UART3 sub interrupts */ 166 167 ··· 171 174 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 172 175 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 173 176 174 - static void s3c2416_irq_uart3_mask(unsigned int irqno) 177 + static void s3c2416_irq_uart3_mask(struct irq_data *data) 175 178 { 176 - s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3); 179 + s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3); 177 180 } 178 181 179 - static void s3c2416_irq_uart3_unmask(unsigned int irqno) 182 + static void s3c2416_irq_uart3_unmask(struct irq_data *data) 180 183 { 181 - s3c_irqsub_unmask(irqno, INTMSK_UART3); 184 + s3c_irqsub_unmask(data->irq, INTMSK_UART3); 182 185 } 183 186 184 - static void s3c2416_irq_uart3_ack(unsigned int irqno) 187 + static void s3c2416_irq_uart3_ack(struct irq_data *data) 185 188 { 186 - s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3); 189 + s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3); 187 190 } 188 191 189 192 static struct irq_chip s3c2416_irq_uart3 = { 190 - .mask = s3c2416_irq_uart3_mask, 191 - .unmask = s3c2416_irq_uart3_unmask, 192 - .ack = s3c2416_irq_uart3_ack, 193 + .irq_mask = s3c2416_irq_uart3_mask, 194 + .irq_unmask = s3c2416_irq_uart3_unmask, 195 + .irq_ack = s3c2416_irq_uart3_ack, 193 196 }; 194 - 195 197 196 198 /* IRQ initialisation code */ 197 199
+23
arch/arm/mach-s3c2416/mach-smdk2416.c
··· 46 46 #include <plat/devs.h> 47 47 #include <plat/cpu.h> 48 48 #include <plat/nand.h> 49 + #include <plat/sdhci.h> 49 50 50 51 #include <plat/regs-fb-v4.h> 51 52 #include <plat/fb.h> ··· 111 110 .ucon = UCON, 112 111 .ulcon = ULCON | 0x50, 113 112 .ufcon = UFCON, 113 + }, 114 + [3] = { 115 + .hwport = 3, 116 + .flags = 0, 117 + .ucon = UCON, 118 + .ulcon = ULCON, 119 + .ufcon = UFCON, 114 120 } 115 121 }; 116 122 ··· 167 159 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 168 160 }; 169 161 162 + static struct s3c_sdhci_platdata smdk2416_hsmmc0_pdata __initdata = { 163 + .max_width = 4, 164 + .cd_type = S3C_SDHCI_CD_GPIO, 165 + .ext_cd_gpio = S3C2410_GPF(1), 166 + .ext_cd_gpio_invert = 1, 167 + }; 168 + 169 + static struct s3c_sdhci_platdata smdk2416_hsmmc1_pdata __initdata = { 170 + .max_width = 4, 171 + .cd_type = S3C_SDHCI_CD_NONE, 172 + }; 173 + 170 174 static struct platform_device *smdk2416_devices[] __initdata = { 171 175 &s3c_device_fb, 172 176 &s3c_device_wdt, ··· 199 179 { 200 180 s3c_i2c0_set_platdata(NULL); 201 181 s3c_fb_set_platdata(&smdk2416_fb_platdata); 182 + 183 + s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); 184 + s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); 202 185 203 186 gpio_request(S3C2410_GPB(4), "USBHost Power"); 204 187 gpio_direction_output(S3C2410_GPB(4), 1);
+5
arch/arm/mach-s3c2416/s3c2416.c
··· 53 53 #include <plat/s3c2416.h> 54 54 #include <plat/devs.h> 55 55 #include <plat/cpu.h> 56 + #include <plat/sdhci.h> 56 57 57 58 #include <plat/iic-core.h> 58 59 #include <plat/fb-core.h> ··· 115 114 { 116 115 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; 117 116 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; 117 + 118 + /* initialize device information early */ 119 + s3c2416_default_sdhci0(); 120 + s3c2416_default_sdhci1(); 118 121 119 122 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 120 123 }
+34
arch/arm/mach-s3c2416/setup-sdhci-gpio.c
··· 1 + /* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c 2 + * 3 + * Copyright 2010 Promwad Innovation Company 4 + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> 5 + * 6 + * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) 7 + * 8 + * Based on mach-s3c64xx/setup-sdhci-gpio.c 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/kernel.h> 16 + #include <linux/types.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/io.h> 20 + #include <linux/gpio.h> 21 + 22 + #include <mach/regs-gpio.h> 23 + #include <plat/gpio-cfg.h> 24 + 25 + void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 26 + { 27 + s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width, S3C_GPIO_SFN(2)); 28 + } 29 + 30 + void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 31 + { 32 + s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2)); 33 + s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2)); 34 + }
+61
arch/arm/mach-s3c2416/setup-sdhci.c
··· 1 + /* linux/arch/arm/mach-s3c2416/setup-sdhci.c 2 + * 3 + * Copyright 2010 Promwad Innovation Company 4 + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> 5 + * 6 + * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC) 7 + * 8 + * Based on mach-s3c64xx/setup-sdhci.c 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/kernel.h> 16 + #include <linux/types.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/io.h> 20 + 21 + #include <linux/mmc/card.h> 22 + #include <linux/mmc/host.h> 23 + 24 + #include <plat/regs-sdhci.h> 25 + #include <plat/sdhci.h> 26 + 27 + /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 28 + 29 + char *s3c2416_hsmmc_clksrcs[4] = { 30 + [0] = "hsmmc", 31 + [1] = "hsmmc", 32 + [2] = "hsmmc-if", 33 + /* [3] = "48m", - note not successfully used yet */ 34 + }; 35 + 36 + void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev, 37 + void __iomem *r, 38 + struct mmc_ios *ios, 39 + struct mmc_card *card) 40 + { 41 + u32 ctrl2, ctrl3; 42 + 43 + ctrl2 = __raw_readl(r + S3C_SDHCI_CONTROL2); 44 + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; 45 + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | 46 + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | 47 + S3C_SDHCI_CTRL2_ENFBCLKRX | 48 + S3C_SDHCI_CTRL2_DFCNT_NONE | 49 + S3C_SDHCI_CTRL2_ENCLKOUTHOLD); 50 + 51 + if (ios->clock < 25 * 1000000) 52 + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | 53 + S3C_SDHCI_CTRL3_FCSEL2 | 54 + S3C_SDHCI_CTRL3_FCSEL1 | 55 + S3C_SDHCI_CTRL3_FCSEL0); 56 + else 57 + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); 58 + 59 + __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2); 60 + __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3); 61 + }
+9 -9
arch/arm/mach-s3c2440/irq.c
··· 69 69 #define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0)) 70 70 71 71 static void 72 - s3c_irq_wdtac97_mask(unsigned int irqno) 72 + s3c_irq_wdtac97_mask(struct irq_data *data) 73 73 { 74 - s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13); 74 + s3c_irqsub_mask(data->irq, INTMSK_WDT, 3 << 13); 75 75 } 76 76 77 77 static void 78 - s3c_irq_wdtac97_unmask(unsigned int irqno) 78 + s3c_irq_wdtac97_unmask(struct irq_data *data) 79 79 { 80 - s3c_irqsub_unmask(irqno, INTMSK_WDT); 80 + s3c_irqsub_unmask(data->irq, INTMSK_WDT); 81 81 } 82 82 83 83 static void 84 - s3c_irq_wdtac97_ack(unsigned int irqno) 84 + s3c_irq_wdtac97_ack(struct irq_data *data) 85 85 { 86 - s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13); 86 + s3c_irqsub_maskack(data->irq, INTMSK_WDT, 3 << 13); 87 87 } 88 88 89 89 static struct irq_chip s3c_irq_wdtac97 = { 90 - .mask = s3c_irq_wdtac97_mask, 91 - .unmask = s3c_irq_wdtac97_unmask, 92 - .ack = s3c_irq_wdtac97_ack, 90 + .irq_mask = s3c_irq_wdtac97_mask, 91 + .irq_unmask = s3c_irq_wdtac97_unmask, 92 + .irq_ack = s3c_irq_wdtac97_ack, 93 93 }; 94 94 95 95 static int s3c2440_irq_add(struct sys_device *sysdev)
+9 -9
arch/arm/mach-s3c2440/s3c244x-irq.c
··· 68 68 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 69 69 70 70 static void 71 - s3c_irq_cam_mask(unsigned int irqno) 71 + s3c_irq_cam_mask(struct irq_data *data) 72 72 { 73 - s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11); 73 + s3c_irqsub_mask(data->irq, INTMSK_CAM, 3 << 11); 74 74 } 75 75 76 76 static void 77 - s3c_irq_cam_unmask(unsigned int irqno) 77 + s3c_irq_cam_unmask(struct irq_data *data) 78 78 { 79 - s3c_irqsub_unmask(irqno, INTMSK_CAM); 79 + s3c_irqsub_unmask(data->irq, INTMSK_CAM); 80 80 } 81 81 82 82 static void 83 - s3c_irq_cam_ack(unsigned int irqno) 83 + s3c_irq_cam_ack(struct irq_data *data) 84 84 { 85 - s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11); 85 + s3c_irqsub_maskack(data->irq, INTMSK_CAM, 3 << 11); 86 86 } 87 87 88 88 static struct irq_chip s3c_irq_cam = { 89 - .mask = s3c_irq_cam_mask, 90 - .unmask = s3c_irq_cam_unmask, 91 - .ack = s3c_irq_cam_ack, 89 + .irq_mask = s3c_irq_cam_mask, 90 + .irq_unmask = s3c_irq_cam_unmask, 91 + .irq_ack = s3c_irq_cam_ack, 92 92 }; 93 93 94 94 static int s3c244x_irq_add(struct sys_device *sysdev)
+2 -1
arch/arm/mach-s3c2443/Kconfig
··· 10 10 select CPU_LLSERIAL_S3C2440 11 11 select SAMSUNG_CLKSRC 12 12 select S3C2443_CLOCK 13 + select S3C_GPIO_PULL_S3C2443 13 14 help 14 15 Support for the S3C2443 SoC from the S3C24XX line 15 16 ··· 26 25 bool "SMDK2443" 27 26 select CPU_S3C2443 28 27 select MACH_SMDK 29 - select S3C_DEV_HSMMC 28 + select S3C_DEV_HSMMC1 30 29 help 31 30 Say Y here if you are using an SMDK2443 32 31
+2 -2
arch/arm/mach-s3c2443/clock.c
··· 196 196 static struct clksrc_clk clk_hsmmc_div = { 197 197 .clk = { 198 198 .name = "hsmmc-div", 199 - .id = -1, 199 + .id = 1, 200 200 .parent = &clk_esysclk.clk, 201 201 }, 202 202 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 231 231 232 232 static struct clk clk_hsmmc = { 233 233 .name = "hsmmc-if", 234 - .id = -1, 234 + .id = 1, 235 235 .parent = &clk_hsmmc_div.clk, 236 236 .enable = s3c2443_enable_hsmmc, 237 237 .ops = &(struct clk_ops) {
+45 -50
arch/arm/mach-s3c2443/irq.c
··· 75 75 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 76 76 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 77 77 78 - static void s3c2443_irq_wdtac97_mask(unsigned int irqno) 78 + static void s3c2443_irq_wdtac97_mask(struct irq_data *data) 79 79 { 80 - s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 80 + s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 81 81 } 82 82 83 - static void s3c2443_irq_wdtac97_unmask(unsigned int irqno) 83 + static void s3c2443_irq_wdtac97_unmask(struct irq_data *data) 84 84 { 85 - s3c_irqsub_unmask(irqno, INTMSK_WDTAC97); 85 + s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97); 86 86 } 87 87 88 - static void s3c2443_irq_wdtac97_ack(unsigned int irqno) 88 + static void s3c2443_irq_wdtac97_ack(struct irq_data *data) 89 89 { 90 - s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 90 + s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 91 91 } 92 92 93 93 static struct irq_chip s3c2443_irq_wdtac97 = { 94 - .mask = s3c2443_irq_wdtac97_mask, 95 - .unmask = s3c2443_irq_wdtac97_unmask, 96 - .ack = s3c2443_irq_wdtac97_ack, 94 + .irq_mask = s3c2443_irq_wdtac97_mask, 95 + .irq_unmask = s3c2443_irq_wdtac97_unmask, 96 + .irq_ack = s3c2443_irq_wdtac97_ack, 97 97 }; 98 - 99 98 100 99 /* LCD sub interrupts */ 101 100 ··· 106 107 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 107 108 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 108 109 109 - static void s3c2443_irq_lcd_mask(unsigned int irqno) 110 + static void s3c2443_irq_lcd_mask(struct irq_data *data) 110 111 { 111 - s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD); 112 + s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD); 112 113 } 113 114 114 - static void s3c2443_irq_lcd_unmask(unsigned int irqno) 115 + static void s3c2443_irq_lcd_unmask(struct irq_data *data) 115 116 { 116 - s3c_irqsub_unmask(irqno, INTMSK_LCD); 117 + s3c_irqsub_unmask(data->irq, INTMSK_LCD); 117 118 } 118 119 119 - static void s3c2443_irq_lcd_ack(unsigned int irqno) 120 + static void s3c2443_irq_lcd_ack(struct irq_data *data) 120 121 { 121 - s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD); 122 + s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD); 122 123 } 123 124 124 125 static struct irq_chip s3c2443_irq_lcd = { 125 - .mask = s3c2443_irq_lcd_mask, 126 - .unmask = s3c2443_irq_lcd_unmask, 127 - .ack = s3c2443_irq_lcd_ack, 126 + .irq_mask = s3c2443_irq_lcd_mask, 127 + .irq_unmask = s3c2443_irq_lcd_unmask, 128 + .irq_ack = s3c2443_irq_lcd_ack, 128 129 }; 129 - 130 130 131 131 /* DMA sub interrupts */ 132 132 ··· 137 139 #define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0)) 138 140 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 139 141 140 - 141 - static void s3c2443_irq_dma_mask(unsigned int irqno) 142 + static void s3c2443_irq_dma_mask(struct irq_data *data) 142 143 { 143 - s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA); 144 + s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA); 144 145 } 145 146 146 - static void s3c2443_irq_dma_unmask(unsigned int irqno) 147 + static void s3c2443_irq_dma_unmask(struct irq_data *data) 147 148 { 148 - s3c_irqsub_unmask(irqno, INTMSK_DMA); 149 + s3c_irqsub_unmask(data->irq, INTMSK_DMA); 149 150 } 150 151 151 - static void s3c2443_irq_dma_ack(unsigned int irqno) 152 + static void s3c2443_irq_dma_ack(struct irq_data *data) 152 153 { 153 - s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA); 154 + s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA); 154 155 } 155 156 156 157 static struct irq_chip s3c2443_irq_dma = { 157 - .mask = s3c2443_irq_dma_mask, 158 - .unmask = s3c2443_irq_dma_unmask, 159 - .ack = s3c2443_irq_dma_ack, 158 + .irq_mask = s3c2443_irq_dma_mask, 159 + .irq_unmask = s3c2443_irq_dma_unmask, 160 + .irq_ack = s3c2443_irq_dma_ack, 160 161 }; 161 - 162 162 163 163 /* UART3 sub interrupts */ 164 164 ··· 168 172 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 169 173 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 170 174 171 - static void s3c2443_irq_uart3_mask(unsigned int irqno) 175 + static void s3c2443_irq_uart3_mask(struct irq_data *data) 172 176 { 173 - s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3); 177 + s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3); 174 178 } 175 179 176 - static void s3c2443_irq_uart3_unmask(unsigned int irqno) 180 + static void s3c2443_irq_uart3_unmask(struct irq_data *data) 177 181 { 178 - s3c_irqsub_unmask(irqno, INTMSK_UART3); 182 + s3c_irqsub_unmask(data->irq, INTMSK_UART3); 179 183 } 180 184 181 - static void s3c2443_irq_uart3_ack(unsigned int irqno) 185 + static void s3c2443_irq_uart3_ack(struct irq_data *data) 182 186 { 183 - s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3); 187 + s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3); 184 188 } 185 189 186 190 static struct irq_chip s3c2443_irq_uart3 = { 187 - .mask = s3c2443_irq_uart3_mask, 188 - .unmask = s3c2443_irq_uart3_unmask, 189 - .ack = s3c2443_irq_uart3_ack, 191 + .irq_mask = s3c2443_irq_uart3_mask, 192 + .irq_unmask = s3c2443_irq_uart3_unmask, 193 + .irq_ack = s3c2443_irq_uart3_ack, 190 194 }; 191 - 192 195 193 196 /* CAM sub interrupts */ 194 197 ··· 199 204 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 200 205 #define SUBMSK_CAM INTMSK(IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P) 201 206 202 - static void s3c2443_irq_cam_mask(unsigned int irqno) 207 + static void s3c2443_irq_cam_mask(struct irq_data *data) 203 208 { 204 - s3c_irqsub_mask(irqno, INTMSK_CAM, SUBMSK_CAM); 209 + s3c_irqsub_mask(data->irq, INTMSK_CAM, SUBMSK_CAM); 205 210 } 206 211 207 - static void s3c2443_irq_cam_unmask(unsigned int irqno) 212 + static void s3c2443_irq_cam_unmask(struct irq_data *data) 208 213 { 209 - s3c_irqsub_unmask(irqno, INTMSK_CAM); 214 + s3c_irqsub_unmask(data->irq, INTMSK_CAM); 210 215 } 211 216 212 - static void s3c2443_irq_cam_ack(unsigned int irqno) 217 + static void s3c2443_irq_cam_ack(struct irq_data *data) 213 218 { 214 - s3c_irqsub_maskack(irqno, INTMSK_CAM, SUBMSK_CAM); 219 + s3c_irqsub_maskack(data->irq, INTMSK_CAM, SUBMSK_CAM); 215 220 } 216 221 217 222 static struct irq_chip s3c2443_irq_cam = { 218 - .mask = s3c2443_irq_cam_mask, 219 - .unmask = s3c2443_irq_cam_unmask, 220 - .ack = s3c2443_irq_cam_ack, 223 + .irq_mask = s3c2443_irq_cam_mask, 224 + .irq_unmask = s3c2443_irq_cam_unmask, 225 + .irq_ack = s3c2443_irq_cam_ack, 221 226 }; 222 227 223 228 /* IRQ initialisation code */
+8 -1
arch/arm/mach-s3c2443/mach-smdk2443.c
··· 99 99 .ucon = 0x3c5, 100 100 .ulcon = 0x43, 101 101 .ufcon = 0x51, 102 + }, 103 + [3] = { 104 + .hwport = 3, 105 + .flags = 0, 106 + .ucon = 0x3c5, 107 + .ulcon = 0x03, 108 + .ufcon = 0x51, 102 109 } 103 110 }; 104 111 105 112 static struct platform_device *smdk2443_devices[] __initdata = { 106 113 &s3c_device_wdt, 107 114 &s3c_device_i2c0, 108 - &s3c_device_hsmmc0, 115 + &s3c_device_hsmmc1, 109 116 #ifdef CONFIG_SND_SOC_SMDK2443_WM9710 110 117 &s3c_device_ac97, 111 118 #endif
+7
arch/arm/mach-s3c2443/s3c2443.c
··· 16 16 #include <linux/list.h> 17 17 #include <linux/timer.h> 18 18 #include <linux/init.h> 19 + #include <linux/gpio.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/serial_core.h> 21 22 #include <linux/sysdev.h> ··· 33 32 #include <mach/regs-s3c2443-clock.h> 34 33 #include <mach/reset.h> 35 34 35 + #include <plat/gpio-core.h> 36 + #include <plat/gpio-cfg.h> 37 + #include <plat/gpio-cfg-helpers.h> 36 38 #include <plat/s3c2443.h> 37 39 #include <plat/devs.h> 38 40 #include <plat/cpu.h> ··· 90 86 91 87 void __init s3c2443_map_io(void) 92 88 { 89 + s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443; 90 + s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443; 91 + 93 92 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 94 93 } 95 94
+3 -16
arch/arm/mach-s3c64xx/clock.c
··· 127 127 return s3c64xx_gate(S3C_SCLK_GATE, clk, enable); 128 128 } 129 129 130 - static struct clk init_clocks_disable[] = { 130 + static struct clk init_clocks_off[] = { 131 131 { 132 132 .name = "nand", 133 133 .id = -1, ··· 834 834 void __init s3c64xx_register_clocks(unsigned long xtal, 835 835 unsigned armclk_divlimit) 836 836 { 837 - struct clk *clkp; 838 - int ret; 839 - int ptr; 840 - 841 837 armclk_mask = armclk_divlimit; 842 838 843 839 s3c24xx_register_baseclocks(xtal); ··· 841 845 842 846 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 843 847 844 - clkp = init_clocks_disable; 845 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 846 - 847 - ret = s3c24xx_register_clock(clkp); 848 - if (ret < 0) { 849 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 850 - clkp->name, ret); 851 - } 852 - 853 - (clkp->enable)(clkp, 0); 854 - } 848 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 849 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 855 850 856 851 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 857 852 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
+1
arch/arm/mach-s3c64xx/dma.c
··· 212 212 213 213 config = readl(chan->regs + PL080S_CH_CONFIG); 214 214 config |= PL080_CONFIG_ENABLE; 215 + config &= ~PL080_CONFIG_HALT; 215 216 216 217 pr_debug("%s: writing config %08x\n", __func__, config); 217 218 writel(config, chan->regs + PL080S_CH_CONFIG);
+19 -18
arch/arm/mach-s3c64xx/irq-eint.c
··· 30 30 #include <plat/pm.h> 31 31 32 32 #define eint_offset(irq) ((irq) - IRQ_EINT(0)) 33 - #define eint_irq_to_bit(irq) (1 << eint_offset(irq)) 33 + #define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq))) 34 34 35 - static inline void s3c_irq_eint_mask(unsigned int irq) 35 + static inline void s3c_irq_eint_mask(struct irq_data *data) 36 36 { 37 37 u32 mask; 38 38 39 39 mask = __raw_readl(S3C64XX_EINT0MASK); 40 - mask |= eint_irq_to_bit(irq); 40 + mask |= (u32)data->chip_data; 41 41 __raw_writel(mask, S3C64XX_EINT0MASK); 42 42 } 43 43 44 - static void s3c_irq_eint_unmask(unsigned int irq) 44 + static void s3c_irq_eint_unmask(struct irq_data *data) 45 45 { 46 46 u32 mask; 47 47 48 48 mask = __raw_readl(S3C64XX_EINT0MASK); 49 - mask &= ~eint_irq_to_bit(irq); 49 + mask &= ~((u32)data->chip_data); 50 50 __raw_writel(mask, S3C64XX_EINT0MASK); 51 51 } 52 52 53 - static inline void s3c_irq_eint_ack(unsigned int irq) 53 + static inline void s3c_irq_eint_ack(struct irq_data *data) 54 54 { 55 - __raw_writel(eint_irq_to_bit(irq), S3C64XX_EINT0PEND); 55 + __raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND); 56 56 } 57 57 58 - static void s3c_irq_eint_maskack(unsigned int irq) 58 + static void s3c_irq_eint_maskack(struct irq_data *data) 59 59 { 60 60 /* compiler should in-line these */ 61 - s3c_irq_eint_mask(irq); 62 - s3c_irq_eint_ack(irq); 61 + s3c_irq_eint_mask(data); 62 + s3c_irq_eint_ack(data); 63 63 } 64 64 65 - static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) 65 + static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type) 66 66 { 67 - int offs = eint_offset(irq); 67 + int offs = eint_offset(data->irq); 68 68 int pin, pin_val; 69 69 int shift; 70 70 u32 ctrl, mask; ··· 140 140 141 141 static struct irq_chip s3c_irq_eint = { 142 142 .name = "s3c-eint", 143 - .mask = s3c_irq_eint_mask, 144 - .unmask = s3c_irq_eint_unmask, 145 - .mask_ack = s3c_irq_eint_maskack, 146 - .ack = s3c_irq_eint_ack, 147 - .set_type = s3c_irq_eint_set_type, 148 - .set_wake = s3c_irqext_wake, 143 + .irq_mask = s3c_irq_eint_mask, 144 + .irq_unmask = s3c_irq_eint_unmask, 145 + .irq_mask_ack = s3c_irq_eint_maskack, 146 + .irq_ack = s3c_irq_eint_ack, 147 + .irq_set_type = s3c_irq_eint_set_type, 148 + .irq_set_wake = s3c_irqext_wake, 149 149 }; 150 150 151 151 /* s3c_irq_demux_eint ··· 198 198 199 199 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { 200 200 set_irq_chip(irq, &s3c_irq_eint); 201 + set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq)); 201 202 set_irq_handler(irq, handle_level_irq); 202 203 set_irq_flags(irq, IRQF_VALID); 203 204 }
+3 -13
arch/arm/mach-s5p6442/clock.c
··· 340 340 clk_pclkd1.rate = pclkd1; 341 341 } 342 342 343 - static struct clk init_clocks_disable[] = { 343 + static struct clk init_clocks_off[] = { 344 344 { 345 345 .name = "pdma", 346 346 .id = -1, ··· 408 408 409 409 void __init s5p6442_register_clocks(void) 410 410 { 411 - struct clk *clkptr; 412 - int i, ret; 413 - 414 411 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 415 412 416 413 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 417 414 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 418 415 419 - clkptr = init_clocks_disable; 420 - for (i = 0; i < ARRAY_SIZE(init_clocks_disable); i++, clkptr++) { 421 - ret = s3c24xx_register_clock(clkptr); 422 - if (ret < 0) { 423 - printk(KERN_ERR "Fail to register clock %s (%d)\n", 424 - clkptr->name, ret); 425 - } else 426 - (clkptr->enable)(clkptr, 0); 427 - } 416 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 417 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 428 418 429 419 s3c_pwmclk_init(); 430 420 }
+3
arch/arm/mach-s5p6442/include/mach/map.h
··· 28 28 #define S5P6442_PA_VIC1 (0xE4100000) 29 29 #define S5P6442_PA_VIC2 (0xE4200000) 30 30 31 + #define S5P6442_PA_SROMC (0xE7000000) 32 + #define S5P_PA_SROMC S5P6442_PA_SROMC 33 + 31 34 #define S5P6442_PA_MDMA 0xE8000000 32 35 #define S5P6442_PA_PDMA 0xE9000000 33 36
+10
arch/arm/mach-s5p6442/mach-smdk6442.c
··· 12 12 #include <linux/types.h> 13 13 #include <linux/init.h> 14 14 #include <linux/serial_core.h> 15 + #include <linux/i2c.h> 15 16 16 17 #include <asm/mach/arch.h> 17 18 #include <asm/mach/map.h> ··· 26 25 #include <plat/s5p6442.h> 27 26 #include <plat/devs.h> 28 27 #include <plat/cpu.h> 28 + #include <plat/iic.h> 29 29 30 30 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 31 #define SMDK6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 67 65 }; 68 66 69 67 static struct platform_device *smdk6442_devices[] __initdata = { 68 + &s3c_device_i2c0, 70 69 &s5p6442_device_iis0, 71 70 &s3c_device_wdt, 71 + }; 72 + 73 + static struct i2c_board_info smdk6442_i2c_devs0[] __initdata = { 74 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 72 75 }; 73 76 74 77 static void __init smdk6442_map_io(void) ··· 85 78 86 79 static void __init smdk6442_machine_init(void) 87 80 { 81 + s3c_i2c0_set_platdata(NULL); 82 + i2c_register_board_info(0, smdk6442_i2c_devs0, 83 + ARRAY_SIZE(smdk6442_i2c_devs0)); 88 84 platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices)); 89 85 } 90 86
+4 -1
arch/arm/mach-s5p6442/setup-i2c0.c
··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/types.h> 17 + #include <linux/gpio.h> 17 18 18 19 struct platform_device; /* don't need the contents */ 19 20 21 + #include <plat/gpio-cfg.h> 20 22 #include <plat/iic.h> 21 23 22 24 void s3c_i2c0_cfg_gpio(struct platform_device *dev) 23 25 { 24 - /* Will be populated later */ 26 + s3c_gpio_cfgall_range(S5P6442_GPD1(0), 2, 27 + S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); 25 28 }
+2 -2
arch/arm/mach-s5p64x0/Makefile
··· 12 12 13 13 # Core support for S5P64X0 system 14 14 15 - obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o 15 + obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o gpiolib.o 16 16 obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o 17 - obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o gpio.o 17 + obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o 18 18 obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o 19 19 20 20 # machine support
+6 -16
arch/arm/mach-s5p64x0/clock-s5p6440.c
··· 133 133 * recommended to keep the following clocks disabled until the driver requests 134 134 * for enabling the clock. 135 135 */ 136 - static struct clk init_clocks_disable[] = { 136 + static struct clk init_clocks_off[] = { 137 137 { 138 138 .name = "nand", 139 139 .id = -1, ··· 419 419 static struct clksrc_clk clksrcs[] = { 420 420 { 421 421 .clk = { 422 - .name = "mmc_bus", 422 + .name = "sclk_mmc", 423 423 .id = 0, 424 424 .ctrlbit = (1 << 24), 425 425 .enable = s5p64x0_sclk_ctrl, ··· 429 429 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, 430 430 }, { 431 431 .clk = { 432 - .name = "mmc_bus", 432 + .name = "sclk_mmc", 433 433 .id = 1, 434 434 .ctrlbit = (1 << 25), 435 435 .enable = s5p64x0_sclk_ctrl, ··· 439 439 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, 440 440 }, { 441 441 .clk = { 442 - .name = "mmc_bus", 442 + .name = "sclk_mmc", 443 443 .id = 2, 444 444 .ctrlbit = (1 << 26), 445 445 .enable = s5p64x0_sclk_ctrl, ··· 602 602 603 603 void __init s5p6440_register_clocks(void) 604 604 { 605 - struct clk *clkp; 606 - int ret; 607 605 int ptr; 608 606 609 607 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 612 614 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 613 615 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 614 616 615 - clkp = init_clocks_disable; 616 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 617 - 618 - ret = s3c24xx_register_clock(clkp); 619 - if (ret < 0) { 620 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 621 - clkp->name, ret); 622 - } 623 - (clkp->enable)(clkp, 0); 624 - } 617 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 618 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 625 619 626 620 s3c_pwmclk_init(); 627 621 }
+21 -13
arch/arm/mach-s5p64x0/clock-s5p6450.c
··· 181 181 * recommended to keep the following clocks disabled until the driver requests 182 182 * for enabling the clock. 183 183 */ 184 - static struct clk init_clocks_disable[] = { 184 + static struct clk init_clocks_off[] = { 185 185 { 186 186 .name = "usbhost", 187 187 .id = -1, ··· 231 231 .enable = s5p64x0_pclk_ctrl, 232 232 .ctrlbit = (1 << 5), 233 233 }, { 234 + .name = "rtc", 235 + .id = -1, 236 + .parent = &clk_pclk_low.clk, 237 + .enable = s5p64x0_pclk_ctrl, 238 + .ctrlbit = (1 << 6), 239 + }, { 234 240 .name = "adc", 235 241 .id = -1, 236 242 .parent = &clk_pclk_low.clk, ··· 266 260 .parent = &clk_pclk_low.clk, 267 261 .enable = s5p64x0_pclk_ctrl, 268 262 .ctrlbit = (1 << 26), 263 + }, { 264 + .name = "iis", 265 + .id = 1, 266 + .parent = &clk_pclk_low.clk, 267 + .enable = s5p64x0_pclk_ctrl, 268 + .ctrlbit = (1 << 15), 269 + }, { 270 + .name = "iis", 271 + .id = 2, 272 + .parent = &clk_pclk_low.clk, 273 + .enable = s5p64x0_pclk_ctrl, 274 + .ctrlbit = (1 << 16), 269 275 }, { 270 276 .name = "i2c", 271 277 .id = 1, ··· 651 633 652 634 void __init s5p6450_register_clocks(void) 653 635 { 654 - struct clk *clkp; 655 - int ret; 656 636 int ptr; 657 637 658 638 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) ··· 659 643 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 660 644 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 661 645 662 - clkp = init_clocks_disable; 663 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 664 - 665 - ret = s3c24xx_register_clock(clkp); 666 - if (ret < 0) { 667 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 668 - clkp->name, ret); 669 - } 670 - (clkp->enable)(clkp, 0); 671 - } 646 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 647 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 672 648 673 649 s3c_pwmclk_init(); 674 650 }
+110 -13
arch/arm/mach-s5p64x0/dev-audio.c
··· 24 24 [1] = "sclk_audio2", 25 25 }; 26 26 27 - static int s5p64x0_cfg_i2s(struct platform_device *pdev) 27 + static int s5p6440_cfg_i2s(struct platform_device *pdev) 28 28 { 29 - /* configure GPIO for i2s port */ 30 29 switch (pdev->id) { 31 30 case 0: 32 - s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5)); 33 - s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5)); 31 + s3c_gpio_cfgpin_range(S5P6440_GPC(4), 2, S3C_GPIO_SFN(5)); 32 + s3c_gpio_cfgpin(S5P6440_GPC(7), S3C_GPIO_SFN(5)); 33 + s3c_gpio_cfgpin_range(S5P6440_GPH(6), 4, S3C_GPIO_SFN(5)); 34 34 break; 35 35 default: 36 36 printk(KERN_ERR "Invalid Device %d\n", pdev->id); ··· 40 40 return 0; 41 41 } 42 42 43 - static struct s3c_audio_pdata s5p64x0_i2s_pdata = { 44 - .cfg_gpio = s5p64x0_cfg_i2s, 43 + static struct s3c_audio_pdata s5p6440_i2s_pdata = { 44 + .cfg_gpio = s5p6440_cfg_i2s, 45 45 .type = { 46 46 .i2s = { 47 47 .quirks = QUIRK_PRI_6CHAN, ··· 50 50 }, 51 51 }; 52 52 53 - static struct resource s5p64x0_iis0_resource[] = { 53 + static struct resource s5p64x0_i2s0_resource[] = { 54 54 [0] = { 55 55 .start = S5P64X0_PA_I2S, 56 56 .end = S5P64X0_PA_I2S + 0x100 - 1, ··· 71 71 struct platform_device s5p6440_device_iis = { 72 72 .name = "samsung-i2s", 73 73 .id = 0, 74 - .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 75 - .resource = s5p64x0_iis0_resource, 74 + .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), 75 + .resource = s5p64x0_i2s0_resource, 76 76 .dev = { 77 - .platform_data = &s5p64x0_i2s_pdata, 77 + .platform_data = &s5p6440_i2s_pdata, 78 + }, 79 + }; 80 + 81 + static int s5p6450_cfg_i2s(struct platform_device *pdev) 82 + { 83 + switch (pdev->id) { 84 + case 0: 85 + s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5)); 86 + s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5)); 87 + break; 88 + case 1: 89 + s3c_gpio_cfgpin(S5P6440_GPB(4), S3C_GPIO_SFN(5)); 90 + s3c_gpio_cfgpin_range(S5P6450_GPC(0), 4, S3C_GPIO_SFN(5)); 91 + break; 92 + case 2: 93 + s3c_gpio_cfgpin_range(S5P6450_GPK(0), 5, S3C_GPIO_SFN(5)); 94 + break; 95 + default: 96 + printk(KERN_ERR "Invalid Device %d\n", pdev->id); 97 + return -EINVAL; 98 + } 99 + 100 + return 0; 101 + } 102 + 103 + static struct s3c_audio_pdata s5p6450_i2s0_pdata = { 104 + .cfg_gpio = s5p6450_cfg_i2s, 105 + .type = { 106 + .i2s = { 107 + .quirks = QUIRK_PRI_6CHAN, 108 + .src_clk = rclksrc, 109 + }, 78 110 }, 79 111 }; 80 112 81 113 struct platform_device s5p6450_device_iis0 = { 82 114 .name = "samsung-i2s", 83 115 .id = 0, 84 - .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 85 - .resource = s5p64x0_iis0_resource, 116 + .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), 117 + .resource = s5p64x0_i2s0_resource, 86 118 .dev = { 87 - .platform_data = &s5p64x0_i2s_pdata, 119 + .platform_data = &s5p6450_i2s0_pdata, 120 + }, 121 + }; 122 + 123 + static struct s3c_audio_pdata s5p6450_i2s_pdata = { 124 + .cfg_gpio = s5p6450_cfg_i2s, 125 + .type = { 126 + .i2s = { 127 + .src_clk = rclksrc, 128 + }, 129 + }, 130 + }; 131 + 132 + static struct resource s5p6450_i2s1_resource[] = { 133 + [0] = { 134 + .start = S5P6450_PA_I2S1, 135 + .end = S5P6450_PA_I2S1 + 0x100 - 1, 136 + .flags = IORESOURCE_MEM, 137 + }, 138 + [1] = { 139 + .start = DMACH_I2S1_TX, 140 + .end = DMACH_I2S1_TX, 141 + .flags = IORESOURCE_DMA, 142 + }, 143 + [2] = { 144 + .start = DMACH_I2S1_RX, 145 + .end = DMACH_I2S1_RX, 146 + .flags = IORESOURCE_DMA, 147 + }, 148 + }; 149 + 150 + struct platform_device s5p6450_device_iis1 = { 151 + .name = "samsung-i2s", 152 + .id = 1, 153 + .num_resources = ARRAY_SIZE(s5p6450_i2s1_resource), 154 + .resource = s5p6450_i2s1_resource, 155 + .dev = { 156 + .platform_data = &s5p6450_i2s_pdata, 157 + }, 158 + }; 159 + 160 + static struct resource s5p6450_i2s2_resource[] = { 161 + [0] = { 162 + .start = S5P6450_PA_I2S2, 163 + .end = S5P6450_PA_I2S2 + 0x100 - 1, 164 + .flags = IORESOURCE_MEM, 165 + }, 166 + [1] = { 167 + .start = DMACH_I2S2_TX, 168 + .end = DMACH_I2S2_TX, 169 + .flags = IORESOURCE_DMA, 170 + }, 171 + [2] = { 172 + .start = DMACH_I2S2_RX, 173 + .end = DMACH_I2S2_RX, 174 + .flags = IORESOURCE_DMA, 175 + }, 176 + }; 177 + 178 + struct platform_device s5p6450_device_iis2 = { 179 + .name = "samsung-i2s", 180 + .id = 2, 181 + .num_resources = ARRAY_SIZE(s5p6450_i2s2_resource), 182 + .resource = s5p6450_i2s2_resource, 183 + .dev = { 184 + .platform_data = &s5p6450_i2s_pdata, 88 185 }, 89 186 }; 90 187
+195 -26
arch/arm/mach-s5p64x0/gpio.c arch/arm/mach-s5p64x0/gpiolib.c
··· 1 - /* linux/arch/arm/mach-s5p64x0/gpio.c 1 + /* linux/arch/arm/mach-s5p64x0/gpiolib.c 2 2 * 3 3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 4 4 * http://www.samsung.com ··· 17 17 18 18 #include <mach/map.h> 19 19 #include <mach/regs-gpio.h> 20 + #include <mach/regs-clock.h> 20 21 21 22 #include <plat/gpio-core.h> 22 23 #include <plat/gpio-cfg.h> 23 24 #include <plat/gpio-cfg-helpers.h> 24 - 25 - /* To be implemented S5P6450 GPIO */ 26 25 27 26 /* 28 27 * S5P6440 GPIO bank summary: ··· 38 39 * N 16 2Bit No IRQ_EINT 39 40 * P 8 2Bit Yes 8 40 41 * R 15 4Bit[2] Yes 8 42 + * 43 + * S5P6450 GPIO bank summary: 44 + * 45 + * Bank GPIOs Style SlpCon ExtInt Group 46 + * A 6 4Bit Yes 1 47 + * B 7 4Bit Yes 1 48 + * C 8 4Bit Yes 2 49 + * D 8 4Bit Yes None 50 + * F 2 2Bit Yes None 51 + * G 14 4Bit[2] Yes 5 52 + * H 10 4Bit[2] Yes 6 53 + * I 16 2Bit Yes None 54 + * J 12 2Bit Yes None 55 + * K 5 4Bit Yes None 56 + * N 16 2Bit No IRQ_EINT 57 + * P 11 2Bit Yes 8 58 + * Q 14 2Bit Yes None 59 + * R 15 4Bit[2] Yes None 60 + * S 8 2Bit Yes None 41 61 * 42 62 * [1] BANKF pins 14,15 do not form part of the external interrupt sources 43 63 * [2] BANK has two control registers, GPxCON0 and GPxCON1 ··· 208 190 209 191 static struct s3c_gpio_chip s5p6440_gpio_4bit[] = { 210 192 { 211 - .base = S5P6440_GPA_BASE, 193 + .base = S5P64X0_GPA_BASE, 212 194 .config = &s5p64x0_gpio_cfgs[1], 213 195 .chip = { 214 196 .base = S5P6440_GPA(0), ··· 216 198 .label = "GPA", 217 199 }, 218 200 }, { 219 - .base = S5P6440_GPB_BASE, 201 + .base = S5P64X0_GPB_BASE, 220 202 .config = &s5p64x0_gpio_cfgs[1], 221 203 .chip = { 222 204 .base = S5P6440_GPB(0), ··· 224 206 .label = "GPB", 225 207 }, 226 208 }, { 227 - .base = S5P6440_GPC_BASE, 209 + .base = S5P64X0_GPC_BASE, 228 210 .config = &s5p64x0_gpio_cfgs[1], 229 211 .chip = { 230 212 .base = S5P6440_GPC(0), ··· 232 214 .label = "GPC", 233 215 }, 234 216 }, { 235 - .base = S5P6440_GPG_BASE, 217 + .base = S5P64X0_GPG_BASE, 236 218 .config = &s5p64x0_gpio_cfgs[1], 237 219 .chip = { 238 220 .base = S5P6440_GPG(0), ··· 244 226 245 227 static struct s3c_gpio_chip s5p6440_gpio_4bit2[] = { 246 228 { 247 - .base = S5P6440_GPH_BASE + 0x4, 229 + .base = S5P64X0_GPH_BASE + 0x4, 248 230 .config = &s5p64x0_gpio_cfgs[1], 249 231 .chip = { 250 232 .base = S5P6440_GPH(0), ··· 256 238 257 239 static struct s3c_gpio_chip s5p6440_gpio_rbank_4bit2[] = { 258 240 { 259 - .base = S5P6440_GPR_BASE + 0x4, 241 + .base = S5P64X0_GPR_BASE + 0x4, 260 242 .config = &s5p64x0_gpio_cfgs[2], 261 243 .chip = { 262 244 .base = S5P6440_GPR(0), ··· 268 250 269 251 static struct s3c_gpio_chip s5p6440_gpio_2bit[] = { 270 252 { 271 - .base = S5P6440_GPF_BASE, 253 + .base = S5P64X0_GPF_BASE, 272 254 .config = &s5p64x0_gpio_cfgs[5], 273 255 .chip = { 274 256 .base = S5P6440_GPF(0), ··· 276 258 .label = "GPF", 277 259 }, 278 260 }, { 279 - .base = S5P6440_GPI_BASE, 261 + .base = S5P64X0_GPI_BASE, 280 262 .config = &s5p64x0_gpio_cfgs[3], 281 263 .chip = { 282 264 .base = S5P6440_GPI(0), ··· 284 266 .label = "GPI", 285 267 }, 286 268 }, { 287 - .base = S5P6440_GPJ_BASE, 269 + .base = S5P64X0_GPJ_BASE, 288 270 .config = &s5p64x0_gpio_cfgs[3], 289 271 .chip = { 290 272 .base = S5P6440_GPJ(0), ··· 292 274 .label = "GPJ", 293 275 }, 294 276 }, { 295 - .base = S5P6440_GPN_BASE, 277 + .base = S5P64X0_GPN_BASE, 296 278 .config = &s5p64x0_gpio_cfgs[4], 297 279 .chip = { 298 280 .base = S5P6440_GPN(0), ··· 300 282 .label = "GPN", 301 283 }, 302 284 }, { 303 - .base = S5P6440_GPP_BASE, 285 + .base = S5P64X0_GPP_BASE, 304 286 .config = &s5p64x0_gpio_cfgs[5], 305 287 .chip = { 306 288 .base = S5P6440_GPP(0), 307 289 .ngpio = S5P6440_GPIO_P_NR, 308 290 .label = "GPP", 291 + }, 292 + }, 293 + }; 294 + 295 + static struct s3c_gpio_chip s5p6450_gpio_4bit[] = { 296 + { 297 + .base = S5P64X0_GPA_BASE, 298 + .config = &s5p64x0_gpio_cfgs[1], 299 + .chip = { 300 + .base = S5P6450_GPA(0), 301 + .ngpio = S5P6450_GPIO_A_NR, 302 + .label = "GPA", 303 + }, 304 + }, { 305 + .base = S5P64X0_GPB_BASE, 306 + .config = &s5p64x0_gpio_cfgs[1], 307 + .chip = { 308 + .base = S5P6450_GPB(0), 309 + .ngpio = S5P6450_GPIO_B_NR, 310 + .label = "GPB", 311 + }, 312 + }, { 313 + .base = S5P64X0_GPC_BASE, 314 + .config = &s5p64x0_gpio_cfgs[1], 315 + .chip = { 316 + .base = S5P6450_GPC(0), 317 + .ngpio = S5P6450_GPIO_C_NR, 318 + .label = "GPC", 319 + }, 320 + }, { 321 + .base = S5P6450_GPD_BASE, 322 + .config = &s5p64x0_gpio_cfgs[1], 323 + .chip = { 324 + .base = S5P6450_GPD(0), 325 + .ngpio = S5P6450_GPIO_D_NR, 326 + .label = "GPD", 327 + }, 328 + }, { 329 + .base = S5P6450_GPK_BASE, 330 + .config = &s5p64x0_gpio_cfgs[1], 331 + .chip = { 332 + .base = S5P6450_GPK(0), 333 + .ngpio = S5P6450_GPIO_K_NR, 334 + .label = "GPK", 335 + }, 336 + }, 337 + }; 338 + 339 + static struct s3c_gpio_chip s5p6450_gpio_4bit2[] = { 340 + { 341 + .base = S5P64X0_GPG_BASE + 0x4, 342 + .config = &s5p64x0_gpio_cfgs[1], 343 + .chip = { 344 + .base = S5P6450_GPG(0), 345 + .ngpio = S5P6450_GPIO_G_NR, 346 + .label = "GPG", 347 + }, 348 + }, { 349 + .base = S5P64X0_GPH_BASE + 0x4, 350 + .config = &s5p64x0_gpio_cfgs[1], 351 + .chip = { 352 + .base = S5P6450_GPH(0), 353 + .ngpio = S5P6450_GPIO_H_NR, 354 + .label = "GPH", 355 + }, 356 + }, 357 + }; 358 + 359 + static struct s3c_gpio_chip s5p6450_gpio_rbank_4bit2[] = { 360 + { 361 + .base = S5P64X0_GPR_BASE + 0x4, 362 + .config = &s5p64x0_gpio_cfgs[2], 363 + .chip = { 364 + .base = S5P6450_GPR(0), 365 + .ngpio = S5P6450_GPIO_R_NR, 366 + .label = "GPR", 367 + }, 368 + }, 369 + }; 370 + 371 + static struct s3c_gpio_chip s5p6450_gpio_2bit[] = { 372 + { 373 + .base = S5P64X0_GPF_BASE, 374 + .config = &s5p64x0_gpio_cfgs[5], 375 + .chip = { 376 + .base = S5P6450_GPF(0), 377 + .ngpio = S5P6450_GPIO_F_NR, 378 + .label = "GPF", 379 + }, 380 + }, { 381 + .base = S5P64X0_GPI_BASE, 382 + .config = &s5p64x0_gpio_cfgs[3], 383 + .chip = { 384 + .base = S5P6450_GPI(0), 385 + .ngpio = S5P6450_GPIO_I_NR, 386 + .label = "GPI", 387 + }, 388 + }, { 389 + .base = S5P64X0_GPJ_BASE, 390 + .config = &s5p64x0_gpio_cfgs[3], 391 + .chip = { 392 + .base = S5P6450_GPJ(0), 393 + .ngpio = S5P6450_GPIO_J_NR, 394 + .label = "GPJ", 395 + }, 396 + }, { 397 + .base = S5P64X0_GPN_BASE, 398 + .config = &s5p64x0_gpio_cfgs[4], 399 + .chip = { 400 + .base = S5P6450_GPN(0), 401 + .ngpio = S5P6450_GPIO_N_NR, 402 + .label = "GPN", 403 + }, 404 + }, { 405 + .base = S5P64X0_GPP_BASE, 406 + .config = &s5p64x0_gpio_cfgs[5], 407 + .chip = { 408 + .base = S5P6450_GPP(0), 409 + .ngpio = S5P6450_GPIO_P_NR, 410 + .label = "GPP", 411 + }, 412 + }, { 413 + .base = S5P6450_GPQ_BASE, 414 + .config = &s5p64x0_gpio_cfgs[4], 415 + .chip = { 416 + .base = S5P6450_GPQ(0), 417 + .ngpio = S5P6450_GPIO_Q_NR, 418 + .label = "GPQ", 419 + }, 420 + }, { 421 + .base = S5P6450_GPS_BASE, 422 + .config = &s5p64x0_gpio_cfgs[5], 423 + .chip = { 424 + .base = S5P6450_GPS(0), 425 + .ngpio = S5P6450_GPIO_S_NR, 426 + .label = "GPS", 309 427 }, 310 428 }, 311 429 }; ··· 471 317 } 472 318 } 473 319 474 - static int __init s5p6440_gpiolib_init(void) 320 + static int __init s5p64x0_gpiolib_init(void) 475 321 { 476 - struct s3c_gpio_chip *chips = s5p6440_gpio_2bit; 477 - int nr_chips = ARRAY_SIZE(s5p6440_gpio_2bit); 322 + unsigned int chipid; 323 + 324 + chipid = __raw_readl(S5P64X0_SYS_ID); 478 325 479 326 s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs, 480 327 ARRAY_SIZE(s5p64x0_gpio_cfgs)); 481 328 482 - for (; nr_chips > 0; nr_chips--, chips++) 483 - s3c_gpiolib_add(chips); 329 + if ((chipid & 0xff000) == 0x50000) { 330 + samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit, 331 + ARRAY_SIZE(s5p6450_gpio_2bit)); 484 332 485 - samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit, 486 - ARRAY_SIZE(s5p6440_gpio_4bit)); 333 + samsung_gpiolib_add_4bit_chips(s5p6450_gpio_4bit, 334 + ARRAY_SIZE(s5p6450_gpio_4bit)); 487 335 488 - samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2, 489 - ARRAY_SIZE(s5p6440_gpio_4bit2)); 336 + samsung_gpiolib_add_4bit2_chips(s5p6450_gpio_4bit2, 337 + ARRAY_SIZE(s5p6450_gpio_4bit2)); 490 338 491 - s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2, 492 - ARRAY_SIZE(s5p6440_gpio_rbank_4bit2)); 339 + s5p64x0_gpio_add_rbank_4bit2(s5p6450_gpio_rbank_4bit2, 340 + ARRAY_SIZE(s5p6450_gpio_rbank_4bit2)); 341 + } else { 342 + samsung_gpiolib_add_2bit_chips(s5p6440_gpio_2bit, 343 + ARRAY_SIZE(s5p6440_gpio_2bit)); 344 + 345 + samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit, 346 + ARRAY_SIZE(s5p6440_gpio_4bit)); 347 + 348 + samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2, 349 + ARRAY_SIZE(s5p6440_gpio_4bit2)); 350 + 351 + s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2, 352 + ARRAY_SIZE(s5p6440_gpio_rbank_4bit2)); 353 + } 493 354 494 355 return 0; 495 356 } 496 - arch_initcall(s5p6440_gpiolib_init); 357 + core_initcall(s5p64x0_gpiolib_init);
+5
arch/arm/mach-s5p64x0/include/mach/map.h
··· 29 29 #define S5P64X0_PA_VIC0 (0xE4000000) 30 30 #define S5P64X0_PA_VIC1 (0xE4100000) 31 31 32 + #define S5P64X0_PA_SROMC (0xE7000000) 33 + #define S5P_PA_SROMC S5P64X0_PA_SROMC 34 + 32 35 #define S5P64X0_PA_PDMA (0xE9000000) 33 36 34 37 #define S5P64X0_PA_TIMER (0xEA000000) ··· 66 63 #define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 67 64 68 65 #define S5P64X0_PA_I2S (0xF2000000) 66 + #define S5P6450_PA_I2S1 0xF2800000 67 + #define S5P6450_PA_I2S2 0xF2900000 69 68 70 69 #define S5P64X0_PA_PCM (0xF2100000) 71 70
+15 -40
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
··· 15 15 16 16 #include <mach/map.h> 17 17 18 - /* Will be implemented S5P6442 GPIOlib */ 19 - 20 18 /* Base addresses for each of the banks */ 21 19 22 - #define S5P6440_GPA_BASE (S5P_VA_GPIO + 0x0000) 23 - #define S5P6440_GPB_BASE (S5P_VA_GPIO + 0x0020) 24 - #define S5P6440_GPC_BASE (S5P_VA_GPIO + 0x0040) 25 - #define S5P6440_GPF_BASE (S5P_VA_GPIO + 0x00A0) 26 - #define S5P6440_GPG_BASE (S5P_VA_GPIO + 0x00C0) 27 - #define S5P6440_GPH_BASE (S5P_VA_GPIO + 0x00E0) 28 - #define S5P6440_GPI_BASE (S5P_VA_GPIO + 0x0100) 29 - #define S5P6440_GPJ_BASE (S5P_VA_GPIO + 0x0120) 30 - #define S5P6440_GPN_BASE (S5P_VA_GPIO + 0x0830) 31 - #define S5P6440_GPP_BASE (S5P_VA_GPIO + 0x0160) 32 - #define S5P6440_GPR_BASE (S5P_VA_GPIO + 0x0290) 20 + #define S5P64X0_GPA_BASE (S5P_VA_GPIO + 0x0000) 21 + #define S5P64X0_GPB_BASE (S5P_VA_GPIO + 0x0020) 22 + #define S5P64X0_GPC_BASE (S5P_VA_GPIO + 0x0040) 23 + #define S5P64X0_GPF_BASE (S5P_VA_GPIO + 0x00A0) 24 + #define S5P64X0_GPG_BASE (S5P_VA_GPIO + 0x00C0) 25 + #define S5P64X0_GPH_BASE (S5P_VA_GPIO + 0x00E0) 26 + #define S5P64X0_GPI_BASE (S5P_VA_GPIO + 0x0100) 27 + #define S5P64X0_GPJ_BASE (S5P_VA_GPIO + 0x0120) 28 + #define S5P64X0_GPN_BASE (S5P_VA_GPIO + 0x0830) 29 + #define S5P64X0_GPP_BASE (S5P_VA_GPIO + 0x0160) 30 + #define S5P64X0_GPR_BASE (S5P_VA_GPIO + 0x0290) 33 31 34 - #define S5P6440_EINT0CON0 (S5P_VA_GPIO + 0x900) 35 - #define S5P6440_EINT0FLTCON0 (S5P_VA_GPIO + 0x910) 36 - #define S5P6440_EINT0FLTCON1 (S5P_VA_GPIO + 0x914) 37 - #define S5P6440_EINT0MASK (S5P_VA_GPIO + 0x920) 38 - #define S5P6440_EINT0PEND (S5P_VA_GPIO + 0x924) 39 - 40 - /* for LCD */ 41 - 42 - #define S5P6440_SPCON_LCD_SEL_RGB (1 << 0) 43 - #define S5P6440_SPCON_LCD_SEL_MASK (3 << 0) 44 - 45 - /* 46 - * These set of macros are not really useful for the 47 - * GPF/GPI/GPJ/GPN/GPP, useful for others set of GPIO's (4 bit) 48 - */ 49 - 50 - #define S5P6440_GPIO_CONMASK(__gpio) (0xf << ((__gpio) * 4)) 51 - #define S5P6440_GPIO_INPUT(__gpio) (0x0 << ((__gpio) * 4)) 52 - #define S5P6440_GPIO_OUTPUT(__gpio) (0x1 << ((__gpio) * 4)) 53 - 54 - /* 55 - * Use these macros for GPF/GPI/GPJ/GPN/GPP set of GPIO (2 bit) 56 - */ 57 - 58 - #define S5P6440_GPIO2_CONMASK(__gpio) (0x3 << ((__gpio) * 2)) 59 - #define S5P6440_GPIO2_INPUT(__gpio) (0x0 << ((__gpio) * 2)) 60 - #define S5P6440_GPIO2_OUTPUT(__gpio) (0x1 << ((__gpio) * 2)) 32 + #define S5P6450_GPD_BASE (S5P_VA_GPIO + 0x0060) 33 + #define S5P6450_GPK_BASE (S5P_VA_GPIO + 0x0140) 34 + #define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180) 35 + #define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) 61 36 62 37 #endif /* __ASM_ARCH_REGS_GPIO_H */
+1
arch/arm/mach-s5p64x0/mach-smdk6440.c
··· 117 117 118 118 static struct i2c_board_info smdk6440_i2c_devs0[] __initdata = { 119 119 { I2C_BOARD_INFO("24c08", 0x50), }, 120 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 120 121 }; 121 122 122 123 static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
+1
arch/arm/mach-s5p64x0/mach-smdk6450.c
··· 135 135 }; 136 136 137 137 static struct i2c_board_info smdk6450_i2c_devs0[] __initdata = { 138 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 138 139 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung KS24C080C EEPROM */ 139 140 }; 140 141
+3 -13
arch/arm/mach-s5pc100/clock.c
··· 396 396 * recommended to keep the following clocks disabled until the driver requests 397 397 * for enabling the clock. 398 398 */ 399 - static struct clk init_clocks_disable[] = { 399 + static struct clk init_clocks_off[] = { 400 400 { 401 401 .name = "cssys", 402 402 .id = -1, ··· 1381 1381 1382 1382 void __init s5pc100_register_clocks(void) 1383 1383 { 1384 - struct clk *clkp; 1385 - int ret; 1386 1384 int ptr; 1387 1385 1388 1386 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 1391 1393 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1392 1394 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1393 1395 1394 - clkp = init_clocks_disable; 1395 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1396 - 1397 - ret = s3c24xx_register_clock(clkp); 1398 - if (ret < 0) { 1399 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1400 - clkp->name, ret); 1401 - } 1402 - (clkp->enable)(clkp, 0); 1403 - } 1396 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1397 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1404 1398 1405 1399 s3c_pwmclk_init(); 1406 1400 }
+2
arch/arm/mach-s5pc100/include/mach/map.h
··· 55 55 #define S5PC100_VA_VIC_OFFSET 0x10000 56 56 #define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) 57 57 58 + #define S5PC100_PA_SROMC (0xE7000000) 59 + #define S5P_PA_SROMC S5PC100_PA_SROMC 58 60 59 61 #define S5PC100_PA_ONENAND (0xE7100000) 60 62
+2
arch/arm/mach-s5pv210/Kconfig
··· 118 118 config MACH_SMDKV210 119 119 bool "SMDKV210" 120 120 select CPU_S5PV210 121 + select S3C_DEV_FB 121 122 select S3C_DEV_HSMMC 122 123 select S3C_DEV_HSMMC1 123 124 select S3C_DEV_HSMMC2 ··· 131 130 select SAMSUNG_DEV_IDE 132 131 select SAMSUNG_DEV_KEYPAD 133 132 select SAMSUNG_DEV_TS 133 + select S5PV210_SETUP_FB_24BPP 134 134 select S5PV210_SETUP_I2C1 135 135 select S5PV210_SETUP_I2C2 136 136 select S5PV210_SETUP_IDE
+10 -15
arch/arm/mach-s5pv210/clock.c
··· 309 309 .get_rate = s5pv210_clk_fout_apll_get_rate, 310 310 }; 311 311 312 - static struct clk init_clocks_disable[] = { 312 + static struct clk init_clocks_off[] = { 313 313 { 314 314 .name = "pdma", 315 315 .id = 0, ··· 525 525 .parent = &clk_pclk_psys.clk, 526 526 .enable = s5pv210_clk_ip3_ctrl, 527 527 .ctrlbit = (1 << 20), 528 + }, { 529 + .name = "sromc", 530 + .id = -1, 531 + .parent = &clk_hclk_psys.clk, 532 + .enable = s5pv210_clk_ip1_ctrl, 533 + .ctrlbit = (1 << 26), 528 534 }, 529 535 }; 530 536 ··· 1226 1220 1227 1221 void __init s5pv210_register_clocks(void) 1228 1222 { 1229 - struct clk *clkp; 1230 - int ret; 1231 1223 int ptr; 1232 1224 1233 - ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1234 - if (ret > 0) 1235 - printk(KERN_ERR "Failed to register %u clocks\n", ret); 1225 + s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1236 1226 1237 1227 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1238 1228 s3c_register_clksrc(sysclks[ptr], 1); ··· 1236 1234 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1237 1235 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1238 1236 1239 - clkp = init_clocks_disable; 1240 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1241 - ret = s3c24xx_register_clock(clkp); 1242 - if (ret < 0) { 1243 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1244 - clkp->name, ret); 1245 - } 1246 - (clkp->enable)(clkp, 0); 1247 - } 1237 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1238 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1248 1239 1249 1240 s3c_pwmclk_init(); 1250 1241 }
-5
arch/arm/mach-s5pv210/cpu.c
··· 81 81 .length = SZ_512K, 82 82 .type = MT_DEVICE, 83 83 }, { 84 - .virtual = (unsigned long)S5P_VA_SROMC, 85 - .pfn = __phys_to_pfn(S5PV210_PA_SROMC), 86 - .length = SZ_4K, 87 - .type = MT_DEVICE, 88 - }, { 89 84 .virtual = (unsigned long)S5P_VA_DMC0, 90 85 .pfn = __phys_to_pfn(S5PV210_PA_DMC0), 91 86 .length = SZ_4K,
+2 -1
arch/arm/mach-s5pv210/include/mach/irqs.h
··· 65 65 #define IRQ_HSMMC0 S5P_IRQ_VIC1(26) 66 66 #define IRQ_HSMMC1 S5P_IRQ_VIC1(27) 67 67 #define IRQ_HSMMC2 S5P_IRQ_VIC1(28) 68 - #define IRQ_MIPICSI S5P_IRQ_VIC1(29) 68 + #define IRQ_MIPI_CSIS S5P_IRQ_VIC1(29) 69 69 #define IRQ_MIPIDSI S5P_IRQ_VIC1(30) 70 70 #define IRQ_ONENAND_AUDI S5P_IRQ_VIC1(31) 71 71 ··· 132 132 #define IRQ_LCD_FIFO IRQ_LCD0 133 133 #define IRQ_LCD_VSYNC IRQ_LCD1 134 134 #define IRQ_LCD_SYSTEM IRQ_LCD2 135 + #define IRQ_MIPI_CSIS0 IRQ_MIPI_CSIS 135 136 136 137 #endif /* ASM_ARCH_IRQS_H */
+6
arch/arm/mach-s5pv210/include/mach/map.h
··· 16 16 #include <plat/map-base.h> 17 17 #include <plat/map-s5p.h> 18 18 19 + #define S5PV210_PA_SROM_BANK5 (0xA8000000) 20 + 19 21 #define S5PC110_PA_ONENAND (0xB0000000) 20 22 #define S5P_PA_ONENAND S5PC110_PA_ONENAND 21 23 ··· 62 60 #define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) 63 61 64 62 #define S5PV210_PA_SROMC (0xE8000000) 63 + #define S5P_PA_SROMC S5PV210_PA_SROMC 65 64 66 65 #define S5PV210_PA_CFCON (0xE8200000) 67 66 ··· 110 107 #define S5PV210_PA_DMC0 (0xF0000000) 111 108 #define S5PV210_PA_DMC1 (0xF1400000) 112 109 110 + #define S5PV210_PA_MIPI_CSIS 0xFA600000 111 + 113 112 /* compatibiltiy defines. */ 114 113 #define S3C_PA_UART S5PV210_PA_UART 115 114 #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) ··· 128 123 #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 129 124 #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 130 125 #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 126 + #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS 131 127 132 128 #define SAMSUNG_PA_ADC S5PV210_PA_ADC 133 129 #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
+1 -4
arch/arm/mach-s5pv210/include/mach/regs-clock.h
··· 161 161 #define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 162 162 #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 163 163 #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 164 - #define S5P_MIPI_CONTROL S5P_CLKREG(0xE814) 164 + #define S5P_MIPI_DPHY_CONTROL S5P_CLKREG(0xE814) 165 165 166 166 #define S5P_IDLE_CFG_TL_MASK (3 << 30) 167 167 #define S5P_IDLE_CFG_TM_MASK (3 << 28) ··· 194 194 #define S5P_OTHERS_RET_MMC (1 << 29) 195 195 #define S5P_OTHERS_RET_UART (1 << 28) 196 196 #define S5P_OTHERS_USB_SIG_MASK (1 << 16) 197 - 198 - /* MIPI */ 199 - #define S5P_MIPI_DPHY_EN (3) 200 197 201 198 /* S5P_DAC_CONTROL */ 202 199 #define S5P_DAC_ENABLE (1)
+1
arch/arm/mach-s5pv210/mach-smdkc110.c
··· 94 94 95 95 static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { 96 96 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 97 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 97 98 }; 98 99 99 100 static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
+135 -4
arch/arm/mach-s5pv210/mach-smdkv210.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/serial_core.h> 16 16 #include <linux/sysdev.h> 17 + #include <linux/dm9000.h> 18 + #include <linux/fb.h> 19 + #include <linux/gpio.h> 20 + #include <linux/delay.h> 17 21 18 22 #include <asm/mach/arch.h> 19 23 #include <asm/mach/map.h> 20 24 #include <asm/setup.h> 21 25 #include <asm/mach-types.h> 22 26 27 + #include <video/platform_lcd.h> 28 + 23 29 #include <mach/map.h> 24 30 #include <mach/regs-clock.h> 31 + #include <mach/regs-fb.h> 25 32 26 33 #include <plat/regs-serial.h> 34 + #include <plat/regs-srom.h> 35 + #include <plat/gpio-cfg.h> 27 36 #include <plat/s5pv210.h> 28 37 #include <plat/devs.h> 29 38 #include <plat/cpu.h> ··· 42 33 #include <plat/iic.h> 43 34 #include <plat/keypad.h> 44 35 #include <plat/pm.h> 36 + #include <plat/fb.h> 45 37 46 38 /* Following are default values for UCON, ULCON and UFCON UART registers */ 47 39 #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 112 102 .cols = 8, 113 103 }; 114 104 105 + static struct resource smdkv210_dm9000_resources[] = { 106 + [0] = { 107 + .start = S5PV210_PA_SROM_BANK5, 108 + .end = S5PV210_PA_SROM_BANK5, 109 + .flags = IORESOURCE_MEM, 110 + }, 111 + [1] = { 112 + .start = S5PV210_PA_SROM_BANK5 + 2, 113 + .end = S5PV210_PA_SROM_BANK5 + 2, 114 + .flags = IORESOURCE_MEM, 115 + }, 116 + [2] = { 117 + .start = IRQ_EINT(9), 118 + .end = IRQ_EINT(9), 119 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 120 + }, 121 + }; 122 + 123 + static struct dm9000_plat_data smdkv210_dm9000_platdata = { 124 + .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, 125 + .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 }, 126 + }; 127 + 128 + struct platform_device smdkv210_dm9000 = { 129 + .name = "dm9000", 130 + .id = -1, 131 + .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources), 132 + .resource = smdkv210_dm9000_resources, 133 + .dev = { 134 + .platform_data = &smdkv210_dm9000_platdata, 135 + }, 136 + }; 137 + 138 + static void smdkv210_lte480wv_set_power(struct plat_lcd_data *pd, 139 + unsigned int power) 140 + { 141 + if (power) { 142 + #if !defined(CONFIG_BACKLIGHT_PWM) 143 + gpio_request(S5PV210_GPD0(3), "GPD0"); 144 + gpio_direction_output(S5PV210_GPD0(3), 1); 145 + gpio_free(S5PV210_GPD0(3)); 146 + #endif 147 + 148 + /* fire nRESET on power up */ 149 + gpio_request(S5PV210_GPH0(6), "GPH0"); 150 + 151 + gpio_direction_output(S5PV210_GPH0(6), 1); 152 + 153 + gpio_set_value(S5PV210_GPH0(6), 0); 154 + mdelay(10); 155 + 156 + gpio_set_value(S5PV210_GPH0(6), 1); 157 + mdelay(10); 158 + 159 + gpio_free(S5PV210_GPH0(6)); 160 + } else { 161 + #if !defined(CONFIG_BACKLIGHT_PWM) 162 + gpio_request(S5PV210_GPD0(3), "GPD0"); 163 + gpio_direction_output(S5PV210_GPD0(3), 0); 164 + gpio_free(S5PV210_GPD0(3)); 165 + #endif 166 + } 167 + } 168 + 169 + static struct plat_lcd_data smdkv210_lcd_lte480wv_data = { 170 + .set_power = smdkv210_lte480wv_set_power, 171 + }; 172 + 173 + static struct platform_device smdkv210_lcd_lte480wv = { 174 + .name = "platform-lcd", 175 + .dev.parent = &s3c_device_fb.dev, 176 + .dev.platform_data = &smdkv210_lcd_lte480wv_data, 177 + }; 178 + 179 + static struct s3c_fb_pd_win smdkv210_fb_win0 = { 180 + .win_mode = { 181 + .left_margin = 13, 182 + .right_margin = 8, 183 + .upper_margin = 7, 184 + .lower_margin = 5, 185 + .hsync_len = 3, 186 + .vsync_len = 1, 187 + .xres = 800, 188 + .yres = 480, 189 + }, 190 + .max_bpp = 32, 191 + .default_bpp = 24, 192 + }; 193 + 194 + static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = { 195 + .win[0] = &smdkv210_fb_win0, 196 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 197 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 198 + .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 199 + }; 200 + 115 201 static struct platform_device *smdkv210_devices[] __initdata = { 116 - &s5pv210_device_iis0, 117 - &s5pv210_device_ac97, 118 - &s5pv210_device_spdif, 119 202 &s3c_device_adc, 120 203 &s3c_device_cfcon, 204 + &s3c_device_fb, 121 205 &s3c_device_hsmmc0, 122 206 &s3c_device_hsmmc1, 123 207 &s3c_device_hsmmc2, ··· 219 115 &s3c_device_i2c0, 220 116 &s3c_device_i2c1, 221 117 &s3c_device_i2c2, 222 - &samsung_device_keypad, 223 118 &s3c_device_rtc, 224 119 &s3c_device_ts, 225 120 &s3c_device_wdt, 121 + &s5pv210_device_ac97, 122 + &s5pv210_device_iis0, 123 + &s5pv210_device_spdif, 124 + &samsung_device_keypad, 125 + &smdkv210_dm9000, 126 + &smdkv210_lcd_lte480wv, 226 127 }; 128 + 129 + static void __init smdkv210_dm9000_init(void) 130 + { 131 + unsigned int tmp; 132 + 133 + gpio_request(S5PV210_MP01(5), "nCS5"); 134 + s3c_gpio_cfgpin(S5PV210_MP01(5), S3C_GPIO_SFN(2)); 135 + gpio_free(S5PV210_MP01(5)); 136 + 137 + tmp = (5 << S5P_SROM_BCX__TACC__SHIFT); 138 + __raw_writel(tmp, S5P_SROM_BC5); 139 + 140 + tmp = __raw_readl(S5P_SROM_BW); 141 + tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS5__SHIFT); 142 + tmp |= (1 << S5P_SROM_BW__NCS5__SHIFT); 143 + __raw_writel(tmp, S5P_SROM_BW); 144 + } 227 145 228 146 static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { 229 147 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 148 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 230 149 }; 231 150 232 151 static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = { ··· 277 150 { 278 151 s3c_pm_init(); 279 152 153 + smdkv210_dm9000_init(); 154 + 280 155 samsung_keypad_set_platdata(&smdkv210_keypad_data); 281 156 s3c24xx_ts_set_platdata(&s3c_ts_platform); 282 157 ··· 293 164 ARRAY_SIZE(smdkv210_i2c_devs2)); 294 165 295 166 s3c_ide_set_platdata(&smdkv210_ide_pdata); 167 + 168 + s3c_fb_set_platdata(&smdkv210_lcd0_pdata); 296 169 297 170 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); 298 171 }
+21
arch/arm/mach-s5pv310/Kconfig
··· 15 15 help 16 16 Enable S5PV310 CPU support 17 17 18 + config S5PV310_DEV_PD 19 + bool 20 + help 21 + Compile in platform device definitions for Power Domain 22 + 18 23 config S5PV310_SETUP_I2C1 19 24 bool 20 25 help ··· 66 61 help 67 62 Common setup code for SDHCI gpio. 68 63 64 + config S5PV310_DEV_SYSMMU 65 + bool 66 + help 67 + Common setup code for SYSTEM MMU in S5PV310 68 + 69 69 # machine support 70 70 71 71 menu "S5PC210 Machines" ··· 80 70 select CPU_S5PV310 81 71 select S3C_DEV_RTC 82 72 select S3C_DEV_WDT 73 + select S3C_DEV_I2C1 83 74 select S3C_DEV_HSMMC 84 75 select S3C_DEV_HSMMC1 85 76 select S3C_DEV_HSMMC2 86 77 select S3C_DEV_HSMMC3 78 + select S5PV310_DEV_PD 79 + select S5PV310_SETUP_I2C1 87 80 select S5PV310_SETUP_SDHCI 81 + select S5PV310_DEV_SYSMMU 88 82 help 89 83 Machine support for Samsung SMDKC210 90 84 S5PC210(MCP) is one of package option of S5PV310 ··· 97 83 bool "Mobile UNIVERSAL_C210 Board" 98 84 select CPU_S5PV310 99 85 select S5P_DEV_ONENAND 86 + select S3C_DEV_HSMMC 87 + select S3C_DEV_HSMMC2 88 + select S3C_DEV_HSMMC3 89 + select S5PV310_SETUP_SDHCI 100 90 select S3C_DEV_I2C1 101 91 select S5PV310_SETUP_I2C1 102 92 help ··· 116 98 select CPU_S5PV310 117 99 select S3C_DEV_RTC 118 100 select S3C_DEV_WDT 101 + select S3C_DEV_I2C1 119 102 select S3C_DEV_HSMMC 120 103 select S3C_DEV_HSMMC1 121 104 select S3C_DEV_HSMMC2 122 105 select S3C_DEV_HSMMC3 106 + select S5PV310_DEV_PD 107 + select S5PV310_SETUP_I2C1 123 108 select S5PV310_SETUP_SDHCI 124 109 help 125 110 Machine support for Samsung SMDKV310
+5 -1
arch/arm/mach-s5pv310/Makefile
··· 14 14 15 15 obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o 16 16 obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o 17 + obj-$(CONFIG_CPU_FREQ) += cpufreq.o 17 18 18 19 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 19 20 obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o ··· 28 27 29 28 # device support 30 29 31 - obj-y += dev-audio.o 30 + obj-y += dev-audio.o 31 + obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o 32 + obj-$(CONFIG_S5PV310_DEV_SYSMMU) += dev-sysmmu.o 33 + 32 34 obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o 33 35 obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o 34 36 obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
+55 -22
arch/arm/mach-s5pv310/clock.c
··· 244 244 .id = -1, 245 245 }, 246 246 .sources = &clkset_mout_corebus, 247 - .reg_src = { .reg = S5P_CLKSRC_CORE, .shift = 4, .size = 1 }, 247 + .reg_src = { .reg = S5P_CLKSRC_DMC, .shift = 4, .size = 1 }, 248 248 }; 249 249 250 250 static struct clksrc_clk clk_sclk_dmc = { ··· 253 253 .id = -1, 254 254 .parent = &clk_mout_corebus.clk, 255 255 }, 256 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 12, .size = 3 }, 256 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 12, .size = 3 }, 257 257 }; 258 258 259 259 static struct clksrc_clk clk_aclk_cored = { ··· 262 262 .id = -1, 263 263 .parent = &clk_sclk_dmc.clk, 264 264 }, 265 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 16, .size = 3 }, 265 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 16, .size = 3 }, 266 266 }; 267 267 268 268 static struct clksrc_clk clk_aclk_corep = { ··· 271 271 .id = -1, 272 272 .parent = &clk_aclk_cored.clk, 273 273 }, 274 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 20, .size = 3 }, 274 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 20, .size = 3 }, 275 275 }; 276 276 277 277 static struct clksrc_clk clk_aclk_acp = { ··· 280 280 .id = -1, 281 281 .parent = &clk_mout_corebus.clk, 282 282 }, 283 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 0, .size = 3 }, 283 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 0, .size = 3 }, 284 284 }; 285 285 286 286 static struct clksrc_clk clk_pclk_acp = { ··· 289 289 .id = -1, 290 290 .parent = &clk_aclk_acp.clk, 291 291 }, 292 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 4, .size = 3 }, 292 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 4, .size = 3 }, 293 293 }; 294 294 295 295 /* Core list of CMU_TOP side */ ··· 384 384 .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 8, .size = 1 }, 385 385 }; 386 386 387 - static struct clk init_clocks_disable[] = { 387 + static struct clk init_clocks_off[] = { 388 388 { 389 389 .name = "timers", 390 390 .id = -1, ··· 467 467 .enable = s5pv310_clk_ip_fsys_ctrl, 468 468 .ctrlbit = (1 << 10), 469 469 }, { 470 + .name = "pdma", 471 + .id = 0, 472 + .enable = s5pv310_clk_ip_fsys_ctrl, 473 + .ctrlbit = (1 << 0), 474 + }, { 475 + .name = "pdma", 476 + .id = 1, 477 + .enable = s5pv310_clk_ip_fsys_ctrl, 478 + .ctrlbit = (1 << 1), 479 + }, { 470 480 .name = "adc", 471 481 .id = -1, 472 482 .enable = s5pv310_clk_ip_peril_ctrl, ··· 516 506 .id = 2, 517 507 .enable = s5pv310_clk_ip_peril_ctrl, 518 508 .ctrlbit = (1 << 18), 509 + }, { 510 + .name = "iis", 511 + .id = 0, 512 + .enable = s5pv310_clk_ip_peril_ctrl, 513 + .ctrlbit = (1 << 19), 514 + }, { 515 + .name = "iis", 516 + .id = 1, 517 + .enable = s5pv310_clk_ip_peril_ctrl, 518 + .ctrlbit = (1 << 20), 519 + }, { 520 + .name = "iis", 521 + .id = 2, 522 + .enable = s5pv310_clk_ip_peril_ctrl, 523 + .ctrlbit = (1 << 21), 524 + }, { 525 + .name = "ac97", 526 + .id = -1, 527 + .enable = s5pv310_clk_ip_peril_ctrl, 528 + .ctrlbit = (1 << 27), 519 529 }, { 520 530 .name = "fimg2d", 521 531 .id = -1, ··· 1020 990 &clk_dout_mmc4, 1021 991 }; 1022 992 993 + static int xtal_rate; 994 + 995 + static unsigned long s5pv310_fout_apll_get_rate(struct clk *clk) 996 + { 997 + return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), pll_4508); 998 + } 999 + 1000 + static struct clk_ops s5pv310_fout_apll_ops = { 1001 + .get_rate = s5pv310_fout_apll_get_rate, 1002 + }; 1003 + 1023 1004 void __init_or_cpufreq s5pv310_setup_clocks(void) 1024 1005 { 1025 1006 struct clk *xtal_clk; ··· 1054 1013 BUG_ON(IS_ERR(xtal_clk)); 1055 1014 1056 1015 xtal = clk_get_rate(xtal_clk); 1016 + 1017 + xtal_rate = xtal; 1018 + 1057 1019 clk_put(xtal_clk); 1058 1020 1059 1021 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); ··· 1070 1026 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1071 1027 __raw_readl(S5P_VPLL_CON1), pll_4650); 1072 1028 1073 - clk_fout_apll.rate = apll; 1029 + clk_fout_apll.ops = &s5pv310_fout_apll_ops; 1074 1030 clk_fout_mpll.rate = mpll; 1075 1031 clk_fout_epll.rate = epll; 1076 1032 clk_fout_vpll.rate = vpll; ··· 1105 1061 1106 1062 void __init s5pv310_register_clocks(void) 1107 1063 { 1108 - struct clk *clkp; 1109 - int ret; 1110 1064 int ptr; 1111 1065 1112 - ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1113 - if (ret > 0) 1114 - printk(KERN_ERR "Failed to register %u clocks\n", ret); 1066 + s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1115 1067 1116 1068 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1117 1069 s3c_register_clksrc(sysclks[ptr], 1); ··· 1115 1075 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1116 1076 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1117 1077 1118 - clkp = init_clocks_disable; 1119 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1120 - ret = s3c24xx_register_clock(clkp); 1121 - if (ret < 0) { 1122 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1123 - clkp->name, ret); 1124 - } 1125 - (clkp->enable)(clkp, 0); 1126 - } 1078 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1079 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1127 1080 1128 1081 s3c_pwmclk_init(); 1129 1082 }
+20 -1
arch/arm/mach-s5pv310/cpu.c
··· 41 41 .length = SZ_128K, 42 42 .type = MT_DEVICE, 43 43 }, { 44 + .virtual = (unsigned long)S5P_VA_PMU, 45 + .pfn = __phys_to_pfn(S5PV310_PA_PMU), 46 + .length = SZ_64K, 47 + .type = MT_DEVICE, 48 + }, { 44 49 .virtual = (unsigned long)S5P_VA_COMBINER_BASE, 45 50 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER), 46 51 .length = SZ_4K, ··· 74 69 .virtual = (unsigned long)S5P_VA_GPIO3, 75 70 .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), 76 71 .length = SZ_256, 72 + .type = MT_DEVICE, 73 + }, { 74 + .virtual = (unsigned long)S5P_VA_DMC0, 75 + .pfn = __phys_to_pfn(S5PV310_PA_DMC0), 76 + .length = SZ_4K, 77 77 .type = MT_DEVICE, 78 78 }, { 79 79 .virtual = (unsigned long)S3C_VA_UART, ··· 133 123 gic_init(0, IRQ_LOCALTIMER, S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 134 124 135 125 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 126 + 127 + /* 128 + * From SPI(0) to SPI(39) and SPI(51), SPI(53) are 129 + * connected to the interrupt combiner. These irqs 130 + * should be initialized to support cascade interrupt. 131 + */ 132 + if ((irq >= 40) && !(irq == 51) && !(irq == 53)) 133 + continue; 134 + 136 135 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), 137 136 COMBINER_IRQ(irq, 0)); 138 137 combiner_cascade_irq(irq, IRQ_SPI(irq)); ··· 183 164 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN, 184 165 S5P_VA_L2CC + L2X0_POWER_CTRL); 185 166 186 - l2x0_init(S5P_VA_L2CC, 0x7C070001, 0xC200ffff); 167 + l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff); 187 168 188 169 return 0; 189 170 }
+580
arch/arm/mach-s5pv310/cpufreq.c
··· 1 + /* linux/arch/arm/mach-s5pv310/cpufreq.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - CPU frequency scaling support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/types.h> 14 + #include <linux/kernel.h> 15 + #include <linux/err.h> 16 + #include <linux/clk.h> 17 + #include <linux/io.h> 18 + #include <linux/slab.h> 19 + #include <linux/regulator/consumer.h> 20 + #include <linux/cpufreq.h> 21 + 22 + #include <mach/map.h> 23 + #include <mach/regs-clock.h> 24 + #include <mach/regs-mem.h> 25 + 26 + #include <plat/clock.h> 27 + #include <plat/pm.h> 28 + 29 + static struct clk *cpu_clk; 30 + static struct clk *moutcore; 31 + static struct clk *mout_mpll; 32 + static struct clk *mout_apll; 33 + 34 + #ifdef CONFIG_REGULATOR 35 + static struct regulator *arm_regulator; 36 + static struct regulator *int_regulator; 37 + #endif 38 + 39 + static struct cpufreq_freqs freqs; 40 + static unsigned int memtype; 41 + 42 + enum s5pv310_memory_type { 43 + DDR2 = 4, 44 + LPDDR2, 45 + DDR3, 46 + }; 47 + 48 + enum cpufreq_level_index { 49 + L0, L1, L2, L3, CPUFREQ_LEVEL_END, 50 + }; 51 + 52 + static struct cpufreq_frequency_table s5pv310_freq_table[] = { 53 + {L0, 1000*1000}, 54 + {L1, 800*1000}, 55 + {L2, 400*1000}, 56 + {L3, 100*1000}, 57 + {0, CPUFREQ_TABLE_END}, 58 + }; 59 + 60 + static unsigned int clkdiv_cpu0[CPUFREQ_LEVEL_END][7] = { 61 + /* 62 + * Clock divider value for following 63 + * { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH, 64 + * DIVATB, DIVPCLK_DBG, DIVAPLL } 65 + */ 66 + 67 + /* ARM L0: 1000MHz */ 68 + { 0, 3, 7, 3, 3, 0, 1 }, 69 + 70 + /* ARM L1: 800MHz */ 71 + { 0, 3, 7, 3, 3, 0, 1 }, 72 + 73 + /* ARM L2: 400MHz */ 74 + { 0, 1, 3, 1, 3, 0, 1 }, 75 + 76 + /* ARM L3: 100MHz */ 77 + { 0, 0, 1, 0, 3, 1, 1 }, 78 + }; 79 + 80 + static unsigned int clkdiv_cpu1[CPUFREQ_LEVEL_END][2] = { 81 + /* 82 + * Clock divider value for following 83 + * { DIVCOPY, DIVHPM } 84 + */ 85 + 86 + /* ARM L0: 1000MHz */ 87 + { 3, 0 }, 88 + 89 + /* ARM L1: 800MHz */ 90 + { 3, 0 }, 91 + 92 + /* ARM L2: 400MHz */ 93 + { 3, 0 }, 94 + 95 + /* ARM L3: 100MHz */ 96 + { 3, 0 }, 97 + }; 98 + 99 + static unsigned int clkdiv_dmc0[CPUFREQ_LEVEL_END][8] = { 100 + /* 101 + * Clock divider value for following 102 + * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD 103 + * DIVDMCP, DIVCOPY2, DIVCORE_TIMERS } 104 + */ 105 + 106 + /* DMC L0: 400MHz */ 107 + { 3, 1, 1, 1, 1, 1, 3, 1 }, 108 + 109 + /* DMC L1: 400MHz */ 110 + { 3, 1, 1, 1, 1, 1, 3, 1 }, 111 + 112 + /* DMC L2: 266.7MHz */ 113 + { 7, 1, 1, 2, 1, 1, 3, 1 }, 114 + 115 + /* DMC L3: 200MHz */ 116 + { 7, 1, 1, 3, 1, 1, 3, 1 }, 117 + }; 118 + 119 + static unsigned int clkdiv_top[CPUFREQ_LEVEL_END][5] = { 120 + /* 121 + * Clock divider value for following 122 + * { DIVACLK200, DIVACLK100, DIVACLK160, DIVACLK133, DIVONENAND } 123 + */ 124 + 125 + /* ACLK200 L0: 200MHz */ 126 + { 3, 7, 4, 5, 1 }, 127 + 128 + /* ACLK200 L1: 200MHz */ 129 + { 3, 7, 4, 5, 1 }, 130 + 131 + /* ACLK200 L2: 160MHz */ 132 + { 4, 7, 5, 7, 1 }, 133 + 134 + /* ACLK200 L3: 133.3MHz */ 135 + { 5, 7, 7, 7, 1 }, 136 + }; 137 + 138 + static unsigned int clkdiv_lr_bus[CPUFREQ_LEVEL_END][2] = { 139 + /* 140 + * Clock divider value for following 141 + * { DIVGDL/R, DIVGPL/R } 142 + */ 143 + 144 + /* ACLK_GDL/R L0: 200MHz */ 145 + { 3, 1 }, 146 + 147 + /* ACLK_GDL/R L1: 200MHz */ 148 + { 3, 1 }, 149 + 150 + /* ACLK_GDL/R L2: 160MHz */ 151 + { 4, 1 }, 152 + 153 + /* ACLK_GDL/R L3: 133.3MHz */ 154 + { 5, 1 }, 155 + }; 156 + 157 + struct cpufreq_voltage_table { 158 + unsigned int index; /* any */ 159 + unsigned int arm_volt; /* uV */ 160 + unsigned int int_volt; 161 + }; 162 + 163 + static struct cpufreq_voltage_table s5pv310_volt_table[CPUFREQ_LEVEL_END] = { 164 + { 165 + .index = L0, 166 + .arm_volt = 1200000, 167 + .int_volt = 1100000, 168 + }, { 169 + .index = L1, 170 + .arm_volt = 1100000, 171 + .int_volt = 1100000, 172 + }, { 173 + .index = L2, 174 + .arm_volt = 1000000, 175 + .int_volt = 1000000, 176 + }, { 177 + .index = L3, 178 + .arm_volt = 900000, 179 + .int_volt = 1000000, 180 + }, 181 + }; 182 + 183 + static unsigned int s5pv310_apll_pms_table[CPUFREQ_LEVEL_END] = { 184 + /* APLL FOUT L0: 1000MHz */ 185 + ((250 << 16) | (6 << 8) | 1), 186 + 187 + /* APLL FOUT L1: 800MHz */ 188 + ((200 << 16) | (6 << 8) | 1), 189 + 190 + /* APLL FOUT L2 : 400MHz */ 191 + ((200 << 16) | (6 << 8) | 2), 192 + 193 + /* APLL FOUT L3: 100MHz */ 194 + ((200 << 16) | (6 << 8) | 4), 195 + }; 196 + 197 + int s5pv310_verify_speed(struct cpufreq_policy *policy) 198 + { 199 + return cpufreq_frequency_table_verify(policy, s5pv310_freq_table); 200 + } 201 + 202 + unsigned int s5pv310_getspeed(unsigned int cpu) 203 + { 204 + return clk_get_rate(cpu_clk) / 1000; 205 + } 206 + 207 + void s5pv310_set_clkdiv(unsigned int div_index) 208 + { 209 + unsigned int tmp; 210 + 211 + /* Change Divider - CPU0 */ 212 + 213 + tmp = __raw_readl(S5P_CLKDIV_CPU); 214 + 215 + tmp &= ~(S5P_CLKDIV_CPU0_CORE_MASK | S5P_CLKDIV_CPU0_COREM0_MASK | 216 + S5P_CLKDIV_CPU0_COREM1_MASK | S5P_CLKDIV_CPU0_PERIPH_MASK | 217 + S5P_CLKDIV_CPU0_ATB_MASK | S5P_CLKDIV_CPU0_PCLKDBG_MASK | 218 + S5P_CLKDIV_CPU0_APLL_MASK); 219 + 220 + tmp |= ((clkdiv_cpu0[div_index][0] << S5P_CLKDIV_CPU0_CORE_SHIFT) | 221 + (clkdiv_cpu0[div_index][1] << S5P_CLKDIV_CPU0_COREM0_SHIFT) | 222 + (clkdiv_cpu0[div_index][2] << S5P_CLKDIV_CPU0_COREM1_SHIFT) | 223 + (clkdiv_cpu0[div_index][3] << S5P_CLKDIV_CPU0_PERIPH_SHIFT) | 224 + (clkdiv_cpu0[div_index][4] << S5P_CLKDIV_CPU0_ATB_SHIFT) | 225 + (clkdiv_cpu0[div_index][5] << S5P_CLKDIV_CPU0_PCLKDBG_SHIFT) | 226 + (clkdiv_cpu0[div_index][6] << S5P_CLKDIV_CPU0_APLL_SHIFT)); 227 + 228 + __raw_writel(tmp, S5P_CLKDIV_CPU); 229 + 230 + do { 231 + tmp = __raw_readl(S5P_CLKDIV_STATCPU); 232 + } while (tmp & 0x1111111); 233 + 234 + /* Change Divider - CPU1 */ 235 + 236 + tmp = __raw_readl(S5P_CLKDIV_CPU1); 237 + 238 + tmp &= ~((0x7 << 4) | 0x7); 239 + 240 + tmp |= ((clkdiv_cpu1[div_index][0] << 4) | 241 + (clkdiv_cpu1[div_index][1] << 0)); 242 + 243 + __raw_writel(tmp, S5P_CLKDIV_CPU1); 244 + 245 + do { 246 + tmp = __raw_readl(S5P_CLKDIV_STATCPU1); 247 + } while (tmp & 0x11); 248 + 249 + /* Change Divider - DMC0 */ 250 + 251 + tmp = __raw_readl(S5P_CLKDIV_DMC0); 252 + 253 + tmp &= ~(S5P_CLKDIV_DMC0_ACP_MASK | S5P_CLKDIV_DMC0_ACPPCLK_MASK | 254 + S5P_CLKDIV_DMC0_DPHY_MASK | S5P_CLKDIV_DMC0_DMC_MASK | 255 + S5P_CLKDIV_DMC0_DMCD_MASK | S5P_CLKDIV_DMC0_DMCP_MASK | 256 + S5P_CLKDIV_DMC0_COPY2_MASK | S5P_CLKDIV_DMC0_CORETI_MASK); 257 + 258 + tmp |= ((clkdiv_dmc0[div_index][0] << S5P_CLKDIV_DMC0_ACP_SHIFT) | 259 + (clkdiv_dmc0[div_index][1] << S5P_CLKDIV_DMC0_ACPPCLK_SHIFT) | 260 + (clkdiv_dmc0[div_index][2] << S5P_CLKDIV_DMC0_DPHY_SHIFT) | 261 + (clkdiv_dmc0[div_index][3] << S5P_CLKDIV_DMC0_DMC_SHIFT) | 262 + (clkdiv_dmc0[div_index][4] << S5P_CLKDIV_DMC0_DMCD_SHIFT) | 263 + (clkdiv_dmc0[div_index][5] << S5P_CLKDIV_DMC0_DMCP_SHIFT) | 264 + (clkdiv_dmc0[div_index][6] << S5P_CLKDIV_DMC0_COPY2_SHIFT) | 265 + (clkdiv_dmc0[div_index][7] << S5P_CLKDIV_DMC0_CORETI_SHIFT)); 266 + 267 + __raw_writel(tmp, S5P_CLKDIV_DMC0); 268 + 269 + do { 270 + tmp = __raw_readl(S5P_CLKDIV_STAT_DMC0); 271 + } while (tmp & 0x11111111); 272 + 273 + /* Change Divider - TOP */ 274 + 275 + tmp = __raw_readl(S5P_CLKDIV_TOP); 276 + 277 + tmp &= ~(S5P_CLKDIV_TOP_ACLK200_MASK | S5P_CLKDIV_TOP_ACLK100_MASK | 278 + S5P_CLKDIV_TOP_ACLK160_MASK | S5P_CLKDIV_TOP_ACLK133_MASK | 279 + S5P_CLKDIV_TOP_ONENAND_MASK); 280 + 281 + tmp |= ((clkdiv_top[div_index][0] << S5P_CLKDIV_TOP_ACLK200_SHIFT) | 282 + (clkdiv_top[div_index][1] << S5P_CLKDIV_TOP_ACLK100_SHIFT) | 283 + (clkdiv_top[div_index][2] << S5P_CLKDIV_TOP_ACLK160_SHIFT) | 284 + (clkdiv_top[div_index][3] << S5P_CLKDIV_TOP_ACLK133_SHIFT) | 285 + (clkdiv_top[div_index][4] << S5P_CLKDIV_TOP_ONENAND_SHIFT)); 286 + 287 + __raw_writel(tmp, S5P_CLKDIV_TOP); 288 + 289 + do { 290 + tmp = __raw_readl(S5P_CLKDIV_STAT_TOP); 291 + } while (tmp & 0x11111); 292 + 293 + /* Change Divider - LEFTBUS */ 294 + 295 + tmp = __raw_readl(S5P_CLKDIV_LEFTBUS); 296 + 297 + tmp &= ~(S5P_CLKDIV_BUS_GDLR_MASK | S5P_CLKDIV_BUS_GPLR_MASK); 298 + 299 + tmp |= ((clkdiv_lr_bus[div_index][0] << S5P_CLKDIV_BUS_GDLR_SHIFT) | 300 + (clkdiv_lr_bus[div_index][1] << S5P_CLKDIV_BUS_GPLR_SHIFT)); 301 + 302 + __raw_writel(tmp, S5P_CLKDIV_LEFTBUS); 303 + 304 + do { 305 + tmp = __raw_readl(S5P_CLKDIV_STAT_LEFTBUS); 306 + } while (tmp & 0x11); 307 + 308 + /* Change Divider - RIGHTBUS */ 309 + 310 + tmp = __raw_readl(S5P_CLKDIV_RIGHTBUS); 311 + 312 + tmp &= ~(S5P_CLKDIV_BUS_GDLR_MASK | S5P_CLKDIV_BUS_GPLR_MASK); 313 + 314 + tmp |= ((clkdiv_lr_bus[div_index][0] << S5P_CLKDIV_BUS_GDLR_SHIFT) | 315 + (clkdiv_lr_bus[div_index][1] << S5P_CLKDIV_BUS_GPLR_SHIFT)); 316 + 317 + __raw_writel(tmp, S5P_CLKDIV_RIGHTBUS); 318 + 319 + do { 320 + tmp = __raw_readl(S5P_CLKDIV_STAT_RIGHTBUS); 321 + } while (tmp & 0x11); 322 + } 323 + 324 + static void s5pv310_set_apll(unsigned int index) 325 + { 326 + unsigned int tmp; 327 + 328 + /* 1. MUX_CORE_SEL = MPLL, ARMCLK uses MPLL for lock time */ 329 + clk_set_parent(moutcore, mout_mpll); 330 + 331 + do { 332 + tmp = (__raw_readl(S5P_CLKMUX_STATCPU) 333 + >> S5P_CLKSRC_CPU_MUXCORE_SHIFT); 334 + tmp &= 0x7; 335 + } while (tmp != 0x2); 336 + 337 + /* 2. Set APLL Lock time */ 338 + __raw_writel(S5P_APLL_LOCKTIME, S5P_APLL_LOCK); 339 + 340 + /* 3. Change PLL PMS values */ 341 + tmp = __raw_readl(S5P_APLL_CON0); 342 + tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0)); 343 + tmp |= s5pv310_apll_pms_table[index]; 344 + __raw_writel(tmp, S5P_APLL_CON0); 345 + 346 + /* 4. wait_lock_time */ 347 + do { 348 + tmp = __raw_readl(S5P_APLL_CON0); 349 + } while (!(tmp & (0x1 << S5P_APLLCON0_LOCKED_SHIFT))); 350 + 351 + /* 5. MUX_CORE_SEL = APLL */ 352 + clk_set_parent(moutcore, mout_apll); 353 + 354 + do { 355 + tmp = __raw_readl(S5P_CLKMUX_STATCPU); 356 + tmp &= S5P_CLKMUX_STATCPU_MUXCORE_MASK; 357 + } while (tmp != (0x1 << S5P_CLKSRC_CPU_MUXCORE_SHIFT)); 358 + } 359 + 360 + static void s5pv310_set_frequency(unsigned int old_index, unsigned int new_index) 361 + { 362 + unsigned int tmp; 363 + 364 + if (old_index > new_index) { 365 + /* The frequency changing to L0 needs to change apll */ 366 + if (freqs.new == s5pv310_freq_table[L0].frequency) { 367 + /* 1. Change the system clock divider values */ 368 + s5pv310_set_clkdiv(new_index); 369 + 370 + /* 2. Change the apll m,p,s value */ 371 + s5pv310_set_apll(new_index); 372 + } else { 373 + /* 1. Change the system clock divider values */ 374 + s5pv310_set_clkdiv(new_index); 375 + 376 + /* 2. Change just s value in apll m,p,s value */ 377 + tmp = __raw_readl(S5P_APLL_CON0); 378 + tmp &= ~(0x7 << 0); 379 + tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 380 + __raw_writel(tmp, S5P_APLL_CON0); 381 + } 382 + } 383 + 384 + else if (old_index < new_index) { 385 + /* The frequency changing from L0 needs to change apll */ 386 + if (freqs.old == s5pv310_freq_table[L0].frequency) { 387 + /* 1. Change the apll m,p,s value */ 388 + s5pv310_set_apll(new_index); 389 + 390 + /* 2. Change the system clock divider values */ 391 + s5pv310_set_clkdiv(new_index); 392 + } else { 393 + /* 1. Change just s value in apll m,p,s value */ 394 + tmp = __raw_readl(S5P_APLL_CON0); 395 + tmp &= ~(0x7 << 0); 396 + tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 397 + __raw_writel(tmp, S5P_APLL_CON0); 398 + 399 + /* 2. Change the system clock divider values */ 400 + s5pv310_set_clkdiv(new_index); 401 + } 402 + } 403 + } 404 + 405 + static int s5pv310_target(struct cpufreq_policy *policy, 406 + unsigned int target_freq, 407 + unsigned int relation) 408 + { 409 + unsigned int index, old_index; 410 + unsigned int arm_volt, int_volt; 411 + 412 + freqs.old = s5pv310_getspeed(policy->cpu); 413 + 414 + if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 415 + freqs.old, relation, &old_index)) 416 + return -EINVAL; 417 + 418 + if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 419 + target_freq, relation, &index)) 420 + return -EINVAL; 421 + 422 + freqs.new = s5pv310_freq_table[index].frequency; 423 + freqs.cpu = policy->cpu; 424 + 425 + if (freqs.new == freqs.old) 426 + return 0; 427 + 428 + /* get the voltage value */ 429 + arm_volt = s5pv310_volt_table[index].arm_volt; 430 + int_volt = s5pv310_volt_table[index].int_volt; 431 + 432 + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 433 + 434 + /* control regulator */ 435 + if (freqs.new > freqs.old) { 436 + /* Voltage up */ 437 + #ifdef CONFIG_REGULATOR 438 + regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 439 + regulator_set_voltage(int_regulator, int_volt, int_volt); 440 + #endif 441 + } 442 + 443 + /* Clock Configuration Procedure */ 444 + s5pv310_set_frequency(old_index, index); 445 + 446 + /* control regulator */ 447 + if (freqs.new < freqs.old) { 448 + /* Voltage down */ 449 + #ifdef CONFIG_REGULATOR 450 + regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 451 + regulator_set_voltage(int_regulator, int_volt, int_volt); 452 + #endif 453 + } 454 + 455 + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 456 + 457 + return 0; 458 + } 459 + 460 + #ifdef CONFIG_PM 461 + static int s5pv310_cpufreq_suspend(struct cpufreq_policy *policy, 462 + pm_message_t pmsg) 463 + { 464 + return 0; 465 + } 466 + 467 + static int s5pv310_cpufreq_resume(struct cpufreq_policy *policy) 468 + { 469 + return 0; 470 + } 471 + #endif 472 + 473 + static int s5pv310_cpufreq_cpu_init(struct cpufreq_policy *policy) 474 + { 475 + policy->cur = policy->min = policy->max = s5pv310_getspeed(policy->cpu); 476 + 477 + cpufreq_frequency_table_get_attr(s5pv310_freq_table, policy->cpu); 478 + 479 + /* set the transition latency value */ 480 + policy->cpuinfo.transition_latency = 100000; 481 + 482 + /* 483 + * S5PV310 multi-core processors has 2 cores 484 + * that the frequency cannot be set independently. 485 + * Each cpu is bound to the same speed. 486 + * So the affected cpu is all of the cpus. 487 + */ 488 + cpumask_setall(policy->cpus); 489 + 490 + return cpufreq_frequency_table_cpuinfo(policy, s5pv310_freq_table); 491 + } 492 + 493 + static struct cpufreq_driver s5pv310_driver = { 494 + .flags = CPUFREQ_STICKY, 495 + .verify = s5pv310_verify_speed, 496 + .target = s5pv310_target, 497 + .get = s5pv310_getspeed, 498 + .init = s5pv310_cpufreq_cpu_init, 499 + .name = "s5pv310_cpufreq", 500 + #ifdef CONFIG_PM 501 + .suspend = s5pv310_cpufreq_suspend, 502 + .resume = s5pv310_cpufreq_resume, 503 + #endif 504 + }; 505 + 506 + static int __init s5pv310_cpufreq_init(void) 507 + { 508 + cpu_clk = clk_get(NULL, "armclk"); 509 + if (IS_ERR(cpu_clk)) 510 + return PTR_ERR(cpu_clk); 511 + 512 + moutcore = clk_get(NULL, "moutcore"); 513 + if (IS_ERR(moutcore)) 514 + goto out; 515 + 516 + mout_mpll = clk_get(NULL, "mout_mpll"); 517 + if (IS_ERR(mout_mpll)) 518 + goto out; 519 + 520 + mout_apll = clk_get(NULL, "mout_apll"); 521 + if (IS_ERR(mout_apll)) 522 + goto out; 523 + 524 + #ifdef CONFIG_REGULATOR 525 + arm_regulator = regulator_get(NULL, "vdd_arm"); 526 + if (IS_ERR(arm_regulator)) { 527 + printk(KERN_ERR "failed to get resource %s\n", "vdd_arm"); 528 + goto out; 529 + } 530 + 531 + int_regulator = regulator_get(NULL, "vdd_int"); 532 + if (IS_ERR(int_regulator)) { 533 + printk(KERN_ERR "failed to get resource %s\n", "vdd_int"); 534 + goto out; 535 + } 536 + #endif 537 + 538 + /* 539 + * Check DRAM type. 540 + * Because DVFS level is different according to DRAM type. 541 + */ 542 + memtype = __raw_readl(S5P_VA_DMC0 + S5P_DMC0_MEMCON_OFFSET); 543 + memtype = (memtype >> S5P_DMC0_MEMTYPE_SHIFT); 544 + memtype &= S5P_DMC0_MEMTYPE_MASK; 545 + 546 + if ((memtype < DDR2) && (memtype > DDR3)) { 547 + printk(KERN_ERR "%s: wrong memtype= 0x%x\n", __func__, memtype); 548 + goto out; 549 + } else { 550 + printk(KERN_DEBUG "%s: memtype= 0x%x\n", __func__, memtype); 551 + } 552 + 553 + return cpufreq_register_driver(&s5pv310_driver); 554 + 555 + out: 556 + if (!IS_ERR(cpu_clk)) 557 + clk_put(cpu_clk); 558 + 559 + if (!IS_ERR(moutcore)) 560 + clk_put(moutcore); 561 + 562 + if (!IS_ERR(mout_mpll)) 563 + clk_put(mout_mpll); 564 + 565 + if (!IS_ERR(mout_apll)) 566 + clk_put(mout_apll); 567 + 568 + #ifdef CONFIG_REGULATOR 569 + if (!IS_ERR(arm_regulator)) 570 + regulator_put(arm_regulator); 571 + 572 + if (!IS_ERR(int_regulator)) 573 + regulator_put(int_regulator); 574 + #endif 575 + 576 + printk(KERN_ERR "%s: failed initialization\n", __func__); 577 + 578 + return -EINVAL; 579 + } 580 + late_initcall(s5pv310_cpufreq_init);
+139
arch/arm/mach-s5pv310/dev-pd.c
··· 1 + /* linux/arch/arm/mach-s5pv310/dev-pd.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - Power Domain support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/io.h> 14 + #include <linux/kernel.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/delay.h> 17 + 18 + #include <mach/regs-pmu.h> 19 + 20 + #include <plat/pd.h> 21 + 22 + static int s5pv310_pd_enable(struct device *dev) 23 + { 24 + struct samsung_pd_info *pdata = dev->platform_data; 25 + u32 timeout; 26 + 27 + __raw_writel(S5P_INT_LOCAL_PWR_EN, pdata->base); 28 + 29 + /* Wait max 1ms */ 30 + timeout = 10; 31 + while ((__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) 32 + != S5P_INT_LOCAL_PWR_EN) { 33 + if (timeout == 0) { 34 + printk(KERN_ERR "Power domain %s enable failed.\n", 35 + dev_name(dev)); 36 + return -ETIMEDOUT; 37 + } 38 + timeout--; 39 + udelay(100); 40 + } 41 + 42 + return 0; 43 + } 44 + 45 + static int s5pv310_pd_disable(struct device *dev) 46 + { 47 + struct samsung_pd_info *pdata = dev->platform_data; 48 + u32 timeout; 49 + 50 + __raw_writel(0, pdata->base); 51 + 52 + /* Wait max 1ms */ 53 + timeout = 10; 54 + while (__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) { 55 + if (timeout == 0) { 56 + printk(KERN_ERR "Power domain %s disable failed.\n", 57 + dev_name(dev)); 58 + return -ETIMEDOUT; 59 + } 60 + timeout--; 61 + udelay(100); 62 + } 63 + 64 + return 0; 65 + } 66 + 67 + struct platform_device s5pv310_device_pd[] = { 68 + { 69 + .name = "samsung-pd", 70 + .id = 0, 71 + .dev = { 72 + .platform_data = &(struct samsung_pd_info) { 73 + .enable = s5pv310_pd_enable, 74 + .disable = s5pv310_pd_disable, 75 + .base = S5P_PMU_MFC_CONF, 76 + }, 77 + }, 78 + }, { 79 + .name = "samsung-pd", 80 + .id = 1, 81 + .dev = { 82 + .platform_data = &(struct samsung_pd_info) { 83 + .enable = s5pv310_pd_enable, 84 + .disable = s5pv310_pd_disable, 85 + .base = S5P_PMU_G3D_CONF, 86 + }, 87 + }, 88 + }, { 89 + .name = "samsung-pd", 90 + .id = 2, 91 + .dev = { 92 + .platform_data = &(struct samsung_pd_info) { 93 + .enable = s5pv310_pd_enable, 94 + .disable = s5pv310_pd_disable, 95 + .base = S5P_PMU_LCD0_CONF, 96 + }, 97 + }, 98 + }, { 99 + .name = "samsung-pd", 100 + .id = 3, 101 + .dev = { 102 + .platform_data = &(struct samsung_pd_info) { 103 + .enable = s5pv310_pd_enable, 104 + .disable = s5pv310_pd_disable, 105 + .base = S5P_PMU_LCD1_CONF, 106 + }, 107 + }, 108 + }, { 109 + .name = "samsung-pd", 110 + .id = 4, 111 + .dev = { 112 + .platform_data = &(struct samsung_pd_info) { 113 + .enable = s5pv310_pd_enable, 114 + .disable = s5pv310_pd_disable, 115 + .base = S5P_PMU_TV_CONF, 116 + }, 117 + }, 118 + }, { 119 + .name = "samsung-pd", 120 + .id = 5, 121 + .dev = { 122 + .platform_data = &(struct samsung_pd_info) { 123 + .enable = s5pv310_pd_enable, 124 + .disable = s5pv310_pd_disable, 125 + .base = S5P_PMU_CAM_CONF, 126 + }, 127 + }, 128 + }, { 129 + .name = "samsung-pd", 130 + .id = 6, 131 + .dev = { 132 + .platform_data = &(struct samsung_pd_info) { 133 + .enable = s5pv310_pd_enable, 134 + .disable = s5pv310_pd_disable, 135 + .base = S5P_PMU_GPS_CONF, 136 + }, 137 + }, 138 + }, 139 + };
+187
arch/arm/mach-s5pv310/dev-sysmmu.c
··· 1 + /* linux/arch/arm/mach-s5pv310/dev-sysmmu.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/platform_device.h> 12 + #include <linux/dma-mapping.h> 13 + 14 + #include <mach/map.h> 15 + #include <mach/irqs.h> 16 + 17 + static struct resource s5pv310_sysmmu_resource[] = { 18 + [0] = { 19 + .start = S5PV310_PA_SYSMMU_MDMA, 20 + .end = S5PV310_PA_SYSMMU_MDMA + SZ_64K - 1, 21 + .flags = IORESOURCE_MEM, 22 + }, 23 + [1] = { 24 + .start = IRQ_SYSMMU_MDMA0_0, 25 + .end = IRQ_SYSMMU_MDMA0_0, 26 + .flags = IORESOURCE_IRQ, 27 + }, 28 + [2] = { 29 + .start = S5PV310_PA_SYSMMU_SSS, 30 + .end = S5PV310_PA_SYSMMU_SSS + SZ_64K - 1, 31 + .flags = IORESOURCE_MEM, 32 + }, 33 + [3] = { 34 + .start = IRQ_SYSMMU_SSS_0, 35 + .end = IRQ_SYSMMU_SSS_0, 36 + .flags = IORESOURCE_IRQ, 37 + }, 38 + [4] = { 39 + .start = S5PV310_PA_SYSMMU_FIMC0, 40 + .end = S5PV310_PA_SYSMMU_FIMC0 + SZ_64K - 1, 41 + .flags = IORESOURCE_MEM, 42 + }, 43 + [5] = { 44 + .start = IRQ_SYSMMU_FIMC0_0, 45 + .end = IRQ_SYSMMU_FIMC0_0, 46 + .flags = IORESOURCE_IRQ, 47 + }, 48 + [6] = { 49 + .start = S5PV310_PA_SYSMMU_FIMC1, 50 + .end = S5PV310_PA_SYSMMU_FIMC1 + SZ_64K - 1, 51 + .flags = IORESOURCE_MEM, 52 + }, 53 + [7] = { 54 + .start = IRQ_SYSMMU_FIMC1_0, 55 + .end = IRQ_SYSMMU_FIMC1_0, 56 + .flags = IORESOURCE_IRQ, 57 + }, 58 + [8] = { 59 + .start = S5PV310_PA_SYSMMU_FIMC2, 60 + .end = S5PV310_PA_SYSMMU_FIMC2 + SZ_64K - 1, 61 + .flags = IORESOURCE_MEM, 62 + }, 63 + [9] = { 64 + .start = IRQ_SYSMMU_FIMC2_0, 65 + .end = IRQ_SYSMMU_FIMC2_0, 66 + .flags = IORESOURCE_IRQ, 67 + }, 68 + [10] = { 69 + .start = S5PV310_PA_SYSMMU_FIMC3, 70 + .end = S5PV310_PA_SYSMMU_FIMC3 + SZ_64K - 1, 71 + .flags = IORESOURCE_MEM, 72 + }, 73 + [11] = { 74 + .start = IRQ_SYSMMU_FIMC3_0, 75 + .end = IRQ_SYSMMU_FIMC3_0, 76 + .flags = IORESOURCE_IRQ, 77 + }, 78 + [12] = { 79 + .start = S5PV310_PA_SYSMMU_JPEG, 80 + .end = S5PV310_PA_SYSMMU_JPEG + SZ_64K - 1, 81 + .flags = IORESOURCE_MEM, 82 + }, 83 + [13] = { 84 + .start = IRQ_SYSMMU_JPEG_0, 85 + .end = IRQ_SYSMMU_JPEG_0, 86 + .flags = IORESOURCE_IRQ, 87 + }, 88 + [14] = { 89 + .start = S5PV310_PA_SYSMMU_FIMD0, 90 + .end = S5PV310_PA_SYSMMU_FIMD0 + SZ_64K - 1, 91 + .flags = IORESOURCE_MEM, 92 + }, 93 + [15] = { 94 + .start = IRQ_SYSMMU_LCD0_M0_0, 95 + .end = IRQ_SYSMMU_LCD0_M0_0, 96 + .flags = IORESOURCE_IRQ, 97 + }, 98 + [16] = { 99 + .start = S5PV310_PA_SYSMMU_FIMD1, 100 + .end = S5PV310_PA_SYSMMU_FIMD1 + SZ_64K - 1, 101 + .flags = IORESOURCE_MEM, 102 + }, 103 + [17] = { 104 + .start = IRQ_SYSMMU_LCD1_M1_0, 105 + .end = IRQ_SYSMMU_LCD1_M1_0, 106 + .flags = IORESOURCE_IRQ, 107 + }, 108 + [18] = { 109 + .start = S5PV310_PA_SYSMMU_PCIe, 110 + .end = S5PV310_PA_SYSMMU_PCIe + SZ_64K - 1, 111 + .flags = IORESOURCE_MEM, 112 + }, 113 + [19] = { 114 + .start = IRQ_SYSMMU_PCIE_0, 115 + .end = IRQ_SYSMMU_PCIE_0, 116 + .flags = IORESOURCE_IRQ, 117 + }, 118 + [20] = { 119 + .start = S5PV310_PA_SYSMMU_G2D, 120 + .end = S5PV310_PA_SYSMMU_G2D + SZ_64K - 1, 121 + .flags = IORESOURCE_MEM, 122 + }, 123 + [21] = { 124 + .start = IRQ_SYSMMU_2D_0, 125 + .end = IRQ_SYSMMU_2D_0, 126 + .flags = IORESOURCE_IRQ, 127 + }, 128 + [22] = { 129 + .start = S5PV310_PA_SYSMMU_ROTATOR, 130 + .end = S5PV310_PA_SYSMMU_ROTATOR + SZ_64K - 1, 131 + .flags = IORESOURCE_MEM, 132 + }, 133 + [23] = { 134 + .start = IRQ_SYSMMU_ROTATOR_0, 135 + .end = IRQ_SYSMMU_ROTATOR_0, 136 + .flags = IORESOURCE_IRQ, 137 + }, 138 + [24] = { 139 + .start = S5PV310_PA_SYSMMU_MDMA2, 140 + .end = S5PV310_PA_SYSMMU_MDMA2 + SZ_64K - 1, 141 + .flags = IORESOURCE_MEM, 142 + }, 143 + [25] = { 144 + .start = IRQ_SYSMMU_MDMA1_0, 145 + .end = IRQ_SYSMMU_MDMA1_0, 146 + .flags = IORESOURCE_IRQ, 147 + }, 148 + [26] = { 149 + .start = S5PV310_PA_SYSMMU_TV, 150 + .end = S5PV310_PA_SYSMMU_TV + SZ_64K - 1, 151 + .flags = IORESOURCE_MEM, 152 + }, 153 + [27] = { 154 + .start = IRQ_SYSMMU_TV_M0_0, 155 + .end = IRQ_SYSMMU_TV_M0_0, 156 + .flags = IORESOURCE_IRQ, 157 + }, 158 + [28] = { 159 + .start = S5PV310_PA_SYSMMU_MFC_L, 160 + .end = S5PV310_PA_SYSMMU_MFC_L + SZ_64K - 1, 161 + .flags = IORESOURCE_MEM, 162 + }, 163 + [29] = { 164 + .start = IRQ_SYSMMU_MFC_M0_0, 165 + .end = IRQ_SYSMMU_MFC_M0_0, 166 + .flags = IORESOURCE_IRQ, 167 + }, 168 + [30] = { 169 + .start = S5PV310_PA_SYSMMU_MFC_R, 170 + .end = S5PV310_PA_SYSMMU_MFC_R + SZ_64K - 1, 171 + .flags = IORESOURCE_MEM, 172 + }, 173 + [31] = { 174 + .start = IRQ_SYSMMU_MFC_M1_0, 175 + .end = IRQ_SYSMMU_MFC_M1_0, 176 + .flags = IORESOURCE_IRQ, 177 + }, 178 + }; 179 + 180 + struct platform_device s5pv310_device_sysmmu = { 181 + .name = "s5p-sysmmu", 182 + .id = 32, 183 + .num_resources = ARRAY_SIZE(s5pv310_sysmmu_resource), 184 + .resource = s5pv310_sysmmu_resource, 185 + }; 186 + 187 + EXPORT_SYMBOL(s5pv310_device_sysmmu);
+31 -3
arch/arm/mach-s5pv310/include/mach/irqs.h
··· 25 25 26 26 #define IRQ_SPI(x) S5P_IRQ(x+32) 27 27 28 + #define IRQ_MCT1 IRQ_SPI(35) 29 + 28 30 #define IRQ_EINT0 IRQ_SPI(40) 29 31 #define IRQ_EINT1 IRQ_SPI(41) 30 32 #define IRQ_EINT2 IRQ_SPI(42) ··· 38 36 #define IRQ_JPEG IRQ_SPI(48) 39 37 #define IRQ_2D IRQ_SPI(49) 40 38 #define IRQ_PCIE IRQ_SPI(50) 41 - #define IRQ_SYSTEM_TIMER IRQ_SPI(51) 39 + #define IRQ_MCT0 IRQ_SPI(51) 42 40 #define IRQ_MFC IRQ_SPI(52) 43 - #define IRQ_WDT IRQ_SPI(53) 44 41 #define IRQ_AUDIO_SS IRQ_SPI(54) 45 42 #define IRQ_AC97 IRQ_SPI(55) 46 43 #define IRQ_SPDIF IRQ_SPI(56) ··· 54 53 #define MAX_IRQ_IN_COMBINER 8 55 54 #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) 56 55 #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) 56 + 57 + #define IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0) 58 + #define IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1) 59 + #define IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2) 60 + #define IRQ_SYSMMU_FIMC1_0 COMBINER_IRQ(4, 3) 61 + #define IRQ_SYSMMU_FIMC2_0 COMBINER_IRQ(4, 4) 62 + #define IRQ_SYSMMU_FIMC3_0 COMBINER_IRQ(4, 5) 63 + #define IRQ_SYSMMU_JPEG_0 COMBINER_IRQ(4, 6) 64 + #define IRQ_SYSMMU_2D_0 COMBINER_IRQ(4, 7) 65 + 66 + #define IRQ_SYSMMU_ROTATOR_0 COMBINER_IRQ(5, 0) 67 + #define IRQ_SYSMMU_MDMA1_0 COMBINER_IRQ(5, 1) 68 + #define IRQ_SYSMMU_LCD0_M0_0 COMBINER_IRQ(5, 2) 69 + #define IRQ_SYSMMU_LCD1_M1_0 COMBINER_IRQ(5, 3) 70 + #define IRQ_SYSMMU_TV_M0_0 COMBINER_IRQ(5, 4) 71 + #define IRQ_SYSMMU_MFC_M0_0 COMBINER_IRQ(5, 5) 72 + #define IRQ_SYSMMU_MFC_M1_0 COMBINER_IRQ(5, 6) 73 + #define IRQ_SYSMMU_PCIE_0 COMBINER_IRQ(5, 7) 57 74 58 75 #define IRQ_PDMA0 COMBINER_IRQ(21, 0) 59 76 #define IRQ_PDMA1 COMBINER_IRQ(21, 1) ··· 105 86 #define IRQ_HSMMC2 COMBINER_IRQ(29, 2) 106 87 #define IRQ_HSMMC3 COMBINER_IRQ(29, 3) 107 88 89 + #define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0) 90 + #define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1) 91 + 108 92 #define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 93 + 94 + #define IRQ_MCT_L1 COMBINER_IRQ(35, 3) 109 95 110 96 #define IRQ_EINT4 COMBINER_IRQ(37, 0) 111 97 #define IRQ_EINT5 COMBINER_IRQ(37, 1) ··· 128 104 129 105 #define IRQ_EINT16_31 COMBINER_IRQ(39, 0) 130 106 131 - #define MAX_COMBINER_NR 40 107 + #define IRQ_MCT_L0 COMBINER_IRQ(51, 0) 108 + 109 + #define IRQ_WDT COMBINER_IRQ(53, 0) 110 + 111 + #define MAX_COMBINER_NR 54 132 112 133 113 #define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) 134 114
+29
arch/arm/mach-s5pv310/include/mach/map.h
··· 39 39 #define S5PV310_PA_SYSCON (0x10010000) 40 40 #define S5P_PA_SYSCON S5PV310_PA_SYSCON 41 41 42 + #define S5PV310_PA_PMU (0x10020000) 43 + 42 44 #define S5PV310_PA_CMU (0x10030000) 43 45 44 46 #define S5PV310_PA_WATCHDOG (0x10060000) 45 47 #define S5PV310_PA_RTC (0x10070000) 48 + 49 + #define S5PV310_PA_DMC0 (0x10400000) 46 50 47 51 #define S5PV310_PA_COMBINER (0x10448000) 48 52 ··· 65 61 #define S5PV310_PA_GPIO2 (0x11000000) 66 62 #define S5PV310_PA_GPIO3 (0x03860000) 67 63 64 + #define S5PV310_PA_MIPI_CSIS0 0x11880000 65 + #define S5PV310_PA_MIPI_CSIS1 0x11890000 66 + 68 67 #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) 69 68 70 69 #define S5PV310_PA_SROMC (0x12570000) 70 + #define S5P_PA_SROMC S5PV310_PA_SROMC 71 71 72 72 /* S/PDIF */ 73 73 #define S5PV310_PA_SPDIF 0xE1100000 ··· 108 100 #define S5PV310_PA_SDRAM (0x40000000) 109 101 #define S5P_PA_SDRAM S5PV310_PA_SDRAM 110 102 103 + #define S5PV310_PA_SYSMMU_MDMA 0x10A40000 104 + #define S5PV310_PA_SYSMMU_SSS 0x10A50000 105 + #define S5PV310_PA_SYSMMU_FIMC0 0x11A20000 106 + #define S5PV310_PA_SYSMMU_FIMC1 0x11A30000 107 + #define S5PV310_PA_SYSMMU_FIMC2 0x11A40000 108 + #define S5PV310_PA_SYSMMU_FIMC3 0x11A50000 109 + #define S5PV310_PA_SYSMMU_JPEG 0x11A60000 110 + #define S5PV310_PA_SYSMMU_FIMD0 0x11E20000 111 + #define S5PV310_PA_SYSMMU_FIMD1 0x12220000 112 + #define S5PV310_PA_SYSMMU_PCIe 0x12620000 113 + #define S5PV310_PA_SYSMMU_G2D 0x12A20000 114 + #define S5PV310_PA_SYSMMU_ROTATOR 0x12A30000 115 + #define S5PV310_PA_SYSMMU_MDMA2 0x12A40000 116 + #define S5PV310_PA_SYSMMU_TV 0x12E20000 117 + #define S5PV310_PA_SYSMMU_MFC_L 0x13620000 118 + #define S5PV310_PA_SYSMMU_MFC_R 0x13630000 119 + #define S5PV310_SYSMMU_TOTAL_IPNUM 16 120 + #define S5P_SYSMMU_TOTAL_IPNUM S5PV310_SYSMMU_TOTAL_IPNUM 121 + 111 122 /* compatibiltiy defines. */ 112 123 #define S3C_PA_UART S5PV310_PA_UART 113 124 #define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0) ··· 143 116 #define S3C_PA_IIC7 S5PV310_PA_IIC(7) 144 117 #define S3C_PA_RTC S5PV310_PA_RTC 145 118 #define S3C_PA_WDT S5PV310_PA_WATCHDOG 119 + #define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0 120 + #define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1 146 121 147 122 #endif /* __ASM_ARCH_MAP_H */
+78 -2
arch/arm/mach-s5pv310/include/mach/regs-clock.h
··· 19 19 20 20 #define S5P_INFORM0 S5P_CLKREG(0x800) 21 21 22 + #define S5P_CLKDIV_LEFTBUS S5P_CLKREG(0x04500) 23 + #define S5P_CLKDIV_STAT_LEFTBUS S5P_CLKREG(0x04600) 24 + 25 + #define S5P_CLKDIV_RIGHTBUS S5P_CLKREG(0x08500) 26 + #define S5P_CLKDIV_STAT_RIGHTBUS S5P_CLKREG(0x08600) 27 + 22 28 #define S5P_EPLL_CON0 S5P_CLKREG(0x0C110) 23 29 #define S5P_EPLL_CON1 S5P_CLKREG(0x0C114) 24 30 #define S5P_VPLL_CON0 S5P_CLKREG(0x0C120) ··· 64 58 #define S5P_CLKSRC_MASK_PERIL0 S5P_CLKREG(0x0C350) 65 59 #define S5P_CLKSRC_MASK_PERIL1 S5P_CLKREG(0x0C354) 66 60 61 + #define S5P_CLKDIV_STAT_TOP S5P_CLKREG(0x0C610) 62 + 67 63 #define S5P_CLKGATE_IP_CAM S5P_CLKREG(0x0C920) 68 64 #define S5P_CLKGATE_IP_IMAGE S5P_CLKREG(0x0C930) 69 65 #define S5P_CLKGATE_IP_LCD0 S5P_CLKREG(0x0C934) ··· 74 66 #define S5P_CLKGATE_IP_PERIL S5P_CLKREG(0x0C950) 75 67 #define S5P_CLKGATE_IP_PERIR S5P_CLKREG(0x0C960) 76 68 77 - #define S5P_CLKSRC_CORE S5P_CLKREG(0x10200) 78 - #define S5P_CLKDIV_CORE0 S5P_CLKREG(0x10500) 69 + #define S5P_CLKSRC_DMC S5P_CLKREG(0x10200) 70 + #define S5P_CLKDIV_DMC0 S5P_CLKREG(0x10500) 71 + #define S5P_CLKDIV_STAT_DMC0 S5P_CLKREG(0x10600) 79 72 80 73 #define S5P_APLL_LOCK S5P_CLKREG(0x14000) 81 74 #define S5P_MPLL_LOCK S5P_CLKREG(0x14004) ··· 89 80 #define S5P_CLKMUX_STATCPU S5P_CLKREG(0x14400) 90 81 91 82 #define S5P_CLKDIV_CPU S5P_CLKREG(0x14500) 83 + #define S5P_CLKDIV_CPU1 S5P_CLKREG(0x14504) 92 84 #define S5P_CLKDIV_STATCPU S5P_CLKREG(0x14600) 85 + #define S5P_CLKDIV_STATCPU1 S5P_CLKREG(0x14604) 93 86 94 87 #define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800) 88 + 89 + /* APLL_LOCK */ 90 + #define S5P_APLL_LOCKTIME (0x1C20) /* 300us */ 91 + 92 + /* APLL_CON0 */ 93 + #define S5P_APLLCON0_ENABLE_SHIFT (31) 94 + #define S5P_APLLCON0_LOCKED_SHIFT (29) 95 + #define S5P_APLL_VAL_1000 ((250 << 16) | (6 << 8) | 1) 96 + #define S5P_APLL_VAL_800 ((200 << 16) | (6 << 8) | 1) 97 + 98 + /* CLK_SRC_CPU */ 99 + #define S5P_CLKSRC_CPU_MUXCORE_SHIFT (16) 100 + #define S5P_CLKMUX_STATCPU_MUXCORE_MASK (0x7 << S5P_CLKSRC_CPU_MUXCORE_SHIFT) 101 + 102 + /* CLKDIV_CPU0 */ 103 + #define S5P_CLKDIV_CPU0_CORE_SHIFT (0) 104 + #define S5P_CLKDIV_CPU0_CORE_MASK (0x7 << S5P_CLKDIV_CPU0_CORE_SHIFT) 105 + #define S5P_CLKDIV_CPU0_COREM0_SHIFT (4) 106 + #define S5P_CLKDIV_CPU0_COREM0_MASK (0x7 << S5P_CLKDIV_CPU0_COREM0_SHIFT) 107 + #define S5P_CLKDIV_CPU0_COREM1_SHIFT (8) 108 + #define S5P_CLKDIV_CPU0_COREM1_MASK (0x7 << S5P_CLKDIV_CPU0_COREM1_SHIFT) 109 + #define S5P_CLKDIV_CPU0_PERIPH_SHIFT (12) 110 + #define S5P_CLKDIV_CPU0_PERIPH_MASK (0x7 << S5P_CLKDIV_CPU0_PERIPH_SHIFT) 111 + #define S5P_CLKDIV_CPU0_ATB_SHIFT (16) 112 + #define S5P_CLKDIV_CPU0_ATB_MASK (0x7 << S5P_CLKDIV_CPU0_ATB_SHIFT) 113 + #define S5P_CLKDIV_CPU0_PCLKDBG_SHIFT (20) 114 + #define S5P_CLKDIV_CPU0_PCLKDBG_MASK (0x7 << S5P_CLKDIV_CPU0_PCLKDBG_SHIFT) 115 + #define S5P_CLKDIV_CPU0_APLL_SHIFT (24) 116 + #define S5P_CLKDIV_CPU0_APLL_MASK (0x7 << S5P_CLKDIV_CPU0_APLL_SHIFT) 117 + 118 + /* CLKDIV_DMC0 */ 119 + #define S5P_CLKDIV_DMC0_ACP_SHIFT (0) 120 + #define S5P_CLKDIV_DMC0_ACP_MASK (0x7 << S5P_CLKDIV_DMC0_ACP_SHIFT) 121 + #define S5P_CLKDIV_DMC0_ACPPCLK_SHIFT (4) 122 + #define S5P_CLKDIV_DMC0_ACPPCLK_MASK (0x7 << S5P_CLKDIV_DMC0_ACPPCLK_SHIFT) 123 + #define S5P_CLKDIV_DMC0_DPHY_SHIFT (8) 124 + #define S5P_CLKDIV_DMC0_DPHY_MASK (0x7 << S5P_CLKDIV_DMC0_DPHY_SHIFT) 125 + #define S5P_CLKDIV_DMC0_DMC_SHIFT (12) 126 + #define S5P_CLKDIV_DMC0_DMC_MASK (0x7 << S5P_CLKDIV_DMC0_DMC_SHIFT) 127 + #define S5P_CLKDIV_DMC0_DMCD_SHIFT (16) 128 + #define S5P_CLKDIV_DMC0_DMCD_MASK (0x7 << S5P_CLKDIV_DMC0_DMCD_SHIFT) 129 + #define S5P_CLKDIV_DMC0_DMCP_SHIFT (20) 130 + #define S5P_CLKDIV_DMC0_DMCP_MASK (0x7 << S5P_CLKDIV_DMC0_DMCP_SHIFT) 131 + #define S5P_CLKDIV_DMC0_COPY2_SHIFT (24) 132 + #define S5P_CLKDIV_DMC0_COPY2_MASK (0x7 << S5P_CLKDIV_DMC0_COPY2_SHIFT) 133 + #define S5P_CLKDIV_DMC0_CORETI_SHIFT (28) 134 + #define S5P_CLKDIV_DMC0_CORETI_MASK (0x7 << S5P_CLKDIV_DMC0_CORETI_SHIFT) 135 + 136 + /* CLKDIV_TOP */ 137 + #define S5P_CLKDIV_TOP_ACLK200_SHIFT (0) 138 + #define S5P_CLKDIV_TOP_ACLK200_MASK (0x7 << S5P_CLKDIV_TOP_ACLK200_SHIFT) 139 + #define S5P_CLKDIV_TOP_ACLK100_SHIFT (4) 140 + #define S5P_CLKDIV_TOP_ACLK100_MASK (0xf << S5P_CLKDIV_TOP_ACLK100_SHIFT) 141 + #define S5P_CLKDIV_TOP_ACLK160_SHIFT (8) 142 + #define S5P_CLKDIV_TOP_ACLK160_MASK (0x7 << S5P_CLKDIV_TOP_ACLK160_SHIFT) 143 + #define S5P_CLKDIV_TOP_ACLK133_SHIFT (12) 144 + #define S5P_CLKDIV_TOP_ACLK133_MASK (0x7 << S5P_CLKDIV_TOP_ACLK133_SHIFT) 145 + #define S5P_CLKDIV_TOP_ONENAND_SHIFT (16) 146 + #define S5P_CLKDIV_TOP_ONENAND_MASK (0x7 << S5P_CLKDIV_TOP_ONENAND_SHIFT) 147 + 148 + /* CLKDIV_LEFTBUS / CLKDIV_RIGHTBUS*/ 149 + #define S5P_CLKDIV_BUS_GDLR_SHIFT (0) 150 + #define S5P_CLKDIV_BUS_GDLR_MASK (0x7 << S5P_CLKDIV_BUS_GDLR_SHIFT) 151 + #define S5P_CLKDIV_BUS_GPLR_SHIFT (4) 152 + #define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT) 95 153 96 154 /* Compatibility defines */ 97 155
+23
arch/arm/mach-s5pv310/include/mach/regs-mem.h
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-mem.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - SROMC and DMC register definitions 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_ARCH_REGS_MEM_H 14 + #define __ASM_ARCH_REGS_MEM_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_DMC0_MEMCON_OFFSET 0x04 19 + 20 + #define S5P_DMC0_MEMTYPE_SHIFT 8 21 + #define S5P_DMC0_MEMTYPE_MASK 0xF 22 + 23 + #endif /* __ASM_ARCH_REGS_MEM_H */
+30
arch/arm/mach-s5pv310/include/mach/regs-pmu.h
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - Power management unit definition 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_ARCH_REGS_PMU_H 14 + #define __ASM_ARCH_REGS_PMU_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_PMUREG(x) (S5P_VA_PMU + (x)) 19 + 20 + #define S5P_PMU_CAM_CONF S5P_PMUREG(0x3C00) 21 + #define S5P_PMU_TV_CONF S5P_PMUREG(0x3C20) 22 + #define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40) 23 + #define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60) 24 + #define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80) 25 + #define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0) 26 + #define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0) 27 + 28 + #define S5P_INT_LOCAL_PWR_EN 0x7 29 + 30 + #endif /* __ASM_ARCH_REGS_PMU_H */
-50
arch/arm/mach-s5pv310/include/mach/regs-srom.h
··· 1 - /* linux/arch/arm/mach-s5pv310/include/mach/regs-srom.h 2 - * 3 - * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 - * http://www.samsung.com 5 - * 6 - * S5PV310 - SROMC register definitions 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 12 - 13 - #ifndef __ASM_ARCH_REGS_SROM_H 14 - #define __ASM_ARCH_REGS_SROM_H __FILE__ 15 - 16 - #include <mach/map.h> 17 - 18 - #define S5PV310_SROMREG(x) (S5P_VA_SROMC + (x)) 19 - 20 - #define S5PV310_SROM_BW S5PV310_SROMREG(0x0) 21 - #define S5PV310_SROM_BC0 S5PV310_SROMREG(0x4) 22 - #define S5PV310_SROM_BC1 S5PV310_SROMREG(0x8) 23 - #define S5PV310_SROM_BC2 S5PV310_SROMREG(0xc) 24 - #define S5PV310_SROM_BC3 S5PV310_SROMREG(0x10) 25 - 26 - /* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */ 27 - 28 - #define S5PV310_SROM_BW__DATAWIDTH__SHIFT 0 29 - #define S5PV310_SROM_BW__ADDRMODE__SHIFT 1 30 - #define S5PV310_SROM_BW__WAITENABLE__SHIFT 2 31 - #define S5PV310_SROM_BW__BYTEENABLE__SHIFT 3 32 - 33 - #define S5PV310_SROM_BW__CS_MASK 0xf 34 - 35 - #define S5PV310_SROM_BW__NCS0__SHIFT 0 36 - #define S5PV310_SROM_BW__NCS1__SHIFT 4 37 - #define S5PV310_SROM_BW__NCS2__SHIFT 8 38 - #define S5PV310_SROM_BW__NCS3__SHIFT 12 39 - 40 - /* applies to same to BCS0 - BCS3 */ 41 - 42 - #define S5PV310_SROM_BCX__PMC__SHIFT 0 43 - #define S5PV310_SROM_BCX__TACP__SHIFT 4 44 - #define S5PV310_SROM_BCX__TCAH__SHIFT 8 45 - #define S5PV310_SROM_BCX__TCOH__SHIFT 12 46 - #define S5PV310_SROM_BCX__TACC__SHIFT 16 47 - #define S5PV310_SROM_BCX__TCOS__SHIFT 24 48 - #define S5PV310_SROM_BCX__TACS__SHIFT 28 49 - 50 - #endif /* __ASM_ARCH_REGS_SROM_H */
+24
arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - System MMU register 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_ARCH_REGS_SYSMMU_H 14 + #define __ASM_ARCH_REGS_SYSMMU_H __FILE__ 15 + 16 + #define S5P_MMU_CTRL 0x000 17 + #define S5P_MMU_CFG 0x004 18 + #define S5P_MMU_STATUS 0x008 19 + #define S5P_MMU_FLUSH 0x00C 20 + #define S5P_PT_BASE_ADDR 0x014 21 + #define S5P_INT_STATUS 0x018 22 + #define S5P_PAGE_FAULT_ADDR 0x024 23 + 24 + #endif /* __ASM_ARCH_REGS_SYSMMU_H */
+119
arch/arm/mach-s5pv310/include/mach/sysmmu.h
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com/ 5 + * 6 + * Samsung sysmmu driver for S5PV310 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_ARM_ARCH_SYSMMU_H 14 + #define __ASM_ARM_ARCH_SYSMMU_H __FILE__ 15 + 16 + enum s5pv310_sysmmu_ips { 17 + SYSMMU_MDMA, 18 + SYSMMU_SSS, 19 + SYSMMU_FIMC0, 20 + SYSMMU_FIMC1, 21 + SYSMMU_FIMC2, 22 + SYSMMU_FIMC3, 23 + SYSMMU_JPEG, 24 + SYSMMU_FIMD0, 25 + SYSMMU_FIMD1, 26 + SYSMMU_PCIe, 27 + SYSMMU_G2D, 28 + SYSMMU_ROTATOR, 29 + SYSMMU_MDMA2, 30 + SYSMMU_TV, 31 + SYSMMU_MFC_L, 32 + SYSMMU_MFC_R, 33 + }; 34 + 35 + static char *sysmmu_ips_name[S5P_SYSMMU_TOTAL_IPNUM] = { 36 + "SYSMMU_MDMA" , 37 + "SYSMMU_SSS" , 38 + "SYSMMU_FIMC0" , 39 + "SYSMMU_FIMC1" , 40 + "SYSMMU_FIMC2" , 41 + "SYSMMU_FIMC3" , 42 + "SYSMMU_JPEG" , 43 + "SYSMMU_FIMD0" , 44 + "SYSMMU_FIMD1" , 45 + "SYSMMU_PCIe" , 46 + "SYSMMU_G2D" , 47 + "SYSMMU_ROTATOR", 48 + "SYSMMU_MDMA2" , 49 + "SYSMMU_TV" , 50 + "SYSMMU_MFC_L" , 51 + "SYSMMU_MFC_R" , 52 + }; 53 + 54 + typedef enum s5pv310_sysmmu_ips sysmmu_ips; 55 + 56 + struct sysmmu_tt_info { 57 + unsigned long *pgd; 58 + unsigned long pgd_paddr; 59 + unsigned long *pte; 60 + }; 61 + 62 + struct sysmmu_controller { 63 + const char *name; 64 + 65 + /* channels registers */ 66 + void __iomem *regs; 67 + 68 + /* channel irq */ 69 + unsigned int irq; 70 + 71 + sysmmu_ips ips; 72 + 73 + /* Translation Table Info. */ 74 + struct sysmmu_tt_info *tt_info; 75 + 76 + struct resource *mem; 77 + struct device *dev; 78 + 79 + /* SysMMU controller enable - true : enable */ 80 + bool enable; 81 + }; 82 + 83 + /** 84 + * s5p_sysmmu_enable() - enable system mmu of ip 85 + * @ips: The ip connected system mmu. 86 + * 87 + * This function enable system mmu to transfer address 88 + * from virtual address to physical address 89 + */ 90 + int s5p_sysmmu_enable(sysmmu_ips ips); 91 + 92 + /** 93 + * s5p_sysmmu_disable() - disable sysmmu mmu of ip 94 + * @ips: The ip connected system mmu. 95 + * 96 + * This function disable system mmu to transfer address 97 + * from virtual address to physical address 98 + */ 99 + int s5p_sysmmu_disable(sysmmu_ips ips); 100 + 101 + /** 102 + * s5p_sysmmu_set_tablebase_pgd() - set page table base address to refer page table 103 + * @ips: The ip connected system mmu. 104 + * @pgd: The page table base address. 105 + * 106 + * This function set page table base address 107 + * When system mmu transfer address from virtaul address to physical address, 108 + * system mmu refer address information from page table 109 + */ 110 + int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd); 111 + 112 + /** 113 + * s5p_sysmmu_tlb_invalidate() - flush all TLB entry in system mmu 114 + * @ips: The ip connected system mmu. 115 + * 116 + * This function flush all TLB entry in system mmu 117 + */ 118 + int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips); 119 + #endif /* __ASM_ARM_ARCH_SYSMMU_H */
+19 -13
arch/arm/mach-s5pv310/irq-combiner.c
··· 24 24 25 25 struct combiner_chip_data { 26 26 unsigned int irq_offset; 27 + unsigned int irq_mask; 27 28 void __iomem *base; 28 29 }; 29 30 30 31 static struct combiner_chip_data combiner_data[MAX_COMBINER_NR]; 31 32 32 - static inline void __iomem *combiner_base(unsigned int irq) 33 + static inline void __iomem *combiner_base(struct irq_data *data) 33 34 { 34 - struct combiner_chip_data *combiner_data = get_irq_chip_data(irq); 35 + struct combiner_chip_data *combiner_data = 36 + irq_data_get_irq_chip_data(data); 37 + 35 38 return combiner_data->base; 36 39 } 37 40 38 - static void combiner_mask_irq(unsigned int irq) 41 + static void combiner_mask_irq(struct irq_data *data) 39 42 { 40 - u32 mask = 1 << (irq % 32); 43 + u32 mask = 1 << (data->irq % 32); 41 44 42 - __raw_writel(mask, combiner_base(irq) + COMBINER_ENABLE_CLEAR); 45 + __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR); 43 46 } 44 47 45 - static void combiner_unmask_irq(unsigned int irq) 48 + static void combiner_unmask_irq(struct irq_data *data) 46 49 { 47 - u32 mask = 1 << (irq % 32); 50 + u32 mask = 1 << (data->irq % 32); 48 51 49 - __raw_writel(mask, combiner_base(irq) + COMBINER_ENABLE_SET); 52 + __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET); 50 53 } 51 54 52 55 static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) ··· 60 57 unsigned long status; 61 58 62 59 /* primary controller ack'ing */ 63 - chip->ack(irq); 60 + chip->irq_ack(&desc->irq_data); 64 61 65 62 spin_lock(&irq_controller_lock); 66 63 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS); 67 64 spin_unlock(&irq_controller_lock); 65 + status &= chip_data->irq_mask; 68 66 69 67 if (status == 0) 70 68 goto out; ··· 80 76 81 77 out: 82 78 /* primary controller unmasking */ 83 - chip->unmask(irq); 79 + chip->irq_unmask(&desc->irq_data); 84 80 } 85 81 86 82 static struct irq_chip combiner_chip = { 87 83 .name = "COMBINER", 88 - .mask = combiner_mask_irq, 89 - .unmask = combiner_unmask_irq, 84 + .irq_mask = combiner_mask_irq, 85 + .irq_unmask = combiner_unmask_irq, 90 86 }; 91 87 92 88 void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq) ··· 108 104 109 105 combiner_data[combiner_nr].base = base; 110 106 combiner_data[combiner_nr].irq_offset = irq_start; 107 + combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3); 111 108 112 109 /* Disable all interrupts */ 113 110 114 - __raw_writel(0xffffffff, base + COMBINER_ENABLE_CLEAR); 111 + __raw_writel(combiner_data[combiner_nr].irq_mask, 112 + base + COMBINER_ENABLE_CLEAR); 115 113 116 114 /* Setup the Linux IRQ subsystem */ 117 115
+28 -27
arch/arm/mach-s5pv310/irq-eint.c
··· 48 48 return ret; 49 49 } 50 50 51 - static inline void s5pv310_irq_eint_mask(unsigned int irq) 51 + static inline void s5pv310_irq_eint_mask(struct irq_data *data) 52 52 { 53 53 u32 mask; 54 54 55 55 spin_lock(&eint_lock); 56 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 57 - mask |= eint_irq_to_bit(irq); 58 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 56 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 57 + mask |= eint_irq_to_bit(data->irq); 58 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 59 59 spin_unlock(&eint_lock); 60 60 } 61 61 62 - static void s5pv310_irq_eint_unmask(unsigned int irq) 62 + static void s5pv310_irq_eint_unmask(struct irq_data *data) 63 63 { 64 64 u32 mask; 65 65 66 66 spin_lock(&eint_lock); 67 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 68 - mask &= ~(eint_irq_to_bit(irq)); 69 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 67 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 68 + mask &= ~(eint_irq_to_bit(data->irq)); 69 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 70 70 spin_unlock(&eint_lock); 71 71 } 72 72 73 - static inline void s5pv310_irq_eint_ack(unsigned int irq) 73 + static inline void s5pv310_irq_eint_ack(struct irq_data *data) 74 74 { 75 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 75 + __raw_writel(eint_irq_to_bit(data->irq), 76 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 76 77 } 77 78 78 - static void s5pv310_irq_eint_maskack(unsigned int irq) 79 + static void s5pv310_irq_eint_maskack(struct irq_data *data) 79 80 { 80 - s5pv310_irq_eint_mask(irq); 81 - s5pv310_irq_eint_ack(irq); 81 + s5pv310_irq_eint_mask(data); 82 + s5pv310_irq_eint_ack(data); 82 83 } 83 84 84 - static int s5pv310_irq_eint_set_type(unsigned int irq, unsigned int type) 85 + static int s5pv310_irq_eint_set_type(struct irq_data *data, unsigned int type) 85 86 { 86 - int offs = EINT_OFFSET(irq); 87 + int offs = EINT_OFFSET(data->irq); 87 88 int shift; 88 89 u32 ctrl, mask; 89 90 u32 newvalue = 0; ··· 119 118 mask = 0x7 << shift; 120 119 121 120 spin_lock(&eint_lock); 122 - ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(irq))); 121 + ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq))); 123 122 ctrl &= ~mask; 124 123 ctrl |= newvalue << shift; 125 - __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(irq))); 124 + __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq))); 126 125 spin_unlock(&eint_lock); 127 126 128 127 switch (offs) { ··· 147 146 148 147 static struct irq_chip s5pv310_irq_eint = { 149 148 .name = "s5pv310-eint", 150 - .mask = s5pv310_irq_eint_mask, 151 - .unmask = s5pv310_irq_eint_unmask, 152 - .mask_ack = s5pv310_irq_eint_maskack, 153 - .ack = s5pv310_irq_eint_ack, 154 - .set_type = s5pv310_irq_eint_set_type, 149 + .irq_mask = s5pv310_irq_eint_mask, 150 + .irq_unmask = s5pv310_irq_eint_unmask, 151 + .irq_mask_ack = s5pv310_irq_eint_maskack, 152 + .irq_ack = s5pv310_irq_eint_ack, 153 + .irq_set_type = s5pv310_irq_eint_set_type, 155 154 #ifdef CONFIG_PM 156 - .set_wake = s3c_irqext_wake, 155 + .irq_set_wake = s3c_irqext_wake, 157 156 #endif 158 157 }; 159 158 ··· 193 192 u32 *irq_data = get_irq_data(irq); 194 193 struct irq_chip *chip = get_irq_chip(irq); 195 194 196 - chip->mask(irq); 195 + chip->irq_mask(&desc->irq_data); 197 196 198 - if (chip->ack) 199 - chip->ack(irq); 197 + if (chip->irq_ack) 198 + chip->irq_ack(&desc->irq_data); 200 199 201 200 generic_handle_irq(*irq_data); 202 201 203 - chip->unmask(irq); 202 + chip->irq_unmask(&desc->irq_data); 204 203 } 205 204 206 205 int __init s5pv310_init_irq_eint(void)
+36 -16
arch/arm/mach-s5pv310/mach-smdkc210.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/smsc911x.h> 16 16 #include <linux/io.h> 17 + #include <linux/i2c.h> 17 18 18 19 #include <asm/mach/arch.h> 19 20 #include <asm/mach-types.h> 20 21 21 22 #include <plat/regs-serial.h> 23 + #include <plat/regs-srom.h> 22 24 #include <plat/s5pv310.h> 23 25 #include <plat/cpu.h> 24 26 #include <plat/devs.h> 25 27 #include <plat/sdhci.h> 28 + #include <plat/iic.h> 29 + #include <plat/pd.h> 26 30 27 31 #include <mach/map.h> 28 - #include <mach/regs-srom.h> 29 32 30 33 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 34 #define SMDKC210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 142 139 }, 143 140 }; 144 141 142 + static struct i2c_board_info i2c_devs1[] __initdata = { 143 + {I2C_BOARD_INFO("wm8994", 0x1a),}, 144 + }; 145 + 145 146 static struct platform_device *smdkc210_devices[] __initdata = { 146 147 &s3c_device_hsmmc0, 147 148 &s3c_device_hsmmc1, 148 149 &s3c_device_hsmmc2, 149 150 &s3c_device_hsmmc3, 151 + &s3c_device_i2c1, 150 152 &s3c_device_rtc, 151 153 &s3c_device_wdt, 154 + &s5pv310_device_ac97, 155 + &s5pv310_device_i2s0, 156 + &s5pv310_device_pd[PD_MFC], 157 + &s5pv310_device_pd[PD_G3D], 158 + &s5pv310_device_pd[PD_LCD0], 159 + &s5pv310_device_pd[PD_LCD1], 160 + &s5pv310_device_pd[PD_CAM], 161 + &s5pv310_device_pd[PD_TV], 162 + &s5pv310_device_pd[PD_GPS], 152 163 &smdkc210_smsc911x, 164 + &s5pv310_device_sysmmu, 153 165 }; 154 166 155 167 static void __init smdkc210_smsc911x_init(void) ··· 172 154 u32 cs1; 173 155 174 156 /* configure nCS1 width to 16 bits */ 175 - cs1 = __raw_readl(S5PV310_SROM_BW) & 176 - ~(S5PV310_SROM_BW__CS_MASK << 177 - S5PV310_SROM_BW__NCS1__SHIFT); 178 - cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 179 - (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 180 - (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 181 - S5PV310_SROM_BW__NCS1__SHIFT; 182 - __raw_writel(cs1, S5PV310_SROM_BW); 157 + cs1 = __raw_readl(S5P_SROM_BW) & 158 + ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT); 159 + cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) | 160 + (1 << S5P_SROM_BW__WAITENABLE__SHIFT) | 161 + (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) << 162 + S5P_SROM_BW__NCS1__SHIFT; 163 + __raw_writel(cs1, S5P_SROM_BW); 183 164 184 165 /* set timing for nCS1 suitable for ethernet chip */ 185 - __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 186 - (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 187 - (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 188 - (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 189 - (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 190 - (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 191 - (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 166 + __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) | 167 + (0x9 << S5P_SROM_BCX__TACP__SHIFT) | 168 + (0xc << S5P_SROM_BCX__TCAH__SHIFT) | 169 + (0x1 << S5P_SROM_BCX__TCOH__SHIFT) | 170 + (0x6 << S5P_SROM_BCX__TACC__SHIFT) | 171 + (0x1 << S5P_SROM_BCX__TCOS__SHIFT) | 172 + (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); 192 173 } 193 174 194 175 static void __init smdkc210_map_io(void) ··· 199 182 200 183 static void __init smdkc210_machine_init(void) 201 184 { 185 + s3c_i2c1_set_platdata(NULL); 186 + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 187 + 202 188 smdkc210_smsc911x_init(); 203 189 204 190 s3c_sdhci0_set_platdata(&smdkc210_hsmmc0_pdata);
+36 -16
arch/arm/mach-s5pv310/mach-smdkv310.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/smsc911x.h> 16 16 #include <linux/io.h> 17 + #include <linux/i2c.h> 17 18 18 19 #include <asm/mach/arch.h> 19 20 #include <asm/mach-types.h> 20 21 21 22 #include <plat/regs-serial.h> 23 + #include <plat/regs-srom.h> 22 24 #include <plat/s5pv310.h> 23 25 #include <plat/cpu.h> 24 26 #include <plat/devs.h> 25 27 #include <plat/sdhci.h> 28 + #include <plat/iic.h> 29 + #include <plat/pd.h> 26 30 27 31 #include <mach/map.h> 28 - #include <mach/regs-srom.h> 29 32 30 33 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 34 #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 142 139 }, 143 140 }; 144 141 142 + static struct i2c_board_info i2c_devs1[] __initdata = { 143 + {I2C_BOARD_INFO("wm8994", 0x1a),}, 144 + }; 145 + 145 146 static struct platform_device *smdkv310_devices[] __initdata = { 146 147 &s3c_device_hsmmc0, 147 148 &s3c_device_hsmmc1, 148 149 &s3c_device_hsmmc2, 149 150 &s3c_device_hsmmc3, 151 + &s3c_device_i2c1, 150 152 &s3c_device_rtc, 151 153 &s3c_device_wdt, 154 + &s5pv310_device_ac97, 155 + &s5pv310_device_i2s0, 156 + &s5pv310_device_pd[PD_MFC], 157 + &s5pv310_device_pd[PD_G3D], 158 + &s5pv310_device_pd[PD_LCD0], 159 + &s5pv310_device_pd[PD_LCD1], 160 + &s5pv310_device_pd[PD_CAM], 161 + &s5pv310_device_pd[PD_TV], 162 + &s5pv310_device_pd[PD_GPS], 152 163 &smdkv310_smsc911x, 164 + &s5pv310_device_sysmmu, 153 165 }; 154 166 155 167 static void __init smdkv310_smsc911x_init(void) ··· 172 154 u32 cs1; 173 155 174 156 /* configure nCS1 width to 16 bits */ 175 - cs1 = __raw_readl(S5PV310_SROM_BW) & 176 - ~(S5PV310_SROM_BW__CS_MASK << 177 - S5PV310_SROM_BW__NCS1__SHIFT); 178 - cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 179 - (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 180 - (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 181 - S5PV310_SROM_BW__NCS1__SHIFT; 182 - __raw_writel(cs1, S5PV310_SROM_BW); 157 + cs1 = __raw_readl(S5P_SROM_BW) & 158 + ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT); 159 + cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) | 160 + (1 << S5P_SROM_BW__WAITENABLE__SHIFT) | 161 + (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) << 162 + S5P_SROM_BW__NCS1__SHIFT; 163 + __raw_writel(cs1, S5P_SROM_BW); 183 164 184 165 /* set timing for nCS1 suitable for ethernet chip */ 185 - __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 186 - (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 187 - (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 188 - (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 189 - (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 190 - (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 191 - (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 166 + __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) | 167 + (0x9 << S5P_SROM_BCX__TACP__SHIFT) | 168 + (0xc << S5P_SROM_BCX__TCAH__SHIFT) | 169 + (0x1 << S5P_SROM_BCX__TCOH__SHIFT) | 170 + (0x6 << S5P_SROM_BCX__TACC__SHIFT) | 171 + (0x1 << S5P_SROM_BCX__TCOS__SHIFT) | 172 + (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); 192 173 } 193 174 194 175 static void __init smdkv310_map_io(void) ··· 199 182 200 183 static void __init smdkv310_machine_init(void) 201 184 { 185 + s3c_i2c1_set_platdata(NULL); 186 + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 187 + 202 188 smdkv310_smsc911x_init(); 203 189 204 190 s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
+80
arch/arm/mach-s5pv310/mach-universal_c210.c
··· 13 13 #include <linux/i2c.h> 14 14 #include <linux/gpio_keys.h> 15 15 #include <linux/gpio.h> 16 + #include <linux/regulator/machine.h> 17 + #include <linux/regulator/fixed.h> 18 + #include <linux/mmc/host.h> 16 19 17 20 #include <asm/mach/arch.h> 18 21 #include <asm/mach-types.h> ··· 24 21 #include <plat/s5pv310.h> 25 22 #include <plat/cpu.h> 26 23 #include <plat/devs.h> 24 + #include <plat/sdhci.h> 27 25 28 26 #include <mach/map.h> 29 27 ··· 120 116 }, 121 117 }; 122 118 119 + /* eMMC */ 120 + static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = { 121 + .max_width = 8, 122 + .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | 123 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 124 + MMC_CAP_DISABLE), 125 + .cd_type = S3C_SDHCI_CD_PERMANENT, 126 + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 127 + }; 128 + 129 + static struct regulator_consumer_supply mmc0_supplies[] = { 130 + REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), 131 + }; 132 + 133 + static struct regulator_init_data mmc0_fixed_voltage_init_data = { 134 + .constraints = { 135 + .name = "VMEM_VDD_2.8V", 136 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 137 + }, 138 + .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies), 139 + .consumer_supplies = mmc0_supplies, 140 + }; 141 + 142 + static struct fixed_voltage_config mmc0_fixed_voltage_config = { 143 + .supply_name = "MASSMEMORY_EN", 144 + .microvolts = 2800000, 145 + .gpio = S5PV310_GPE1(3), 146 + .enable_high = true, 147 + .init_data = &mmc0_fixed_voltage_init_data, 148 + }; 149 + 150 + static struct platform_device mmc0_fixed_voltage = { 151 + .name = "reg-fixed-voltage", 152 + .id = 0, 153 + .dev = { 154 + .platform_data = &mmc0_fixed_voltage_config, 155 + }, 156 + }; 157 + 158 + /* SD */ 159 + static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = { 160 + .max_width = 4, 161 + .host_caps = MMC_CAP_4_BIT_DATA | 162 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 163 + MMC_CAP_DISABLE, 164 + .ext_cd_gpio = S5PV310_GPX3(4), /* XEINT_28 */ 165 + .ext_cd_gpio_invert = 1, 166 + .cd_type = S3C_SDHCI_CD_GPIO, 167 + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 168 + }; 169 + 170 + /* WiFi */ 171 + static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = { 172 + .max_width = 4, 173 + .host_caps = MMC_CAP_4_BIT_DATA | 174 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 175 + MMC_CAP_DISABLE, 176 + .cd_type = S3C_SDHCI_CD_EXTERNAL, 177 + }; 178 + 179 + static void __init universal_sdhci_init(void) 180 + { 181 + s3c_sdhci0_set_platdata(&universal_hsmmc0_data); 182 + s3c_sdhci2_set_platdata(&universal_hsmmc2_data); 183 + s3c_sdhci3_set_platdata(&universal_hsmmc3_data); 184 + } 185 + 123 186 /* I2C0 */ 124 187 static struct i2c_board_info i2c0_devs[] __initdata = { 125 188 /* Camera, To be updated */ ··· 198 127 }; 199 128 200 129 static struct platform_device *universal_devices[] __initdata = { 130 + /* Samsung Platform Devices */ 131 + &mmc0_fixed_voltage, 132 + &s3c_device_hsmmc0, 133 + &s3c_device_hsmmc2, 134 + &s3c_device_hsmmc3, 135 + 136 + /* Universal Devices */ 201 137 &universal_gpio_keys, 202 138 &s5p_device_onenand, 203 139 }; ··· 218 140 219 141 static void __init universal_machine_init(void) 220 142 { 143 + universal_sdhci_init(); 144 + 221 145 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); 222 146 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 223 147
+42 -42
arch/arm/mach-sa1100/irq.c
··· 37 37 #define GPIO_11_27_IRQ(i) ((i) - 21) 38 38 #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) 39 39 40 - static int sa1100_gpio_type(unsigned int irq, unsigned int type) 40 + static int sa1100_gpio_type(struct irq_data *d, unsigned int type) 41 41 { 42 42 unsigned int mask; 43 43 44 - if (irq <= 10) 45 - mask = 1 << irq; 44 + if (d->irq <= 10) 45 + mask = 1 << d->irq; 46 46 else 47 - mask = GPIO11_27_MASK(irq); 47 + mask = GPIO11_27_MASK(d->irq); 48 48 49 49 if (type == IRQ_TYPE_PROBE) { 50 50 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) ··· 70 70 /* 71 71 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10. 72 72 */ 73 - static void sa1100_low_gpio_ack(unsigned int irq) 73 + static void sa1100_low_gpio_ack(struct irq_data *d) 74 74 { 75 - GEDR = (1 << irq); 75 + GEDR = (1 << d->irq); 76 76 } 77 77 78 - static void sa1100_low_gpio_mask(unsigned int irq) 78 + static void sa1100_low_gpio_mask(struct irq_data *d) 79 79 { 80 - ICMR &= ~(1 << irq); 80 + ICMR &= ~(1 << d->irq); 81 81 } 82 82 83 - static void sa1100_low_gpio_unmask(unsigned int irq) 83 + static void sa1100_low_gpio_unmask(struct irq_data *d) 84 84 { 85 - ICMR |= 1 << irq; 85 + ICMR |= 1 << d->irq; 86 86 } 87 87 88 - static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on) 88 + static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on) 89 89 { 90 90 if (on) 91 - PWER |= 1 << irq; 91 + PWER |= 1 << d->irq; 92 92 else 93 - PWER &= ~(1 << irq); 93 + PWER &= ~(1 << d->irq); 94 94 return 0; 95 95 } 96 96 97 97 static struct irq_chip sa1100_low_gpio_chip = { 98 98 .name = "GPIO-l", 99 - .ack = sa1100_low_gpio_ack, 100 - .mask = sa1100_low_gpio_mask, 101 - .unmask = sa1100_low_gpio_unmask, 102 - .set_type = sa1100_gpio_type, 103 - .set_wake = sa1100_low_gpio_wake, 99 + .irq_ack = sa1100_low_gpio_ack, 100 + .irq_mask = sa1100_low_gpio_mask, 101 + .irq_unmask = sa1100_low_gpio_unmask, 102 + .irq_set_type = sa1100_gpio_type, 103 + .irq_set_wake = sa1100_low_gpio_wake, 104 104 }; 105 105 106 106 /* ··· 139 139 * In addition, the IRQs are all collected up into one bit in the 140 140 * interrupt controller registers. 141 141 */ 142 - static void sa1100_high_gpio_ack(unsigned int irq) 142 + static void sa1100_high_gpio_ack(struct irq_data *d) 143 143 { 144 - unsigned int mask = GPIO11_27_MASK(irq); 144 + unsigned int mask = GPIO11_27_MASK(d->irq); 145 145 146 146 GEDR = mask; 147 147 } 148 148 149 - static void sa1100_high_gpio_mask(unsigned int irq) 149 + static void sa1100_high_gpio_mask(struct irq_data *d) 150 150 { 151 - unsigned int mask = GPIO11_27_MASK(irq); 151 + unsigned int mask = GPIO11_27_MASK(d->irq); 152 152 153 153 GPIO_IRQ_mask &= ~mask; 154 154 ··· 156 156 GFER &= ~mask; 157 157 } 158 158 159 - static void sa1100_high_gpio_unmask(unsigned int irq) 159 + static void sa1100_high_gpio_unmask(struct irq_data *d) 160 160 { 161 - unsigned int mask = GPIO11_27_MASK(irq); 161 + unsigned int mask = GPIO11_27_MASK(d->irq); 162 162 163 163 GPIO_IRQ_mask |= mask; 164 164 ··· 166 166 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; 167 167 } 168 168 169 - static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on) 169 + static int sa1100_high_gpio_wake(struct irq_data *d, unsigned int on) 170 170 { 171 171 if (on) 172 - PWER |= GPIO11_27_MASK(irq); 172 + PWER |= GPIO11_27_MASK(d->irq); 173 173 else 174 - PWER &= ~GPIO11_27_MASK(irq); 174 + PWER &= ~GPIO11_27_MASK(d->irq); 175 175 return 0; 176 176 } 177 177 178 178 static struct irq_chip sa1100_high_gpio_chip = { 179 179 .name = "GPIO-h", 180 - .ack = sa1100_high_gpio_ack, 181 - .mask = sa1100_high_gpio_mask, 182 - .unmask = sa1100_high_gpio_unmask, 183 - .set_type = sa1100_gpio_type, 184 - .set_wake = sa1100_high_gpio_wake, 180 + .irq_ack = sa1100_high_gpio_ack, 181 + .irq_mask = sa1100_high_gpio_mask, 182 + .irq_unmask = sa1100_high_gpio_unmask, 183 + .irq_set_type = sa1100_gpio_type, 184 + .irq_set_wake = sa1100_high_gpio_wake, 185 185 }; 186 186 187 187 /* 188 188 * We don't need to ACK IRQs on the SA1100 unless they're GPIOs 189 189 * this is for internal IRQs i.e. from 11 to 31. 190 190 */ 191 - static void sa1100_mask_irq(unsigned int irq) 191 + static void sa1100_mask_irq(struct irq_data *d) 192 192 { 193 - ICMR &= ~(1 << irq); 193 + ICMR &= ~(1 << d->irq); 194 194 } 195 195 196 - static void sa1100_unmask_irq(unsigned int irq) 196 + static void sa1100_unmask_irq(struct irq_data *d) 197 197 { 198 - ICMR |= (1 << irq); 198 + ICMR |= (1 << d->irq); 199 199 } 200 200 201 201 /* 202 202 * Apart form GPIOs, only the RTC alarm can be a wakeup event. 203 203 */ 204 - static int sa1100_set_wake(unsigned int irq, unsigned int on) 204 + static int sa1100_set_wake(struct irq_data *d, unsigned int on) 205 205 { 206 - if (irq == IRQ_RTCAlrm) { 206 + if (d->irq == IRQ_RTCAlrm) { 207 207 if (on) 208 208 PWER |= PWER_RTC; 209 209 else ··· 215 215 216 216 static struct irq_chip sa1100_normal_chip = { 217 217 .name = "SC", 218 - .ack = sa1100_mask_irq, 219 - .mask = sa1100_mask_irq, 220 - .unmask = sa1100_unmask_irq, 221 - .set_wake = sa1100_set_wake, 218 + .irq_ack = sa1100_mask_irq, 219 + .irq_mask = sa1100_mask_irq, 220 + .irq_unmask = sa1100_unmask_irq, 221 + .irq_set_wake = sa1100_set_wake, 222 222 }; 223 223 224 224 static struct resource irq_resource = {
+4 -4
arch/arm/mach-sa1100/neponset.c
··· 35 35 /* 36 36 * Acknowledge the parent IRQ. 37 37 */ 38 - desc->chip->ack(irq); 38 + desc->irq_data.chip->irq_ack(&desc->irq_data); 39 39 40 40 /* 41 41 * Read the interrupt reason register. Let's have all ··· 53 53 * recheck the register for any pending IRQs. 54 54 */ 55 55 if (irr & (IRR_ETHERNET | IRR_USAR)) { 56 - desc->chip->mask(irq); 56 + desc->irq_data.chip->irq_mask(&desc->irq_data); 57 57 58 58 /* 59 59 * Ack the interrupt now to prevent re-entering ··· 61 61 * since we'll check the IRR register prior to 62 62 * leaving. 63 63 */ 64 - desc->chip->ack(irq); 64 + desc->irq_data.chip->irq_ack(&desc->irq_data); 65 65 66 66 if (irr & IRR_ETHERNET) { 67 67 generic_handle_irq(IRQ_NEPONSET_SMC9196); ··· 71 71 generic_handle_irq(IRQ_NEPONSET_USAR); 72 72 } 73 73 74 - desc->chip->unmask(irq); 74 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 75 75 } 76 76 77 77 if (irr & IRR_SA1111) {
+13 -13
arch/arm/mach-shark/irq.c
··· 30 30 * These have to be protected by the irq controller spinlock 31 31 * before being called. 32 32 */ 33 - static void shark_disable_8259A_irq(unsigned int irq) 33 + static void shark_disable_8259A_irq(struct irq_data *d) 34 34 { 35 35 unsigned int mask; 36 - if (irq<8) { 37 - mask = 1 << irq; 36 + if (d->irq<8) { 37 + mask = 1 << d->irq; 38 38 cached_irq_mask[0] |= mask; 39 39 outb(cached_irq_mask[1],0xA1); 40 40 } else { 41 - mask = 1 << (irq-8); 41 + mask = 1 << (d->irq-8); 42 42 cached_irq_mask[1] |= mask; 43 43 outb(cached_irq_mask[0],0x21); 44 44 } 45 45 } 46 46 47 - static void shark_enable_8259A_irq(unsigned int irq) 47 + static void shark_enable_8259A_irq(struct irq_data *d) 48 48 { 49 49 unsigned int mask; 50 - if (irq<8) { 51 - mask = ~(1 << irq); 50 + if (d->irq<8) { 51 + mask = ~(1 << d->irq); 52 52 cached_irq_mask[0] &= mask; 53 53 outb(cached_irq_mask[0],0x21); 54 54 } else { 55 - mask = ~(1 << (irq-8)); 55 + mask = ~(1 << (d->irq-8)); 56 56 cached_irq_mask[1] &= mask; 57 57 outb(cached_irq_mask[1],0xA1); 58 58 } 59 59 } 60 60 61 - static void shark_ack_8259A_irq(unsigned int irq){} 61 + static void shark_ack_8259A_irq(struct irq_data *d){} 62 62 63 63 static irqreturn_t bogus_int(int irq, void *dev_id) 64 64 { ··· 69 69 static struct irqaction cascade; 70 70 71 71 static struct irq_chip fb_chip = { 72 - .name = "XT-PIC", 73 - .ack = shark_ack_8259A_irq, 74 - .mask = shark_disable_8259A_irq, 75 - .unmask = shark_enable_8259A_irq, 72 + .name = "XT-PIC", 73 + .irq_ack = shark_ack_8259A_irq, 74 + .irq_mask = shark_disable_8259A_irq, 75 + .irq_unmask = shark_enable_8259A_irq, 76 76 }; 77 77 78 78 void __init shark_init_irq(void)
+8 -8
arch/arm/mach-stmp378x/stmp378x.c
··· 47 47 /* 48 48 * IRQ handling 49 49 */ 50 - static void stmp378x_ack_irq(unsigned int irq) 50 + static void stmp378x_ack_irq(struct irq_data *d) 51 51 { 52 52 /* Tell ICOLL to release IRQ line */ 53 53 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR); ··· 60 60 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 61 61 } 62 62 63 - static void stmp378x_mask_irq(unsigned int irq) 63 + static void stmp378x_mask_irq(struct irq_data *d) 64 64 { 65 65 /* IRQ disable */ 66 66 stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE, 67 - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); 67 + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10); 68 68 } 69 69 70 - static void stmp378x_unmask_irq(unsigned int irq) 70 + static void stmp378x_unmask_irq(struct irq_data *d) 71 71 { 72 72 /* IRQ enable */ 73 73 stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE, 74 - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); 74 + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10); 75 75 } 76 76 77 77 static struct irq_chip stmp378x_chip = { 78 - .ack = stmp378x_ack_irq, 79 - .mask = stmp378x_mask_irq, 80 - .unmask = stmp378x_unmask_irq, 78 + .irq_ack = stmp378x_ack_irq, 79 + .irq_mask = stmp378x_mask_irq, 80 + .irq_unmask = stmp378x_unmask_irq, 81 81 }; 82 82 83 83 void __init stmp378x_init_irq(void)
+12 -12
arch/arm/mach-stmp37xx/stmp37xx.c
··· 43 43 /* 44 44 * IRQ handling 45 45 */ 46 - static void stmp37xx_ack_irq(unsigned int irq) 46 + static void stmp37xx_ack_irq(struct irq_data *d) 47 47 { 48 48 /* Disable IRQ */ 49 - stmp3xxx_clearl(0x04 << ((irq % 4) * 8), 50 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 49 + stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8), 50 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 51 51 52 52 /* ACK current interrupt */ 53 53 __raw_writel(1, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK); ··· 56 56 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 57 57 } 58 58 59 - static void stmp37xx_mask_irq(unsigned int irq) 59 + static void stmp37xx_mask_irq(struct irq_data *d) 60 60 { 61 61 /* IRQ disable */ 62 - stmp3xxx_clearl(0x04 << ((irq % 4) * 8), 63 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 62 + stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8), 63 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 64 64 } 65 65 66 - static void stmp37xx_unmask_irq(unsigned int irq) 66 + static void stmp37xx_unmask_irq(struct irq_data *d) 67 67 { 68 68 /* IRQ enable */ 69 - stmp3xxx_setl(0x04 << ((irq % 4) * 8), 70 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 69 + stmp3xxx_setl(0x04 << ((d->irq % 4) * 8), 70 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 71 71 } 72 72 73 73 static struct irq_chip stmp37xx_chip = { 74 - .ack = stmp37xx_ack_irq, 75 - .mask = stmp37xx_mask_irq, 76 - .unmask = stmp37xx_unmask_irq, 74 + .irq_ack = stmp37xx_ack_irq, 75 + .irq_mask = stmp37xx_mask_irq, 76 + .irq_unmask = stmp37xx_unmask_irq, 77 77 }; 78 78 79 79 void __init stmp37xx_init_irq(void)
+28 -28
arch/arm/mach-tcc8k/irq.c
··· 18 18 #include "common.h" 19 19 20 20 /* Disable IRQ */ 21 - static void tcc8000_mask_ack_irq0(unsigned int irq) 21 + static void tcc8000_mask_ack_irq0(struct irq_data *d) 22 22 { 23 - PIC0_IEN &= ~(1 << irq); 24 - PIC0_CREQ |= (1 << irq); 23 + PIC0_IEN &= ~(1 << d->irq); 24 + PIC0_CREQ |= (1 << d->irq); 25 25 } 26 26 27 - static void tcc8000_mask_ack_irq1(unsigned int irq) 27 + static void tcc8000_mask_ack_irq1(struct irq_data *d) 28 28 { 29 - PIC1_IEN &= ~(1 << (irq - 32)); 30 - PIC1_CREQ |= (1 << (irq - 32)); 29 + PIC1_IEN &= ~(1 << (d->irq - 32)); 30 + PIC1_CREQ |= (1 << (d->irq - 32)); 31 31 } 32 32 33 - static void tcc8000_mask_irq0(unsigned int irq) 33 + static void tcc8000_mask_irq0(struct irq_data *d) 34 34 { 35 - PIC0_IEN &= ~(1 << irq); 35 + PIC0_IEN &= ~(1 << d->irq); 36 36 } 37 37 38 - static void tcc8000_mask_irq1(unsigned int irq) 38 + static void tcc8000_mask_irq1(struct irq_data *d) 39 39 { 40 - PIC1_IEN &= ~(1 << (irq - 32)); 40 + PIC1_IEN &= ~(1 << (d->irq - 32)); 41 41 } 42 42 43 - static void tcc8000_ack_irq0(unsigned int irq) 43 + static void tcc8000_ack_irq0(struct irq_data *d) 44 44 { 45 - PIC0_CREQ |= (1 << irq); 45 + PIC0_CREQ |= (1 << d->irq); 46 46 } 47 47 48 - static void tcc8000_ack_irq1(unsigned int irq) 48 + static void tcc8000_ack_irq1(struct irq_data *d) 49 49 { 50 - PIC1_CREQ |= (1 << (irq - 32)); 50 + PIC1_CREQ |= (1 << (d->irq - 32)); 51 51 } 52 52 53 53 /* Enable IRQ */ 54 - static void tcc8000_unmask_irq0(unsigned int irq) 54 + static void tcc8000_unmask_irq0(struct irq_data *d) 55 55 { 56 - PIC0_IEN |= (1 << irq); 57 - PIC0_INTOEN |= (1 << irq); 56 + PIC0_IEN |= (1 << d->irq); 57 + PIC0_INTOEN |= (1 << d->irq); 58 58 } 59 59 60 - static void tcc8000_unmask_irq1(unsigned int irq) 60 + static void tcc8000_unmask_irq1(struct irq_data *d) 61 61 { 62 - PIC1_IEN |= (1 << (irq - 32)); 63 - PIC1_INTOEN |= (1 << (irq - 32)); 62 + PIC1_IEN |= (1 << (d->irq - 32)); 63 + PIC1_INTOEN |= (1 << (d->irq - 32)); 64 64 } 65 65 66 66 static struct irq_chip tcc8000_irq_chip0 = { 67 67 .name = "tcc_irq0", 68 - .mask = tcc8000_mask_irq0, 69 - .ack = tcc8000_ack_irq0, 70 - .mask_ack = tcc8000_mask_ack_irq0, 71 - .unmask = tcc8000_unmask_irq0, 68 + .irq_mask = tcc8000_mask_irq0, 69 + .irq_ack = tcc8000_ack_irq0, 70 + .irq_mask_ack = tcc8000_mask_ack_irq0, 71 + .irq_unmask = tcc8000_unmask_irq0, 72 72 }; 73 73 74 74 static struct irq_chip tcc8000_irq_chip1 = { 75 75 .name = "tcc_irq1", 76 - .mask = tcc8000_mask_irq1, 77 - .ack = tcc8000_ack_irq1, 78 - .mask_ack = tcc8000_mask_ack_irq1, 79 - .unmask = tcc8000_unmask_irq1, 76 + .irq_mask = tcc8000_mask_irq1, 77 + .irq_ack = tcc8000_ack_irq1, 78 + .irq_mask_ack = tcc8000_mask_ack_irq1, 79 + .irq_unmask = tcc8000_unmask_irq1, 80 80 }; 81 81 82 82 void __init tcc8k_init_irq(void)
+19 -19
arch/arm/mach-tegra/gpio.c
··· 142 142 .ngpio = TEGRA_NR_GPIOS, 143 143 }; 144 144 145 - static void tegra_gpio_irq_ack(unsigned int irq) 145 + static void tegra_gpio_irq_ack(struct irq_data *d) 146 146 { 147 - int gpio = irq - INT_GPIO_BASE; 147 + int gpio = d->irq - INT_GPIO_BASE; 148 148 149 149 __raw_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); 150 150 } 151 151 152 - static void tegra_gpio_irq_mask(unsigned int irq) 152 + static void tegra_gpio_irq_mask(struct irq_data *d) 153 153 { 154 - int gpio = irq - INT_GPIO_BASE; 154 + int gpio = d->irq - INT_GPIO_BASE; 155 155 156 156 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); 157 157 } 158 158 159 - static void tegra_gpio_irq_unmask(unsigned int irq) 159 + static void tegra_gpio_irq_unmask(struct irq_data *d) 160 160 { 161 - int gpio = irq - INT_GPIO_BASE; 161 + int gpio = d->irq - INT_GPIO_BASE; 162 162 163 163 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); 164 164 } 165 165 166 - static int tegra_gpio_irq_set_type(unsigned int irq, unsigned int type) 166 + static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) 167 167 { 168 - int gpio = irq - INT_GPIO_BASE; 169 - struct tegra_gpio_bank *bank = get_irq_chip_data(irq); 168 + int gpio = d->irq - INT_GPIO_BASE; 169 + struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 170 170 int port = GPIO_PORT(gpio); 171 171 int lvl_type; 172 172 int val; ··· 221 221 int pin; 222 222 int unmasked = 0; 223 223 224 - desc->chip->ack(irq); 224 + desc->irq_data.chip->irq_ack(&desc->irq_data); 225 225 226 226 bank = get_irq_data(irq); 227 227 ··· 240 240 */ 241 241 if (lvl & (0x100 << pin)) { 242 242 unmasked = 1; 243 - desc->chip->unmask(irq); 243 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 244 244 } 245 245 246 246 generic_handle_irq(gpio_to_irq(gpio + pin)); ··· 248 248 } 249 249 250 250 if (!unmasked) 251 - desc->chip->unmask(irq); 251 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 252 252 253 253 } 254 254 ··· 316 316 local_irq_restore(flags); 317 317 } 318 318 319 - static int tegra_gpio_wake_enable(unsigned int irq, unsigned int enable) 319 + static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable) 320 320 { 321 - struct tegra_gpio_bank *bank = get_irq_chip_data(irq); 321 + struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 322 322 return set_irq_wake(bank->irq, enable); 323 323 } 324 324 #endif 325 325 326 326 static struct irq_chip tegra_gpio_irq_chip = { 327 327 .name = "GPIO", 328 - .ack = tegra_gpio_irq_ack, 329 - .mask = tegra_gpio_irq_mask, 330 - .unmask = tegra_gpio_irq_unmask, 331 - .set_type = tegra_gpio_irq_set_type, 328 + .irq_ack = tegra_gpio_irq_ack, 329 + .irq_mask = tegra_gpio_irq_mask, 330 + .irq_unmask = tegra_gpio_irq_unmask, 331 + .irq_set_type = tegra_gpio_irq_set_type, 332 332 #ifdef CONFIG_PM 333 - .set_wake = tegra_gpio_wake_enable, 333 + .irq_set_wake = tegra_gpio_wake_enable, 334 334 #endif 335 335 }; 336 336
+18 -18
arch/arm/mach-tegra/irq.c
··· 46 46 #define ICTLR_COP_IER_CLR 0x38 47 47 #define ICTLR_COP_IEP_CLASS 0x3c 48 48 49 - static void (*gic_mask_irq)(unsigned int irq); 50 - static void (*gic_unmask_irq)(unsigned int irq); 49 + static void (*gic_mask_irq)(struct irq_data *d); 50 + static void (*gic_unmask_irq)(struct irq_data *d); 51 51 52 52 #define irq_to_ictlr(irq) (((irq)-32) >> 5) 53 53 static void __iomem *tegra_ictlr_base = IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE); 54 54 #define ictlr_to_virt(ictlr) (tegra_ictlr_base + (ictlr)*0x100) 55 55 56 - static void tegra_mask(unsigned int irq) 56 + static void tegra_mask(struct irq_data *d) 57 57 { 58 - void __iomem *addr = ictlr_to_virt(irq_to_ictlr(irq)); 59 - gic_mask_irq(irq); 60 - writel(1<<(irq&31), addr+ICTLR_CPU_IER_CLR); 58 + void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 59 + gic_mask_irq(d); 60 + writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_CLR); 61 61 } 62 62 63 - static void tegra_unmask(unsigned int irq) 63 + static void tegra_unmask(struct irq_data *d) 64 64 { 65 - void __iomem *addr = ictlr_to_virt(irq_to_ictlr(irq)); 66 - gic_unmask_irq(irq); 67 - writel(1<<(irq&31), addr+ICTLR_CPU_IER_SET); 65 + void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 66 + gic_unmask_irq(d); 67 + writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_SET); 68 68 } 69 69 70 70 #ifdef CONFIG_PM 71 71 72 - static int tegra_set_wake(unsigned int irq, unsigned int on) 72 + static int tegra_set_wake(struct irq_data *d, unsigned int on) 73 73 { 74 74 return 0; 75 75 } ··· 77 77 78 78 static struct irq_chip tegra_irq = { 79 79 .name = "PPI", 80 - .mask = tegra_mask, 81 - .unmask = tegra_unmask, 80 + .irq_mask = tegra_mask, 81 + .irq_unmask = tegra_unmask, 82 82 #ifdef CONFIG_PM 83 - .set_wake = tegra_set_wake, 83 + .irq_set_wake = tegra_set_wake, 84 84 #endif 85 85 }; 86 86 ··· 98 98 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 99 99 100 100 gic = get_irq_chip(29); 101 - gic_unmask_irq = gic->unmask; 102 - gic_mask_irq = gic->mask; 103 - tegra_irq.ack = gic->ack; 101 + gic_unmask_irq = gic->irq_unmask; 102 + gic_mask_irq = gic->irq_mask; 103 + tegra_irq.irq_ack = gic->irq_ack; 104 104 #ifdef CONFIG_SMP 105 - tegra_irq.set_affinity = gic->set_affinity; 105 + tegra_irq.irq_set_affinity = gic->irq_set_affinity; 106 106 #endif 107 107 108 108 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) {
+10 -8
arch/arm/mach-versatile/core.c
··· 63 63 #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 64 64 #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 65 65 66 - static void sic_mask_irq(unsigned int irq) 66 + static void sic_mask_irq(struct irq_data *d) 67 67 { 68 - irq -= IRQ_SIC_START; 68 + unsigned int irq = d->irq - IRQ_SIC_START; 69 + 69 70 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 70 71 } 71 72 72 - static void sic_unmask_irq(unsigned int irq) 73 + static void sic_unmask_irq(struct irq_data *d) 73 74 { 74 - irq -= IRQ_SIC_START; 75 + unsigned int irq = d->irq - IRQ_SIC_START; 76 + 75 77 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET); 76 78 } 77 79 78 80 static struct irq_chip sic_chip = { 79 - .name = "SIC", 80 - .ack = sic_mask_irq, 81 - .mask = sic_mask_irq, 82 - .unmask = sic_unmask_irq, 81 + .name = "SIC", 82 + .irq_ack = sic_mask_irq, 83 + .irq_mask = sic_mask_irq, 84 + .irq_unmask = sic_unmask_irq, 83 85 }; 84 86 85 87 static void
+10 -10
arch/arm/mach-w90x900/irq.c
··· 92 92 __raw_writel(regval, REG_AIC_GEN); 93 93 } 94 94 95 - static void nuc900_irq_mask(unsigned int irq) 95 + static void nuc900_irq_mask(struct irq_data *d) 96 96 { 97 97 struct group_irq *group_irq; 98 98 99 99 group_irq = NULL; 100 100 101 - __raw_writel(1 << irq, REG_AIC_MDCR); 101 + __raw_writel(1 << d->irq, REG_AIC_MDCR); 102 102 103 - switch (irq) { 103 + switch (d->irq) { 104 104 case IRQ_GROUP0: 105 105 group_irq = &group_nirq0; 106 106 break; ··· 143 143 * to REG_AIC_EOSCR for ACK 144 144 */ 145 145 146 - static void nuc900_irq_ack(unsigned int irq) 146 + static void nuc900_irq_ack(struct irq_data *d) 147 147 { 148 148 __raw_writel(0x01, REG_AIC_EOSCR); 149 149 } 150 150 151 - static void nuc900_irq_unmask(unsigned int irq) 151 + static void nuc900_irq_unmask(struct irq_data *d) 152 152 { 153 153 struct group_irq *group_irq; 154 154 155 155 group_irq = NULL; 156 156 157 - __raw_writel(1 << irq, REG_AIC_MECR); 157 + __raw_writel(1 << d->irq, REG_AIC_MECR); 158 158 159 - switch (irq) { 159 + switch (d->irq) { 160 160 case IRQ_GROUP0: 161 161 group_irq = &group_nirq0; 162 162 break; ··· 195 195 } 196 196 197 197 static struct irq_chip nuc900_irq_chip = { 198 - .ack = nuc900_irq_ack, 199 - .mask = nuc900_irq_mask, 200 - .unmask = nuc900_irq_unmask, 198 + .irq_ack = nuc900_irq_ack, 199 + .irq_mask = nuc900_irq_mask, 200 + .irq_unmask = nuc900_irq_unmask, 201 201 }; 202 202 203 203 void __init nuc900_init_irq(void)
+14 -14
arch/arm/plat-mxc/3ds_debugboard.c
··· 60 60 #define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) 61 61 62 62 static void __iomem *brd_io; 63 - static void expio_ack_irq(u32 irq); 64 63 65 64 static struct resource smsc911x_resources[] = { 66 65 { ··· 92 93 u32 int_valid; 93 94 u32 expio_irq; 94 95 95 - desc->chip->mask(irq); /* irq = gpio irq number */ 96 + /* irq = gpio irq number */ 97 + desc->irq_data.chip->irq_mask(&desc->irq_data); 96 98 97 99 imr_val = __raw_readw(brd_io + INTR_MASK_REG); 98 100 int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; ··· 110 110 d->handle_irq(expio_irq, d); 111 111 } 112 112 113 - desc->chip->ack(irq); 114 - desc->chip->unmask(irq); 113 + desc->irq_data.chip->irq_ack(&desc->irq_data); 114 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 115 115 } 116 116 117 117 /* 118 118 * Disable an expio pin's interrupt by setting the bit in the imr. 119 119 * Irq is an expio virtual irq number 120 120 */ 121 - static void expio_mask_irq(u32 irq) 121 + static void expio_mask_irq(struct irq_data *d) 122 122 { 123 123 u16 reg; 124 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 124 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 125 125 126 126 reg = __raw_readw(brd_io + INTR_MASK_REG); 127 127 reg |= (1 << expio); 128 128 __raw_writew(reg, brd_io + INTR_MASK_REG); 129 129 } 130 130 131 - static void expio_ack_irq(u32 irq) 131 + static void expio_ack_irq(struct irq_data *d) 132 132 { 133 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 133 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 134 134 135 135 __raw_writew(1 << expio, brd_io + INTR_RESET_REG); 136 136 __raw_writew(0, brd_io + INTR_RESET_REG); 137 - expio_mask_irq(irq); 137 + expio_mask_irq(d); 138 138 } 139 139 140 - static void expio_unmask_irq(u32 irq) 140 + static void expio_unmask_irq(struct irq_data *d) 141 141 { 142 142 u16 reg; 143 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 143 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 144 144 145 145 reg = __raw_readw(brd_io + INTR_MASK_REG); 146 146 reg &= ~(1 << expio); ··· 148 148 } 149 149 150 150 static struct irq_chip expio_irq_chip = { 151 - .ack = expio_ack_irq, 152 - .mask = expio_mask_irq, 153 - .unmask = expio_unmask_irq, 151 + .irq_ack = expio_ack_irq, 152 + .irq_mask = expio_mask_irq, 153 + .irq_unmask = expio_unmask_irq, 154 154 }; 155 155 156 156 int __init mxc_expio_init(u32 base, u32 p_irq)
+7 -7
arch/arm/plat-mxc/avic.c
··· 89 89 #endif /* CONFIG_FIQ */ 90 90 91 91 /* Disable interrupt number "irq" in the AVIC */ 92 - static void mxc_mask_irq(unsigned int irq) 92 + static void mxc_mask_irq(struct irq_data *d) 93 93 { 94 - __raw_writel(irq, avic_base + AVIC_INTDISNUM); 94 + __raw_writel(d->irq, avic_base + AVIC_INTDISNUM); 95 95 } 96 96 97 97 /* Enable interrupt number "irq" in the AVIC */ 98 - static void mxc_unmask_irq(unsigned int irq) 98 + static void mxc_unmask_irq(struct irq_data *d) 99 99 { 100 - __raw_writel(irq, avic_base + AVIC_INTENNUM); 100 + __raw_writel(d->irq, avic_base + AVIC_INTENNUM); 101 101 } 102 102 103 103 static struct mxc_irq_chip mxc_avic_chip = { 104 104 .base = { 105 - .ack = mxc_mask_irq, 106 - .mask = mxc_mask_irq, 107 - .unmask = mxc_unmask_irq, 105 + .irq_ack = mxc_mask_irq, 106 + .irq_mask = mxc_mask_irq, 107 + .irq_unmask = mxc_unmask_irq, 108 108 }, 109 109 #ifdef CONFIG_MXC_IRQ_PRIOR 110 110 .set_priority = avic_irq_set_priority,
+1 -1
arch/arm/plat-mxc/devices/Kconfig
··· 1 1 config IMX_HAVE_PLATFORM_FEC 2 2 bool 3 - default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 3 + default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53 4 4 5 5 config IMX_HAVE_PLATFORM_FLEXCAN 6 6 select HAVE_CAN_FLEXCAN if CAN
+5
arch/arm/plat-mxc/devices/platform-fec.c
··· 36 36 imx_fec_data_entry_single(MX51); 37 37 #endif 38 38 39 + #ifdef CONFIG_SOC_IMX53 40 + const struct imx_fec_data imx53_fec_data __initconst = 41 + imx_fec_data_entry_single(MX53); 42 + #endif 43 + 39 44 struct platform_device *__init imx_add_fec( 40 45 const struct imx_fec_data *data, 41 46 const struct fec_platform_data *pdata)
+9
arch/arm/plat-mxc/devices/platform-imx-i2c.c
··· 78 78 }; 79 79 #endif /* ifdef CONFIG_SOC_IMX51 */ 80 80 81 + #ifdef CONFIG_SOC_IMX53 82 + const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = { 83 + #define imx53_imx_i2c_data_entry(_id, _hwid) \ 84 + imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K) 85 + imx53_imx_i2c_data_entry(0, 1), 86 + imx53_imx_i2c_data_entry(1, 2), 87 + }; 88 + #endif /* ifdef CONFIG_SOC_IMX51 */ 89 + 81 90 struct platform_device *__init imx_add_imx_i2c( 82 91 const struct imx_imx_i2c_data *data, 83 92 const struct imxi2c_platform_data *pdata)
+5
arch/arm/plat-mxc/devices/platform-imx-keypad.c
··· 41 41 imx_imx_keypad_data_entry_single(MX35, SZ_16); 42 42 #endif /* ifdef CONFIG_SOC_IMX35 */ 43 43 44 + #ifdef CONFIG_SOC_IMX51 45 + const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst = 46 + imx_imx_keypad_data_entry_single(MX51, SZ_16); 47 + #endif /* ifdef CONFIG_SOC_IMX51 */ 48 + 44 49 struct platform_device *__init imx_add_imx_keypad( 45 50 const struct imx_imx_keypad_data *data, 46 51 const struct matrix_keymap_data *pdata)
+9
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
··· 40 40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); 41 41 #endif /* ifdef CONFIG_SOC_IMX27 */ 42 42 43 + #ifdef CONFIG_SOC_IMX51 44 + const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { 45 + #define imx51_mxc_pwm_data_entry(_id, _hwid) \ 46 + imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K) 47 + imx51_mxc_pwm_data_entry(0, 1), 48 + imx51_mxc_pwm_data_entry(1, 2), 49 + }; 50 + #endif /* ifdef CONFIG_SOC_IMX51 */ 51 + 43 52 struct platform_device *__init imx_add_mxc_pwm( 44 53 const struct imx_mxc_pwm_data *data) 45 54 {
+12
arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
··· 53 53 }; 54 54 #endif /* ifdef CONFIG_SOC_IMX51 */ 55 55 56 + #ifdef CONFIG_SOC_IMX53 57 + const struct imx_sdhci_esdhc_imx_data 58 + imx53_sdhci_esdhc_imx_data[] __initconst = { 59 + #define imx53_sdhci_esdhc_imx_data_entry(_id, _hwid) \ 60 + imx_sdhci_esdhc_imx_data_entry(MX53, _id, _hwid) 61 + imx53_sdhci_esdhc_imx_data_entry(0, 1), 62 + imx53_sdhci_esdhc_imx_data_entry(1, 2), 63 + imx53_sdhci_esdhc_imx_data_entry(2, 3), 64 + imx53_sdhci_esdhc_imx_data_entry(3, 4), 65 + }; 66 + #endif /* ifdef CONFIG_SOC_IMX53 */ 67 + 56 68 struct platform_device *__init imx_add_sdhci_esdhc_imx( 57 69 const struct imx_sdhci_esdhc_imx_data *data, 58 70 const struct esdhc_platform_data *pdata)
+12
arch/arm/plat-mxc/devices/platform-spi_imx.c
··· 81 81 }; 82 82 #endif /* ifdef CONFIG_SOC_IMX51 */ 83 83 84 + #ifdef CONFIG_SOC_IMX53 85 + const struct imx_spi_imx_data imx53_cspi_data __initconst = 86 + imx_spi_imx_data_entry_single(MX53, CSPI, "imx53-cspi", 0, , SZ_4K); 87 + 88 + const struct imx_spi_imx_data imx53_ecspi_data[] __initconst = { 89 + #define imx53_ecspi_data_entry(_id, _hwid) \ 90 + imx_spi_imx_data_entry(MX53, ECSPI, "imx53-ecspi", _id, _hwid, SZ_4K) 91 + imx53_ecspi_data_entry(0, 1), 92 + imx53_ecspi_data_entry(1, 2), 93 + }; 94 + #endif /* ifdef CONFIG_SOC_IMX53 */ 95 + 84 96 struct platform_device *__init imx_add_spi_imx( 85 97 const struct imx_spi_imx_data *data, 86 98 const struct spi_imx_master *pdata)
+15 -15
arch/arm/plat-mxc/gpio.c
··· 63 63 __raw_writel(l, port->base + GPIO_IMR); 64 64 } 65 65 66 - static void gpio_ack_irq(u32 irq) 66 + static void gpio_ack_irq(struct irq_data *d) 67 67 { 68 - u32 gpio = irq_to_gpio(irq); 68 + u32 gpio = irq_to_gpio(d->irq); 69 69 _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f); 70 70 } 71 71 72 - static void gpio_mask_irq(u32 irq) 72 + static void gpio_mask_irq(struct irq_data *d) 73 73 { 74 - u32 gpio = irq_to_gpio(irq); 74 + u32 gpio = irq_to_gpio(d->irq); 75 75 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0); 76 76 } 77 77 78 - static void gpio_unmask_irq(u32 irq) 78 + static void gpio_unmask_irq(struct irq_data *d) 79 79 { 80 - u32 gpio = irq_to_gpio(irq); 80 + u32 gpio = irq_to_gpio(d->irq); 81 81 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); 82 82 } 83 83 84 84 static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset); 85 85 86 - static int gpio_set_irq_type(u32 irq, u32 type) 86 + static int gpio_set_irq_type(struct irq_data *d, u32 type) 87 87 { 88 - u32 gpio = irq_to_gpio(irq); 88 + u32 gpio = irq_to_gpio(d->irq); 89 89 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 90 90 u32 bit, val; 91 91 int edge; ··· 211 211 * @param enable enable as wake-up if equal to non-zero 212 212 * @return This function returns 0 on success. 213 213 */ 214 - static int gpio_set_wake_irq(u32 irq, u32 enable) 214 + static int gpio_set_wake_irq(struct irq_data *d, u32 enable) 215 215 { 216 - u32 gpio = irq_to_gpio(irq); 216 + u32 gpio = irq_to_gpio(d->irq); 217 217 u32 gpio_idx = gpio & 0x1F; 218 218 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 219 219 ··· 233 233 } 234 234 235 235 static struct irq_chip gpio_irq_chip = { 236 - .ack = gpio_ack_irq, 237 - .mask = gpio_mask_irq, 238 - .unmask = gpio_unmask_irq, 239 - .set_type = gpio_set_irq_type, 240 - .set_wake = gpio_set_wake_irq, 236 + .irq_ack = gpio_ack_irq, 237 + .irq_mask = gpio_mask_irq, 238 + .irq_unmask = gpio_unmask_irq, 239 + .irq_set_type = gpio_set_irq_type, 240 + .irq_set_wake = gpio_set_wake_irq, 241 241 }; 242 242 243 243 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+3 -1
arch/arm/plat-mxc/include/mach/iomux-mx53.h
··· 34 34 IOMUX_CONFIG_ALT6, 35 35 IOMUX_CONFIG_ALT7, 36 36 IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */ 37 - IOMUX_CONFIG_SION = 0x1 << 4, /* LOOPBACK:MUX SION bit */ 38 37 } iomux_pin_cfg_t; 39 38 40 39 /* These 2 defines are for pins that may not have a mux register, but could ··· 134 135 #define MX53_PAD_EIM_D16__GPIO_3_16 IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 135 136 #define MX53_PAD_EIM_D17__GPIO_3_17 IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 136 137 #define MX53_PAD_EIM_D18__GPIO_3_18 IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 138 + #define MX53_PAD_EIM_D16__CSPI1_SCLK IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT4, 0x79c, 3, NO_PAD_CTRL) 139 + #define MX53_PAD_EIM_D17__CSPI1_MISO IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT4, 0x7a0, 3, NO_PAD_CTRL) 140 + #define MX53_PAD_EIM_D18__CSPI1_MOSI IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT4, 0x7a4, 3, NO_PAD_CTRL) 137 141 #define MX53_PAD_EIM_D19__GPIO_3_19 IOMUX_PAD(0x46C, 0x124,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 138 142 #define MX53_PAD_EIM_D20__GPIO_3_20 IOMUX_PAD(0x470, 0x128,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 139 143 #define MX53_PAD_EIM_D21__GPIO_3_21 IOMUX_PAD(0x474, 0x12C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL)
+1
arch/arm/plat-mxc/include/mach/iomux-v3.h
··· 105 105 #define PAD_CTL_SRE_FAST (1 << 0) 106 106 #define PAD_CTL_SRE_SLOW (0 << 0) 107 107 108 + #define IOMUX_CONFIG_SION (0x1 << 4) 108 109 109 110 #define MX51_NUM_GPIO_PORT 4 110 111
+3 -3
arch/arm/plat-mxc/include/mach/mx51.h
··· 301 301 #define MX51_MXC_INT_GPIO4_HIGH 57 302 302 #define MX51_MXC_INT_WDOG1 58 303 303 #define MX51_MXC_INT_WDOG2 59 304 - #define MX51_MXC_INT_KPP 60 305 - #define MX51_MXC_INT_PWM1 61 304 + #define MX51_INT_KPP 60 305 + #define MX51_INT_PWM1 61 306 306 #define MX51_INT_I2C1 62 307 307 #define MX51_INT_I2C2 63 308 308 #define MX51_MXC_INT_HS_I2C 64 ··· 335 335 #define MX51_MXC_INT_SPDIF 91 336 336 #define MX51_MXC_INT_TVE 92 337 337 #define MX51_MXC_INT_FIRI 93 338 - #define MX51_MXC_INT_PWM2 94 338 + #define MX51_INT_PWM2 94 339 339 #define MX51_MXC_INT_SLIM_EXP 95 340 340 #define MX51_INT_SSI3 96 341 341 #define MX51_MXC_INT_EMI_BOOT 97
+14 -14
arch/arm/plat-mxc/include/mach/mx53.h
··· 53 53 #define MX53_SPBA0_BASE_ADDR 0x50000000 54 54 #define MX53_SPBA0_SIZE SZ_1M 55 55 56 - #define MX53_MMC_SDHC1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00004000) 57 - #define MX53_MMC_SDHC2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00008000) 56 + #define MX53_ESDHC1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00004000) 57 + #define MX53_ESDHC2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00008000) 58 58 #define MX53_UART3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0000C000) 59 - #define MX53_CSPI1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00010000) 59 + #define MX53_ECSPI1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00010000) 60 60 #define MX53_SSI2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00014000) 61 - #define MX53_MMC_SDHC3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00020000) 62 - #define MX53_MMC_SDHC4_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00024000) 61 + #define MX53_ESDHC3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00020000) 62 + #define MX53_ESDHC4_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00024000) 63 63 #define MX53_SPDIF_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00028000) 64 64 #define MX53_ASRC_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0002C000) 65 65 #define MX53_ATA_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00030000) ··· 117 117 #define MX53_ARM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A0000) 118 118 #define MX53_OWIRE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A4000) 119 119 #define MX53_FIRI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A8000) 120 - #define MX53_CSPI2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000AC000) 120 + #define MX53_ECSPI2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000AC000) 121 121 #define MX53_SDMA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B0000) 122 122 #define MX53_SCC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B4000) 123 123 #define MX53_ROMCP_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B8000) 124 124 #define MX53_RTIC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000BC000) 125 - #define MX53_CSPI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C0000) 125 + #define MX53_CSPI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C0000) 126 126 #define MX53_I2C2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C4000) 127 127 #define MX53_I2C1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C8000) 128 128 #define MX53_SSI1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000CC000) ··· 136 136 #define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000) 137 137 #define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000) 138 138 #define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000) 139 - #define MX53_MXC_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) 139 + #define MX53_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) 140 140 #define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000) 141 141 #define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000) 142 142 #define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000) ··· 229 229 * Interrupt numbers 230 230 */ 231 231 #define MX53_INT_RESV0 0 232 - #define MX53_INT_MMC_SDHC1 1 233 - #define MX53_INT_MMC_SDHC2 2 234 - #define MX53_INT_MMC_SDHC3 3 235 - #define MX53_INT_MMC_SDHC4 4 232 + #define MX53_INT_ESDHC1 1 233 + #define MX53_INT_ESDHC2 2 234 + #define MX53_INT_ESDHC3 3 235 + #define MX53_INT_ESDHC4 4 236 236 #define MX53_INT_RESV5 5 237 237 #define MX53_INT_SDMA 6 238 238 #define MX53_INT_IOMUX 7 ··· 264 264 #define MX53_INT_UART3 33 265 265 #define MX53_INT_RESV34 34 266 266 #define MX53_INT_RESV35 35 267 - #define MX53_INT_CSPI1 36 268 - #define MX53_INT_CSPI2 37 267 + #define MX53_INT_ECSPI1 36 268 + #define MX53_INT_ECSPI2 37 269 269 #define MX53_INT_CSPI 38 270 270 #define MX53_INT_GPT 39 271 271 #define MX53_INT_EPIT1 40
+1 -1
arch/arm/plat-mxc/pwm.c
··· 57 57 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) 58 58 return -EINVAL; 59 59 60 - if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { 60 + if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) { 61 61 unsigned long long c; 62 62 unsigned long period_cycles, duty_cycles, prescale; 63 63 u32 cr;
+19 -19
arch/arm/plat-mxc/tzic.c
··· 69 69 #endif 70 70 71 71 /** 72 - * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC 72 + * tzic_mask_irq() - Disable interrupt source "d" in the TZIC 73 73 * 74 - * @param irq interrupt source number 74 + * @param d interrupt source 75 75 */ 76 - static void tzic_mask_irq(unsigned int irq) 76 + static void tzic_mask_irq(struct irq_data *d) 77 77 { 78 78 int index, off; 79 79 80 - index = irq >> 5; 81 - off = irq & 0x1F; 80 + index = d->irq >> 5; 81 + off = d->irq & 0x1F; 82 82 __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index)); 83 83 } 84 84 85 85 /** 86 - * tzic_unmask_irq() - Enable interrupt number "irq" in the TZIC 86 + * tzic_unmask_irq() - Enable interrupt source "d" in the TZIC 87 87 * 88 - * @param irq interrupt source number 88 + * @param d interrupt source 89 89 */ 90 - static void tzic_unmask_irq(unsigned int irq) 90 + static void tzic_unmask_irq(struct irq_data *d) 91 91 { 92 92 int index, off; 93 93 94 - index = irq >> 5; 95 - off = irq & 0x1F; 94 + index = d->irq >> 5; 95 + off = d->irq & 0x1F; 96 96 __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index)); 97 97 } 98 98 99 99 static unsigned int wakeup_intr[4]; 100 100 101 101 /** 102 - * tzic_set_wake_irq() - Set interrupt number "irq" in the TZIC as a wake-up source. 102 + * tzic_set_wake_irq() - Set interrupt source "d" in the TZIC as a wake-up source. 103 103 * 104 - * @param irq interrupt source number 104 + * @param d interrupt source 105 105 * @param enable enable as wake-up if equal to non-zero 106 106 * disble as wake-up if equal to zero 107 107 * 108 108 * @return This function returns 0 on success. 109 109 */ 110 - static int tzic_set_wake_irq(unsigned int irq, unsigned int enable) 110 + static int tzic_set_wake_irq(struct irq_data *d, unsigned int enable) 111 111 { 112 112 unsigned int index, off; 113 113 114 - index = irq >> 5; 115 - off = irq & 0x1F; 114 + index = d->irq >> 5; 115 + off = d->irq & 0x1F; 116 116 117 117 if (index > 3) 118 118 return -EINVAL; ··· 128 128 static struct mxc_irq_chip mxc_tzic_chip = { 129 129 .base = { 130 130 .name = "MXC_TZIC", 131 - .ack = tzic_mask_irq, 132 - .mask = tzic_mask_irq, 133 - .unmask = tzic_unmask_irq, 134 - .set_wake = tzic_set_wake_irq, 131 + .irq_ack = tzic_mask_irq, 132 + .irq_mask = tzic_mask_irq, 133 + .irq_unmask = tzic_unmask_irq, 134 + .irq_set_wake = tzic_set_wake_irq, 135 135 }, 136 136 #ifdef CONFIG_FIQ 137 137 .set_irq_fiq = tzic_set_irq_fiq,
+28 -28
arch/arm/plat-nomadik/gpio.c
··· 356 356 return 1 << (gpio % 32); 357 357 } 358 358 359 - static void nmk_gpio_irq_ack(unsigned int irq) 359 + static void nmk_gpio_irq_ack(struct irq_data *d) 360 360 { 361 361 int gpio; 362 362 struct nmk_gpio_chip *nmk_chip; 363 363 364 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 365 - nmk_chip = get_irq_chip_data(irq); 364 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 365 + nmk_chip = irq_data_get_irq_chip_data(d); 366 366 if (!nmk_chip) 367 367 return; 368 368 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); ··· 401 401 } 402 402 } 403 403 404 - static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which, 404 + static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which, 405 405 bool enable) 406 406 { 407 407 int gpio; ··· 409 409 unsigned long flags; 410 410 u32 bitmask; 411 411 412 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 413 - nmk_chip = get_irq_chip_data(irq); 412 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 413 + nmk_chip = irq_data_get_irq_chip_data(d); 414 414 bitmask = nmk_gpio_get_bitmask(gpio); 415 415 if (!nmk_chip) 416 416 return -EINVAL; ··· 422 422 return 0; 423 423 } 424 424 425 - static void nmk_gpio_irq_mask(unsigned int irq) 425 + static void nmk_gpio_irq_mask(struct irq_data *d) 426 426 { 427 - nmk_gpio_irq_modify(irq, NORMAL, false); 427 + nmk_gpio_irq_modify(d, NORMAL, false); 428 428 } 429 429 430 - static void nmk_gpio_irq_unmask(unsigned int irq) 430 + static void nmk_gpio_irq_unmask(struct irq_data *d) 431 431 { 432 - nmk_gpio_irq_modify(irq, NORMAL, true); 432 + nmk_gpio_irq_modify(d, NORMAL, true); 433 433 } 434 434 435 - static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on) 435 + static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 436 436 { 437 437 struct nmk_gpio_chip *nmk_chip; 438 438 unsigned long flags; 439 439 int gpio; 440 440 441 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 442 - nmk_chip = get_irq_chip_data(irq); 441 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 442 + nmk_chip = irq_data_get_irq_chip_data(d); 443 443 if (!nmk_chip) 444 444 return -EINVAL; 445 445 ··· 457 457 return 0; 458 458 } 459 459 460 - static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) 460 + static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) 461 461 { 462 - struct irq_desc *desc = irq_to_desc(irq); 462 + struct irq_desc *desc = irq_to_desc(d->irq); 463 463 bool enabled = !(desc->status & IRQ_DISABLED); 464 464 bool wake = desc->wake_depth; 465 465 int gpio; ··· 467 467 unsigned long flags; 468 468 u32 bitmask; 469 469 470 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 471 - nmk_chip = get_irq_chip_data(irq); 470 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 471 + nmk_chip = irq_data_get_irq_chip_data(d); 472 472 bitmask = nmk_gpio_get_bitmask(gpio); 473 473 if (!nmk_chip) 474 474 return -EINVAL; ··· 507 507 508 508 static struct irq_chip nmk_gpio_irq_chip = { 509 509 .name = "Nomadik-GPIO", 510 - .ack = nmk_gpio_irq_ack, 511 - .mask = nmk_gpio_irq_mask, 512 - .unmask = nmk_gpio_irq_unmask, 513 - .set_type = nmk_gpio_irq_set_type, 514 - .set_wake = nmk_gpio_irq_set_wake, 510 + .irq_ack = nmk_gpio_irq_ack, 511 + .irq_mask = nmk_gpio_irq_mask, 512 + .irq_unmask = nmk_gpio_irq_unmask, 513 + .irq_set_type = nmk_gpio_irq_set_type, 514 + .irq_set_wake = nmk_gpio_irq_set_wake, 515 515 }; 516 516 517 517 static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 522 522 u32 pending; 523 523 unsigned int first_irq; 524 524 525 - if (host_chip->mask_ack) 526 - host_chip->mask_ack(irq); 525 + if (host_chip->irq_mask_ack) 526 + host_chip->irq_mask_ack(&desc->irq_data); 527 527 else { 528 - host_chip->mask(irq); 529 - if (host_chip->ack) 530 - host_chip->ack(irq); 528 + host_chip->irq_mask(&desc->irq_data); 529 + if (host_chip->irq_ack) 530 + host_chip->irq_ack(&desc->irq_data); 531 531 } 532 532 533 533 nmk_chip = get_irq_data(irq); ··· 537 537 generic_handle_irq(gpio_irq); 538 538 } 539 539 540 - host_chip->unmask(irq); 540 + host_chip->irq_unmask(&desc->irq_data); 541 541 } 542 542 543 543 static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
+47 -48
arch/arm/plat-omap/gpio.c
··· 729 729 return -EINVAL; 730 730 } 731 731 732 - static int gpio_irq_type(unsigned irq, unsigned type) 732 + static int gpio_irq_type(struct irq_data *d, unsigned type) 733 733 { 734 734 struct gpio_bank *bank; 735 735 unsigned gpio; 736 736 int retval; 737 737 unsigned long flags; 738 738 739 - if (!cpu_class_is_omap2() && irq > IH_MPUIO_BASE) 740 - gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 739 + if (!cpu_class_is_omap2() && d->irq > IH_MPUIO_BASE) 740 + gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 741 741 else 742 - gpio = irq - IH_GPIO_BASE; 742 + gpio = d->irq - IH_GPIO_BASE; 743 743 744 744 if (check_gpio(gpio) < 0) 745 745 return -EINVAL; ··· 752 752 && (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))) 753 753 return -EINVAL; 754 754 755 - bank = get_irq_chip_data(irq); 755 + bank = irq_data_get_irq_chip_data(d); 756 756 spin_lock_irqsave(&bank->lock, flags); 757 757 retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); 758 758 if (retval == 0) { 759 - struct irq_desc *d = irq_to_desc(irq); 759 + struct irq_desc *desc = irq_to_desc(d->irq); 760 760 761 - d->status &= ~IRQ_TYPE_SENSE_MASK; 762 - d->status |= type; 761 + desc->status &= ~IRQ_TYPE_SENSE_MASK; 762 + desc->status |= type; 763 763 } 764 764 spin_unlock_irqrestore(&bank->lock, flags); 765 765 766 766 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 767 - __set_irq_handler_unlocked(irq, handle_level_irq); 767 + __set_irq_handler_unlocked(d->irq, handle_level_irq); 768 768 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 769 - __set_irq_handler_unlocked(irq, handle_edge_irq); 769 + __set_irq_handler_unlocked(d->irq, handle_edge_irq); 770 770 771 771 return retval; 772 772 } ··· 1023 1023 } 1024 1024 1025 1025 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */ 1026 - static int gpio_wake_enable(unsigned int irq, unsigned int enable) 1026 + static int gpio_wake_enable(struct irq_data *d, unsigned int enable) 1027 1027 { 1028 - unsigned int gpio = irq - IH_GPIO_BASE; 1028 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1029 1029 struct gpio_bank *bank; 1030 1030 int retval; 1031 1031 1032 1032 if (check_gpio(gpio) < 0) 1033 1033 return -ENODEV; 1034 - bank = get_irq_chip_data(irq); 1034 + bank = irq_data_get_irq_chip_data(d); 1035 1035 retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable); 1036 1036 1037 1037 return retval; ··· 1144 1144 u32 retrigger = 0; 1145 1145 int unmasked = 0; 1146 1146 1147 - desc->chip->ack(irq); 1147 + desc->irq_data.chip->irq_ack(&desc->irq_data); 1148 1148 1149 1149 bank = get_irq_data(irq); 1150 1150 #ifdef CONFIG_ARCH_OMAP1 ··· 1201 1201 configured, we could unmask GPIO bank interrupt immediately */ 1202 1202 if (!level_mask && !unmasked) { 1203 1203 unmasked = 1; 1204 - desc->chip->unmask(irq); 1204 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 1205 1205 } 1206 1206 1207 1207 isr |= retrigger; ··· 1237 1237 interrupt */ 1238 1238 exit: 1239 1239 if (!unmasked) 1240 - desc->chip->unmask(irq); 1241 - 1240 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 1242 1241 } 1243 1242 1244 - static void gpio_irq_shutdown(unsigned int irq) 1243 + static void gpio_irq_shutdown(struct irq_data *d) 1245 1244 { 1246 - unsigned int gpio = irq - IH_GPIO_BASE; 1247 - struct gpio_bank *bank = get_irq_chip_data(irq); 1245 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1246 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1248 1247 1249 1248 _reset_gpio(bank, gpio); 1250 1249 } 1251 1250 1252 - static void gpio_ack_irq(unsigned int irq) 1251 + static void gpio_ack_irq(struct irq_data *d) 1253 1252 { 1254 - unsigned int gpio = irq - IH_GPIO_BASE; 1255 - struct gpio_bank *bank = get_irq_chip_data(irq); 1253 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1254 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1256 1255 1257 1256 _clear_gpio_irqstatus(bank, gpio); 1258 1257 } 1259 1258 1260 - static void gpio_mask_irq(unsigned int irq) 1259 + static void gpio_mask_irq(struct irq_data *d) 1261 1260 { 1262 - unsigned int gpio = irq - IH_GPIO_BASE; 1263 - struct gpio_bank *bank = get_irq_chip_data(irq); 1261 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1262 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1264 1263 1265 1264 _set_gpio_irqenable(bank, gpio, 0); 1266 1265 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); 1267 1266 } 1268 1267 1269 - static void gpio_unmask_irq(unsigned int irq) 1268 + static void gpio_unmask_irq(struct irq_data *d) 1270 1269 { 1271 - unsigned int gpio = irq - IH_GPIO_BASE; 1272 - struct gpio_bank *bank = get_irq_chip_data(irq); 1270 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1271 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1273 1272 unsigned int irq_mask = 1 << get_gpio_index(gpio); 1274 - struct irq_desc *desc = irq_to_desc(irq); 1273 + struct irq_desc *desc = irq_to_desc(d->irq); 1275 1274 u32 trigger = desc->status & IRQ_TYPE_SENSE_MASK; 1276 1275 1277 1276 if (trigger) ··· 1288 1289 1289 1290 static struct irq_chip gpio_irq_chip = { 1290 1291 .name = "GPIO", 1291 - .shutdown = gpio_irq_shutdown, 1292 - .ack = gpio_ack_irq, 1293 - .mask = gpio_mask_irq, 1294 - .unmask = gpio_unmask_irq, 1295 - .set_type = gpio_irq_type, 1296 - .set_wake = gpio_wake_enable, 1292 + .irq_shutdown = gpio_irq_shutdown, 1293 + .irq_ack = gpio_ack_irq, 1294 + .irq_mask = gpio_mask_irq, 1295 + .irq_unmask = gpio_unmask_irq, 1296 + .irq_set_type = gpio_irq_type, 1297 + .irq_set_wake = gpio_wake_enable, 1297 1298 }; 1298 1299 1299 1300 /*---------------------------------------------------------------------*/ ··· 1302 1303 1303 1304 /* MPUIO uses the always-on 32k clock */ 1304 1305 1305 - static void mpuio_ack_irq(unsigned int irq) 1306 + static void mpuio_ack_irq(struct irq_data *d) 1306 1307 { 1307 1308 /* The ISR is reset automatically, so do nothing here. */ 1308 1309 } 1309 1310 1310 - static void mpuio_mask_irq(unsigned int irq) 1311 + static void mpuio_mask_irq(struct irq_data *d) 1311 1312 { 1312 - unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 1313 - struct gpio_bank *bank = get_irq_chip_data(irq); 1313 + unsigned int gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 1314 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1314 1315 1315 1316 _set_gpio_irqenable(bank, gpio, 0); 1316 1317 } 1317 1318 1318 - static void mpuio_unmask_irq(unsigned int irq) 1319 + static void mpuio_unmask_irq(struct irq_data *d) 1319 1320 { 1320 - unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 1321 - struct gpio_bank *bank = get_irq_chip_data(irq); 1321 + unsigned int gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 1322 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1322 1323 1323 1324 _set_gpio_irqenable(bank, gpio, 1); 1324 1325 } 1325 1326 1326 1327 static struct irq_chip mpuio_irq_chip = { 1327 1328 .name = "MPUIO", 1328 - .ack = mpuio_ack_irq, 1329 - .mask = mpuio_mask_irq, 1330 - .unmask = mpuio_unmask_irq, 1331 - .set_type = gpio_irq_type, 1329 + .irq_ack = mpuio_ack_irq, 1330 + .irq_mask = mpuio_mask_irq, 1331 + .irq_unmask = mpuio_unmask_irq, 1332 + .irq_set_type = gpio_irq_type, 1332 1333 #ifdef CONFIG_ARCH_OMAP16XX 1333 1334 /* REVISIT: assuming only 16xx supports MPUIO wake events */ 1334 - .set_wake = gpio_wake_enable, 1335 + .irq_set_wake = gpio_wake_enable, 1335 1336 #endif 1336 1337 }; 1337 1338
+18 -19
arch/arm/plat-orion/gpio.c
··· 232 232 * polarity LEVEL mask 233 233 * 234 234 ****************************************************************************/ 235 - 236 - static void gpio_irq_ack(u32 irq) 235 + static void gpio_irq_ack(struct irq_data *d) 237 236 { 238 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 237 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 239 238 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 240 - int pin = irq_to_gpio(irq); 239 + int pin = irq_to_gpio(d->irq); 241 240 writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); 242 241 } 243 242 } 244 243 245 - static void gpio_irq_mask(u32 irq) 244 + static void gpio_irq_mask(struct irq_data *d) 246 245 { 247 - int pin = irq_to_gpio(irq); 248 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 246 + int pin = irq_to_gpio(d->irq); 247 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 249 248 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 250 249 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 251 250 u32 u = readl(reg); ··· 252 253 writel(u, reg); 253 254 } 254 255 255 - static void gpio_irq_unmask(u32 irq) 256 + static void gpio_irq_unmask(struct irq_data *d) 256 257 { 257 - int pin = irq_to_gpio(irq); 258 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 258 + int pin = irq_to_gpio(d->irq); 259 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 259 260 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 260 261 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 261 262 u32 u = readl(reg); ··· 263 264 writel(u, reg); 264 265 } 265 266 266 - static int gpio_irq_set_type(u32 irq, u32 type) 267 + static int gpio_irq_set_type(struct irq_data *d, u32 type) 267 268 { 268 - int pin = irq_to_gpio(irq); 269 + int pin = irq_to_gpio(d->irq); 269 270 struct irq_desc *desc; 270 271 u32 u; 271 272 272 273 u = readl(GPIO_IO_CONF(pin)) & (1 << (pin & 31)); 273 274 if (!u) { 274 275 printk(KERN_ERR "orion gpio_irq_set_type failed " 275 - "(irq %d, pin %d).\n", irq, pin); 276 + "(irq %d, pin %d).\n", d->irq, pin); 276 277 return -EINVAL; 277 278 } 278 279 279 - desc = irq_desc + irq; 280 + desc = irq_desc + d->irq; 280 281 281 282 /* 282 283 * Set edge/level type. ··· 286 287 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 287 288 desc->handle_irq = handle_level_irq; 288 289 } else { 289 - printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); 290 + printk(KERN_ERR "failed to set irq=%d (type=%d)\n", d->irq, type); 290 291 return -EINVAL; 291 292 } 292 293 ··· 324 325 325 326 struct irq_chip orion_gpio_irq_chip = { 326 327 .name = "orion_gpio_irq", 327 - .ack = gpio_irq_ack, 328 - .mask = gpio_irq_mask, 329 - .unmask = gpio_irq_unmask, 330 - .set_type = gpio_irq_set_type, 328 + .irq_ack = gpio_irq_ack, 329 + .irq_mask = gpio_irq_mask, 330 + .irq_unmask = gpio_irq_unmask, 331 + .irq_set_type = gpio_irq_set_type, 331 332 }; 332 333 333 334 void orion_gpio_irq_handler(int pinoff)
+9 -9
arch/arm/plat-orion/irq.c
··· 14 14 #include <linux/io.h> 15 15 #include <plat/irq.h> 16 16 17 - static void orion_irq_mask(u32 irq) 17 + static void orion_irq_mask(struct irq_data *d) 18 18 { 19 - void __iomem *maskaddr = get_irq_chip_data(irq); 19 + void __iomem *maskaddr = irq_data_get_irq_chip_data(d); 20 20 u32 mask; 21 21 22 22 mask = readl(maskaddr); 23 - mask &= ~(1 << (irq & 31)); 23 + mask &= ~(1 << (d->irq & 31)); 24 24 writel(mask, maskaddr); 25 25 } 26 26 27 - static void orion_irq_unmask(u32 irq) 27 + static void orion_irq_unmask(struct irq_data *d) 28 28 { 29 - void __iomem *maskaddr = get_irq_chip_data(irq); 29 + void __iomem *maskaddr = irq_data_get_irq_chip_data(d); 30 30 u32 mask; 31 31 32 32 mask = readl(maskaddr); 33 - mask |= 1 << (irq & 31); 33 + mask |= 1 << (d->irq & 31); 34 34 writel(mask, maskaddr); 35 35 } 36 36 37 37 static struct irq_chip orion_irq_chip = { 38 38 .name = "orion_irq", 39 - .mask = orion_irq_mask, 40 - .mask_ack = orion_irq_mask, 41 - .unmask = orion_irq_unmask, 39 + .irq_mask = orion_irq_mask, 40 + .irq_mask_ack = orion_irq_mask, 41 + .irq_unmask = orion_irq_unmask, 42 42 }; 43 43 44 44 void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
+14 -14
arch/arm/plat-pxa/gpio.c
··· 155 155 __raw_writel(gfer, c->regbase + GFER_OFFSET); 156 156 } 157 157 158 - static int pxa_gpio_irq_type(unsigned int irq, unsigned int type) 158 + static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type) 159 159 { 160 160 struct pxa_gpio_chip *c; 161 - int gpio = irq_to_gpio(irq); 161 + int gpio = irq_to_gpio(d->irq); 162 162 unsigned long gpdr, mask = GPIO_bit(gpio); 163 163 164 164 c = gpio_to_chip(gpio); ··· 195 195 196 196 update_edge_detect(c); 197 197 198 - pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio, 198 + pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, d->irq, gpio, 199 199 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""), 200 200 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : "")); 201 201 return 0; ··· 227 227 } while (loop); 228 228 } 229 229 230 - static void pxa_ack_muxed_gpio(unsigned int irq) 230 + static void pxa_ack_muxed_gpio(struct irq_data *d) 231 231 { 232 - int gpio = irq_to_gpio(irq); 232 + int gpio = irq_to_gpio(d->irq); 233 233 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 234 234 235 235 __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); 236 236 } 237 237 238 - static void pxa_mask_muxed_gpio(unsigned int irq) 238 + static void pxa_mask_muxed_gpio(struct irq_data *d) 239 239 { 240 - int gpio = irq_to_gpio(irq); 240 + int gpio = irq_to_gpio(d->irq); 241 241 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 242 242 uint32_t grer, gfer; 243 243 ··· 249 249 __raw_writel(gfer, c->regbase + GFER_OFFSET); 250 250 } 251 251 252 - static void pxa_unmask_muxed_gpio(unsigned int irq) 252 + static void pxa_unmask_muxed_gpio(struct irq_data *d) 253 253 { 254 - int gpio = irq_to_gpio(irq); 254 + int gpio = irq_to_gpio(d->irq); 255 255 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 256 256 257 257 c->irq_mask |= GPIO_bit(gpio); ··· 260 260 261 261 static struct irq_chip pxa_muxed_gpio_chip = { 262 262 .name = "GPIO", 263 - .ack = pxa_ack_muxed_gpio, 264 - .mask = pxa_mask_muxed_gpio, 265 - .unmask = pxa_unmask_muxed_gpio, 266 - .set_type = pxa_gpio_irq_type, 263 + .irq_ack = pxa_ack_muxed_gpio, 264 + .irq_mask = pxa_mask_muxed_gpio, 265 + .irq_unmask = pxa_unmask_muxed_gpio, 266 + .irq_set_type = pxa_gpio_irq_type, 267 267 }; 268 268 269 269 void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn) ··· 291 291 292 292 /* Install handler for GPIO>=2 edge detect interrupts */ 293 293 set_irq_chained_handler(mux_irq, pxa_gpio_demux_handler); 294 - pxa_muxed_gpio_chip.set_wake = fn; 294 + pxa_muxed_gpio_chip.irq_set_wake = fn; 295 295 } 296 296 297 297 #ifdef CONFIG_PM
+3 -1
arch/arm/plat-pxa/include/plat/gpio.h
··· 1 1 #ifndef __PLAT_GPIO_H 2 2 #define __PLAT_GPIO_H 3 3 4 + struct irq_data; 5 + 4 6 /* 5 7 * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with 6 8 * one set of registers. The register offsets are organized below: ··· 58 56 */ 59 57 extern int pxa_last_gpio; 60 58 61 - typedef int (*set_wake_t)(unsigned int irq, unsigned int on); 59 + typedef int (*set_wake_t)(struct irq_data *d, unsigned int on); 62 60 63 61 extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn); 64 62 #endif /* __PLAT_GPIO_H */
-1
arch/arm/plat-s3c24xx/devs.c
··· 194 194 memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); 195 195 s3c_device_ts.dev.platform_data = &s3c2410ts_info; 196 196 } 197 - EXPORT_SYMBOL(s3c24xx_ts_set_platdata); 198 197 199 198 /* USB Device (Gadget)*/ 200 199
+2 -2
arch/arm/plat-s3c24xx/include/plat/irq.h
··· 107 107 /* exported for use in arch/arm/mach-s3c2410 */ 108 108 109 109 #ifdef CONFIG_PM 110 - extern int s3c_irq_wake(unsigned int irqno, unsigned int state); 110 + extern int s3c_irq_wake(struct irq_data *data, unsigned int state); 111 111 #else 112 112 #define s3c_irq_wake NULL 113 113 #endif 114 114 115 - extern int s3c_irqext_type(unsigned int irq, unsigned int type); 115 + extern int s3c_irqext_type(struct irq_data *d, unsigned int type);
+6 -3
arch/arm/plat-s3c24xx/irq-pm.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/interrupt.h> 17 17 #include <linux/sysdev.h> 18 + #include <linux/irq.h> 18 19 19 20 #include <plat/cpu.h> 20 21 #include <plat/pm.h> 21 22 #include <plat/irq.h> 23 + 24 + #include <asm/irq.h> 22 25 23 26 /* state for IRQs over sleep */ 24 27 ··· 33 30 unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; 34 31 unsigned long s3c_irqwake_eintallow = 0x0000fff0L; 35 32 36 - int s3c_irq_wake(unsigned int irqno, unsigned int state) 33 + int s3c_irq_wake(struct irq_data *data, unsigned int state) 37 34 { 38 - unsigned long irqbit = 1 << (irqno - IRQ_EINT0); 35 + unsigned long irqbit = 1 << (data->irq - IRQ_EINT0); 39 36 40 37 if (!(s3c_irqwake_intallow & irqbit)) 41 38 return -ENOENT; 42 39 43 40 printk(KERN_INFO "wake %s for irq %d\n", 44 - state ? "enabled" : "disabled", irqno); 41 + state ? "enabled" : "disabled", data->irq); 45 42 46 43 if (!state) 47 44 s3c_irqwake_intmask |= irqbit;
+87 -95
arch/arm/plat-s3c24xx/irq.c
··· 34 34 #include <plat/irq.h> 35 35 36 36 static void 37 - s3c_irq_mask(unsigned int irqno) 37 + s3c_irq_mask(struct irq_data *data) 38 38 { 39 + unsigned int irqno = data->irq - IRQ_EINT0; 39 40 unsigned long mask; 40 - 41 - irqno -= IRQ_EINT0; 42 41 43 42 mask = __raw_readl(S3C2410_INTMSK); 44 43 mask |= 1UL << irqno; ··· 45 46 } 46 47 47 48 static inline void 48 - s3c_irq_ack(unsigned int irqno) 49 + s3c_irq_ack(struct irq_data *data) 49 50 { 50 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 51 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 51 52 52 53 __raw_writel(bitval, S3C2410_SRCPND); 53 54 __raw_writel(bitval, S3C2410_INTPND); 54 55 } 55 56 56 57 static inline void 57 - s3c_irq_maskack(unsigned int irqno) 58 + s3c_irq_maskack(struct irq_data *data) 58 59 { 59 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 60 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 60 61 unsigned long mask; 61 62 62 63 mask = __raw_readl(S3C2410_INTMSK); ··· 68 69 69 70 70 71 static void 71 - s3c_irq_unmask(unsigned int irqno) 72 + s3c_irq_unmask(struct irq_data *data) 72 73 { 74 + unsigned int irqno = data->irq; 73 75 unsigned long mask; 74 76 75 77 if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23) ··· 85 85 86 86 struct irq_chip s3c_irq_level_chip = { 87 87 .name = "s3c-level", 88 - .ack = s3c_irq_maskack, 89 - .mask = s3c_irq_mask, 90 - .unmask = s3c_irq_unmask, 91 - .set_wake = s3c_irq_wake 88 + .irq_ack = s3c_irq_maskack, 89 + .irq_mask = s3c_irq_mask, 90 + .irq_unmask = s3c_irq_unmask, 91 + .irq_set_wake = s3c_irq_wake 92 92 }; 93 93 94 94 struct irq_chip s3c_irq_chip = { 95 95 .name = "s3c", 96 - .ack = s3c_irq_ack, 97 - .mask = s3c_irq_mask, 98 - .unmask = s3c_irq_unmask, 99 - .set_wake = s3c_irq_wake 96 + .irq_ack = s3c_irq_ack, 97 + .irq_mask = s3c_irq_mask, 98 + .irq_unmask = s3c_irq_unmask, 99 + .irq_set_wake = s3c_irq_wake 100 100 }; 101 101 102 102 static void 103 - s3c_irqext_mask(unsigned int irqno) 103 + s3c_irqext_mask(struct irq_data *data) 104 104 { 105 + unsigned int irqno = data->irq - EXTINT_OFF; 105 106 unsigned long mask; 106 - 107 - irqno -= EXTINT_OFF; 108 107 109 108 mask = __raw_readl(S3C24XX_EINTMASK); 110 109 mask |= ( 1UL << irqno); ··· 111 112 } 112 113 113 114 static void 114 - s3c_irqext_ack(unsigned int irqno) 115 + s3c_irqext_ack(struct irq_data *data) 115 116 { 116 117 unsigned long req; 117 118 unsigned long bit; 118 119 unsigned long mask; 119 120 120 - bit = 1UL << (irqno - EXTINT_OFF); 121 + bit = 1UL << (data->irq - EXTINT_OFF); 121 122 122 123 mask = __raw_readl(S3C24XX_EINTMASK); 123 124 ··· 128 129 129 130 /* not sure if we should be acking the parent irq... */ 130 131 131 - if (irqno <= IRQ_EINT7 ) { 132 + if (data->irq <= IRQ_EINT7) { 132 133 if ((req & 0xf0) == 0) 133 - s3c_irq_ack(IRQ_EINT4t7); 134 + s3c_irq_ack(irq_get_irq_data(IRQ_EINT4t7)); 134 135 } else { 135 136 if ((req >> 8) == 0) 136 - s3c_irq_ack(IRQ_EINT8t23); 137 + s3c_irq_ack(irq_get_irq_data(IRQ_EINT8t23)); 137 138 } 138 139 } 139 140 140 141 static void 141 - s3c_irqext_unmask(unsigned int irqno) 142 + s3c_irqext_unmask(struct irq_data *data) 142 143 { 144 + unsigned int irqno = data->irq - EXTINT_OFF; 143 145 unsigned long mask; 144 146 145 - irqno -= EXTINT_OFF; 146 - 147 147 mask = __raw_readl(S3C24XX_EINTMASK); 148 - mask &= ~( 1UL << irqno); 148 + mask &= ~(1UL << irqno); 149 149 __raw_writel(mask, S3C24XX_EINTMASK); 150 150 } 151 151 152 152 int 153 - s3c_irqext_type(unsigned int irq, unsigned int type) 153 + s3c_irqext_type(struct irq_data *data, unsigned int type) 154 154 { 155 155 void __iomem *extint_reg; 156 156 void __iomem *gpcon_reg; 157 157 unsigned long gpcon_offset, extint_offset; 158 158 unsigned long newvalue = 0, value; 159 159 160 - if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3)) 161 - { 160 + if ((data->irq >= IRQ_EINT0) && (data->irq <= IRQ_EINT3)) { 162 161 gpcon_reg = S3C2410_GPFCON; 163 162 extint_reg = S3C24XX_EXTINT0; 164 - gpcon_offset = (irq - IRQ_EINT0) * 2; 165 - extint_offset = (irq - IRQ_EINT0) * 4; 166 - } 167 - else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7)) 168 - { 163 + gpcon_offset = (data->irq - IRQ_EINT0) * 2; 164 + extint_offset = (data->irq - IRQ_EINT0) * 4; 165 + } else if ((data->irq >= IRQ_EINT4) && (data->irq <= IRQ_EINT7)) { 169 166 gpcon_reg = S3C2410_GPFCON; 170 167 extint_reg = S3C24XX_EXTINT0; 171 - gpcon_offset = (irq - (EXTINT_OFF)) * 2; 172 - extint_offset = (irq - (EXTINT_OFF)) * 4; 173 - } 174 - else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15)) 175 - { 168 + gpcon_offset = (data->irq - (EXTINT_OFF)) * 2; 169 + extint_offset = (data->irq - (EXTINT_OFF)) * 4; 170 + } else if ((data->irq >= IRQ_EINT8) && (data->irq <= IRQ_EINT15)) { 176 171 gpcon_reg = S3C2410_GPGCON; 177 172 extint_reg = S3C24XX_EXTINT1; 178 - gpcon_offset = (irq - IRQ_EINT8) * 2; 179 - extint_offset = (irq - IRQ_EINT8) * 4; 180 - } 181 - else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23)) 182 - { 173 + gpcon_offset = (data->irq - IRQ_EINT8) * 2; 174 + extint_offset = (data->irq - IRQ_EINT8) * 4; 175 + } else if ((data->irq >= IRQ_EINT16) && (data->irq <= IRQ_EINT23)) { 183 176 gpcon_reg = S3C2410_GPGCON; 184 177 extint_reg = S3C24XX_EXTINT2; 185 - gpcon_offset = (irq - IRQ_EINT8) * 2; 186 - extint_offset = (irq - IRQ_EINT16) * 4; 187 - } else 178 + gpcon_offset = (data->irq - IRQ_EINT8) * 2; 179 + extint_offset = (data->irq - IRQ_EINT16) * 4; 180 + } else { 188 181 return -1; 182 + } 189 183 190 184 /* Set the GPIO to external interrupt mode */ 191 185 value = __raw_readl(gpcon_reg); ··· 226 234 227 235 static struct irq_chip s3c_irqext_chip = { 228 236 .name = "s3c-ext", 229 - .mask = s3c_irqext_mask, 230 - .unmask = s3c_irqext_unmask, 231 - .ack = s3c_irqext_ack, 232 - .set_type = s3c_irqext_type, 233 - .set_wake = s3c_irqext_wake 237 + .irq_mask = s3c_irqext_mask, 238 + .irq_unmask = s3c_irqext_unmask, 239 + .irq_ack = s3c_irqext_ack, 240 + .irq_set_type = s3c_irqext_type, 241 + .irq_set_wake = s3c_irqext_wake 234 242 }; 235 243 236 244 static struct irq_chip s3c_irq_eint0t4 = { 237 245 .name = "s3c-ext0", 238 - .ack = s3c_irq_ack, 239 - .mask = s3c_irq_mask, 240 - .unmask = s3c_irq_unmask, 241 - .set_wake = s3c_irq_wake, 242 - .set_type = s3c_irqext_type, 246 + .irq_ack = s3c_irq_ack, 247 + .irq_mask = s3c_irq_mask, 248 + .irq_unmask = s3c_irq_unmask, 249 + .irq_set_wake = s3c_irq_wake, 250 + .irq_set_type = s3c_irqext_type, 243 251 }; 244 252 245 253 /* mask values for the parent registers for each of the interrupt types */ ··· 253 261 /* UART0 */ 254 262 255 263 static void 256 - s3c_irq_uart0_mask(unsigned int irqno) 264 + s3c_irq_uart0_mask(struct irq_data *data) 257 265 { 258 - s3c_irqsub_mask(irqno, INTMSK_UART0, 7); 266 + s3c_irqsub_mask(data->irq, INTMSK_UART0, 7); 259 267 } 260 268 261 269 static void 262 - s3c_irq_uart0_unmask(unsigned int irqno) 270 + s3c_irq_uart0_unmask(struct irq_data *data) 263 271 { 264 - s3c_irqsub_unmask(irqno, INTMSK_UART0); 272 + s3c_irqsub_unmask(data->irq, INTMSK_UART0); 265 273 } 266 274 267 275 static void 268 - s3c_irq_uart0_ack(unsigned int irqno) 276 + s3c_irq_uart0_ack(struct irq_data *data) 269 277 { 270 - s3c_irqsub_maskack(irqno, INTMSK_UART0, 7); 278 + s3c_irqsub_maskack(data->irq, INTMSK_UART0, 7); 271 279 } 272 280 273 281 static struct irq_chip s3c_irq_uart0 = { 274 282 .name = "s3c-uart0", 275 - .mask = s3c_irq_uart0_mask, 276 - .unmask = s3c_irq_uart0_unmask, 277 - .ack = s3c_irq_uart0_ack, 283 + .irq_mask = s3c_irq_uart0_mask, 284 + .irq_unmask = s3c_irq_uart0_unmask, 285 + .irq_ack = s3c_irq_uart0_ack, 278 286 }; 279 287 280 288 /* UART1 */ 281 289 282 290 static void 283 - s3c_irq_uart1_mask(unsigned int irqno) 291 + s3c_irq_uart1_mask(struct irq_data *data) 284 292 { 285 - s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3); 293 + s3c_irqsub_mask(data->irq, INTMSK_UART1, 7 << 3); 286 294 } 287 295 288 296 static void 289 - s3c_irq_uart1_unmask(unsigned int irqno) 297 + s3c_irq_uart1_unmask(struct irq_data *data) 290 298 { 291 - s3c_irqsub_unmask(irqno, INTMSK_UART1); 299 + s3c_irqsub_unmask(data->irq, INTMSK_UART1); 292 300 } 293 301 294 302 static void 295 - s3c_irq_uart1_ack(unsigned int irqno) 303 + s3c_irq_uart1_ack(struct irq_data *data) 296 304 { 297 - s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3); 305 + s3c_irqsub_maskack(data->irq, INTMSK_UART1, 7 << 3); 298 306 } 299 307 300 308 static struct irq_chip s3c_irq_uart1 = { 301 309 .name = "s3c-uart1", 302 - .mask = s3c_irq_uart1_mask, 303 - .unmask = s3c_irq_uart1_unmask, 304 - .ack = s3c_irq_uart1_ack, 310 + .irq_mask = s3c_irq_uart1_mask, 311 + .irq_unmask = s3c_irq_uart1_unmask, 312 + .irq_ack = s3c_irq_uart1_ack, 305 313 }; 306 314 307 315 /* UART2 */ 308 316 309 317 static void 310 - s3c_irq_uart2_mask(unsigned int irqno) 318 + s3c_irq_uart2_mask(struct irq_data *data) 311 319 { 312 - s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6); 320 + s3c_irqsub_mask(data->irq, INTMSK_UART2, 7 << 6); 313 321 } 314 322 315 323 static void 316 - s3c_irq_uart2_unmask(unsigned int irqno) 324 + s3c_irq_uart2_unmask(struct irq_data *data) 317 325 { 318 - s3c_irqsub_unmask(irqno, INTMSK_UART2); 326 + s3c_irqsub_unmask(data->irq, INTMSK_UART2); 319 327 } 320 328 321 329 static void 322 - s3c_irq_uart2_ack(unsigned int irqno) 330 + s3c_irq_uart2_ack(struct irq_data *data) 323 331 { 324 - s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6); 332 + s3c_irqsub_maskack(data->irq, INTMSK_UART2, 7 << 6); 325 333 } 326 334 327 335 static struct irq_chip s3c_irq_uart2 = { 328 336 .name = "s3c-uart2", 329 - .mask = s3c_irq_uart2_mask, 330 - .unmask = s3c_irq_uart2_unmask, 331 - .ack = s3c_irq_uart2_ack, 337 + .irq_mask = s3c_irq_uart2_mask, 338 + .irq_unmask = s3c_irq_uart2_unmask, 339 + .irq_ack = s3c_irq_uart2_ack, 332 340 }; 333 341 334 342 /* ADC and Touchscreen */ 335 343 336 344 static void 337 - s3c_irq_adc_mask(unsigned int irqno) 345 + s3c_irq_adc_mask(struct irq_data *d) 338 346 { 339 - s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9); 347 + s3c_irqsub_mask(d->irq, INTMSK_ADCPARENT, 3 << 9); 340 348 } 341 349 342 350 static void 343 - s3c_irq_adc_unmask(unsigned int irqno) 351 + s3c_irq_adc_unmask(struct irq_data *d) 344 352 { 345 - s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT); 353 + s3c_irqsub_unmask(d->irq, INTMSK_ADCPARENT); 346 354 } 347 355 348 356 static void 349 - s3c_irq_adc_ack(unsigned int irqno) 357 + s3c_irq_adc_ack(struct irq_data *d) 350 358 { 351 - s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9); 359 + s3c_irqsub_ack(d->irq, INTMSK_ADCPARENT, 3 << 9); 352 360 } 353 361 354 362 static struct irq_chip s3c_irq_adc = { 355 363 .name = "s3c-adc", 356 - .mask = s3c_irq_adc_mask, 357 - .unmask = s3c_irq_adc_unmask, 358 - .ack = s3c_irq_adc_ack, 364 + .irq_mask = s3c_irq_adc_mask, 365 + .irq_unmask = s3c_irq_adc_unmask, 366 + .irq_ack = s3c_irq_adc_ack, 359 367 }; 360 368 361 369 /* irq demux for adc */
+1 -1
arch/arm/plat-s3c24xx/s3c2443-clock.c
··· 271 271 .ctrlbit = S3C2443_HCLKCON_DMA5, 272 272 }, { 273 273 .name = "hsmmc", 274 - .id = 0, 274 + .id = 1, 275 275 .parent = &clk_h, 276 276 .enable = s3c2443_clkcon_enable_h, 277 277 .ctrlbit = S3C2443_HCLKCON_HSMMC,
+26
arch/arm/plat-s5p/Kconfig
··· 56 56 bool 57 57 help 58 58 Compile in platform device definition for OneNAND controller 59 + 60 + config S5P_DEV_CSIS0 61 + bool 62 + help 63 + Compile in platform device definitions for MIPI-CSIS channel 0 64 + 65 + config S5P_DEV_CSIS1 66 + bool 67 + help 68 + Compile in platform device definitions for MIPI-CSIS channel 1 69 + 70 + menuconfig S5P_SYSMMU 71 + bool "SYSMMU support" 72 + depends on ARCH_S5PV310 73 + help 74 + This is a System MMU driver for Samsung ARM based Soc. 75 + 76 + if S5P_SYSMMU 77 + 78 + config S5P_SYSMMU_DEBUG 79 + bool "Enables debug messages" 80 + depends on S5P_SYSMMU 81 + help 82 + This enables SYSMMU driver debug massages. 83 + 84 + endif
+3
arch/arm/plat-s5p/Makefile
··· 28 28 obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 29 29 obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 30 30 obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o 31 + obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o 32 + obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o 33 + obj-$(CONFIG_S5P_SYSMMU) += sysmmu.o
+5
arch/arm/plat-s5p/cpu.c
··· 108 108 .pfn = __phys_to_pfn(S3C_PA_WDT), 109 109 .length = SZ_4K, 110 110 .type = MT_DEVICE, 111 + }, { 112 + .virtual = (unsigned long)S5P_VA_SROMC, 113 + .pfn = __phys_to_pfn(S5P_PA_SROMC), 114 + .length = SZ_4K, 115 + .type = MT_DEVICE, 111 116 }, 112 117 }; 113 118
+34
arch/arm/plat-s5p/dev-csis0.c
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series device definition for MIPI-CSIS channel 0 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/kernel.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + #include <mach/map.h> 15 + 16 + static struct resource s5p_mipi_csis0_resource[] = { 17 + [0] = { 18 + .start = S5P_PA_MIPI_CSIS0, 19 + .end = S5P_PA_MIPI_CSIS0 + SZ_4K - 1, 20 + .flags = IORESOURCE_MEM, 21 + }, 22 + [1] = { 23 + .start = IRQ_MIPI_CSIS0, 24 + .end = IRQ_MIPI_CSIS0, 25 + .flags = IORESOURCE_IRQ, 26 + } 27 + }; 28 + 29 + struct platform_device s5p_device_mipi_csis0 = { 30 + .name = "s5p-mipi-csis", 31 + .id = 0, 32 + .num_resources = ARRAY_SIZE(s5p_mipi_csis0_resource), 33 + .resource = s5p_mipi_csis0_resource, 34 + };
+34
arch/arm/plat-s5p/dev-csis1.c
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series device definition for MIPI-CSIS channel 1 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/kernel.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + #include <mach/map.h> 15 + 16 + static struct resource s5p_mipi_csis1_resource[] = { 17 + [0] = { 18 + .start = S5P_PA_MIPI_CSIS1, 19 + .end = S5P_PA_MIPI_CSIS1 + SZ_4K - 1, 20 + .flags = IORESOURCE_MEM, 21 + }, 22 + [1] = { 23 + .start = IRQ_MIPI_CSIS1, 24 + .end = IRQ_MIPI_CSIS1, 25 + .flags = IORESOURCE_IRQ, 26 + }, 27 + }; 28 + 29 + struct platform_device s5p_device_mipi_csis1 = { 30 + .name = "s5p-mipi-csis", 31 + .id = 1, 32 + .num_resources = ARRAY_SIZE(s5p_mipi_csis1_resource), 33 + .resource = s5p_mipi_csis1_resource, 34 + };
+28
arch/arm/plat-s5p/include/plat/csis.h
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series MIPI CSI slave device support 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #ifndef PLAT_S5P_CSIS_H_ 12 + #define PLAT_S5P_CSIS_H_ __FILE__ 13 + 14 + /** 15 + * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS 16 + * @clk_rate: bus clock frequency 17 + * @lanes: number of data lanes used 18 + * @alignment: data alignment in bits 19 + * @hs_settle: HS-RX settle time 20 + */ 21 + struct s5p_platform_mipi_csis { 22 + unsigned long clk_rate; 23 + u8 lanes; 24 + u8 alignment; 25 + u8 hs_settle; 26 + }; 27 + 28 + #endif /* PLAT_S5P_CSIS_H_ */
+1
arch/arm/plat-s5p/include/plat/map-s5p.h
··· 15 15 16 16 #define S5P_VA_CHIPID S3C_ADDR(0x02000000) 17 17 #define S5P_VA_CMU S3C_ADDR(0x02100000) 18 + #define S5P_VA_PMU S3C_ADDR(0x02180000) 18 19 #define S5P_VA_GPIO S3C_ADDR(0x02200000) 19 20 #define S5P_VA_GPIO1 S5P_VA_GPIO 20 21 #define S5P_VA_GPIO2 S3C_ADDR(0x02240000)
+54
arch/arm/plat-s5p/include/plat/regs-srom.h
··· 1 + /* linux/arch/arm/plat-s5p/include/plat/regs-srom.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5P SROMC register definitions 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_PLAT_S5P_REGS_SROM_H 14 + #define __ASM_PLAT_S5P_REGS_SROM_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_SROMREG(x) (S5P_VA_SROMC + (x)) 19 + 20 + #define S5P_SROM_BW S5P_SROMREG(0x0) 21 + #define S5P_SROM_BC0 S5P_SROMREG(0x4) 22 + #define S5P_SROM_BC1 S5P_SROMREG(0x8) 23 + #define S5P_SROM_BC2 S5P_SROMREG(0xc) 24 + #define S5P_SROM_BC3 S5P_SROMREG(0x10) 25 + #define S5P_SROM_BC4 S5P_SROMREG(0x14) 26 + #define S5P_SROM_BC5 S5P_SROMREG(0x18) 27 + 28 + /* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */ 29 + 30 + #define S5P_SROM_BW__DATAWIDTH__SHIFT 0 31 + #define S5P_SROM_BW__ADDRMODE__SHIFT 1 32 + #define S5P_SROM_BW__WAITENABLE__SHIFT 2 33 + #define S5P_SROM_BW__BYTEENABLE__SHIFT 3 34 + 35 + #define S5P_SROM_BW__CS_MASK 0xf 36 + 37 + #define S5P_SROM_BW__NCS0__SHIFT 0 38 + #define S5P_SROM_BW__NCS1__SHIFT 4 39 + #define S5P_SROM_BW__NCS2__SHIFT 8 40 + #define S5P_SROM_BW__NCS3__SHIFT 12 41 + #define S5P_SROM_BW__NCS4__SHIFT 16 42 + #define S5P_SROM_BW__NCS5__SHIFT 20 43 + 44 + /* applies to same to BCS0 - BCS3 */ 45 + 46 + #define S5P_SROM_BCX__PMC__SHIFT 0 47 + #define S5P_SROM_BCX__TACP__SHIFT 4 48 + #define S5P_SROM_BCX__TCAH__SHIFT 8 49 + #define S5P_SROM_BCX__TCOH__SHIFT 12 50 + #define S5P_SROM_BCX__TACC__SHIFT 16 51 + #define S5P_SROM_BCX__TCOS__SHIFT 24 52 + #define S5P_SROM_BCX__TACS__SHIFT 28 53 + 54 + #endif /* __ASM_PLAT_S5P_REGS_SROM_H */
+23
arch/arm/plat-s5p/include/plat/sysmmu.h
··· 1 + /* linux/arch/arm/plat-s5p/include/plat/sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com/ 5 + * 6 + * Samsung sysmmu driver 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_PLAT_S5P_SYSMMU_H 14 + #define __ASM_PLAT_S5P_SYSMMU_H __FILE__ 15 + 16 + /* debug macro */ 17 + #ifdef CONFIG_S5P_SYSMMU_DEBUG 18 + #define sysmmu_debug(fmt, arg...) printk(KERN_INFO "[%s] " fmt, __func__, ## arg) 19 + #else 20 + #define sysmmu_debug(fmt, arg...) do { } while (0) 21 + #endif 22 + 23 + #endif /* __ASM_PLAT_S5P_SYSMMU_H */
+44 -42
arch/arm/plat-s5p/irq-eint.c
··· 28 28 #include <plat/gpio-cfg.h> 29 29 #include <mach/regs-gpio.h> 30 30 31 - static inline void s5p_irq_eint_mask(unsigned int irq) 31 + static inline void s5p_irq_eint_mask(struct irq_data *data) 32 32 { 33 33 u32 mask; 34 34 35 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 36 - mask |= eint_irq_to_bit(irq); 37 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 35 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 36 + mask |= eint_irq_to_bit(data->irq); 37 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 38 38 } 39 39 40 - static void s5p_irq_eint_unmask(unsigned int irq) 40 + static void s5p_irq_eint_unmask(struct irq_data *data) 41 41 { 42 42 u32 mask; 43 43 44 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 45 - mask &= ~(eint_irq_to_bit(irq)); 46 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 44 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 45 + mask &= ~(eint_irq_to_bit(data->irq)); 46 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 47 47 } 48 48 49 - static inline void s5p_irq_eint_ack(unsigned int irq) 49 + static inline void s5p_irq_eint_ack(struct irq_data *data) 50 50 { 51 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 51 + __raw_writel(eint_irq_to_bit(data->irq), 52 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 52 53 } 53 54 54 - static void s5p_irq_eint_maskack(unsigned int irq) 55 + static void s5p_irq_eint_maskack(struct irq_data *data) 55 56 { 56 57 /* compiler should in-line these */ 57 - s5p_irq_eint_mask(irq); 58 - s5p_irq_eint_ack(irq); 58 + s5p_irq_eint_mask(data); 59 + s5p_irq_eint_ack(data); 59 60 } 60 61 61 - static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) 62 + static int s5p_irq_eint_set_type(struct irq_data *data, unsigned int type) 62 63 { 63 - int offs = EINT_OFFSET(irq); 64 + int offs = EINT_OFFSET(data->irq); 64 65 int shift; 65 66 u32 ctrl, mask; 66 67 u32 newvalue = 0; ··· 95 94 shift = (offs & 0x7) * 4; 96 95 mask = 0x7 << shift; 97 96 98 - ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(irq))); 97 + ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq))); 99 98 ctrl &= ~mask; 100 99 ctrl |= newvalue << shift; 101 - __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(irq))); 100 + __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq))); 102 101 103 102 if ((0 <= offs) && (offs < 8)) 104 103 s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE); ··· 120 119 121 120 static struct irq_chip s5p_irq_eint = { 122 121 .name = "s5p-eint", 123 - .mask = s5p_irq_eint_mask, 124 - .unmask = s5p_irq_eint_unmask, 125 - .mask_ack = s5p_irq_eint_maskack, 126 - .ack = s5p_irq_eint_ack, 127 - .set_type = s5p_irq_eint_set_type, 122 + .irq_mask = s5p_irq_eint_mask, 123 + .irq_unmask = s5p_irq_eint_unmask, 124 + .irq_mask_ack = s5p_irq_eint_maskack, 125 + .irq_ack = s5p_irq_eint_ack, 126 + .irq_set_type = s5p_irq_eint_set_type, 128 127 #ifdef CONFIG_PM 129 - .set_wake = s3c_irqext_wake, 128 + .irq_set_wake = s3c_irqext_wake, 130 129 #endif 131 130 }; 132 131 ··· 160 159 s5p_irq_demux_eint(IRQ_EINT(24)); 161 160 } 162 161 163 - static inline void s5p_irq_vic_eint_mask(unsigned int irq) 162 + static inline void s5p_irq_vic_eint_mask(struct irq_data *data) 164 163 { 165 - void __iomem *base = get_irq_chip_data(irq); 164 + void __iomem *base = irq_data_get_irq_chip_data(data); 166 165 167 - s5p_irq_eint_mask(irq); 168 - writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE_CLEAR); 166 + s5p_irq_eint_mask(data); 167 + writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE_CLEAR); 169 168 } 170 169 171 - static void s5p_irq_vic_eint_unmask(unsigned int irq) 170 + static void s5p_irq_vic_eint_unmask(struct irq_data *data) 172 171 { 173 - void __iomem *base = get_irq_chip_data(irq); 172 + void __iomem *base = irq_data_get_irq_chip_data(data); 174 173 175 - s5p_irq_eint_unmask(irq); 176 - writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE); 174 + s5p_irq_eint_unmask(data); 175 + writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE); 177 176 } 178 177 179 - static inline void s5p_irq_vic_eint_ack(unsigned int irq) 178 + static inline void s5p_irq_vic_eint_ack(struct irq_data *data) 180 179 { 181 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 180 + __raw_writel(eint_irq_to_bit(data->irq), 181 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 182 182 } 183 183 184 - static void s5p_irq_vic_eint_maskack(unsigned int irq) 184 + static void s5p_irq_vic_eint_maskack(struct irq_data *data) 185 185 { 186 - s5p_irq_vic_eint_mask(irq); 187 - s5p_irq_vic_eint_ack(irq); 186 + s5p_irq_vic_eint_mask(data); 187 + s5p_irq_vic_eint_ack(data); 188 188 } 189 189 190 190 static struct irq_chip s5p_irq_vic_eint = { 191 191 .name = "s5p_vic_eint", 192 - .mask = s5p_irq_vic_eint_mask, 193 - .unmask = s5p_irq_vic_eint_unmask, 194 - .mask_ack = s5p_irq_vic_eint_maskack, 195 - .ack = s5p_irq_vic_eint_ack, 196 - .set_type = s5p_irq_eint_set_type, 192 + .irq_mask = s5p_irq_vic_eint_mask, 193 + .irq_unmask = s5p_irq_vic_eint_unmask, 194 + .irq_mask_ack = s5p_irq_vic_eint_maskack, 195 + .irq_ack = s5p_irq_vic_eint_ack, 196 + .irq_set_type = s5p_irq_eint_set_type, 197 197 #ifdef CONFIG_PM 198 - .set_wake = s3c_irqext_wake, 198 + .irq_set_wake = s3c_irqext_wake, 199 199 #endif 200 200 }; 201 201
+25 -25
arch/arm/plat-s5p/irq-gpioint.c
··· 30 30 31 31 static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; 32 32 33 - static int s5p_gpioint_get_group(unsigned int irq) 33 + static int s5p_gpioint_get_group(struct irq_data *data) 34 34 { 35 - struct gpio_chip *chip = get_irq_data(irq); 35 + struct gpio_chip *chip = irq_data_get_irq_data(data); 36 36 struct s3c_gpio_chip *s3c_chip = container_of(chip, 37 37 struct s3c_gpio_chip, chip); 38 38 int group; ··· 44 44 return group; 45 45 } 46 46 47 - static int s5p_gpioint_get_offset(unsigned int irq) 47 + static int s5p_gpioint_get_offset(struct irq_data *data) 48 48 { 49 - struct gpio_chip *chip = get_irq_data(irq); 49 + struct gpio_chip *chip = irq_data_get_irq_data(data); 50 50 struct s3c_gpio_chip *s3c_chip = container_of(chip, 51 51 struct s3c_gpio_chip, chip); 52 52 53 - return irq - s3c_chip->irq_base; 53 + return data->irq - s3c_chip->irq_base; 54 54 } 55 55 56 - static void s5p_gpioint_ack(unsigned int irq) 56 + static void s5p_gpioint_ack(struct irq_data *data) 57 57 { 58 58 int group, offset, pend_offset; 59 59 unsigned int value; 60 60 61 - group = s5p_gpioint_get_group(irq); 62 - offset = s5p_gpioint_get_offset(irq); 61 + group = s5p_gpioint_get_group(data); 62 + offset = s5p_gpioint_get_offset(data); 63 63 pend_offset = group << 2; 64 64 65 65 value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); ··· 67 67 __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); 68 68 } 69 69 70 - static void s5p_gpioint_mask(unsigned int irq) 70 + static void s5p_gpioint_mask(struct irq_data *data) 71 71 { 72 72 int group, offset, mask_offset; 73 73 unsigned int value; 74 74 75 - group = s5p_gpioint_get_group(irq); 76 - offset = s5p_gpioint_get_offset(irq); 75 + group = s5p_gpioint_get_group(data); 76 + offset = s5p_gpioint_get_offset(data); 77 77 mask_offset = group << 2; 78 78 79 79 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 81 81 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 82 82 } 83 83 84 - static void s5p_gpioint_unmask(unsigned int irq) 84 + static void s5p_gpioint_unmask(struct irq_data *data) 85 85 { 86 86 int group, offset, mask_offset; 87 87 unsigned int value; 88 88 89 - group = s5p_gpioint_get_group(irq); 90 - offset = s5p_gpioint_get_offset(irq); 89 + group = s5p_gpioint_get_group(data); 90 + offset = s5p_gpioint_get_offset(data); 91 91 mask_offset = group << 2; 92 92 93 93 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 95 95 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 96 96 } 97 97 98 - static void s5p_gpioint_mask_ack(unsigned int irq) 98 + static void s5p_gpioint_mask_ack(struct irq_data *data) 99 99 { 100 - s5p_gpioint_mask(irq); 101 - s5p_gpioint_ack(irq); 100 + s5p_gpioint_mask(data); 101 + s5p_gpioint_ack(data); 102 102 } 103 103 104 - static int s5p_gpioint_set_type(unsigned int irq, unsigned int type) 104 + static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type) 105 105 { 106 106 int group, offset, con_offset; 107 107 unsigned int value; 108 108 109 - group = s5p_gpioint_get_group(irq); 110 - offset = s5p_gpioint_get_offset(irq); 109 + group = s5p_gpioint_get_group(data); 110 + offset = s5p_gpioint_get_offset(data); 111 111 con_offset = group << 2; 112 112 113 113 switch (type) { ··· 142 142 143 143 struct irq_chip s5p_gpioint = { 144 144 .name = "s5p_gpioint", 145 - .ack = s5p_gpioint_ack, 146 - .mask = s5p_gpioint_mask, 147 - .mask_ack = s5p_gpioint_mask_ack, 148 - .unmask = s5p_gpioint_unmask, 149 - .set_type = s5p_gpioint_set_type, 145 + .irq_ack = s5p_gpioint_ack, 146 + .irq_mask = s5p_gpioint_mask, 147 + .irq_mask_ack = s5p_gpioint_mask_ack, 148 + .irq_unmask = s5p_gpioint_unmask, 149 + .irq_set_type = s5p_gpioint_set_type, 150 150 }; 151 151 152 152 static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
+3 -3
arch/arm/plat-s5p/irq-pm.c
··· 37 37 unsigned long s3c_irqwake_intallow = 0x00000006L; 38 38 unsigned long s3c_irqwake_eintallow = 0xffffffffL; 39 39 40 - int s3c_irq_wake(unsigned int irqno, unsigned int state) 40 + int s3c_irq_wake(struct irq_data *data, unsigned int state) 41 41 { 42 42 unsigned long irqbit; 43 43 44 - switch (irqno) { 44 + switch (data->irq) { 45 45 case IRQ_RTC_TIC: 46 46 case IRQ_RTC_ALARM: 47 - irqbit = 1 << (irqno + 1 - IRQ_RTC_ALARM); 47 + irqbit = 1 << (data->irq + 1 - IRQ_RTC_ALARM); 48 48 if (!state) 49 49 s3c_irqwake_intmask |= irqbit; 50 50 else
+328
arch/arm/plat-s5p/sysmmu.c
··· 1 + /* linux/arch/arm/plat-s5p/sysmmu.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/io.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include <mach/map.h> 16 + #include <mach/regs-sysmmu.h> 17 + #include <mach/sysmmu.h> 18 + 19 + #include <plat/sysmmu.h> 20 + 21 + struct sysmmu_controller s5p_sysmmu_cntlrs[S5P_SYSMMU_TOTAL_IPNUM]; 22 + 23 + void s5p_sysmmu_register(struct sysmmu_controller *sysmmuconp) 24 + { 25 + unsigned int reg_mmu_ctrl; 26 + unsigned int reg_mmu_status; 27 + unsigned int reg_pt_base_addr; 28 + unsigned int reg_int_status; 29 + unsigned int reg_page_ft_addr; 30 + 31 + reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 32 + reg_mmu_ctrl = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 33 + reg_mmu_status = __raw_readl(sysmmuconp->regs + S5P_MMU_STATUS); 34 + reg_pt_base_addr = __raw_readl(sysmmuconp->regs + S5P_PT_BASE_ADDR); 35 + reg_page_ft_addr = __raw_readl(sysmmuconp->regs + S5P_PAGE_FAULT_ADDR); 36 + 37 + printk(KERN_INFO "%s: ips:%s\n", __func__, sysmmuconp->name); 38 + printk(KERN_INFO "%s: MMU_CTRL:0x%X, ", __func__, reg_mmu_ctrl); 39 + printk(KERN_INFO "MMU_STATUS:0x%X, PT_BASE_ADDR:0x%X\n", reg_mmu_status, reg_pt_base_addr); 40 + printk(KERN_INFO "%s: INT_STATUS:0x%X, PAGE_FAULT_ADDR:0x%X\n", __func__, reg_int_status, reg_page_ft_addr); 41 + 42 + switch (reg_int_status & 0xFF) { 43 + case 0x1: 44 + printk(KERN_INFO "%s: Page fault\n", __func__); 45 + printk(KERN_INFO "%s: Virtual address causing last page fault or bus error : 0x%x\n", __func__ , reg_page_ft_addr); 46 + break; 47 + case 0x2: 48 + printk(KERN_INFO "%s: AR multi-hit fault\n", __func__); 49 + break; 50 + case 0x4: 51 + printk(KERN_INFO "%s: AW multi-hit fault\n", __func__); 52 + break; 53 + case 0x8: 54 + printk(KERN_INFO "%s: Bus error\n", __func__); 55 + break; 56 + case 0x10: 57 + printk(KERN_INFO "%s: AR Security protection fault\n", __func__); 58 + break; 59 + case 0x20: 60 + printk(KERN_INFO "%s: AR Access protection fault\n", __func__); 61 + break; 62 + case 0x40: 63 + printk(KERN_INFO "%s: AW Security protection fault\n", __func__); 64 + break; 65 + case 0x80: 66 + printk(KERN_INFO "%s: AW Access protection fault\n", __func__); 67 + break; 68 + } 69 + } 70 + 71 + static irqreturn_t s5p_sysmmu_irq(int irq, void *dev_id) 72 + { 73 + unsigned int i; 74 + unsigned int reg_int_status; 75 + struct sysmmu_controller *sysmmuconp; 76 + 77 + for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 78 + sysmmuconp = &s5p_sysmmu_cntlrs[i]; 79 + 80 + if (sysmmuconp->enable == true) { 81 + reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 82 + 83 + if (reg_int_status & 0xFF) 84 + s5p_sysmmu_register(sysmmuconp); 85 + } 86 + } 87 + return IRQ_HANDLED; 88 + } 89 + 90 + int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd) 91 + { 92 + struct sysmmu_controller *sysmmuconp = NULL; 93 + 94 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 95 + 96 + if (sysmmuconp == NULL) { 97 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 98 + return 1; 99 + } 100 + 101 + /* Set sysmmu page table base address */ 102 + __raw_writel(pgd, sysmmuconp->regs + S5P_PT_BASE_ADDR); 103 + 104 + if (s5p_sysmmu_tlb_invalidate(ips) != 0) 105 + printk(KERN_ERR "failed s5p_sysmmu_tlb_invalidate\n"); 106 + 107 + return 0; 108 + } 109 + 110 + static int s5p_sysmmu_set_tablebase(sysmmu_ips ips) 111 + { 112 + unsigned int pg; 113 + struct sysmmu_controller *sysmmuconp; 114 + 115 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 116 + 117 + if (sysmmuconp == NULL) { 118 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 119 + return 1; 120 + } 121 + 122 + __asm__("mrc p15, 0, %0, c2, c0, 0" \ 123 + : "=r" (pg) : : "cc"); \ 124 + pg &= ~0x3fff; 125 + 126 + sysmmu_debug("CP15 TTBR0 : 0x%x\n", pg); 127 + 128 + /* Set sysmmu page table base address */ 129 + __raw_writel(pg, sysmmuconp->regs + S5P_PT_BASE_ADDR); 130 + 131 + return 0; 132 + } 133 + 134 + int s5p_sysmmu_enable(sysmmu_ips ips) 135 + { 136 + unsigned int reg; 137 + 138 + struct sysmmu_controller *sysmmuconp; 139 + 140 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 141 + 142 + if (sysmmuconp == NULL) { 143 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 144 + return 1; 145 + } 146 + 147 + s5p_sysmmu_set_tablebase(ips); 148 + 149 + /* replacement policy : LRU */ 150 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 151 + reg |= 0x1; 152 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG); 153 + 154 + /* Enable interrupt, Enable MMU */ 155 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 156 + reg |= (0x1 << 2) | (0x1 << 0); 157 + 158 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 159 + 160 + sysmmuconp->enable = true; 161 + 162 + return 0; 163 + } 164 + 165 + int s5p_sysmmu_disable(sysmmu_ips ips) 166 + { 167 + unsigned int reg; 168 + 169 + struct sysmmu_controller *sysmmuconp = NULL; 170 + 171 + if (ips > S5P_SYSMMU_TOTAL_IPNUM) 172 + printk(KERN_ERR "failed to get ips parameter\n"); 173 + 174 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 175 + 176 + if (sysmmuconp == NULL) { 177 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 178 + return 1; 179 + } 180 + 181 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 182 + 183 + /* replacement policy : LRU */ 184 + reg |= 0x1; 185 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG); 186 + 187 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 188 + 189 + /* Disable MMU */ 190 + reg &= ~0x1; 191 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 192 + 193 + sysmmuconp->enable = false; 194 + 195 + return 0; 196 + } 197 + 198 + int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips) 199 + { 200 + unsigned int reg; 201 + struct sysmmu_controller *sysmmuconp = NULL; 202 + 203 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 204 + 205 + if (sysmmuconp == NULL) { 206 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 207 + return 1; 208 + } 209 + 210 + /* set Block MMU for flush TLB */ 211 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 212 + reg |= 0x1 << 1; 213 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 214 + 215 + /* flush all TLB entry */ 216 + __raw_writel(0x1, sysmmuconp->regs + S5P_MMU_FLUSH); 217 + 218 + /* set Un-block MMU after flush TLB */ 219 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 220 + reg &= ~(0x1 << 1); 221 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 222 + 223 + return 0; 224 + } 225 + 226 + static int s5p_sysmmu_probe(struct platform_device *pdev) 227 + { 228 + int i; 229 + int ret; 230 + struct resource *res; 231 + struct sysmmu_controller *sysmmuconp; 232 + sysmmu_ips ips; 233 + 234 + for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 235 + sysmmuconp = &s5p_sysmmu_cntlrs[i]; 236 + if (sysmmuconp == NULL) { 237 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 238 + ret = -ENOENT; 239 + goto err_res; 240 + } 241 + 242 + sysmmuconp->name = sysmmu_ips_name[i]; 243 + 244 + res = platform_get_resource(pdev, IORESOURCE_MEM, i); 245 + if (!res) { 246 + printk(KERN_ERR "failed to get sysmmu resource\n"); 247 + ret = -ENODEV; 248 + goto err_res; 249 + } 250 + 251 + sysmmuconp->mem = request_mem_region(res->start, 252 + ((res->end) - (res->start)) + 1, pdev->name); 253 + if (!sysmmuconp->mem) { 254 + pr_err("failed to request sysmmu memory region\n"); 255 + ret = -EBUSY; 256 + goto err_res; 257 + } 258 + 259 + sysmmuconp->regs = ioremap(res->start, res->end - res->start + 1); 260 + if (!sysmmuconp->regs) { 261 + pr_err("failed to sysmmu ioremap\n"); 262 + ret = -ENXIO; 263 + goto err_reg; 264 + } 265 + 266 + sysmmuconp->irq = platform_get_irq(pdev, i); 267 + if (sysmmuconp->irq <= 0) { 268 + pr_err("failed to get sysmmu irq resource\n"); 269 + ret = -ENOENT; 270 + goto err_map; 271 + } 272 + 273 + ret = request_irq(sysmmuconp->irq, s5p_sysmmu_irq, IRQF_DISABLED, pdev->name, sysmmuconp); 274 + if (ret) { 275 + pr_err("failed to request irq\n"); 276 + ret = -ENOENT; 277 + goto err_map; 278 + } 279 + 280 + ips = (sysmmu_ips)i; 281 + 282 + sysmmuconp->ips = ips; 283 + } 284 + 285 + return 0; 286 + 287 + err_reg: 288 + release_mem_region((resource_size_t)sysmmuconp->mem, (resource_size_t)((res->end) - (res->start) + 1)); 289 + err_map: 290 + iounmap(sysmmuconp->regs); 291 + err_res: 292 + return ret; 293 + } 294 + 295 + static int s5p_sysmmu_remove(struct platform_device *pdev) 296 + { 297 + return 0; 298 + } 299 + int s5p_sysmmu_runtime_suspend(struct device *dev) 300 + { 301 + return 0; 302 + } 303 + 304 + int s5p_sysmmu_runtime_resume(struct device *dev) 305 + { 306 + return 0; 307 + } 308 + 309 + const struct dev_pm_ops s5p_sysmmu_pm_ops = { 310 + .runtime_suspend = s5p_sysmmu_runtime_suspend, 311 + .runtime_resume = s5p_sysmmu_runtime_resume, 312 + }; 313 + 314 + static struct platform_driver s5p_sysmmu_driver = { 315 + .probe = s5p_sysmmu_probe, 316 + .remove = s5p_sysmmu_remove, 317 + .driver = { 318 + .owner = THIS_MODULE, 319 + .name = "s5p-sysmmu", 320 + .pm = &s5p_sysmmu_pm_ops, 321 + } 322 + }; 323 + 324 + static int __init s5p_sysmmu_init(void) 325 + { 326 + return platform_driver_register(&s5p_sysmmu_driver); 327 + } 328 + arch_initcall(s5p_sysmmu_init);
+14
arch/arm/plat-samsung/Kconfig
··· 95 95 help 96 96 Internal configuration to enable the correct GPIO pull helper 97 97 98 + config S3C_GPIO_PULL_S3C2443 99 + bool 100 + select S3C_GPIO_PULL_UPDOWN 101 + help 102 + Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO 103 + 98 104 config S3C_GPIO_PULL_DOWN 99 105 bool 100 106 help ··· 338 332 Compile support for wakeup-mask controls found on the S3C6400 339 333 and above. This code allows a set of interrupt to wakeup-mask 340 334 mappings. See <plat/wakeup-mask.h> 335 + 336 + comment "Power Domain" 337 + 338 + config SAMSUNG_PD 339 + bool "Samsung Power Domain" 340 + depends on PM_RUNTIME 341 + help 342 + Say Y here if you want to control Power Domain by Runtime PM. 341 343 342 344 endif
+4
arch/arm/plat-samsung/Makefile
··· 74 74 75 75 obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o 76 76 77 + # PD support 78 + 79 + obj-$(CONFIG_SAMSUNG_PD) += pd.o 80 + 77 81 # PWM support 78 82 79 83 obj-$(CONFIG_HAVE_PWM) += pwm.o
+92
arch/arm/plat-samsung/clock.c
··· 39 39 #include <linux/clk.h> 40 40 #include <linux/spinlock.h> 41 41 #include <linux/io.h> 42 + #if defined(CONFIG_DEBUG_FS) 43 + #include <linux/debugfs.h> 44 + #endif 42 45 43 46 #include <mach/hardware.h> 44 47 #include <asm/irq.h> ··· 450 447 return 0; 451 448 } 452 449 450 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 451 + /* debugfs support to trace clock tree hierarchy and attributes */ 452 + 453 + static struct dentry *clk_debugfs_root; 454 + 455 + static int clk_debugfs_register_one(struct clk *c) 456 + { 457 + int err; 458 + struct dentry *d, *child, *child_tmp; 459 + struct clk *pa = c->parent; 460 + char s[255]; 461 + char *p = s; 462 + 463 + p += sprintf(p, "%s", c->name); 464 + 465 + if (c->id >= 0) 466 + sprintf(p, ":%d", c->id); 467 + 468 + d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root); 469 + if (!d) 470 + return -ENOMEM; 471 + 472 + c->dent = d; 473 + 474 + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usage); 475 + if (!d) { 476 + err = -ENOMEM; 477 + goto err_out; 478 + } 479 + 480 + d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 481 + if (!d) { 482 + err = -ENOMEM; 483 + goto err_out; 484 + } 485 + return 0; 486 + 487 + err_out: 488 + d = c->dent; 489 + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) 490 + debugfs_remove(child); 491 + debugfs_remove(c->dent); 492 + return err; 493 + } 494 + 495 + static int clk_debugfs_register(struct clk *c) 496 + { 497 + int err; 498 + struct clk *pa = c->parent; 499 + 500 + if (pa && !pa->dent) { 501 + err = clk_debugfs_register(pa); 502 + if (err) 503 + return err; 504 + } 505 + 506 + if (!c->dent) { 507 + err = clk_debugfs_register_one(c); 508 + if (err) 509 + return err; 510 + } 511 + return 0; 512 + } 513 + 514 + static int __init clk_debugfs_init(void) 515 + { 516 + struct clk *c; 517 + struct dentry *d; 518 + int err; 519 + 520 + d = debugfs_create_dir("clock", NULL); 521 + if (!d) 522 + return -ENOMEM; 523 + clk_debugfs_root = d; 524 + 525 + list_for_each_entry(c, &clocks, list) { 526 + err = clk_debugfs_register(c); 527 + if (err) 528 + goto err_out; 529 + } 530 + return 0; 531 + 532 + err_out: 533 + debugfs_remove_recursive(clk_debugfs_root); 534 + return err; 535 + } 536 + late_initcall(clk_debugfs_init); 537 + 538 + #endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
-2
arch/arm/plat-samsung/dev-nand.c
··· 126 126 127 127 s3c_device_nand.dev.platform_data = npd; 128 128 } 129 - 130 - EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
+42
arch/arm/plat-samsung/gpio-config.c
··· 278 278 pup &= 0x3; 279 279 return (__force s3c_gpio_pull_t)pup; 280 280 } 281 + 282 + #ifdef CONFIG_S3C_GPIO_PULL_S3C2443 283 + int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip, 284 + unsigned int off, s3c_gpio_pull_t pull) 285 + { 286 + switch (pull) { 287 + case S3C_GPIO_PULL_NONE: 288 + pull = 0x01; 289 + break; 290 + case S3C_GPIO_PULL_UP: 291 + pull = 0x00; 292 + break; 293 + case S3C_GPIO_PULL_DOWN: 294 + pull = 0x02; 295 + break; 296 + } 297 + return s3c_gpio_setpull_updown(chip, off, pull); 298 + } 299 + 300 + s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip, 301 + unsigned int off) 302 + { 303 + s3c_gpio_pull_t pull; 304 + 305 + pull = s3c_gpio_getpull_updown(chip, off); 306 + 307 + switch (pull) { 308 + case 0x00: 309 + pull = S3C_GPIO_PULL_UP; 310 + break; 311 + case 0x01: 312 + case 0x03: 313 + pull = S3C_GPIO_PULL_NONE; 314 + break; 315 + case 0x02: 316 + pull = S3C_GPIO_PULL_DOWN; 317 + break; 318 + } 319 + 320 + return pull; 321 + } 322 + #endif 281 323 #endif 282 324 283 325 #if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
+7
arch/arm/plat-samsung/gpiolib.c
··· 197 197 s3c_gpiolib_add(chip); 198 198 } 199 199 } 200 + 201 + void __init samsung_gpiolib_add_2bit_chips(struct s3c_gpio_chip *chip, 202 + int nr_chips) 203 + { 204 + for (; nr_chips > 0; nr_chips--, chip++) 205 + s3c_gpiolib_add(chip); 206 + }
+3
arch/arm/plat-samsung/include/plat/clock.h
··· 47 47 48 48 struct clk_ops *ops; 49 49 int (*enable)(struct clk *, int enable); 50 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 51 + struct dentry *dent; /* For visible tree hierarchy */ 52 + #endif 50 53 }; 51 54 52 55 /* other clocks which may be registered by board support */
+8
arch/arm/plat-samsung/include/plat/devs.h
··· 104 104 extern struct platform_device s5pv310_device_i2s1; 105 105 extern struct platform_device s5pv310_device_i2s2; 106 106 extern struct platform_device s5pv310_device_spdif; 107 + extern struct platform_device s5pv310_device_pd[]; 107 108 108 109 extern struct platform_device s5p6442_device_pcm0; 109 110 extern struct platform_device s5p6442_device_pcm1; ··· 116 115 extern struct platform_device s5p6440_device_iis; 117 116 118 117 extern struct platform_device s5p6450_device_iis0; 118 + extern struct platform_device s5p6450_device_iis1; 119 + extern struct platform_device s5p6450_device_iis2; 119 120 extern struct platform_device s5p6450_device_pcm0; 120 121 121 122 extern struct platform_device s5pc100_device_ac97; ··· 133 130 extern struct platform_device s5p_device_fimc0; 134 131 extern struct platform_device s5p_device_fimc1; 135 132 extern struct platform_device s5p_device_fimc2; 133 + 134 + extern struct platform_device s5p_device_mipi_csis0; 135 + extern struct platform_device s5p_device_mipi_csis1; 136 + 137 + extern struct platform_device s5pv310_device_sysmmu; 136 138 137 139 /* s3c2440 specific devices */ 138 140
+1 -1
arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
··· 244 244 * This helper function reads the state of the pull-{up,down} resistor for the 245 245 * given GPIO in the same case as s3c_gpio_setpull_upown. 246 246 */ 247 - extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip *chip, 247 + extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip, 248 248 unsigned int off); 249 249 250 250 #endif /* __PLAT_GPIO_CFG_HELPERS_H */
+2
arch/arm/plat-samsung/include/plat/gpio-core.h
··· 118 118 int nr_chips); 119 119 extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip, 120 120 int nr_chips); 121 + extern void samsung_gpiolib_add_2bit_chips(struct s3c_gpio_chip *chip, 122 + int nr_chips); 121 123 122 124 extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); 123 125 extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
+30
arch/arm/plat-samsung/include/plat/pd.h
··· 1 + /* linux/arch/arm/plat-samsung/include/plat/pd.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #ifndef __ASM_PLAT_SAMSUNG_PD_H 12 + #define __ASM_PLAT_SAMSUNG_PD_H __FILE__ 13 + 14 + struct samsung_pd_info { 15 + int (*enable)(struct device *dev); 16 + int (*disable)(struct device *dev); 17 + void __iomem *base; 18 + }; 19 + 20 + enum s5pv310_pd_block { 21 + PD_MFC, 22 + PD_G3D, 23 + PD_LCD0, 24 + PD_LCD1, 25 + PD_TV, 26 + PD_CAM, 27 + PD_GPS 28 + }; 29 + 30 + #endif /* __ASM_PLAT_SAMSUNG_PD_H */
+3 -1
arch/arm/plat-samsung/include/plat/pm.h
··· 15 15 * management 16 16 */ 17 17 18 + #include <linux/irq.h> 19 + 18 20 #ifdef CONFIG_PM 19 21 20 22 extern __init int s3c_pm_init(void); ··· 102 100 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); 103 101 104 102 #ifdef CONFIG_PM 105 - extern int s3c_irqext_wake(unsigned int irqno, unsigned int state); 103 + extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 106 104 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); 107 105 extern int s3c24xx_irq_resume(struct sys_device *dev); 108 106 #else
+35
arch/arm/plat-samsung/include/plat/sdhci.h
··· 107 107 108 108 /* Helper function availablity */ 109 109 110 + extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 111 + extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 110 112 extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 111 113 extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 112 114 extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); ··· 124 122 extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 125 123 extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 126 124 125 + /* S3C2416 SDHCI setup */ 126 + 127 + #ifdef CONFIG_S3C2416_SETUP_SDHCI 128 + extern char *s3c2416_hsmmc_clksrcs[4]; 129 + 130 + extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev, 131 + void __iomem *r, 132 + struct mmc_ios *ios, 133 + struct mmc_card *card); 134 + 135 + static inline void s3c2416_default_sdhci0(void) 136 + { 137 + #ifdef CONFIG_S3C_DEV_HSMMC 138 + s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 139 + s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; 140 + s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; 141 + #endif /* CONFIG_S3C_DEV_HSMMC */ 142 + } 143 + 144 + static inline void s3c2416_default_sdhci1(void) 145 + { 146 + #ifdef CONFIG_S3C_DEV_HSMMC1 147 + s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 148 + s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; 149 + s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; 150 + #endif /* CONFIG_S3C_DEV_HSMMC1 */ 151 + } 152 + 153 + #else 154 + static inline void s3c2416_default_sdhci0(void) { } 155 + static inline void s3c2416_default_sdhci1(void) { } 156 + 157 + #endif /* CONFIG_S3C2416_SETUP_SDHCI */ 127 158 /* S3C64XX SDHCI setup */ 128 159 129 160 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
+20 -20
arch/arm/plat-samsung/irq-uart.c
··· 28 28 * are consecutive when looking up the interrupt in the demux routines. 29 29 */ 30 30 31 - static inline void __iomem *s3c_irq_uart_base(unsigned int irq) 31 + static inline void __iomem *s3c_irq_uart_base(struct irq_data *data) 32 32 { 33 - struct s3c_uart_irq *uirq = get_irq_chip_data(irq); 33 + struct s3c_uart_irq *uirq = irq_data_get_irq_chip_data(data); 34 34 return uirq->regs; 35 35 } 36 36 ··· 39 39 return irq & 3; 40 40 } 41 41 42 - static void s3c_irq_uart_mask(unsigned int irq) 42 + static void s3c_irq_uart_mask(struct irq_data *data) 43 43 { 44 - void __iomem *regs = s3c_irq_uart_base(irq); 45 - unsigned int bit = s3c_irq_uart_bit(irq); 44 + void __iomem *regs = s3c_irq_uart_base(data); 45 + unsigned int bit = s3c_irq_uart_bit(data->irq); 46 46 u32 reg; 47 47 48 48 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 50 50 __raw_writel(reg, regs + S3C64XX_UINTM); 51 51 } 52 52 53 - static void s3c_irq_uart_maskack(unsigned int irq) 53 + static void s3c_irq_uart_maskack(struct irq_data *data) 54 54 { 55 - void __iomem *regs = s3c_irq_uart_base(irq); 56 - unsigned int bit = s3c_irq_uart_bit(irq); 55 + void __iomem *regs = s3c_irq_uart_base(data); 56 + unsigned int bit = s3c_irq_uart_bit(data->irq); 57 57 u32 reg; 58 58 59 59 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 62 62 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 63 63 } 64 64 65 - static void s3c_irq_uart_unmask(unsigned int irq) 65 + static void s3c_irq_uart_unmask(struct irq_data *data) 66 66 { 67 - void __iomem *regs = s3c_irq_uart_base(irq); 68 - unsigned int bit = s3c_irq_uart_bit(irq); 67 + void __iomem *regs = s3c_irq_uart_base(data); 68 + unsigned int bit = s3c_irq_uart_bit(data->irq); 69 69 u32 reg; 70 70 71 71 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 73 73 __raw_writel(reg, regs + S3C64XX_UINTM); 74 74 } 75 75 76 - static void s3c_irq_uart_ack(unsigned int irq) 76 + static void s3c_irq_uart_ack(struct irq_data *data) 77 77 { 78 - void __iomem *regs = s3c_irq_uart_base(irq); 79 - unsigned int bit = s3c_irq_uart_bit(irq); 78 + void __iomem *regs = s3c_irq_uart_base(data); 79 + unsigned int bit = s3c_irq_uart_bit(data->irq); 80 80 81 81 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 82 82 } 83 83 84 84 static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) 85 85 { 86 - struct s3c_uart_irq *uirq = desc->handler_data; 86 + struct s3c_uart_irq *uirq = desc->irq_data.handler_data; 87 87 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP); 88 88 int base = uirq->base_irq; 89 89 ··· 99 99 100 100 static struct irq_chip s3c_irq_uart = { 101 101 .name = "s3c-uart", 102 - .mask = s3c_irq_uart_mask, 103 - .unmask = s3c_irq_uart_unmask, 104 - .mask_ack = s3c_irq_uart_maskack, 105 - .ack = s3c_irq_uart_ack, 102 + .irq_mask = s3c_irq_uart_mask, 103 + .irq_unmask = s3c_irq_uart_unmask, 104 + .irq_mask_ack = s3c_irq_uart_maskack, 105 + .irq_ack = s3c_irq_uart_ack, 106 106 }; 107 107 108 108 static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) ··· 124 124 set_irq_flags(irq, IRQF_VALID); 125 125 } 126 126 127 - desc->handler_data = uirq; 127 + desc->irq_data.handler_data = uirq; 128 128 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart); 129 129 } 130 130
+15 -11
arch/arm/plat-samsung/irq-vic-timer.c
··· 24 24 25 25 static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) 26 26 { 27 - generic_handle_irq((int)desc->handler_data); 27 + generic_handle_irq((int)desc->irq_data.handler_data); 28 28 } 29 29 30 30 /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ 31 31 32 - static void s3c_irq_timer_mask(unsigned int irq) 32 + static void s3c_irq_timer_mask(struct irq_data *data) 33 33 { 34 34 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 35 + u32 mask = (u32)data->chip_data; 35 36 36 37 reg &= 0x1f; /* mask out pending interrupts */ 37 - reg &= ~(1 << (irq - IRQ_TIMER0)); 38 + reg &= ~mask; 38 39 __raw_writel(reg, S3C64XX_TINT_CSTAT); 39 40 } 40 41 41 - static void s3c_irq_timer_unmask(unsigned int irq) 42 + static void s3c_irq_timer_unmask(struct irq_data *data) 42 43 { 43 44 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 45 + u32 mask = (u32)data->chip_data; 44 46 45 47 reg &= 0x1f; /* mask out pending interrupts */ 46 - reg |= 1 << (irq - IRQ_TIMER0); 48 + reg |= mask; 47 49 __raw_writel(reg, S3C64XX_TINT_CSTAT); 48 50 } 49 51 50 - static void s3c_irq_timer_ack(unsigned int irq) 52 + static void s3c_irq_timer_ack(struct irq_data *data) 51 53 { 52 54 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 55 + u32 mask = (u32)data->chip_data; 53 56 54 57 reg &= 0x1f; 55 - reg |= (1 << 5) << (irq - IRQ_TIMER0); 58 + reg |= mask << 5; 56 59 __raw_writel(reg, S3C64XX_TINT_CSTAT); 57 60 } 58 61 59 62 static struct irq_chip s3c_irq_timer = { 60 63 .name = "s3c-timer", 61 - .mask = s3c_irq_timer_mask, 62 - .unmask = s3c_irq_timer_unmask, 63 - .ack = s3c_irq_timer_ack, 64 + .irq_mask = s3c_irq_timer_mask, 65 + .irq_unmask = s3c_irq_timer_unmask, 66 + .irq_ack = s3c_irq_timer_ack, 64 67 }; 65 68 66 69 /** ··· 82 79 set_irq_chained_handler(parent_irq, s3c_irq_demux_vic_timer); 83 80 84 81 set_irq_chip(timer_irq, &s3c_irq_timer); 82 + set_irq_chip_data(timer_irq, (void *)(1 << (timer_irq - IRQ_TIMER0))); 85 83 set_irq_handler(timer_irq, handle_level_irq); 86 84 set_irq_flags(timer_irq, IRQF_VALID); 87 85 88 - desc->handler_data = (void *)timer_irq; 86 + desc->irq_data.handler_data = (void *)timer_irq; 89 87 }
+95
arch/arm/plat-samsung/pd.c
··· 1 + /* linux/arch/arm/plat-samsung/pd.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * Samsung Power domain support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/init.h> 14 + #include <linux/module.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/err.h> 17 + #include <linux/pm_runtime.h> 18 + 19 + #include <plat/pd.h> 20 + 21 + static int samsung_pd_probe(struct platform_device *pdev) 22 + { 23 + struct samsung_pd_info *pdata = pdev->dev.platform_data; 24 + struct device *dev = &pdev->dev; 25 + 26 + if (!pdata) { 27 + dev_err(dev, "no device data specified\n"); 28 + return -ENOENT; 29 + } 30 + 31 + pm_runtime_set_active(dev); 32 + pm_runtime_enable(dev); 33 + 34 + dev_info(dev, "power domain registered\n"); 35 + return 0; 36 + } 37 + 38 + static int __devexit samsung_pd_remove(struct platform_device *pdev) 39 + { 40 + struct device *dev = &pdev->dev; 41 + 42 + pm_runtime_disable(dev); 43 + return 0; 44 + } 45 + 46 + static int samsung_pd_runtime_suspend(struct device *dev) 47 + { 48 + struct samsung_pd_info *pdata = dev->platform_data; 49 + int ret = 0; 50 + 51 + if (pdata->disable) 52 + ret = pdata->disable(dev); 53 + 54 + dev_dbg(dev, "suspended\n"); 55 + return ret; 56 + } 57 + 58 + static int samsung_pd_runtime_resume(struct device *dev) 59 + { 60 + struct samsung_pd_info *pdata = dev->platform_data; 61 + int ret = 0; 62 + 63 + if (pdata->enable) 64 + ret = pdata->enable(dev); 65 + 66 + dev_dbg(dev, "resumed\n"); 67 + return ret; 68 + } 69 + 70 + static const struct dev_pm_ops samsung_pd_pm_ops = { 71 + .runtime_suspend = samsung_pd_runtime_suspend, 72 + .runtime_resume = samsung_pd_runtime_resume, 73 + }; 74 + 75 + static struct platform_driver samsung_pd_driver = { 76 + .driver = { 77 + .name = "samsung-pd", 78 + .owner = THIS_MODULE, 79 + .pm = &samsung_pd_pm_ops, 80 + }, 81 + .probe = samsung_pd_probe, 82 + .remove = __devexit_p(samsung_pd_remove), 83 + }; 84 + 85 + static int __init samsung_pd_init(void) 86 + { 87 + int ret; 88 + 89 + ret = platform_driver_register(&samsung_pd_driver); 90 + if (ret) 91 + printk(KERN_ERR "%s: failed to add PD driver\n", __func__); 92 + 93 + return ret; 94 + } 95 + arch_initcall(samsung_pd_init);
+3 -3
arch/arm/plat-samsung/pm.c
··· 136 136 unsigned long s3c_irqwake_intmask = 0xffffffffL; 137 137 unsigned long s3c_irqwake_eintmask = 0xffffffffL; 138 138 139 - int s3c_irqext_wake(unsigned int irqno, unsigned int state) 139 + int s3c_irqext_wake(struct irq_data *data, unsigned int state) 140 140 { 141 - unsigned long bit = 1L << IRQ_EINT_BIT(irqno); 141 + unsigned long bit = 1L << IRQ_EINT_BIT(data->irq); 142 142 143 143 if (!(s3c_irqwake_eintallow & bit)) 144 144 return -ENOENT; 145 145 146 146 printk(KERN_INFO "wake %s for irq %d\n", 147 - state ? "enabled" : "disabled", irqno); 147 + state ? "enabled" : "disabled", data->irq); 148 148 149 149 if (!state) 150 150 s3c_irqwake_eintmask |= bit;
+11 -11
arch/arm/plat-spear/shirq.c
··· 20 20 struct spear_shirq *shirq; 21 21 static DEFINE_SPINLOCK(lock); 22 22 23 - static void shirq_irq_mask(unsigned irq) 23 + static void shirq_irq_mask(struct irq_data *d) 24 24 { 25 - struct spear_shirq *shirq = get_irq_chip_data(irq); 26 - u32 val, id = irq - shirq->dev_config[0].virq; 25 + struct spear_shirq *shirq = irq_data_get_irq_chip_data(d); 26 + u32 val, id = d->irq - shirq->dev_config[0].virq; 27 27 unsigned long flags; 28 28 29 29 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 39 39 spin_unlock_irqrestore(&lock, flags); 40 40 } 41 41 42 - static void shirq_irq_unmask(unsigned irq) 42 + static void shirq_irq_unmask(struct irq_data *d) 43 43 { 44 - struct spear_shirq *shirq = get_irq_chip_data(irq); 45 - u32 val, id = irq - shirq->dev_config[0].virq; 44 + struct spear_shirq *shirq = irq_data_get_irq_chip_data(d); 45 + u32 val, id = d->irq - shirq->dev_config[0].virq; 46 46 unsigned long flags; 47 47 48 48 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 60 60 61 61 static struct irq_chip shirq_chip = { 62 62 .name = "spear_shirq", 63 - .ack = shirq_irq_mask, 64 - .mask = shirq_irq_mask, 65 - .unmask = shirq_irq_unmask, 63 + .irq_ack = shirq_irq_mask, 64 + .irq_mask = shirq_irq_mask, 65 + .irq_unmask = shirq_irq_unmask, 66 66 }; 67 67 68 68 static void shirq_handler(unsigned irq, struct irq_desc *desc) ··· 70 70 u32 i, val, mask; 71 71 struct spear_shirq *shirq = get_irq_data(irq); 72 72 73 - desc->chip->ack(irq); 73 + desc->irq_data.chip->irq_ack(&desc->irq_data); 74 74 while ((val = readl(shirq->regs.base + shirq->regs.status_reg) & 75 75 shirq->regs.status_reg_mask)) { 76 76 for (i = 0; (i < shirq->dev_count) && val; i++) { ··· 92 92 writel(mask, shirq->regs.base + shirq->regs.clear_reg); 93 93 } 94 94 } 95 - desc->chip->unmask(irq); 95 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 96 96 } 97 97 98 98 int spear_shirq_register(struct spear_shirq *shirq)
+1 -1
arch/arm/plat-stmp3xxx/irq.c
··· 34 34 35 35 /* Disable all interrupts initially */ 36 36 for (i = 0; i < NR_REAL_IRQS; i++) { 37 - chip->mask(i); 37 + chip->irq_mask(irq_get_irq_data(i)); 38 38 set_irq_chip(i, chip); 39 39 set_irq_handler(i, handle_level_irq); 40 40 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+16 -16
arch/arm/plat-stmp3xxx/pinmux.c
··· 351 351 } 352 352 EXPORT_SYMBOL(stmp3xxx_release_pin_group); 353 353 354 - static int stmp3xxx_irq_to_gpio(int irq, 354 + static int stmp3xxx_irq_data_to_gpio(struct irq_data *d, 355 355 struct stmp3xxx_pinmux_bank **bank, unsigned *gpio) 356 356 { 357 357 struct stmp3xxx_pinmux_bank *pm; 358 358 359 359 for (pm = pinmux_banks; pm < pinmux_banks + NR_BANKS; pm++) 360 - if (pm->virq <= irq && irq < pm->virq + 32) { 360 + if (pm->virq <= d->irq && d->irq < pm->virq + 32) { 361 361 *bank = pm; 362 - *gpio = irq - pm->virq; 362 + *gpio = d->irq - pm->virq; 363 363 return 0; 364 364 } 365 365 return -ENOENT; 366 366 } 367 367 368 - static int stmp3xxx_set_irqtype(unsigned irq, unsigned type) 368 + static int stmp3xxx_set_irqtype(struct irq_data *d, unsigned type) 369 369 { 370 370 struct stmp3xxx_pinmux_bank *pm; 371 371 unsigned gpio; 372 372 int l, p; 373 373 374 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 374 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 375 375 switch (type) { 376 376 case IRQ_TYPE_EDGE_RISING: 377 377 l = 0; p = 1; break; ··· 398 398 return 0; 399 399 } 400 400 401 - static void stmp3xxx_pin_ack_irq(unsigned irq) 401 + static void stmp3xxx_pin_ack_irq(struct irq_data *d) 402 402 { 403 403 u32 stat; 404 404 struct stmp3xxx_pinmux_bank *pm; 405 405 unsigned gpio; 406 406 407 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 407 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 408 408 stat = __raw_readl(pm->irqstat) & (1 << gpio); 409 409 stmp3xxx_clearl(stat, pm->irqstat); 410 410 } 411 411 412 - static void stmp3xxx_pin_mask_irq(unsigned irq) 412 + static void stmp3xxx_pin_mask_irq(struct irq_data *d) 413 413 { 414 414 struct stmp3xxx_pinmux_bank *pm; 415 415 unsigned gpio; 416 416 417 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 417 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 418 418 stmp3xxx_clearl(1 << gpio, pm->irqen); 419 419 stmp3xxx_clearl(1 << gpio, pm->pin2irq); 420 420 } 421 421 422 - static void stmp3xxx_pin_unmask_irq(unsigned irq) 422 + static void stmp3xxx_pin_unmask_irq(struct irq_data *d) 423 423 { 424 424 struct stmp3xxx_pinmux_bank *pm; 425 425 unsigned gpio; 426 426 427 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 427 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 428 428 stmp3xxx_setl(1 << gpio, pm->irqen); 429 429 stmp3xxx_setl(1 << gpio, pm->pin2irq); 430 430 } ··· 503 503 } 504 504 505 505 static struct irq_chip gpio_irq_chip = { 506 - .ack = stmp3xxx_pin_ack_irq, 507 - .mask = stmp3xxx_pin_mask_irq, 508 - .unmask = stmp3xxx_pin_unmask_irq, 509 - .set_type = stmp3xxx_set_irqtype, 506 + .irq_ack = stmp3xxx_pin_ack_irq, 507 + .irq_mask = stmp3xxx_pin_mask_irq, 508 + .irq_unmask = stmp3xxx_pin_unmask_irq, 509 + .irq_set_type = stmp3xxx_set_irqtype, 510 510 }; 511 511 512 512 int __init stmp3xxx_pinmux_init(int virtual_irq_start) ··· 533 533 pm->virq = virtual_irq_start + b * 32; 534 534 535 535 for (virq = pm->virq; virq < pm->virq; virq++) { 536 - gpio_irq_chip.mask(virq); 536 + gpio_irq_chip.irq_mask(irq_get_irq_data(virq)); 537 537 set_irq_chip(virq, &gpio_irq_chip); 538 538 set_irq_handler(virq, handle_level_irq); 539 539 set_irq_flags(virq, IRQF_VALID);
+2 -2
drivers/serial/samsung.c
··· 883 883 884 884 static struct uart_driver s3c24xx_uart_drv = { 885 885 .owner = THIS_MODULE, 886 - .dev_name = "s3c2410_serial", 886 + .driver_name = "s3c2410_serial", 887 887 .nr = CONFIG_SERIAL_SAMSUNG_UARTS, 888 888 .cons = S3C24XX_SERIAL_CONSOLE, 889 - .driver_name = S3C24XX_SERIAL_NAME, 889 + .dev_name = S3C24XX_SERIAL_NAME, 890 890 .major = S3C24XX_SERIAL_MAJOR, 891 891 .minor = S3C24XX_SERIAL_MINOR, 892 892 };