Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296262
b: refs/heads/master
c: b4ac084
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Mar 24, 2012
1 parent 7fa76b4 commit 4d43cec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c402c110721ed53916595473aed1013acde95bab
refs/heads/master: b4ac08492d06e4f2cea24a5b2579b4b0a0f537ce
22 changes: 13 additions & 9 deletions trunk/arch/arm/mach-rpc/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/kthread.h>
#include <linux/irq.h>
#include <linux/io.h>

#include <asm/dma.h>
Expand Down Expand Up @@ -977,8 +978,7 @@ EXPORT_SYMBOL(ecardm_iomap);
* If bit 1 of the first byte of the card is set, then the
* card does not exist.
*/
static int __init
ecard_probe(int slot, card_type_t type)
static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
{
ecard_t **ecp;
ecard_t *ec;
Expand Down Expand Up @@ -1032,19 +1032,18 @@ ecard_probe(int slot, card_type_t type)
break;
}

ec->irq = irq;

/*
* hook the interrupt handlers
*/
if (slot < 8) {
ec->irq = 32 + slot;
irq_set_chip_and_handler(ec->irq, &ecard_chip,
handle_level_irq);
irq_set_chip_data(ec->irq, ec);
set_irq_flags(ec->irq, IRQF_VALID);
}

if (slot == 8)
ec->irq = 11;
#ifdef CONFIG_ARCH_RPC
/* On RiscPC, only first two slots have DMA capability */
if (slot < 2)
Expand Down Expand Up @@ -1074,23 +1073,28 @@ ecard_probe(int slot, card_type_t type)
static int __init ecard_init(void)
{
struct task_struct *task;
int slot, irqhw;
int slot, irqhw, irqbase;

irqbase = irq_alloc_descs(-1, 0, 8, -1);
if (irqbase < 0)
return irqbase;

task = kthread_run(ecard_task, NULL, "kecardd");
if (IS_ERR(task)) {
printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n",
PTR_ERR(task));
irq_free_descs(irqbase, 8);
return PTR_ERR(task);
}

printk("Probing expansion cards\n");

for (slot = 0; slot < 8; slot ++) {
if (ecard_probe(slot, ECARD_EASI) == -ENODEV)
ecard_probe(slot, ECARD_IOC);
if (ecard_probe(slot, irqbase + slot, ECARD_EASI) == -ENODEV)
ecard_probe(slot, irqbase + slot, ECARD_IOC);
}

ecard_probe(8, ECARD_IOC);
ecard_probe(8, 11, ECARD_IOC);

irqhw = ecard_probeirqhw();

Expand Down

0 comments on commit 4d43cec

Please sign in to comment.