aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:29 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:29 -0400
commit5c58666fae58cd69f862beaeb88d293ad00f6e37 (patch)
tree5a42cf57ef7d074c5c1b75cd5f916e986aef6edb
parente4f7f3a0994522303c006c84cb651e4caba1158e (diff)
ppc/pmac: remove ppc_ide_md hooks
* Add pmac_ide_init_ports() helper and use it instead of pmac_ide_init_hwif_ports(). * Remove ppc_ide_md hooks - no need for them (IDE pmac host driver takes care of all this setup). * Then remove no longer needed <linux/ide.h> include from arch/powerpc/platforms/powermac/pmac.h. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--arch/powerpc/platforms/powermac/pmac.h5
-rw-r--r--arch/powerpc/platforms/powermac/setup.c8
-rw-r--r--drivers/ide/ppc/pmac.c50
3 files changed, 11 insertions, 52 deletions
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index b3abaaf61eb4..3362e781b6a7 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -2,7 +2,6 @@
2#define __PMAC_H__ 2#define __PMAC_H__
3 3
4#include <linux/pci.h> 4#include <linux/pci.h>
5#include <linux/ide.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7 6
8/* 7/*
@@ -35,10 +34,6 @@ extern void pmac_check_ht_link(void);
35 34
36extern void pmac_setup_smp(void); 35extern void pmac_setup_smp(void);
37 36
38extern unsigned long pmac_ide_get_base(int index);
39extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
40 unsigned long data_port, unsigned long ctrl_port, int *irq);
41
42extern int pmac_nvram_init(void); 37extern int pmac_nvram_init(void);
43extern void pmac_pic_init(void); 38extern void pmac_pic_init(void);
44 39
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 36ff1b6b7fac..2693fc371eab 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -574,14 +574,6 @@ static int __init pmac_probe(void)
574 ISA_DMA_THRESHOLD = ~0L; 574 ISA_DMA_THRESHOLD = ~0L;
575 DMA_MODE_READ = 1; 575 DMA_MODE_READ = 1;
576 DMA_MODE_WRITE = 2; 576 DMA_MODE_WRITE = 2;
577
578#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
579#ifdef CONFIG_BLK_DEV_IDE_PMAC
580 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
581 ppc_ide_md.default_io_base = pmac_ide_get_base;
582#endif /* CONFIG_BLK_DEV_IDE_PMAC */
583#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
584
585#endif /* CONFIG_PPC32 */ 577#endif /* CONFIG_PPC32 */
586 578
587#ifdef CONFIG_PMAC_SMU 579#ifdef CONFIG_PMAC_SMU
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 763bc5596c9e..88619b50d9ef 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -418,37 +418,6 @@ static void pmac_ide_kauai_selectproc(ide_drive_t *drive);
418 418
419#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ 419#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
420 420
421/*
422 * N.B. this can't be an initfunc, because the media-bay task can
423 * call ide_[un]register at any time.
424 */
425void
426pmac_ide_init_hwif_ports(hw_regs_t *hw,
427 unsigned long data_port, unsigned long ctrl_port,
428 int *irq)
429{
430 int i, ix;
431
432 if (data_port == 0)
433 return;
434
435 for (ix = 0; ix < MAX_HWIFS; ++ix)
436 if (data_port == pmac_ide[ix].regbase)
437 break;
438
439 if (ix >= MAX_HWIFS)
440 return; /* not an IDE PMAC interface */
441
442 for (i = 0; i < 8; ++i)
443 hw->io_ports[i] = data_port + i * 0x10;
444 hw->io_ports[8] = data_port + 0x160;
445
446 if (irq != NULL)
447 *irq = pmac_ide[ix].irq;
448
449 hw->dev = &pmac_ide[ix].mdev->ofdev.dev;
450}
451
452#define PMAC_IDE_REG(x) \ 421#define PMAC_IDE_REG(x) \
453 ((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x))) 422 ((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x)))
454 423
@@ -886,12 +855,6 @@ sanitize_timings(pmac_ide_hwif_t *pmif)
886 pmif->timings[2] = pmif->timings[3] = value2; 855 pmif->timings[2] = pmif->timings[3] = value2;
887} 856}
888 857
889unsigned long
890pmac_ide_get_base(int index)
891{
892 return pmac_ide[index].regbase;
893}
894
895/* Suspend call back, should be called after the child devices 858/* Suspend call back, should be called after the child devices
896 * have actually been suspended 859 * have actually been suspended
897 */ 860 */
@@ -1108,6 +1071,15 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw)
1108 return 0; 1071 return 0;
1109} 1072}
1110 1073
1074static void __devinit pmac_ide_init_ports(hw_regs_t *hw, unsigned long base)
1075{
1076 int i;
1077
1078 for (i = 0; i < 8; ++i)
1079 hw->io_ports[i] = base + i * 0x10;
1080 hw->io_ports[8] = base + 0x160;
1081}
1082
1111/* 1083/*
1112 * Attach to a macio probed interface 1084 * Attach to a macio probed interface
1113 */ 1085 */
@@ -1181,7 +1153,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
1181 dev_set_drvdata(&mdev->ofdev.dev, hwif); 1153 dev_set_drvdata(&mdev->ofdev.dev, hwif);
1182 1154
1183 memset(&hw, 0, sizeof(hw)); 1155 memset(&hw, 0, sizeof(hw));
1184 pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL); 1156 pmac_ide_init_ports(&hw, pmif->regbase);
1185 hw.irq = irq; 1157 hw.irq = irq;
1186 hw.dev = &mdev->ofdev.dev; 1158 hw.dev = &mdev->ofdev.dev;
1187 1159
@@ -1295,7 +1267,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1295 pci_set_drvdata(pdev, hwif); 1267 pci_set_drvdata(pdev, hwif);
1296 1268
1297 memset(&hw, 0, sizeof(hw)); 1269 memset(&hw, 0, sizeof(hw));
1298 pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL); 1270 pmac_ide_init_ports(&hw, pmif->regbase);
1299 hw.irq = pdev->irq; 1271 hw.irq = pdev->irq;
1300 hw.dev = &pdev->dev; 1272 hw.dev = &pdev->dev;
1301 1273