aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_winbond.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-18 00:14:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:37 -0400
commitcbcdd87593a1d85c5c4b259945a3a09eee12814d (patch)
treeee03df963a12ec7f30f6c3a8742421daf2c34f50 /drivers/ata/pata_winbond.c
parente923090ddd9fef1d4e06dc6c5295e29baced19f3 (diff)
libata: implement and use ata_port_desc() to report port configuration
Currently, port configuration reporting has the following problems. * iomapped address is reported instead of raw address * report contains irrelevant fields or lacks necessary fields for non-SFF controllers. * host->irq/irq2 are there just for reporting and hacky. This patch implements and uses ata_port_desc() and ata_port_pbar_desc(). ata_port_desc() is almost identical to ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no locking requirement, can only be used during host initialization and " " is used as separator instead of ", ". ata_port_pbar_desc() is a helper to ease reporting of a PCI BAR or an offsetted address into it. LLD pushes whatever description it wants using the above two functions. The accumulated description is printed on host registration after "[S/P]ATA max MAX_XFERMODE ". SFF init helpers and ata_host_activate() automatically add descriptions for addresses and irq respectively, so only LLDs which isn't standard SFF need to add custom descriptions. In many cases, such controllers need to report different things anyway. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_winbond.c')
-rw-r--r--drivers/ata/pata_winbond.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 553658bacce0..549cbbe9fd07 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -197,6 +197,7 @@ static __init int winbond_init_one(unsigned long port)
197 197
198 for (i = 0; i < 2 ; i ++) { 198 for (i = 0; i < 2 ; i ++) {
199 unsigned long cmd_port = 0x1F0 - (0x80 * i); 199 unsigned long cmd_port = 0x1F0 - (0x80 * i);
200 unsigned long ctl_port = cmd_port + 0x206;
200 struct ata_host *host; 201 struct ata_host *host;
201 struct ata_port *ap; 202 struct ata_port *ap;
202 void __iomem *cmd_addr, *ctl_addr; 203 void __iomem *cmd_addr, *ctl_addr;
@@ -212,14 +213,16 @@ static __init int winbond_init_one(unsigned long port)
212 host = ata_host_alloc(&pdev->dev, 1); 213 host = ata_host_alloc(&pdev->dev, 1);
213 if (!host) 214 if (!host)
214 goto err_unregister; 215 goto err_unregister;
216 ap = host->ports[0];
215 217
216 rc = -ENOMEM; 218 rc = -ENOMEM;
217 cmd_addr = devm_ioport_map(&pdev->dev, cmd_port, 8); 219 cmd_addr = devm_ioport_map(&pdev->dev, cmd_port, 8);
218 ctl_addr = devm_ioport_map(&pdev->dev, cmd_port + 0x0206, 1); 220 ctl_addr = devm_ioport_map(&pdev->dev, ctl_port, 1);
219 if (!cmd_addr || !ctl_addr) 221 if (!cmd_addr || !ctl_addr)
220 goto err_unregister; 222 goto err_unregister;
221 223
222 ap = host->ports[0]; 224 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", cmd_port, ctl_port);
225
223 ap->ops = &winbond_port_ops; 226 ap->ops = &winbond_port_ops;
224 ap->pio_mask = 0x1F; 227 ap->pio_mask = 0x1F;
225 ap->flags |= ATA_FLAG_SLAVE_POSS; 228 ap->flags |= ATA_FLAG_SLAVE_POSS;