aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDirk Opfer <dirk@opfer-online.de>2006-09-25 17:41:47 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-09-27 15:59:00 -0400
commita2025e7f73ae5eab0a25dad88c60aba67e3ae690 (patch)
tree95470b4d1fea82bf8ef9b92afaf4bf49b8c238f3 /arch
parent8d48427ecb0639593ccf14e807479b7873254ccb (diff)
[ARM] 3863/1: Add Locomo SPI Device
The Locomo chip has a SPI interface which is used for SD/MMC cards (only collie). This patch adds the definition for the SPI device inside the Locomo chip. Signed-off-by: Dirk Opfer <Dirk@Opfer-Online.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/locomo.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index c46dc65ec79a..181ef1ead5b8 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -121,6 +121,13 @@ static struct locomo_dev_info locomo_devices[] = {
121 .offset = 0, 121 .offset = 0,
122 .length = 0, 122 .length = 0,
123 }, 123 },
124 {
125 .devid = LOCOMO_DEVID_SPI,
126 .irq = {},
127 .name = "locomo-spi",
128 .offset = LOCOMO_SPI,
129 .length = 0x30,
130 },
124}; 131};
125 132
126 133
@@ -374,7 +381,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
374 struct irqdesc *d; 381 struct irqdesc *d;
375 void __iomem *mapbase = get_irq_chipdata(irq); 382 void __iomem *mapbase = get_irq_chipdata(irq);
376 383
377 req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F; 384 req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F;
378 if (req) { 385 if (req) {
379 irq = LOCOMO_IRQ_SPI_START; 386 irq = LOCOMO_IRQ_SPI_START;
380 d = irq_desc + irq; 387 d = irq_desc + irq;
@@ -391,35 +398,35 @@ static void locomo_spi_ack_irq(unsigned int irq)
391{ 398{
392 void __iomem *mapbase = get_irq_chipdata(irq); 399 void __iomem *mapbase = get_irq_chipdata(irq);
393 unsigned int r; 400 unsigned int r;
394 r = locomo_readl(mapbase + LOCOMO_SPIWE); 401 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
395 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 402 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
396 locomo_writel(r, mapbase + LOCOMO_SPIWE); 403 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
397 404
398 r = locomo_readl(mapbase + LOCOMO_SPIIS); 405 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
399 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 406 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
400 locomo_writel(r, mapbase + LOCOMO_SPIIS); 407 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
401 408
402 r = locomo_readl(mapbase + LOCOMO_SPIWE); 409 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
403 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 410 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
404 locomo_writel(r, mapbase + LOCOMO_SPIWE); 411 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
405} 412}
406 413
407static void locomo_spi_mask_irq(unsigned int irq) 414static void locomo_spi_mask_irq(unsigned int irq)
408{ 415{
409 void __iomem *mapbase = get_irq_chipdata(irq); 416 void __iomem *mapbase = get_irq_chipdata(irq);
410 unsigned int r; 417 unsigned int r;
411 r = locomo_readl(mapbase + LOCOMO_SPIIE); 418 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
412 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 419 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
413 locomo_writel(r, mapbase + LOCOMO_SPIIE); 420 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
414} 421}
415 422
416static void locomo_spi_unmask_irq(unsigned int irq) 423static void locomo_spi_unmask_irq(unsigned int irq)
417{ 424{
418 void __iomem *mapbase = get_irq_chipdata(irq); 425 void __iomem *mapbase = get_irq_chipdata(irq);
419 unsigned int r; 426 unsigned int r;
420 r = locomo_readl(mapbase + LOCOMO_SPIIE); 427 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
421 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 428 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
422 locomo_writel(r, mapbase + LOCOMO_SPIIE); 429 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
423} 430}
424 431
425static struct irq_chip locomo_spi_chip = { 432static struct irq_chip locomo_spi_chip = {