// SPDX-License-Identifier: GPL-2.0-only /* * pata-cs5530.c - CS5530 PATA for new ATA layer * (C) 2005 Red Hat Inc * * based upon cs5530.c by Mark Lord. * * Loosely based on the piix & svwks drivers. * * Documentation: * Available from AMD web site. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #include <linux/dmi.h> #define DRV_NAME … #define DRV_VERSION … static void __iomem *cs5530_port_base(struct ata_port *ap) { … } /** * cs5530_set_piomode - PIO setup * @ap: ATA interface * @adev: device on the interface * * Set our PIO requirements. This is fairly simple on the CS5530 * chips. */ static void cs5530_set_piomode(struct ata_port *ap, struct ata_device *adev) { … } /** * cs5530_set_dmamode - DMA timing setup * @ap: ATA interface * @adev: Device being configured * * We cannot mix MWDMA and UDMA without reloading timings each switch * master to slave. We track the last DMA setup in order to minimise * reloads. */ static void cs5530_set_dmamode(struct ata_port *ap, struct ata_device *adev) { … } /** * cs5530_qc_issue - command issue * @qc: command pending * * Called when the libata layer is about to issue a command. We wrap * this interface so that we can load the correct ATA timings if * necessary. Specifically we have a problem that there is only * one MWDMA/UDMA bit. */ static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc) { … } static const struct scsi_host_template cs5530_sht = …; static struct ata_port_operations cs5530_port_ops = …; static const struct dmi_system_id palmax_dmi_table[] = …; static int cs5530_is_palmax(void) { … } /** * cs5530_init_chip - Chipset init * * Perform the chip initialisation work that is shared between both * setup and resume paths */ static int cs5530_init_chip(void) { … } /** * cs5530_init_one - Initialise a CS5530 * @pdev: PCI device * @id: Entry in match table * * Install a driver for the newly found CS5530 companion chip. Most of * this is just housekeeping. We have to set the chip up correctly and * turn off various bits of emulation magic. */ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) { … } #ifdef CONFIG_PM_SLEEP static int cs5530_reinit_one(struct pci_dev *pdev) { … } #endif /* CONFIG_PM_SLEEP */ static const struct pci_device_id cs5530[] = …; static struct pci_driver cs5530_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, cs5530); MODULE_VERSION(…);