.flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, .port_ops = &ahci_platform_retry_srst_ops, }, [STRICT_AHCI] = { AHCI_HFLAGS (AHCI_HFLAG_DELAY_ENGINE), .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, .port_ops = &ahci_platform_ops, }, }; static struct scsi_host_template ahci_platform_sht = { AHCI_SHT("ahci_platform"), }; static const struct of_device_id ahci_of_match[] = { { .compatible = "fsl,imx6q-ahci", .data = &ahci_devtype[IMX6Q_AHCI],}, { .compatible = "snps,spear-ahci", }, {}, }; MODULE_DEVICE_TABLE(of, ahci_of_match); static int ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev_get_platdata(dev); const struct of_device_id *of_id = of_match_device(ahci_of_match, &pdev->dev);
#include <linux/gfp.h> #include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/device.h> #include <linux/platform_device.h> #include <linux/libata.h> #include <linux/ahci_platform.h> #include "ahci.h" #include <linux/clk.h> #include <mach/sys_config.h> #include "sw_ahci_platform.h" static struct scsi_host_template ahci_platform_sht = { AHCI_SHT("sw_ahci_platform"), }; static char* sw_ahci_hclk_name = "ahb_sata"; static char* sw_ahci_mclk_name = "sata"; static char* sw_ahci_para_name = "sata_para"; static char* sw_ahci_used_name = "sata_used"; static char* sw_ahci_gpio_name = "sata_power_en"; static struct resource sw_ahci_resources[] = { [0] = { .start = SW_AHCI_BASE, .end = SW_AHCI_BASE + 0x1000 - 1, .flags = IORESOURCE_MEM, },
}; static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class, unsigned long deadline); static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline); static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline); #ifdef CONFIG_PM static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); static int ahci_pci_device_resume(struct pci_dev *pdev); #endif static struct scsi_host_template ahci_sht = { AHCI_SHT("ahci"), }; static struct ata_port_operations ahci_vt8251_ops = { .inherits = &ahci_ops, .hardreset = ahci_vt8251_hardreset, }; static struct ata_port_operations ahci_p5wdh_ops = { .inherits = &ahci_ops, .hardreset = ahci_p5wdh_hardreset, }; static struct ata_port_operations ahci_sb600_ops = { .inherits = &ahci_ops, .softreset = ahci_sb600_softreset,
#include <linux/ahci_platform.h> #include <linux/acpi.h> #include <linux/pci_ids.h> #include "ahci.h" #define DRV_NAME "ahci" static const struct ata_port_info ahci_port_info = { .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, .port_ops = &ahci_platform_ops, }; static struct scsi_host_template ahci_platform_sht = { AHCI_SHT(DRV_NAME), }; static int ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; int rc; hpriv = ahci_platform_get_resources(pdev); if (IS_ERR(hpriv)) return PTR_ERR(hpriv); rc = ahci_platform_enable_resources(hpriv); if (rc) return rc;