Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93591
b: refs/heads/master
c: 4764b68
h: refs/heads/master
i:
  93589: f73e233
  93587: 92e00be
  93583: 43c5f77
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent f834e6b commit 9dfe7ea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 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: eb7a07e8d6580ea498cac53acafe42c080af4d06
refs/heads/master: 4764b68405ac918e9ac9939b1a2d1469102e5af7
30 changes: 15 additions & 15 deletions trunk/drivers/ide/pci/sis5513.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ static u8 sis5513_ata133_udma_filter(ide_drive_t *drive)
return (regdw & 0x08) ? ATA_UDMA6 : ATA_UDMA5;
}

/* Chip detection and general config */
static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev,
const char *name)
static int __devinit sis_find_family(struct pci_dev *dev)
{
struct pci_dev *host;
int i = 0;
Expand Down Expand Up @@ -442,14 +440,16 @@ static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev,
}
}

if (!chipset_family)
return -1;
return chipset_family;
}

static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev,
const char *name)
{
/* Make general config ops here
1/ tell IDE channels to operate in Compatibility mode only
2/ tell old chips to allow per drive IDE timings */

{
u8 reg;
u16 regw;

Expand Down Expand Up @@ -495,7 +495,6 @@ static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev,
pci_write_config_byte(dev, 0x52, reg|0x08);
break;
}
}

return 0;
}
Expand Down Expand Up @@ -546,20 +545,13 @@ static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)

static void __devinit init_hwif_sis5513(ide_hwif_t *hwif)
{
u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };

hwif->set_pio_mode = &sis_set_pio_mode;
hwif->set_dma_mode = &sis_set_dma_mode;

if (chipset_family >= ATA_133)
hwif->udma_filter = sis5513_ata133_udma_filter;

hwif->cable_detect = ata66_sis5513;

if (hwif->dma_base == 0)
return;

hwif->ultra_mask = udma_rates[chipset_family];
}

static const struct ide_port_info sis5513_chipset __devinitdata = {
Expand All @@ -574,7 +566,15 @@ static const struct ide_port_info sis5513_chipset __devinitdata = {

static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
return ide_setup_pci_device(dev, &sis5513_chipset);
struct ide_port_info d = sis5513_chipset;
u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };

if (sis_find_family(dev) == 0)
return -ENOTSUPP;

d.udma_mask = udma_rates[chipset_family];

return ide_setup_pci_device(dev, &d);
}

static const struct pci_device_id sis5513_pci_tbl[] = {
Expand Down

0 comments on commit 9dfe7ea

Please sign in to comment.