pata_efar: fix register naming used in efar_set_piomode()
Rename 'idetm_port' and 'idetm_data' variables to 'master_port' and 'master_data' respectively to match register naming used in efar_set_dmamode() and in ata_piix.c. Fix efar_set_piomode() documentation while at it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
5a29854867
commit
a0da19149f
|
@ -73,7 +73,7 @@ static DEFINE_SPINLOCK(efar_lock);
|
||||||
/**
|
/**
|
||||||
* efar_set_piomode - Initialize host controller PATA PIO timings
|
* efar_set_piomode - Initialize host controller PATA PIO timings
|
||||||
* @ap: Port whose timings we are configuring
|
* @ap: Port whose timings we are configuring
|
||||||
* @adev: um
|
* @adev: Device to program
|
||||||
*
|
*
|
||||||
* Set PIO mode for device, in host controller PCI config space.
|
* Set PIO mode for device, in host controller PCI config space.
|
||||||
*
|
*
|
||||||
|
@ -85,9 +85,9 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
|
||||||
{
|
{
|
||||||
unsigned int pio = adev->pio_mode - XFER_PIO_0;
|
unsigned int pio = adev->pio_mode - XFER_PIO_0;
|
||||||
struct pci_dev *dev = to_pci_dev(ap->host->dev);
|
struct pci_dev *dev = to_pci_dev(ap->host->dev);
|
||||||
unsigned int idetm_port= ap->port_no ? 0x42 : 0x40;
|
unsigned int master_port = ap->port_no ? 0x42 : 0x40;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u16 idetm_data;
|
u16 master_data;
|
||||||
u8 udma_enable;
|
u8 udma_enable;
|
||||||
int control = 0;
|
int control = 0;
|
||||||
|
|
||||||
|
@ -113,20 +113,20 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
|
||||||
|
|
||||||
spin_lock_irqsave(&efar_lock, flags);
|
spin_lock_irqsave(&efar_lock, flags);
|
||||||
|
|
||||||
pci_read_config_word(dev, idetm_port, &idetm_data);
|
pci_read_config_word(dev, master_port, &master_data);
|
||||||
|
|
||||||
/* Set PPE, IE, and TIME as appropriate */
|
/* Set PPE, IE, and TIME as appropriate */
|
||||||
if (adev->devno == 0) {
|
if (adev->devno == 0) {
|
||||||
idetm_data &= 0xCCF0;
|
master_data &= 0xCCF0;
|
||||||
idetm_data |= control;
|
master_data |= control;
|
||||||
idetm_data |= (timings[pio][0] << 12) |
|
master_data |= (timings[pio][0] << 12) |
|
||||||
(timings[pio][1] << 8);
|
(timings[pio][1] << 8);
|
||||||
} else {
|
} else {
|
||||||
int shift = 4 * ap->port_no;
|
int shift = 4 * ap->port_no;
|
||||||
u8 slave_data;
|
u8 slave_data;
|
||||||
|
|
||||||
idetm_data &= 0xFF0F;
|
master_data &= 0xFF0F;
|
||||||
idetm_data |= (control << 4);
|
master_data |= (control << 4);
|
||||||
|
|
||||||
/* Slave timing in separate register */
|
/* Slave timing in separate register */
|
||||||
pci_read_config_byte(dev, 0x44, &slave_data);
|
pci_read_config_byte(dev, 0x44, &slave_data);
|
||||||
|
@ -135,8 +135,8 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
|
||||||
pci_write_config_byte(dev, 0x44, slave_data);
|
pci_write_config_byte(dev, 0x44, slave_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
idetm_data |= 0x4000; /* Ensure SITRE is set */
|
master_data |= 0x4000; /* Ensure SITRE is set */
|
||||||
pci_write_config_word(dev, idetm_port, idetm_data);
|
pci_write_config_word(dev, master_port, master_data);
|
||||||
|
|
||||||
pci_read_config_byte(dev, 0x48, &udma_enable);
|
pci_read_config_byte(dev, 0x48, &udma_enable);
|
||||||
udma_enable &= ~(1 << (2 * ap->port_no + adev->devno));
|
udma_enable &= ~(1 << (2 * ap->port_no + adev->devno));
|
||||||
|
|
Reference in New Issue