diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:05 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:05 -0500 |
commit | 57c802e84f9c759c3d1794a9dbe81bc10444df62 (patch) | |
tree | e8774704b3394b12efbb787022cc11b48a13dec0 /drivers/ide/arm | |
parent | 8f8e8483f667d79739007b25f0e59a540fb9fa51 (diff) |
ide: add ide_init_port_hw() helper
* Add ide_init_port_hw() helper.
* rapide.c: convert rapide_locate_hwif() to rapide_setup_ports()
and use ide_init_port_hw().
* ide_platform.c: convert plat_ide_locate_hwif() to plat_ide_setup_ports()
and use ide_init_port_hw().
* sgiioc4.c: use ide_init_port_hw().
* pmac.c: add 'hw_regs_t *hw' argument to pmac_ide_setup_device(),
setup 'hw' in pmac_ide_{macio,pci}_attach() and use ide_init_port_hw()
in pmac_ide_setup_device().
This patch is a preparation for the future changes in the IDE probing code.
There should be no functionality changes caused by this patch.
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Jeremy Higdon <jeremy@sgi.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm')
-rw-r--r-- | drivers/ide/arm/rapide.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index c709d37ec095..0267467d1796 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c | |||
@@ -13,26 +13,18 @@ | |||
13 | 13 | ||
14 | #include <asm/ecard.h> | 14 | #include <asm/ecard.h> |
15 | 15 | ||
16 | static ide_hwif_t * | 16 | static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base, |
17 | rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq) | 17 | void __iomem *ctrl, unsigned int sz, int irq) |
18 | { | 18 | { |
19 | unsigned long port = (unsigned long)base; | 19 | unsigned long port = (unsigned long)base; |
20 | ide_hwif_t *hwif = ide_find_port(port); | ||
21 | int i; | 20 | int i; |
22 | 21 | ||
23 | if (hwif == NULL) | ||
24 | goto out; | ||
25 | |||
26 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { | 22 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { |
27 | hwif->io_ports[i] = port; | 23 | hw->io_ports[i] = port; |
28 | port += sz; | 24 | port += sz; |
29 | } | 25 | } |
30 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; | 26 | hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; |
31 | hwif->irq = irq; | 27 | hw->irq = irq; |
32 | hwif->mmio = 1; | ||
33 | default_hwif_mmiops(hwif); | ||
34 | out: | ||
35 | return hwif; | ||
36 | } | 28 | } |
37 | 29 | ||
38 | static int __devinit | 30 | static int __devinit |
@@ -42,6 +34,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
42 | void __iomem *base; | 34 | void __iomem *base; |
43 | int ret; | 35 | int ret; |
44 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 36 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
37 | hw_regs_t hw; | ||
45 | 38 | ||
46 | ret = ecard_request_resources(ec); | 39 | ret = ecard_request_resources(ec); |
47 | if (ret) | 40 | if (ret) |
@@ -53,12 +46,19 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
53 | goto release; | 46 | goto release; |
54 | } | 47 | } |
55 | 48 | ||
56 | hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq); | 49 | hwif = ide_find_port((unsigned long)base); |
57 | if (hwif) { | 50 | if (hwif) { |
58 | hwif->chipset = ide_generic; | 51 | memset(&hw, 0, sizeof(hw)); |
52 | rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); | ||
53 | hw.chipset = ide_generic; | ||
54 | hw.dev = &ec->dev; | ||
55 | |||
56 | ide_init_port_hw(hwif, &hw); | ||
57 | |||
58 | hwif->mmio = 1; | ||
59 | default_hwif_mmiops(hwif); | ||
60 | |||
59 | hwif->hwif_data = base; | 61 | hwif->hwif_data = base; |
60 | hwif->gendev.parent = &ec->dev; | ||
61 | hwif->noprobe = 0; | ||
62 | 62 | ||
63 | idx[0] = hwif->index; | 63 | idx[0] = hwif->index; |
64 | 64 | ||