Lines Matching refs:ap
126 static void it821x_program(struct ata_port *ap, struct ata_device *adev, u16 timing) in it821x_program() argument
128 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_program()
129 struct it821x_dev *itdev = ap->private_data; in it821x_program()
130 int channel = ap->port_no; in it821x_program()
154 static void it821x_program_udma(struct ata_port *ap, struct ata_device *adev, u16 timing) in it821x_program_udma() argument
156 struct it821x_dev *itdev = ap->private_data; in it821x_program_udma()
157 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_program_udma()
158 int channel = ap->port_no; in it821x_program_udma()
185 static void it821x_clock_strategy(struct ata_port *ap, struct ata_device *adev) in it821x_clock_strategy() argument
187 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_clock_strategy()
188 struct it821x_dev *itdev = ap->private_data; in it821x_clock_strategy()
224 v &= ~(1 << (1 + ap->port_no)); in it821x_clock_strategy()
225 v |= sel << (1 + ap->port_no); in it821x_clock_strategy()
233 it821x_program_udma(ap, pair, itdev->udma[1-unit]); in it821x_clock_strategy()
234 it821x_program(ap, pair, itdev->pio[1-unit]); in it821x_clock_strategy()
241 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_clock_strategy()
242 it821x_program(ap, adev, itdev->pio[unit]); in it821x_clock_strategy()
255 static void it821x_passthru_set_piomode(struct ata_port *ap, struct ata_device *adev) in it821x_passthru_set_piomode() argument
261 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_set_piomode()
269 it821x_clock_strategy(ap, adev); in it821x_passthru_set_piomode()
270 it821x_program(ap, adev, itdev->pio[unit]); in it821x_passthru_set_piomode()
285 static void it821x_passthru_set_dmamode(struct ata_port *ap, struct ata_device *adev) in it821x_passthru_set_dmamode() argument
292 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_passthru_set_dmamode()
293 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_set_dmamode()
294 int channel = ap->port_no; in it821x_passthru_set_dmamode()
315 it821x_clock_strategy(ap, adev); in it821x_passthru_set_dmamode()
316 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_passthru_set_dmamode()
332 it821x_clock_strategy(ap, adev); in it821x_passthru_set_dmamode()
347 struct ata_port *ap = qc->ap; in it821x_passthru_bmdma_start() local
349 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_bmdma_start()
353 it821x_program(ap, adev, itdev->mwdma[unit]); in it821x_passthru_bmdma_start()
355 it821x_program_udma(ap, adev, itdev->udma[unit]); in it821x_passthru_bmdma_start()
370 struct ata_port *ap = qc->ap; in it821x_passthru_bmdma_stop() local
372 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_bmdma_stop()
377 it821x_program(ap, adev, itdev->pio[unit]); in it821x_passthru_bmdma_stop()
389 static void it821x_passthru_dev_select(struct ata_port *ap, in it821x_passthru_dev_select() argument
392 struct it821x_dev *itdev = ap->private_data; in it821x_passthru_dev_select()
394 struct ata_device *adev = &ap->link.device[device]; in it821x_passthru_dev_select()
395 it821x_program(ap, adev, itdev->pio[adev->devno]); in it821x_passthru_dev_select()
398 ata_sff_dev_select(ap, device); in it821x_passthru_dev_select()
450 it821x_passthru_dev_select(qc->ap, qc->dev->devno); in it821x_passthru_qc_issue()
579 struct ata_port *ap = qc->ap; in it821x_check_atapi_dma() local
580 struct it821x_dev *itdev = ap->private_data; in it821x_check_atapi_dma()
606 static void it821x_display_disk(struct ata_port *ap, int n, u8 *buf) in it821x_display_disk() argument
639 ata_port_info(ap, "%d: %-6s %-8s %s %s\n", in it821x_display_disk()
642 ata_port_info(ap, "%d: %-6s %-8s Volume: %1d %s %s\n", in it821x_display_disk()
645 ata_port_info(ap, "%d: Rebuilding: %d%%\n", n, buf[125]); in it821x_display_disk()
659 static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len) in it821x_firmware_command() argument
670 ap->ctl |= ATA_NIEN; in it821x_firmware_command()
671 iowrite8(ap->ctl, ap->ioaddr.ctl_addr); in it821x_firmware_command()
672 ata_wait_idle(ap); in it821x_firmware_command()
673 iowrite8(ATA_DEVICE_OBS, ap->ioaddr.device_addr); in it821x_firmware_command()
674 iowrite8(cmd, ap->ioaddr.command_addr); in it821x_firmware_command()
679 status = ioread8(ap->ioaddr.status_addr); in it821x_firmware_command()
682 ata_port_err(ap, "%s: rejected\n", __func__); in it821x_firmware_command()
686 ioread16_rep(ap->ioaddr.data_addr, buf, len/2); in it821x_firmware_command()
692 ata_port_err(ap, "%s: timeout\n", __func__); in it821x_firmware_command()
704 static void it821x_probe_firmware(struct ata_port *ap) in it821x_probe_firmware() argument
712 buf = it821x_firmware_command(ap, 0xFA, 512); in it821x_probe_firmware()
715 ata_port_info(ap, "pata_it821x: Firmware %02X/%02X/%02X%02X\n", in it821x_probe_firmware()
721 it821x_display_disk(ap, i, buf + 128 * i); in it821x_probe_firmware()
738 static int it821x_port_start(struct ata_port *ap) in it821x_port_start() argument
740 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_port_start()
744 int ret = ata_bmdma_port_start(ap); in it821x_port_start()
751 ap->private_data = itdev; in it821x_port_start()
760 if (ap->port_no == 0) in it821x_port_start()
761 it821x_probe_firmware(ap); in it821x_port_start()
764 if (conf & (1 << (1 + ap->port_no))) in it821x_port_start()
792 static int it821x_rdc_cable(struct ata_port *ap) in it821x_rdc_cable() argument
795 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in it821x_rdc_cable()
798 if (r40 & (1 << (2 + ap->port_no))) in it821x_rdc_cable()