// SPDX-License-Identifier: GPL-2.0-only /* * pata_efar.c - EFAR PIIX clone controller driver * * (C) 2005 Red Hat * (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Some parts based on ata_piix.c by Jeff Garzik and others. * * The EFAR is a PIIX4 clone with UDMA66 support. Unlike the later * Intel ICH controllers the EFAR widened the UDMA mode register bits * and doesn't require the funky clock selection. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/device.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #include <linux/ata.h> #define DRV_NAME … #define DRV_VERSION … /** * efar_pre_reset - Enable bits * @link: ATA link * @deadline: deadline jiffies for the operation * * Perform cable detection for the EFAR ATA interface. This is * different to the PIIX arrangement */ static int efar_pre_reset(struct ata_link *link, unsigned long deadline) { … } /** * efar_cable_detect - check for 40/80 pin * @ap: Port * * Perform cable detection for the EFAR ATA interface. This is * different to the PIIX arrangement */ static int efar_cable_detect(struct ata_port *ap) { … } static DEFINE_SPINLOCK(efar_lock); /** * efar_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device to program * * Set PIO mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev) { … } /** * efar_set_dmamode - Initialize host controller PATA DMA timings * @ap: Port whose timings we are configuring * @adev: Device to program * * Set UDMA/MWDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev) { … } static const struct scsi_host_template efar_sht = …; static struct ata_port_operations efar_ops = …; /** * efar_init_one - Register EFAR ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in efar_pci_tbl matching with @pdev * * Called from kernel PCI layer. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value. */ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) { … } static const struct pci_device_id efar_pci_tbl[] = …; static struct pci_driver efar_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, efar_pci_tbl); MODULE_VERSION(…);