add preliminary Marvell Kirkwood support
[openwrt.git] / target / linux / rb532 / patches-2.6.28 / 004-fix_pata_rb532_cf.patch
1 After applying the following changes I could verify functionality by
2 mounting a filesystem on the cfdisk and reading/writing files in it.
3
4 The set_irq_type() function must be wrong, as there is no set_type()
5 function defined for the rb532 IRQ chip. But as the used IRQ actually is
6 being triggered by a GPIO, setting it's interrupt level should be the
7 right alternative. Also to clear a GPIO triggered IRQ, the source has to
8 be cleared. This is being done at the end of rb532_pata_irq_handler.
9
10 Signed-off-by: Phil Sutter <n0-1@freewrt.org>
11 Acked-by: Florian Fainelli <florian@openwrt.org>
12 ---
13 diff -urN linux-2.6.28.7/drivers/ata/pata_rb532_cf.c linux-2.6.28.7.new/drivers/ata/pata_rb532_cf.c
14 --- linux-2.6.28.7/drivers/ata/pata_rb532_cf.c 2009-02-20 23:41:27.000000000 +0100
15 +++ linux-2.6.28.7.new/drivers/ata/pata_rb532_cf.c 2009-03-15 13:21:06.000000000 +0100
16 @@ -31,6 +31,7 @@
17 #include <scsi/scsi_host.h>
18
19 #include <asm/gpio.h>
20 +#include <asm/mach-rc32434/gpio.h>
21
22 #define DRV_NAME "pata-rb532-cf"
23 #define DRV_VERSION "0.1.0"
24 @@ -63,8 +64,8 @@
25 ata_sff_sync might be sufficient. */
26 ata_sff_dma_pause(ap);
27 ndelay(RB500_CF_IO_DELAY);
28 -
29 - set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
30 +
31 + rb532_gpio_set_ilevel(1, info->gpio_line);
32 }
33
34 static void rb532_pata_exec_command(struct ata_port *ap,
35 @@ -113,13 +114,15 @@
36 struct rb532_cf_info *info = ah->private_data;
37
38 if (gpio_get_value(info->gpio_line)) {
39 - set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
40 + rb532_gpio_set_ilevel(0, info->gpio_line);
41 if (!info->frozen)
42 ata_sff_interrupt(info->irq, dev_instance);
43 } else {
44 - set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
45 + rb532_gpio_set_ilevel(1, info->gpio_line);
46 }
47
48 + rb532_gpio_set_istat(0, info->gpio_line);
49 +
50 return IRQ_HANDLED;
51 }
52
This page took 0.04268 seconds and 5 git commands to generate.