Lines Matching +full:debounce +full:- +full:enter
1 // SPDX-License-Identifier: GPL-2.0-only
9 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
12 * Portions Copyright (C) 2005-2010 MontaVista Software, Inc.
200 * hpt37x_find_mode - reset the hpt37x bus
210 struct hpt_clock *clocks = ap->host->private_data; in hpt37x_find_mode()
212 while (clocks->xfer_speed) { in hpt37x_find_mode()
213 if (clocks->xfer_speed == speed) in hpt37x_find_mode()
214 return clocks->timing; in hpt37x_find_mode()
227 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); in hpt_dma_blacklisted()
229 i = match_string(list, -1, model_num); in hpt_dma_blacklisted()
255 "IBM-DTLA-307075",
256 "IBM-DTLA-307060",
257 "IBM-DTLA-307045",
258 "IBM-DTLA-307030",
259 "IBM-DTLA-307020",
260 "IBM-DTLA-307015",
261 "IBM-DTLA-305040",
262 "IBM-DTLA-305030",
263 "IBM-DTLA-305020",
264 "IC35L010AVER07-0",
265 "IC35L020AVER07-0",
266 "IC35L030AVER07-0",
267 "IC35L040AVER07-0",
268 "IC35L060AVER07-0",
274 * hpt370_filter - mode selection filter
283 if (adev->class == ATA_DEV_ATA) { in hpt370_filter()
293 * hpt370a_filter - mode selection filter
302 if (adev->class == ATA_DEV_ATA) { in hpt370a_filter()
310 * hpt372_filter - mode selection filter
319 if (ata_id_is_sata(adev->id)) in hpt372_filter()
326 * hpt37x_cable_detect - Detect the cable type
334 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt37x_cable_detect()
340 udelay(10); /* debounce */ in hpt37x_cable_detect()
347 if (ata66 & (2 >> ap->port_no)) in hpt37x_cable_detect()
354 * hpt374_fn1_cable_detect - Detect the cable type
362 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt374_fn1_cable_detect()
363 unsigned int mcrbase = 0x50 + 4 * ap->port_no; in hpt374_fn1_cable_detect()
375 if (ata66 & (2 >> ap->port_no)) in hpt374_fn1_cable_detect()
382 * hpt37x_pre_reset - reset the hpt37x bus
391 struct ata_port *ap = link->ap; in hpt37x_pre_reset()
392 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt37x_pre_reset()
399 if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) in hpt37x_pre_reset()
400 return -ENOENT; in hpt37x_pre_reset()
403 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); in hpt37x_pre_reset()
410 pci_read_config_byte(pdev, 0x51 + 4 * ap->port_no, &mcr2); in hpt37x_pre_reset()
412 if (pdev->device == PCI_DEVICE_ID_TTI_HPT366 && pdev->revision < 5) { in hpt37x_pre_reset()
418 pci_write_config_byte(pdev, 0x51 + 4 * ap->port_no, mcr2); in hpt37x_pre_reset()
426 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt37x_set_mode()
427 int addr = 0x40 + 4 * (adev->devno + 2 * ap->port_no); in hpt37x_set_mode()
445 * hpt37x_set_piomode - PIO setup
454 hpt37x_set_mode(ap, adev, adev->pio_mode); in hpt37x_set_piomode()
458 * hpt37x_set_dmamode - DMA timing setup
467 hpt37x_set_mode(ap, adev, adev->dma_mode); in hpt37x_set_dmamode()
471 * hpt370_bmdma_stop - DMA engine stop
479 struct ata_port *ap = qc->ap; in hpt370_bmdma_stop()
480 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt370_bmdma_stop()
481 void __iomem *bmdma = ap->ioaddr.bmdma_addr; in hpt370_bmdma_stop()
491 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); in hpt370_bmdma_stop()
501 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); in hpt370_bmdma_stop()
508 * hpt37x_bmdma_stop - DMA engine stop
516 struct ata_port *ap = qc->ap; in hpt37x_bmdma_stop()
517 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt37x_bmdma_stop()
518 int mscreg = 0x50 + 4 * ap->port_no; in hpt37x_bmdma_stop()
523 if (bwsr_stat & (1 << ap->port_no)) in hpt37x_bmdma_stop()
594 * hpt37x_clock_slot - Turn timing to PC clock entry
613 * hpt37x_calibrate_dpll - Calibrate the DPLL loop
657 if (pdev->device == PCI_DEVICE_ID_TTI_HPT374 && in hpt37x_pci_clock()
658 (PCI_FUNC(pdev->devfn) & 1)) { in hpt37x_pci_clock()
661 pdev_fn0 = pci_get_slot(pdev->bus, pdev->devfn - 1); in hpt37x_pci_clock()
676 dev_warn(&pdev->dev, "BIOS clock data not set\n"); in hpt37x_pci_clock()
701 * hpt37x_init_one - Initialise an HPT37X/302
734 /* HPT370 - UDMA100 */ in hpt37x_init_one()
742 /* HPT370A - UDMA100 */ in hpt37x_init_one()
750 /* HPT370 - UDMA66 */ in hpt37x_init_one()
758 /* HPT370A - UDMA66 */ in hpt37x_init_one()
766 /* HPT372 - UDMA133 */ in hpt37x_init_one()
774 /* HPT371, 302 - UDMA133 */ in hpt37x_init_one()
782 /* HPT374 - UDMA100, function 1 uses different cable_detect method */ in hpt37x_init_one()
801 u8 rev = dev->revision; in hpt37x_init_one()
817 switch (dev->device) { in hpt37x_init_one()
822 return -ENODEV; in hpt37x_init_one()
825 return -ENODEV; in hpt37x_init_one()
843 dev_err(&dev->dev, in hpt37x_init_one()
846 return -ENODEV; in hpt37x_init_one()
852 return -ENODEV; in hpt37x_init_one()
859 return -ENODEV; in hpt37x_init_one()
866 return -ENODEV; in hpt37x_init_one()
879 if (!(PCI_FUNC(dev->devfn) & 1)) in hpt37x_init_one()
885 dev_err(&dev->dev, "PCI table is bogus, please report (%d)\n", in hpt37x_init_one()
886 dev->device); in hpt37x_init_one()
887 return -ENODEV; in hpt37x_init_one()
903 * So, we manually disable the non-existing channel here in hpt37x_init_one()
906 if (dev->device == PCI_DEVICE_ID_TTI_HPT371) { in hpt37x_init_one()
916 * to prevent drives having problems with 40-pin cables. Needed in hpt37x_init_one()
917 * for some drives such as IBM-DTLA which will not enter ready in hpt37x_init_one()
930 freq = hpt37x_pci_clock(dev, chip_table->base); in hpt37x_init_one()
932 return -ENODEV; in hpt37x_init_one()
940 if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) { in hpt37x_init_one()
951 dpll = (ppi[0]->udma_mask & 0xC0) ? 3 : 2; in hpt37x_init_one()
971 f_low -= adjust >> 1; in hpt37x_init_one()
978 dev_err(&dev->dev, "DPLL did not stabilize!\n"); in hpt37x_init_one()
979 return -ENODEV; in hpt37x_init_one()
986 dev_info(&dev->dev, "bus clock %dMHz, using %dMHz DPLL\n", in hpt37x_init_one()
989 private_data = (void *)chip_table->clocks[clock_slot]; in hpt37x_init_one()
1001 dev_info(&dev->dev, "%s using %dMHz bus clock\n", in hpt37x_init_one()
1002 chip_table->name, MHz[clock_slot]); in hpt37x_init_one()
1029 MODULE_DESCRIPTION("low-level driver for the Highpoint HPT37x/30x");