[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45A27278.9000007@pobox.com>
Date: Mon, 08 Jan 2007 11:34:00 -0500
From: Jeff Garzik <jgarzik@...ox.com>
To: Alan <alan@...rguk.ukuu.org.uk>
CC: akpm@...l.org, torvalds@...l.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sata_via: PATA support, resubmit
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@...hat.com>
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists