Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43773
b: refs/heads/master
c: dd607d2
h: refs/heads/master
i:
  43771: 238d7c5
v: v3
  • Loading branch information
Sergei Shtylyov authored and Linus Torvalds committed Dec 8, 2006
1 parent 2a70f89 commit 0a8ad94
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 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: b10a06866600d1eda9e72ff328999e70f077fb3a
refs/heads/master: dd607d23ff4cc004da2986d0b264a972c6a2da3e
31 changes: 13 additions & 18 deletions trunk/drivers/ide/pci/sl82c105.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ static void sl82c105_selectproc(ide_drive_t *drive)
//DBG(("sl82c105_selectproc(drive:%s)\n", drive->name));

mask = hwif->channel ? CTRL_P1F16 : CTRL_P0F16;
old = val = *((u32 *)&hwif->hwif_data);
old = val = (u32)pci_get_drvdata(dev);
if (drive->using_dma)
val &= ~mask;
else
val |= mask;
if (old != val) {
pci_write_config_dword(dev, 0x40, val);
*((u32 *)&hwif->hwif_data) = val;
pci_set_drvdata(dev, (void *)val);
}
}

Expand All @@ -316,14 +316,13 @@ static void sl82c105_selectproc(ide_drive_t *drive)
*/
static void sl82c105_resetproc(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
struct pci_dev *dev = HWIF(drive)->pci_dev;
u32 val;

DBG(("sl82c105_resetproc(drive:%s)\n", drive->name));

pci_read_config_dword(dev, 0x40, &val);
*((u32 *)&hwif->hwif_data) = val;
pci_set_drvdata(dev, (void *)val);
}

/*
Expand Down Expand Up @@ -394,6 +393,7 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c
pci_read_config_dword(dev, 0x40, &val);
val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
pci_write_config_dword(dev, 0x40, val);
pci_set_drvdata(dev, (void *)val);

return dev->irq;
}
Expand All @@ -404,30 +404,25 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c

static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
unsigned int rev;
u8 dma_state;
u32 val;


DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));

hwif->tuneproc = tune_sl82c105;
hwif->selectproc = sl82c105_selectproc;
hwif->resetproc = sl82c105_resetproc;
/* Default to PIO 0 for fallback unless tuned otherwise,
* we always autotune PIO, this is done before DMA is
* checked, so there is no risk of accidentally disabling
* DMA
*/

/*
* Default to PIO 0 for fallback unless tuned otherwise.
* We always autotune PIO, this is done before DMA is checked,
* so there's no risk of accidentally disabling DMA
*/
hwif->drives[0].pio_speed = XFER_PIO_0;
hwif->drives[0].autotune = 1;
hwif->drives[1].pio_speed = XFER_PIO_1;
hwif->drives[1].pio_speed = XFER_PIO_0;
hwif->drives[1].autotune = 1;

pci_read_config_dword(dev, 0x40, &val);
*((u32 *)&hwif->hwif_data) = val;

hwif->atapi_dma = 0;
hwif->mwdma_mask = 0;
hwif->swdma_mask = 0;
Expand Down

0 comments on commit 0a8ad94

Please sign in to comment.