aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:30 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:30 -0400
commit528a572daea90aa41db92683e5a8756acef514c4 (patch)
tree95e616ff7b3a60d90d04b69eb21b8e262627e0b5
parent44a59ad59f4285ce91e61f05e65a3e8fd0943c85 (diff)
ide: add ->chipset field to ide_pci_device_t
Add ->chipset field to ide_pci_device_t and use it in ide_hwif_configure() to set hwif->chipset. Convert cmd64x, cy82c693, rz1000 and trm290 host drivers to use this new ability. While at it define hwif_chipset_t as u8 to save some space in hw_regs_t, ide_hwif_t and ide_pci_device_t instances. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/pci/cmd64x.c4
-rw-r--r--drivers/ide/pci/cy82c693.c2
-rw-r--r--drivers/ide/pci/rz1000.c2
-rw-r--r--drivers/ide/pci/trm290.c2
-rw-r--r--drivers/ide/setup-pci.c2
-rw-r--r--include/linux/ide.h7
6 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 69cdbfb86bbf..5c1b897017b4 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -506,9 +506,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
506 hwif->set_pio_mode = &cmd64x_set_pio_mode; 506 hwif->set_pio_mode = &cmd64x_set_pio_mode;
507 hwif->set_dma_mode = &cmd64x_set_dma_mode; 507 hwif->set_dma_mode = &cmd64x_set_dma_mode;
508 508
509 if (dev->device == PCI_DEVICE_ID_CMD_646)
510 hwif->chipset = ide_cmd646;
511
512 if (!hwif->dma_base) 509 if (!hwif->dma_base)
513 return; 510 return;
514 511
@@ -575,6 +572,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
575 .init_chipset = init_chipset_cmd64x, 572 .init_chipset = init_chipset_cmd64x,
576 .init_hwif = init_hwif_cmd64x, 573 .init_hwif = init_hwif_cmd64x,
577 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 574 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
575 .chipset = ide_cmd646,
578 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 576 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
579 .pio_mask = ATA_PIO5, 577 .pio_mask = ATA_PIO5,
580 .mwdma_mask = ATA_MWDMA2, 578 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index efc20bd97fd5..e70ffa90aefe 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -428,7 +428,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c
428 */ 428 */
429static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) 429static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
430{ 430{
431 hwif->chipset = ide_cy82c693;
432 hwif->set_pio_mode = &cy82c693_set_pio_mode; 431 hwif->set_pio_mode = &cy82c693_set_pio_mode;
433 432
434 if (hwif->dma_base == 0) 433 if (hwif->dma_base == 0)
@@ -454,6 +453,7 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = {
454 .init_chipset = init_chipset_cy82c693, 453 .init_chipset = init_chipset_cy82c693,
455 .init_iops = init_iops_cy82c693, 454 .init_iops = init_iops_cy82c693,
456 .init_hwif = init_hwif_cy82c693, 455 .init_hwif = init_hwif_cy82c693,
456 .chipset = ide_cy82c693,
457 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA | 457 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
458 IDE_HFLAG_BOOTABLE, 458 IDE_HFLAG_BOOTABLE,
459 .pio_mask = ATA_PIO4, 459 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c
index 0d76af45db6b..5f1ad9ef1fe0 100644
--- a/drivers/ide/pci/rz1000.c
+++ b/drivers/ide/pci/rz1000.c
@@ -35,7 +35,6 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
35 u16 reg; 35 u16 reg;
36 struct pci_dev *dev = hwif->pci_dev; 36 struct pci_dev *dev = hwif->pci_dev;
37 37
38 hwif->chipset = ide_rz1000;
39 if (!pci_read_config_word (dev, 0x40, &reg) && 38 if (!pci_read_config_word (dev, 0x40, &reg) &&
40 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) { 39 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
41 printk(KERN_INFO "%s: disabled chipset read-ahead " 40 printk(KERN_INFO "%s: disabled chipset read-ahead "
@@ -53,6 +52,7 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
53static ide_pci_device_t rz1000_chipset __devinitdata = { 52static ide_pci_device_t rz1000_chipset __devinitdata = {
54 .name = "RZ100x", 53 .name = "RZ100x",
55 .init_hwif = init_hwif_rz1000, 54 .init_hwif = init_hwif_rz1000,
55 .chipset = ide_rz1000,
56 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE, 56 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE,
57}; 57};
58 58
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index 140d486f6237..be5d145a94f1 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -250,7 +250,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
250 u8 reg = 0; 250 u8 reg = 0;
251 struct pci_dev *dev = hwif->pci_dev; 251 struct pci_dev *dev = hwif->pci_dev;
252 252
253 hwif->chipset = ide_trm290;
254 cfgbase = pci_resource_start(dev, 4); 253 cfgbase = pci_resource_start(dev, 4);
255 if ((dev->class & 5) && cfgbase) { 254 if ((dev->class & 5) && cfgbase) {
256 hwif->config_data = cfgbase; 255 hwif->config_data = cfgbase;
@@ -323,6 +322,7 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
323static ide_pci_device_t trm290_chipset __devinitdata = { 322static ide_pci_device_t trm290_chipset __devinitdata = {
324 .name = "TRM290", 323 .name = "TRM290",
325 .init_hwif = init_hwif_trm290, 324 .init_hwif = init_hwif_trm290,
325 .chipset = ide_trm290,
326 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 326 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
327#if 0 /* play it safe for now */ 327#if 0 /* play it safe for now */
328 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 328 IDE_HFLAG_TRUST_BIOS_FOR_DMA |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 6903100e3c83..30c0741c5e5c 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -397,7 +397,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
397 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 397 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
398 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 398 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
399 } 399 }
400 hwif->chipset = ide_pci; 400 hwif->chipset = d->chipset ? d->chipset : ide_pci;
401 hwif->pci_dev = dev; 401 hwif->pci_dev = dev;
402 hwif->cds = (struct ide_pci_device_s *) d; 402 hwif->cds = (struct ide_pci_device_s *) d;
403 hwif->channel = port; 403 hwif->channel = port;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index fdd097473055..b676e51d74f1 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -200,14 +200,16 @@ typedef int (ide_ack_intr_t)(struct hwif_s *);
200 * hwif_chipset_t is used to keep track of the specific hardware 200 * hwif_chipset_t is used to keep track of the specific hardware
201 * chipset used by each IDE interface, if known. 201 * chipset used by each IDE interface, if known.
202 */ 202 */
203typedef enum { ide_unknown, ide_generic, ide_pci, 203enum { ide_unknown, ide_generic, ide_pci,
204 ide_cmd640, ide_dtc2278, ide_ali14xx, 204 ide_cmd640, ide_dtc2278, ide_ali14xx,
205 ide_qd65xx, ide_umc8672, ide_ht6560b, 205 ide_qd65xx, ide_umc8672, ide_ht6560b,
206 ide_rz1000, ide_trm290, 206 ide_rz1000, ide_trm290,
207 ide_cmd646, ide_cy82c693, ide_4drives, 207 ide_cmd646, ide_cy82c693, ide_4drives,
208 ide_pmac, ide_etrax100, ide_acorn, 208 ide_pmac, ide_etrax100, ide_acorn,
209 ide_au1xxx, ide_forced 209 ide_au1xxx, ide_forced
210} hwif_chipset_t; 210};
211
212typedef u8 hwif_chipset_t;
211 213
212/* 214/*
213 * Structure to hold all information about the location of this port 215 * Structure to hold all information about the location of this port
@@ -1277,6 +1279,7 @@ typedef struct ide_pci_device_s {
1277 void (*init_dma)(ide_hwif_t *, unsigned long); 1279 void (*init_dma)(ide_hwif_t *, unsigned long);
1278 void (*fixup)(ide_hwif_t *); 1280 void (*fixup)(ide_hwif_t *);
1279 ide_pci_enablebit_t enablebits[2]; 1281 ide_pci_enablebit_t enablebits[2];
1282 hwif_chipset_t chipset;
1280 unsigned int extra; 1283 unsigned int extra;
1281 u32 host_flags; 1284 u32 host_flags;
1282 u8 pio_mask; 1285 u8 pio_mask;