Пример #1
0
static int pacpi_pre_reset(struct ata_link *link, unsigned long deadline)
{
	struct ata_port *ap = link->ap;
	struct pata_acpi *acpi = ap->private_data;
	if (ap->acpi_handle == NULL || ata_acpi_gtm(ap, &acpi->gtm) < 0)
		return -ENODEV;

	return ata_sff_prereset(link, deadline);
}
Пример #2
0
static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
	int unit = adev->devno;
	struct pata_acpi *acpi = ap->private_data;
	const struct ata_timing *t;

	if (!(acpi->gtm.flags & 0x10))
		unit = 0;

	/* Now stuff the nS values into the structure */
	t = ata_timing_find_mode(adev->pio_mode);
	acpi->gtm.drive[unit].pio = t->cycle;
	ata_acpi_stm(ap, &acpi->gtm);
	/* See what mode we actually got */
	ata_acpi_gtm(ap, &acpi->gtm);
}
Пример #3
0
static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
    int unit = adev->devno;
    struct pata_acpi *acpi = ap->private_data;
    const struct ata_timing *t;

    if (!(acpi->gtm.flags & 0x10))
        unit = 0;


    t = ata_timing_find_mode(adev->pio_mode);
    acpi->gtm.drive[unit].pio = t->cycle;
    ata_acpi_stm(ap, &acpi->gtm);

    ata_acpi_gtm(ap, &acpi->gtm);
}
Пример #4
0
static unsigned long pacpi_discover_modes(struct ata_port *ap, struct ata_device *adev)
{
	struct pata_acpi *acpi = ap->private_data;
	struct ata_acpi_gtm probe;
	unsigned int xfer_mask;

	probe = acpi->gtm;

	ata_acpi_gtm(ap, &probe);

	xfer_mask = ata_acpi_gtm_xfermask(adev, &probe);

	if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA))
		ap->cbl = ATA_CBL_PATA80;

	return xfer_mask;
}
Пример #5
0
static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
	int unit = adev->devno;
	struct pata_acpi *acpi = ap->private_data;
	const struct ata_timing *t;

	if (!(acpi->gtm.flags & 0x10))
		unit = 0;

	/* Now stuff the nS values into the structure */
	t = ata_timing_find_mode(adev->dma_mode);
	if (adev->dma_mode >= XFER_UDMA_0) {
		acpi->gtm.drive[unit].dma = t->udma;
		acpi->gtm.flags |= (1 << (2 * unit));
	} else {
		acpi->gtm.drive[unit].dma = t->cycle;
		acpi->gtm.flags &= ~(1 << (2 * unit));
	}
	ata_acpi_stm(ap, &acpi->gtm);
	/* See what mode we actually got */
	ata_acpi_gtm(ap, &acpi->gtm);
}
Пример #6
0
static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
    int unit = adev->devno;
    struct pata_acpi *acpi = ap->private_data;
    const struct ata_timing *t;

    if (!(acpi->gtm.flags & 0x10))
        unit = 0;


    t = ata_timing_find_mode(adev->dma_mode);
    if (adev->dma_mode >= XFER_UDMA_0) {
        acpi->gtm.drive[unit].dma = t->udma;
        acpi->gtm.flags |= (1 << (2 * unit));
    } else {
        acpi->gtm.drive[unit].dma = t->cycle;
        acpi->gtm.flags &= ~(1 << (2 * unit));
    }
    ata_acpi_stm(ap, &acpi->gtm);

    ata_acpi_gtm(ap, &acpi->gtm);
}