Re: [PATCH] sata_via: PATA support, resubmit

From: Jeff Garzik
Date: Mon Jan 08 2007 - 11:34:24 EST


Alan wrote:
Just separate PATA and SATA operations. That way everything works as expected, and you don't unintentionally add lovely oopses all over the place.

Ok - based on your pointers to [ab]using port_start you want something
like this for now, with the port_start evaporating when Tejun's probe
changes go in ?

Signed-off-by: Alan Cox <alan@xxxxxxxxxx>

Looks good to me, modulo minor comments below...



+static void vt6421_set_pio_mode(struct ata_port *ap, struct ata_device *adev)
+{
+ struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+ static const u8 pio_bits[] = { 0xA8, 0x65, 0x65, 0x31, 0x20 };
+ if (ap->port_no == PATA_PORT)
+ pci_write_config_byte(pdev, PATA_PIO_TIMING, pio_bits[adev->pio_mode - XFER_PIO_0]);
+}
+
+static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev)
+{
+ struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+ static const u8 udma_bits[] = { 0xEE, 0xE8, 0xE6, 0xE4, 0xE2, 0xE1, 0xE0, 0xE0 };
+ if (ap->port_no == PATA_PORT)
+ pci_write_config_byte(pdev, PATA_UDMA_TIMING, udma_bits[adev->pio_mode - XFER_UDMA_0]);
+}

You can kill the '== PATA_PORT' tests now.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/