Lines Matching +full:udma +full:- +full:c

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * pata_rdc - Driver for later RDC PATA controllers
6 * INCITS 370-2004 (1510D): ATA Host Adapter Standards
30 * rdc_pata_cable_detect - Probe host controller cable detect info
33 * Read 80c cable indicator from ATA PCI device's PCI config
42 struct rdc_host_priv *hpriv = ap->host->private_data; in rdc_pata_cable_detect()
46 mask = 0x30 << (2 * ap->port_no); in rdc_pata_cable_detect()
47 if ((hpriv->saved_iocfg & mask) == 0) in rdc_pata_cable_detect()
53 * rdc_pata_prereset - prereset for PATA host controller
62 struct ata_port *ap = link->ap; in rdc_pata_prereset()
63 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in rdc_pata_prereset()
70 if (!pci_test_config_bits(pdev, &rdc_enable_bits[ap->port_no])) in rdc_pata_prereset()
71 return -ENOENT; in rdc_pata_prereset()
78 * rdc_set_piomode - Initialize host controller PATA PIO timings
90 unsigned int pio = adev->pio_mode - XFER_PIO_0; in rdc_set_piomode()
91 struct pci_dev *dev = to_pci_dev(ap->host->dev); in rdc_set_piomode()
93 unsigned int is_slave = (adev->devno != 0); in rdc_set_piomode()
94 unsigned int master_port= ap->port_no ? 0x42 : 0x40; in rdc_set_piomode()
113 if (adev->class == ATA_DEV_ATA) in rdc_set_piomode()
131 slave_data &= (ap->port_no ? 0x0f : 0xf0); in rdc_set_piomode()
134 << (ap->port_no ? 4 : 0); in rdc_set_piomode()
149 /* Ensure the UDMA bit is off - it will be turned back on if in rdc_set_piomode()
150 UDMA is selected */ in rdc_set_piomode()
153 udma_enable &= ~(1 << (2 * ap->port_no + adev->devno)); in rdc_set_piomode()
160 * rdc_set_dmamode - Initialize host controller PATA PIO timings
164 * Set UDMA mode for device, in host controller PCI config space.
172 struct pci_dev *dev = to_pci_dev(ap->host->dev); in rdc_set_dmamode()
174 u8 master_port = ap->port_no ? 0x42 : 0x40; in rdc_set_dmamode()
176 u8 speed = adev->dma_mode; in rdc_set_dmamode()
177 int devid = adev->devno + 2 * ap->port_no; in rdc_set_dmamode()
193 unsigned int udma = adev->dma_mode - XFER_UDMA_0; in rdc_set_dmamode() local
199 * UDMA is handled by a combination of clock switching and in rdc_set_dmamode()
205 u_speed = min(2 - (udma & 1), udma); in rdc_set_dmamode()
206 if (udma == 5) in rdc_set_dmamode()
208 else if (udma > 2) in rdc_set_dmamode()
232 unsigned int mwdma = adev->dma_mode - XFER_MW_DMA_0; in rdc_set_dmamode()
238 int pio = needed_pio[mwdma] - XFER_PIO_0; in rdc_set_dmamode()
245 if (adev->pio_mode < needed_pio[mwdma]) in rdc_set_dmamode()
249 if (adev->devno) { /* Slave */ in rdc_set_dmamode()
253 slave_data &= (ap->port_no ? 0x0f : 0xf0); in rdc_set_dmamode()
255 slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0); in rdc_set_dmamode()
296 * rdc_init_one - Register PIIX ATA PCI device with kernel services
307 * Zero on success, or -ERRNO value.
312 struct device *dev = &pdev->dev; in rdc_init_one()
319 ata_print_version_once(&pdev->dev, DRV_VERSION); in rdc_init_one()
331 return -ENOMEM; in rdc_init_one()
336 pci_read_config_dword(pdev, 0x54, &hpriv->saved_iocfg); in rdc_init_one()
341 host->private_data = hpriv; in rdc_init_one()
345 host->flags |= ATA_HOST_PARALLEL_SCAN; in rdc_init_one()
354 struct rdc_host_priv *hpriv = host->private_data; in rdc_remove_one()
356 pci_write_config_dword(pdev, 0x54, hpriv->saved_iocfg); in rdc_remove_one()
382 MODULE_DESCRIPTION("SCSI low-level driver for RDC PATA controllers");