1 --- a/arch/arm/mach-cns3xxx/devices.c
2 +++ b/arch/arm/mach-cns3xxx/devices.c
3 @@ -41,7 +41,7 @@ static struct resource cns3xxx_ahci_reso
4 static u64 cns3xxx_ahci_dmamask = DMA_BIT_MASK(32);
6 static struct platform_device cns3xxx_ahci_pdev = {
8 + .name = "ahci-cns3xxx",
10 .resource = cns3xxx_ahci_resource,
11 .num_resources = ARRAY_SIZE(cns3xxx_ahci_resource),
12 --- a/drivers/ata/ahci_platform.c
13 +++ b/drivers/ata/ahci_platform.c
14 @@ -27,6 +27,7 @@ enum ahci_type {
15 AHCI, /* standard platform ahci */
16 IMX53_AHCI, /* ahci on i.mx53 */
17 STRICT_AHCI, /* delayed DMA engine start */
18 + CNS3XXX_AHCI, /* AHCI on cns3xxx */
21 static struct platform_device_id ahci_devtype[] = {
22 @@ -40,11 +41,32 @@ static struct platform_device_id ahci_de
23 .name = "strict-ahci",
24 .driver_data = STRICT_AHCI,
26 + .name = "ahci-cns3xxx",
27 + .driver_data = CNS3XXX_AHCI,
32 MODULE_DEVICE_TABLE(platform, ahci_devtype);
35 +cns3xxx_ahci_softreset(struct ata_link *link, unsigned int *class,
36 + unsigned long deadline)
38 + int pmp = sata_srst_pmp(link);
41 + ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
43 + return ahci_do_softreset(link, class, 0, deadline,
48 +static struct ata_port_operations cns3xxx_ahci_ops = {
49 + .inherits = &ahci_ops,
50 + .softreset = cns3xxx_ahci_softreset,
53 static const struct ata_port_info ahci_port_info[] = {
55 @@ -67,13 +89,19 @@ static const struct ata_port_info ahci_p
56 .udma_mask = ATA_UDMA6,
57 .port_ops = &ahci_ops,
60 + .flags = AHCI_FLAG_COMMON,
61 + .pio_mask = ATA_PIO4,
62 + .udma_mask = ATA_UDMA6,
63 + .port_ops = &cns3xxx_ahci_ops,
67 static struct scsi_host_template ahci_platform_sht = {
68 AHCI_SHT("ahci_platform"),
71 -static int __init ahci_probe(struct platform_device *pdev)
72 +static int __devinit ahci_probe(struct platform_device *pdev)
74 struct device *dev = &pdev->dev;
75 struct ahci_platform_data *pdata = dev_get_platdata(dev);
76 @@ -285,6 +313,7 @@ static const struct of_device_id ahci_of
77 MODULE_DEVICE_TABLE(of, ahci_of_match);
79 static struct platform_driver ahci_driver = {
80 + .probe = ahci_probe,
81 .remove = __devexit_p(ahci_remove),
84 @@ -299,7 +328,7 @@ static struct platform_driver ahci_drive
86 static int __init ahci_init(void)
88 - return platform_driver_probe(&ahci_driver, ahci_probe);
89 + return platform_driver_register(&ahci_driver);
91 module_init(ahci_init);
93 @@ -312,4 +341,3 @@ module_exit(ahci_exit);
94 MODULE_DESCRIPTION("AHCI SATA platform driver");
95 MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
96 MODULE_LICENSE("GPL");
97 -MODULE_ALIAS("platform:ahci");