diff options
Diffstat (limited to 'drivers/ata/pata_cs5520.c')
-rw-r--r-- | drivers/ata/pata_cs5520.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 1ae6b6bd8564..ff1eb84c7d22 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c | |||
@@ -189,6 +189,8 @@ static struct ata_port_operations cs5520_port_ops = { | |||
189 | 189 | ||
190 | static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | 190 | static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) |
191 | { | 191 | { |
192 | static const unsigned int cmd_port[] = { 0x1F0, 0x170 }; | ||
193 | static const unsigned int ctl_port[] = { 0x3F6, 0x376 }; | ||
192 | struct ata_port_info pi = { | 194 | struct ata_port_info pi = { |
193 | .flags = ATA_FLAG_SLAVE_POSS, | 195 | .flags = ATA_FLAG_SLAVE_POSS, |
194 | .pio_mask = 0x1f, | 196 | .pio_mask = 0x1f, |
@@ -242,10 +244,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi | |||
242 | } | 244 | } |
243 | 245 | ||
244 | /* Map IO ports and initialize host accordingly */ | 246 | /* Map IO ports and initialize host accordingly */ |
245 | iomap[0] = devm_ioport_map(&pdev->dev, 0x1F0, 8); | 247 | iomap[0] = devm_ioport_map(&pdev->dev, cmd_port[0], 8); |
246 | iomap[1] = devm_ioport_map(&pdev->dev, 0x3F6, 1); | 248 | iomap[1] = devm_ioport_map(&pdev->dev, ctl_port[0], 1); |
247 | iomap[2] = devm_ioport_map(&pdev->dev, 0x170, 8); | 249 | iomap[2] = devm_ioport_map(&pdev->dev, cmd_port[1], 8); |
248 | iomap[3] = devm_ioport_map(&pdev->dev, 0x376, 1); | 250 | iomap[3] = devm_ioport_map(&pdev->dev, ctl_port[1], 1); |
249 | iomap[4] = pcim_iomap(pdev, 2, 0); | 251 | iomap[4] = pcim_iomap(pdev, 2, 0); |
250 | 252 | ||
251 | if (!iomap[0] || !iomap[1] || !iomap[2] || !iomap[3] || !iomap[4]) | 253 | if (!iomap[0] || !iomap[1] || !iomap[2] || !iomap[3] || !iomap[4]) |
@@ -258,6 +260,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi | |||
258 | ioaddr->bmdma_addr = iomap[4]; | 260 | ioaddr->bmdma_addr = iomap[4]; |
259 | ata_std_ports(ioaddr); | 261 | ata_std_ports(ioaddr); |
260 | 262 | ||
263 | ata_port_desc(host->ports[0], | ||
264 | "cmd 0x%x ctl 0x%x", cmd_port[0], ctl_port[0]); | ||
265 | ata_port_pbar_desc(host->ports[0], 4, 0, "bmdma"); | ||
266 | |||
261 | ioaddr = &host->ports[1]->ioaddr; | 267 | ioaddr = &host->ports[1]->ioaddr; |
262 | ioaddr->cmd_addr = iomap[2]; | 268 | ioaddr->cmd_addr = iomap[2]; |
263 | ioaddr->ctl_addr = iomap[3]; | 269 | ioaddr->ctl_addr = iomap[3]; |
@@ -265,6 +271,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi | |||
265 | ioaddr->bmdma_addr = iomap[4] + 8; | 271 | ioaddr->bmdma_addr = iomap[4] + 8; |
266 | ata_std_ports(ioaddr); | 272 | ata_std_ports(ioaddr); |
267 | 273 | ||
274 | ata_port_desc(host->ports[1], | ||
275 | "cmd 0x%x ctl 0x%x", cmd_port[1], ctl_port[1]); | ||
276 | ata_port_pbar_desc(host->ports[1], 4, 8, "bmdma"); | ||
277 | |||
268 | /* activate the host */ | 278 | /* activate the host */ |
269 | pci_set_master(pdev); | 279 | pci_set_master(pdev); |
270 | rc = ata_host_start(host); | 280 | rc = ata_host_start(host); |
@@ -283,10 +293,7 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi | |||
283 | if (rc) | 293 | if (rc) |
284 | return rc; | 294 | return rc; |
285 | 295 | ||
286 | if (i == 0) | 296 | ata_port_desc(ap, "irq %d", irq[i]); |
287 | host->irq = irq[0]; | ||
288 | else | ||
289 | host->irq2 = irq[1]; | ||
290 | } | 297 | } |
291 | 298 | ||
292 | return ata_host_register(host, &cs5520_sht); | 299 | return ata_host_register(host, &cs5520_sht); |